summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive_gtk.pm
diff options
context:
space:
mode:
authorpad <pad@mandriva.com>1999-09-05 22:59:26 +0000
committerpad <pad@mandriva.com>1999-09-05 22:59:26 +0000
commit5798823e331c86fb3f97593b0cd2820224767d15 (patch)
tree5dccbae0c0d401beeb09a46154847884e1f474b3 /perl-install/interactive_gtk.pm
parent38dce4a6d02d689b7aefa2b5f925ac5441c51a89 (diff)
downloaddrakx-5798823e331c86fb3f97593b0cd2820224767d15.tar
drakx-5798823e331c86fb3f97593b0cd2820224767d15.tar.gz
drakx-5798823e331c86fb3f97593b0cd2820224767d15.tar.bz2
drakx-5798823e331c86fb3f97593b0cd2820224767d15.tar.xz
drakx-5798823e331c86fb3f97593b0cd2820224767d15.zip
focus_out
Diffstat (limited to 'perl-install/interactive_gtk.pm')
-rw-r--r--perl-install/interactive_gtk.pm21
1 files changed, 17 insertions, 4 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index 6a0b1d1d2..cb3258d3b 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -77,9 +77,10 @@ sub ask_many_from_list_refW($$$$$) {
sub ask_from_entries_refW {
my ($o, $title, $messages, $l, $val, %hcallback) = @_;
my $num_champs = @{$l};
- my $ignore = 0;
+ my $ignore = 0; #to handle recursivity
my $w = my_gtk->new($title, %$o);
+ #the widgets
my @entries = map {
if ($_->{type} eq "list") {
my $depth_combo = new Gtk::Combo;
@@ -111,7 +112,9 @@ sub ask_from_entries_refW {
for (my $i = 0; $i < $num_champs; $i++) {
- my $ind = $i;
+ my $ind = $i; #cos lexical bindings pb !!
+ my $entry = $entries[$i];
+ #changed callback
my $callback = sub {
return if $ignore; #handle recursive deadlock
&{$updates[$ind]};
@@ -121,9 +124,19 @@ sub ask_from_entries_refW {
$ignore = 1;
foreach (@updates_inv) { &{$_};}
$ignore = 0;
- }
+ };
};
- my $entry = $entries[$i];
+ if ($hcallback{focus_out}) {
+ my $callfocusout = sub {
+ return if $ignore;
+ &{$hcallback{focus_out}}($ind);
+ #update all the value
+ $ignore = 1;
+ foreach (@updates_inv) { &{$_};}
+ $ignore = 0;
+ };
+ comb_entry($entry,$val->[$i])->signal_connect(focus_out_event => $callfocusout);
+ }
comb_entry($entry,$val->[$i])->signal_connect(changed => $callback);
comb_entry($entry,$val->[$i])->signal_connect(activate => sub {
($ind == ($num_champs -1)) ?