Re: Glade signals

From: Date: Sun, 08 Feb 2004 17:48:06 +0000
Subject: Re: Glade signals
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4384@lists.php.net to get a copy of this message
Scrive silver_dragoon <silver_dragoon77@hotmail.com>: > Hi, > > I'm currently using Glade and I succeeded in connecting a signal to a widget, > and hence re-using it in php via the signal_autoconnect() method, but I > cannot figure out how to connect a signal like > $button->connect_object("clicked", array(&$this, "button_clicked")); > within > glade. > > Any ideas ? > > Thanx > > Jonathan > in a object. you declare all handlers as a methods of this object. and for show it, ... $this->gld=&new GladeXML('php-edit.glade'); $arr=get_class_methods($this); for ($i=0;$i<sizeof($arr);$i++) { if (strstr($arr[$i],'on_')) { $this->gld->signal_connect($arr[$i],array($this,$arr[$i])); } } using strstr i found all methods beginning with "on_". the totally absence of documentation of GladeXML caused me to grep "signal_autoconnect" into C source code. <flame> i'm broken. documentation looses. if i think to use this as a professional development environment, i must search all infos in GTK API or searching into C code. </flame> if used without parameters, signal_autoconnect connects handlers to global functions with the same name (if they exists, otherwise it prints a warning). but it expected an array as parameter. but i don't know how that it must be written. Dimitri Giardina System Administrator & Internet Programmer C.D. Informatica Srl - Chieti Scalo ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/

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