summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-22 12:02:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-22 12:02:00 +0000
commit12b224d0ed08d9adb5bb342768e441901b0e530c (patch)
tree6e80f0e11f9babd5b43c6f969dbe9657c747872e /perl-install/interactive_gtk.pm
parent9cb5cb2a00640129fe459915f8a58113317db5fa (diff)
downloaddrakx-backup-do-not-use-12b224d0ed08d9adb5bb342768e441901b0e530c.tar
drakx-backup-do-not-use-12b224d0ed08d9adb5bb342768e441901b0e530c.tar.gz
drakx-backup-do-not-use-12b224d0ed08d9adb5bb342768e441901b0e530c.tar.bz2
drakx-backup-do-not-use-12b224d0ed08d9adb5bb342768e441901b0e530c.tar.xz
drakx-backup-do-not-use-12b224d0ed08d9adb5bb342768e441901b0e530c.zip
no_comment
Diffstat (limited to 'perl-install/interactive_gtk.pm')
-rw-r--r--perl-install/interactive_gtk.pm18
1 files changed, 14 insertions, 4 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index 840dbdf95..62f0c3603 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -65,7 +65,7 @@ sub ask_from_treelist {
my $s;
foreach (split $sep, $_[0]) {
$wtree{"$s$_$separator"} ||=
- $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 2, (undef) x 4, 0, 0);
+ $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 5, (undef) x 4, 0, 0);
$s .= "$_$separator";
}
$wtree{$s};
@@ -73,7 +73,7 @@ sub ask_from_treelist {
my ($root, $leaf, $wdef, $ndef);
foreach (@$l) {
($root, $leaf) = /(.*)$sep(.+)/o or ($root, $leaf) = ('', $_);
- my $node = $tree->insert_node($parent->($root), undef, [$leaf], 2, (undef) x 4, 1, 0);
+ my $node = $tree->insert_node($parent->($root), undef, [$leaf], 5, (undef) x 4, 1, 0);
if ($def eq $_) {
$wdef = $node;
@@ -94,20 +94,30 @@ sub ask_from_treelist {
$w->{retval} = join $separator, @l;
Gtk->main_quit;
};
+
gtkadd($w->{window},
gtkpack_(new Gtk::VBox(0,0),
1, gtkset_usize(createScrolledWindow($tree), 200, 280),
0, $w->create_okcancel));
$tree->set_selection_mode('browse');
- $tree->signal_connect(tree_select_row => sub { $curr = $_[1] });
+ $tree->signal_connect(tree_select_row => sub { $curr = $_[1]; });
$tree->signal_connect(button_press_event => sub { &$leave if $_[1]{type} =~ /^2/ });
+ $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";
+ }
+ 1;
+ });
$tree->focus_row($ndef) if $ndef;
$tree->select($wdef) if $wdef;
$tree->node_moveto($wdef, 0, 0.5, 0) if $wdef;
$tree->grab_focus;
- $w->{window}->show_all;
+
$w->main or die "ask_from_list cancel";
}