Problems with libGlade
| From: | PQ Administrator | Date: | Tue, 16 Oct 2001 19:29:38 +0000 |
| Subject: | Problems with libGlade | ||
| Groups: | php.gtk.general php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-290@lists.php.net to get a copy of this message | ||
First off, great work guys, PHP-GTK+LibGlade rocks!
However, im having some touble getting data to pass from GtkButton event 'clicked' to my
function to process the two entry fields the code is as follows:
<?php
function do_login($button1, $entry1) {
$uid = $entry1->get_text();
$passwd = $entry2->get_text();
Print "Username is: $uid\n";
Print "Password is: $passwd\n";
}
dl( 'php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
$gx = &new GladeXML('c:\phpgtk\test\test.glade');
$gx->signal_autoconnect();
Gtk::main();
?>
When i create UI in Glade i set the two text entry boxes named: entry1 and entry2.
The buttons are then set with the signal, clicked and the do_login method.
What i cant figure out is where do i put the entry1 and entry2 variables to pass the data to my
function as parameters
If i was hand coding I do it like this:
<CREATE ENTRY BOXES NAMED entry1, entry2>
$button = &new GtkButton('Login');
$button->connect('clicked', 'do_login', $entry1, $entry2); // entry1 and
entry2 being the entry box's ... using these to get the text input from the user: (ie:
$entry1->get_text(); )
$hbox->pack_start($button);
$button->show();
I keep putting entry1 and entry2 in the data section of Glade property box for GtkButton but it
doesnt work I get this error:
missing arguement 2 for 'do_login' function
AND
Call to member function on a non-object
Any help is greatly appriciated...
Thanks in advance
Troy McComasNetworks/System Admin.PhysicianQuest.comE-Mail Me!Office - (818)550-8777 Cell-
(626)255-9833
<!-- -->
Powered by PhysicianQuest.com