Re: signals pending



On Wed, 2004-08-25 at 22:52, Jorge P Costa wrote:

And I want to ignore the "focus out event" when closing the window. How can I 
do it??

i can't test it since i don't get a focus out event when closing
(probably due to wmaker rather than gnome.) but the following may work
if you get the destroy before the focus_out_event.

use Gtk2 '-init';
use Glib qw/TRUE FALSE/;

my $entry = Gtk2::Entry->new;
my $foe = $entry->signal_connect('focus_out_event' => sub{ print "focus
out\n" });
   
my $window = Gtk2::Window->new('toplevel');
   $window->signal_connect('destroy' => sub{ Glib::Source->remove
($foe);
                           print "destroy\n"; Gtk2->main_quit });

$window->show_all;

Gtk2->main;
exit 0;

-- 
-rm
http://www.neces.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]