Re: Accessing GtkCheckButton->label property?

From: Date: Sat, 10 Jul 2004 11:56:10 +0000
Subject: Re: Accessing GtkCheckButton->label property?
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4704@lists.php.net to get a copy of this message
Hi try this.. Function ChangeLabel($obj){ if($obj->Get_Active()){ $label=$obj->children(); $label[0]->Set_Text('changed'); } } ----- Original Message ----- From: "Benjamin Smith" <bens@effortlessis.com> To: <php-gtk-general@lists.php.net> Sent: Saturday, July 10, 2004 7:44 AM Subject: [PHP-GTK] Accessing GtkCheckButton->label property? > For some reason, the following just doesn't work: > > <? > Function ChangeLabel($obj) > { > // this part works OK. > if ($obj->Get_Active()) > { > // BUT THIS DOES NOT WORK! > $label=$obj->label; > $label->Set_Text('changed!'); > } > } > $win=&New GtkWindow(); > $button=&New GtkCheckButton('unchanged'); > $button->Connect('toggled', 'ChangeLabel'); > $win->Add($button); > $win->Show_All(); > ?> > > Program crashes with error: > Fatal error: Call to member function on a non-object in.... > > I tried a number of ways to get property label out of $obj, to no avail. Even > $obj->children returned nothing! > > Does this work as expected for anybody else? > > -Ben > > -- > "I kept looking around for somebody to solve the problem. > Then I realized I am somebody" > -Anonymous > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > >

« previous php.gtk.general (#4704) next »