Re: connect_object & GtkEventBox

From: 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,
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 argument
This 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 has
only 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
« previous php.gtk.general (#5395) next »