diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-14 09:25:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-14 09:25:40 +0000 |
commit | e2cbffc6422fc59ee624c2c399e79109c21c7cc4 (patch) | |
tree | 8bc16a2c6a23da765f7bd7ca08b5ad5dc676b6c5 /perl-install/interactive_gtk.pm | |
parent | 9266168309a593e84c47cc59edb2a6ccd49e4686 (diff) | |
download | drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.gz drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.bz2 drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.xz drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.zip |
no_comment
Diffstat (limited to 'perl-install/interactive_gtk.pm')
-rw-r--r-- | perl-install/interactive_gtk.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index 3a9feefb8..773ad345f 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -85,8 +85,7 @@ sub ask_from_treelistW { my $s; $tree->expand($wtree{$s .= "$_$separator"}) foreach split $sep, $root; foreach my $nb (1 .. @$l) { if ($tree->node_nth($nb) == $node) { - $tree->set_focus_row($nb); - Gtk->idle_add(sub { $tree->node_moveto($node, 0, 0.5, 0); 0 }); + $tree->set_focus_row($ndef = $nb); last; } } @@ -117,17 +116,23 @@ sub ask_from_treelistW { $tree->signal_connect(key_press_event => sub { my ($w, $e) = @_; my $c = chr $e->{keyval}; - - if ($e->{keyval} >= 0x100) { - &$leave if $c eq "\r" || $c eq "\x8d"; + $curr or return; + if ($e->{keyval} >= 0x100 ? $c eq "\r" || $c eq "\x8d" : $c eq ' ') { + if ($curr->row->is_leaf) { &$leave } + else { $tree->toggle_expansion($curr) } } 1; }); + $tree->grab_focus; + $tree->set_row_height($tree->style->font->ascent + $tree->style->font->descent + 1); + $w->{rwindow}->show; + if ($wdef) { $tree->select($wdef); + $tree->node_moveto($wdef, 0, 0.5, 0); } - $tree->grab_focus; + $w->main or die "ask_from_list cancel"; } @@ -297,7 +302,7 @@ sub wait_messageW($$$) { @$messages, $w->{wait_messageW} = new Gtk::Label($W))); $w->{rwindow}->set_position('center') if $::isStandalone; - $w->{wait_messageW}->signal_connect(expose_event => sub { print "expose_event\n"; $w->{displayed} = 1 }); + $w->{wait_messageW}->signal_connect(expose_event => sub { $w->{displayed} = 1 }); $w->sync until $w->{displayed}; $w; } |