Re: php-gtk glade mysql

From: Date: Fri, 25 Aug 2006 01:18:04 +0000
Subject: Re: php-gtk glade mysql
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7106@lists.php.net to get a copy of this message
Hello Anant, Thank you for your help, I have changed the code in mysql.php and tried to run it, I am getting the below error : Fatal error: Argument 1 passed to MyClass::on_loginButton_clicked() must be an instance of GtkWindow in mysql.php on line 11 as always the whole matter ;) <?php //Here we use an object and connect all the // signals to *object methods* instead of // functions class MyClass { //This method is called when the button is clicked function on_cancelButton_clicked() { Gtk::main_quit(); } function on_loginButton_clicked(GtkWindow $wnd, GtkEntry $login, GtkEntry $password) { $loginName = $login->get_text(); $password = $password->get_text(); echo $loginName; echo $password; } function staticMethod() { echo "MyClass::staticMethod()\r\n"; } } $glade = new GladeXML(dirname(__FILE__) . '/gmsdialog.glade'); //Let glade do all the signal connections we specified in the file // but this time, connect to the object methods $myClassInstance = new MyClass(); $glade->signal_autoconnect_instance($myClassInstance); $login = $glade->get_widget('loginButton'); $login->connect_simple('clicked', array($myClassInstance, 'on_loginButton_clicked'), $myClassInstance, $myClassInstance->loginEntry, $myClassInstance->passwordEntry); //Start the main loop Gtk::main() ?> -- View this message in context: http://www.nabble.com/php-gtk-glade-mysql-tf2157838.html#a5975883 Sent from the Php - GTK - General forum at Nabble.com.

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