RE: [PHP-GTK] Using Glade with PHP-GTK
| From: | Matt Palermo | Date: | Sat, 15 Nov 2003 19:47:33 +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-4151@lists.php.net to get a copy of this message | ||
Thanks for the reply, but I keep getting the following error when trying
to use the code you supplied:
Fatal error: Cannot instantiate a non-existent class: gladexml in...
What am I doing wrong here?
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