Re: Can't add new widget to GtkFixed inside function

From: Date: Sat, 08 Apr 2006 11:13:02 +0000
Subject: Re: Can't add new widget to GtkFixed inside function
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-2721@lists.php.net to get a copy of this message
Just realised that if I take out the class and just use a plain old function, the problem remains the same: (again adding the line MakeNewButton ($fixed); in the main body will make the button appear, but still connect_simple won't do it) <?php if (!class_exists('gtk')) { // standard gtk stuff die("Please load the php-gtk2 module in your php.ini\r\n"); } $wnd = new GtkWindow(); $wnd->set_title('MyApp'); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $fixed = new GtkFixed (); $button1 = new GtkButton("Button 1"); $fixed -> put($button1, 10, 10); $button1 -> connect_simple ("clicked", "MakeNewButton", $fixed); function MakeNewButton ($fixed) { $button2 = new GtkButton("Button 2"); $fixed->put($button2, 30, 40); } $wnd->add($fixed); $wnd->show_all(); Gtk::main(); ?> -- View this message in context: http://www.nabble.com/Can%27t-add-new-widget-to-GtkFixed-inside-class-t1416282.html#a3817188 Sent from the Php - GTK - Dev forum at Nabble.com.

« previous php.gtk.dev (#2721) next »