Re: add_events in PHP-GTK 2

From: Date: Fri, 22 Jul 2005 12:39:00 +0000
Subject: Re: add_events in PHP-GTK 2
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6092@lists.php.net to get a copy of this message
Hi Ivan, Ivan Rodriguez wrote:
Hi Scott, do you realize the window?¿ is necesary to work add_events, try with set_events too.
Yes. After doing some more tests however, it appears that add_events isn't needed. I am confused as to exactly what is going on. Try this: <?php $entry1 = new GtkEntry(); $entry2 = new GtkEntry(); $window = new GtkWindow();
$box    = new GtkVBox();
$window->add($box); $box->add($entry1); $box->add($entry2); $window->show_all(); $entry1->connect('focus-out-event', array('gtk', 'main_quit')); $entry2->add_events(GDK::FOCUS_CHANGE_MASK); $entry2->connect('focus-out-event', array('gtk', 'main_quit')); gtk::main(); ?> Start up the script and hit tab a few times. Each time one of the entries loses focus you will see an error message about gtk::main_quit not expecting any arguments. From what I understand, the message should only be shown when entry2 loses focus. Does anyone know if this is something new in Gtk+ 2.0? If you connect a signal that isn't normally listened for does PHP-GTK 2 call add_events automatically? I have tried with almost all of the GDK event masks and I always get the same result. Both widgets react the same to all events. Thanks, Scott

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