From d4b8566f7d690b25c3aec5dab2c42886b309d4bc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 22 Jan 2002 23:34:59 +0000 Subject: add "quit_if_double_click" and "tree_expanded" flags (request from till) --- perl-install/interactive_gtk.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perl-install/interactive_gtk.pm') diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index eb39348c6..e42833f80 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -147,7 +147,7 @@ sub create_clist { } sub create_ctree { - my ($e, $may_go_to_next, $changed, $double_click) = @_; + my ($e, $may_go_to_next, $changed, $double_click, $tree_expanded) = @_; my @l = map { may_apply($e->{format}, $_) } @{$e->{list}}; my $sep = quotemeta $e->{separator}; @@ -159,7 +159,7 @@ sub create_ctree { my $s; foreach (split $sep, $_[0]) { $wtree{"$s$_$e->{separator}"} ||= - $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 5, (undef) x 4, 0, 0); + $tree->insert_node($s ? $parent->($s) : undef, undef, [$_], 5, (undef) x 4, 0, $tree_expanded); $size++ if !$s; $s .= "$_$e->{separator}"; } @@ -435,7 +435,7 @@ sub ask_fromW { my $quit_if_double_click = #- i'm the only one, double click means accepting - @$l == 1 ? + @$l == 1 || $e->{quit_if_double_click} ? sub { if ($_[1]{type} =~ /^2/) { $mainw->{retval} = 1; Gtk->main_quit } } : ''; my @para = ($e, $may_go_to_next, $changed, $quit_if_double_click); @@ -445,7 +445,7 @@ sub ask_fromW { #- used only when needed, as key bindings are dropped by List (CList does not seems to accepts Tooltips). ($w, $set, $focus_w) = $use_boxradio ? create_boxradio(@para) : create_list(@para); } elsif ($e->{type} eq 'treelist') { - ($w, $set, $size) = create_ctree(@para); + ($w, $set, $size) = create_ctree(@para, $e->{tree_expanded}); } else { ($w, $set, $focus_w) = $use_boxradio ? create_boxradio(@para) : create_clist(@para); } -- cgit v1.2.1