Re: connect_object & GtkEventBox
| From: | Christian Weiske | Date: | Fri, 31 Dec 2004 08:31:40 +0000 |
| Subject: | Re: connect_object & GtkEventBox | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5395@lists.php.net to get a copy of this message | ||
Hi Simon,
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
function do_stuff( $only_argument ){ alert($only_argument); } /*this works fine*/ $regular_widget->connect_object('clicked' , array(&$this,'do_stuff') 'only_argument' ) ; /*but*/ $widget_wrapped_in_GtkEventBox->connect_object('button-press-event' , array(&$this,'do_stuff') 'only_argument' ) ; passes 2 arguments to do_stuff , the first being the GtkEventBox event data (as an object) the second is the expected argumentThis is expected. "button-press-event" generates an event parameter while "clicked" does not. See the "callback" sections in
http://gtk.php.net/manual/en/gtk.gtkwidget.signal.button-press-event.php http://gtk.php.net/manual/en/gtk.gtkbutton.signal.clicked.php You will note that button-press has two parameters while clicked hasonly one. Also, you would have to connect the eventbox->connect_object to receive this events and not the widget placed in the event box. Regards/MfG, Christian Weiske -- XMMS is playing now: The Cardigans - And Then You Kissed Me
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc