RE: [PHP-GTK] Using Glade with PHP-GTK

From: Date: Sun, 16 Nov 2003 12:38:17 +0000
Subject: RE: [PHP-GTK] Using Glade with PHP-GTK
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4155@lists.php.net to get a copy of this message
Okay, I actually having working to the point where I can open the program that I created in Glade now. But I am having trouble closing a window when a button is click. The mail_app window has a menu bar and when you click an item in it, it will open another window called settins_window. I settings_window, I have a cancel button called settings_cancel. I would like to set it so that when you press the cancel button it will close the settings_window and return to the main_app window. Here is the function that I have for it which doesn't work: function on_settings_cancel_clicked() { delete_event(); } Anyone know why this isn't working to close the current window? Please let me know if you do. Thanks, Matt -----Original Message----- From: epplestun [mailto:epplestun@alaplaya.com] Sent: Sunday, November 16, 2003 7:25 AM To: Matt Palermo Cc: 'James Cameron'; php-gtk-general@lists.php.net Subject: RE: [PHP-GTK] Using Glade with PHP-GTK To use GladeXML you need the xml library in your PHP. El sáb, 15 de 11 de 2003 a las 21:45, Matt Palermo escribió: > Actually I have it sort of working now. However, when I run the PHP > script from the command line, this application window shows up and then > disappears right away. It just flashes once and that's it. Here is the > code I'm using: > > > <?php > > $xml = "c:/php4/test/test/test.glade"; > > if (!class_exists('gtk')) > { > if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) > { > dl('php_gtk.dll'); > } > else > { > dl('php_gtk.so'); > } > } > > function open_window($name) > { > global $xml; > > $gx = &new GladeXML($xml, $name); > $gx->signal_autoconnect(); > return $gx; > } > function on_button_clicked() > { > echo "Clicked\n"; > } > > $window = open_window("windowMain"); > > ?> > > Can you give me some suggestions on what to do? > > Thanks, > > Matt > > > -----Original Message----- > From: James Cameron [mailto:quozl@us.netrek.org] > Sent: Saturday, November 15, 2003 5:01 AM > To: php-gtk-general@lists.php.net > Subject: Re: [PHP-GTK] Using Glade with PHP-GTK > > Yes, it could be misleading. Glade doesn't have a code generator for > PHP, instead your PHP code is expected to load the XML file that Glade > uses as the project file. > > Your PHP code might look this; > > # utility functions, instantiate a window from widget tree > function open_window($name) { > global $xml; > > $gx = &new GladeXML($xml, $name); > $gx->signal_autoconnect(); > return $gx; > } > > Where $xml is the file name of the XML file, whatever.glade, and $name > is the top level widget to be displayed. > > http://quozl.netrek.org/pptp/php-gtk/ has an example, in case > you want > to see how it works. > > -- > James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/ > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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