Re: GladeXML question

From: Date: Fri, 30 Nov 2001 12:06:34 +0000
Subject: Re: GladeXML question
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-779@lists.php.net to get a copy of this message
libglade doesn't create any variables itself from the glade source. You have to fetch your widget with $interface->get_widget('unique_name_of_widget'); Have a look at the libglade docs [1]. I've also mentioned it in my article [2] (old, but good ;). - Markus [1] http://developer.gnome.org/doc/API/libglade/gladexml.html#GLADE-XML-GET-WIDGET [2] http://guru.josefine.at/~mfischer/articles/article-php-gtk.html On Fri, Nov 30, 2001 at 01:01:36PM +0100, Henning Sprang wrote : > Hy, > I am just playing around with Glade and using it's XML > to make php-gtk interfaces. > > I can generate interfaces, but i have problems finding the > objects which are generated to accesss their values. > > Attached code gives me the error: > > <b>Fatal error</b>: Call to a member function on a non-object in > <b>/home/henning/Projects/phpgtkmyadmin/phpgtkmyadmin.php</b> on line > <b>19</b><br /> > > I know I have somehow to give the Gtk Objects as arguments to the > on_start_clicked functin, but I can't even find the ojects > in the main program scope (e.g. $host_field doesn't seem to exist as > an object), and if I would I wouldn't know how to pass them > to the function as there is no information about that > on the GtlXML funtctions. > > any guesses? > > henning > > > > -- > Henning Sprang , henning@sprang.de, http://www.sprang.de/ > <?xml version="1.0"?> > <GTK-Interface> > > <project> > <name>Phpgtkmyadmin</name> > <program_name>phpgtkmyadmin</program_name> > <directory></directory> > <source_directory>src</source_directory> > <pixmaps_directory>pixmaps</pixmaps_directory> > <language>Ada 95</language> > <gnome_support>False</gnome_support> > <gettext_support>False</gettext_support> > </project> > > <widget> > <class>GtkWindow</class> > <name>window1</name> > <title>window1</title> > <type>GTK_WINDOW_TOPLEVEL</type> > <position>GTK_WIN_POS_NONE</position> > <modal>False</modal> > <allow_shrink>False</allow_shrink> > <allow_grow>True</allow_grow> > <auto_shrink>False</auto_shrink> > > <widget> > <class>GtkVBox</class> > <name>vbox1</name> > <homogeneous>False</homogeneous> > <spacing>0</spacing> > > <widget> > <class>GtkEntry</class> > <name>host_field</name> > <can_focus>True</can_focus> > <editable>True</editable> > <text_visible>True</text_visible> > <text_max_length>0</text_max_length> > <text>host</text> > <child> > <padding>0</padding> > <expand>False</expand> > <fill>False</fill> > </child> > </widget> > > <widget> > <class>GtkEntry</class> > <name>user_field</name> > <can_focus>True</can_focus> > <editable>True</editable> > <text_visible>True</text_visible> > <text_max_length>0</text_max_length> > <text>user</text> > <child> > <padding>0</padding> > <expand>False</expand> > <fill>False</fill> > </child> > </widget> > > <widget> > <class>GtkEntry</class> > <name>pass_field</name> > <can_focus>True</can_focus> > <editable>True</editable> > <text_visible>True</text_visible> > <text_max_length>0</text_max_length> > <text>pass</text> > <child> > <padding>0</padding> > <expand>False</expand> > <fill>False</fill> > </child> > </widget> > > <widget> > <class>GtkEntry</class> > <name>db_field</name> > <can_focus>True</can_focus> > <editable>True</editable> > <text_visible>True</text_visible> > <text_max_length>0</text_max_length> > <text>db</text> > <child> > <padding>0</padding> > <expand>False</expand> > <fill>False</fill> > </child> > </widget> > > <widget> > <class>GtkEntry</class> > <name>sql_field</name> > <can_focus>True</can_focus> > <editable>True</editable> > <text_visible>True</text_visible> > <text_max_length>0</text_max_length> > <text>sql</text> > <child> > <padding>0</padding> > <expand>False</expand> > <fill>False</fill> > </child> > </widget> > > <widget> > <class>GtkButton</class> > <name>start</name> > <can_focus>True</can_focus> > <signal> > <name>clicked</name> > <handler>on_start_clicked</handler> > <object>$host_field, $user_field, $pass_field, $sql_field, $db_field</object> > <last_modification_time>Fri, 30 Nov 2001 01:25:04 GMT</last_modification_time> > </signal> > <label>start</label> > <relief>GTK_RELIEF_NORMAL</relief> > <child> > <padding>0</padding> > <expand>False</expand> > <fill>False</fill> > </child> > </widget> > > <widget> > <class>GtkScrolledWindow</class> > <name>scrolledwindow1</name> > <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> > <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> > <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> > <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> > <child> > <padding>0</padding> > <expand>True</expand> > <fill>True</fill> > </child> > > <widget> > <class>GtkText</class> > <name>text1</name> > <can_focus>True</can_focus> > <editable>False</editable> > <text>result: > </text> > </widget> > </widget> > </widget> > </widget> > > </GTK-Interface> > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-gtk-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Please always Cc to me when replying to me on the lists.

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