Re: How to disable temporary callbacks using Glade?
- From: Dermot Musgrove <dermot glade perl connectfree co uk>
- To: ws <ws bluewin ch>
- Cc: "gtk-perl-list gnome org" <gtk-perl-list gnome org>
- Subject: Re: How to disable temporary callbacks using Glade?
- Date: Mon, 13 May 2002 21:04:14 +0100
ws wrote:
[...]
sub on_CoEn_changed{
print "..Combo-Entry changed by user and NOT during set-Operations";
}
sub setSelector{
signal_handler_block(?); #how?
$form->{'Co'} ->set_popdown_strings(@choice); #popDownList set
$form->{'CoEn'} ->set_text($sv[2]); #e.g. value $sv[2] visible
#bad:calls on_CoEn_changed
signal_handler_unblock(?); #how?
}
Hi,
You need to know the 'connection id' of the signal_connect call that
is triggering the handler. The connection id is returned by the
signal_connect() call so you do:
$id = $widget->signal_connect('changed', ......
and later:
$widget->signal_handler_block($id);
$id probably needs to be a global so that it is available in the handler.
Version 0.60 of Glade-Perl can generate code that saves the ids in a
predictable fashion so that you can use them in signal handlers like:
my $id = $form->{'__CONNECT_ID'}{'entry1'}{'after_key_press_event'}
$id = $widget->signal_connect('changed', ......
...
HTH, Dermot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]