Realmente solo tengo como 5 dias programando con PHP-GTK, y tengo un problemita con el metodo set_text del widget Entry.
El problema es que desde un Button, quiero cambiar el texto de el Entry; pero resulta que cuando le doy click al boton; me cierra la ventana.
El codigo es el siguiente:
Código PHP:
<?php
dl('php_gtk.dll');
$app=&new GladeXML("GUI.glade");
$entry1=$app->get_widget("entry1");
function button1_click()
{
$entry1->set_text('Hola Mundo PHP-GTK');
}
$app->signal_autoconnect();
Gtk::main();
?>
¿Que falta?, ¿De que me estoy perdiendo?, ¿Porque cierra la ventana al hacer clic en el boton?; aparentemente es un codigo simple, pero no se que pasa!
De antemano Gracias.
Saludos!.
Aqui dejo el GUI.glade:
Código:
<?xml version="1.0"?> <GTK-Interface> <project> <name>HolaPHPGTK</name> <program_name>holaphpgtk</program_name> <directory></directory> <source_directory>src</source_directory> <pixmaps_directory>pixmaps</pixmaps_directory> <language>C</language> <gnome_support>False</gnome_support> <gettext_support>False</gettext_support> </project> <widget> <class>GtkWindow</class> <name>window1</name> <title>Hola PHP-GTK</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_CENTER</position> <modal>False</modal> <allow_shrink>False</allow_shrink> <allow_grow>True</allow_grow> <auto_shrink>False</auto_shrink> <widget> <class>GtkFixed</class> <name>fixed1</name> <widget> <class>GtkEntry</class> <name>entry1</name> <x>88</x> <y>16</y> <width>158</width> <height>18</height> <can_focus>True</can_focus> <editable>True</editable> <text_visible>True</text_visible> <text_max_length>0</text_max_length> <text></text> </widget> <widget> <class>GtkLabel</class> <name>label1</name> <x>16</x> <y>16</y> <width>74</width> <height>18</height> <label>Su Nombre</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> </widget> <widget> <class>GtkButton</class> <name>button1</name> <x>88</x> <y>40</y> <width>85</width> <height>24</height> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>button1_click</handler> <last_modification_time>Thu, 29 Sep 2005 17:34:02 GMT</last_modification_time> </signal> <label>Click Aqui</label> <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> </widget> </GTK-Interface>