Re: connect() and connect_object() question
| From: | Michael Waples | Date: | Wed, 06 Mar 2002 09:19:18 +0000 |
| Subject: | Re: connect() and connect_object() question | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1443@lists.php.net to get a copy of this message | ||
On Tue, 5 Mar 2002 11:55, Steph wrote:
> connect_object() will pass the object given (why 1?!) as the first
> parameter. As opposed to connect() which will pass the calling object as
> the first parameter.
>
> any 'event' signal will pass the event to the callback function as its
> second parameter, i.e. you need to pick that up with the function
>
> eg
> $menuitem1->connect('button-press-event', 'myfunction', $number);
> needs to connect to
> function myfunction($menuitem1, $event, $number) {
> //do stuff
> }
>
> or
> $menuitem1->connect_object('button-press-event', 'myfunction', $button,
> $number); needs to connect to
> function myfunction($button, $event, $number) {
> //do stuff
> }
>
> HTH
>
Thankyou very much - explains everything. I'm off to RTFM again.