Re: glade problem
| From: | Andrei Zmievski | Date: | Fri, 21 Sep 2001 14:51:47 +0000 |
| Subject: | Re: glade problem | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-137@lists.php.net to get a copy of this message | ||
On Fri, 21 Sep 2001, Christophe VG wrote:
> While discovering the possiblities of PHP-GTK and glade I keep running
> into the same problem. This is the situation:
>
> I create a GUI using glade consisting of two windows. The first window
> which is visible at startup has one button with one signal handler
> defined on_button1_clicked. The second window is set to visible=false.
>
> This is the php code that goes with it ...
>
> <?
>
> // load dynamic PHP-GTK library
> dl( 'php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' :
> 'so'));
>
> // init Glade GUI
> $gx = &new GladeXML( 'project2.glade' );
> $wnd = $gx->get_widget( 'window1' );
> $wnd->connect( 'delete_event',
> create_function('','gtk::main_quit();'));
'delete-event' happens when the user tries to close the window. What you
are supposed to do in that handler is return true or false, meaning that
you want to allow the window to be closed or not. You can use to
hide/show the window as necessary too.
And don't use create_function() when not absolutely necessary - just use
connect_object() and an array($obj, 'method') construct.
-Andrei
Some people try to achieve immortality through their work, others
through their children. I hope to achieve immortality by not dying.
-- Woody Allen