signal_autoconnect() into a class
| From: | epplestun | Date: | Fri, 17 Jan 2003 10:40:01 +0000 |
| Subject: | signal_autoconnect() into a class | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2919@lists.php.net to get a copy of this message | ||
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. :-)