Re: Accessing GtkCheckButton->label property?
| From: | Madeleine D. | Date: | Sat, 10 Jul 2004 01:09:30 +0000 |
| Subject: | Re: Accessing GtkCheckButton->label property? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4703@lists.php.net to get a copy of this message | ||
Ben -
Change your function as follows:
$label=$obj->child;
That worked just fine for me.
Madeleine D.
At 04:44 PM 7/9/2004 -0700, you wrote:
>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
>
>