Re: signal_autoconnect() into a class

From: Date: Sun, 19 Jan 2003 04:29:19 +0000
Subject: Re: signal_autoconnect() into a class
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-2923@lists.php.net to get a copy of this message
yeap signal_autoconnect doesnt work like that.. (AFAIK), I've normally resorted to building a routine to grepping or parsing the raw glade xml file and find all the named signals, and connect them to local methods..., rather than use autoconnect.. In theory, it might be possible to add this feature, either by using static methods (eg. Handler = My_Class::callback, or using the object field.. - which could be used somehow in conjuciton with the autoconnect call..) Regards Alan epplestun wrote:
Hello, I´m working with a Glade interface and with objetcs (class), I can´t do signal_autoconnect() into a class, why? what can I use the signals which I put in the glade interface? for example: $glade = &new GladeXML("instalacion.glade"); $glade->signal_autoconnect(); function verificar() { GLOBAL $Gtk_Ctree, $Gtk_Window, $modulos; $Gtk_Window->realize(); $Gtk_Ctree->clear(); $datos = array(); for ($j = 0 ; $j < count($modulos) ; $j++) {
       $existe = class_exists($modulos[$j]);
       $datos[($modulos[$j])] = $existe;
       $text[0] = sprintf($modulos[$j],$cur_depth,$i);
       list($func,$func_mascara) = gdk::pixmap_create_from_xpm($Gtk_Window->window, NULL, ($existe ? "ok.xpm" : "cancel.xpm"));
       $Gtk_Ctree->insert_node(NULL,NULL,$text,5,$func,$func_mascara,$func,$func_mascara,false,false);
} return $datos; } $modulos = array("GtkScintilla","GtkHTML","GdkPixbuf"); $Gtk_Window = $glade->get_widget('window1'); $Gtk_Window->connect('destroy', 'salir'); $Gtk_Window->connect('delete-event', 'delete_event'); $Gtk_Window->set_usize(650,350); $Gtk_Window->set_policy(false, false, true); $Gtk_Window->set_position(GTK_WIN_POS_CENTER); $Gtk_Ctree = $glade->get_widget('ctree1'); $Gtk_Ctree->set_line_style(GTK_CTREE_LINES_NONE); In the instalacion.glade I have a button with the verificar() function in the clicked signal, this wortks perfect but when I use a class I can´t access to the function because I need array into a signal, for example: $Gtk_Button->connect('clicked', array(&$this,'salir')); But I can´t do this, If i works with glade and with objetcs (class) I have to do all functions manualy and the signals puts manualy? Thx. :-)
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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