summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive_gtk.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-03-09 02:40:49 +0000
committerdamien <damien@mandriva.com>2001-03-09 02:40:49 +0000
commit2af607580dd3e1568f0eb5c50f6db77bed314f5b (patch)
tree8708884d76f4d717aa778f3e78ae0e2c177101a2 /perl-install/interactive_gtk.pm
parentd6f963e89a8485f20fc561e5bce5e58c322d668a (diff)
downloaddrakx-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar
drakx-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar.gz
drakx-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar.bz2
drakx-2af607580dd3e1568f0eb5c50f6db77bed314f5b.tar.xz
drakx-2af607580dd3e1568f0eb5c50f6db77bed314f5b.zip
applied gtkradio
created create_boxradio in wizard mode : list -> radio buttons
Diffstat (limited to 'perl-install/interactive_gtk.pm')
-rw-r--r--perl-install/interactive_gtk.pm28
1 files changed, 26 insertions, 2 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index 39f4d0b71..b967f6aa3 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -32,9 +32,31 @@ sub ask_warn {
local $my_gtk::pop_it = 1;
&interactive::ask_warn;
}
+
+sub create_boxradio {
+ my ($e, $may_go_to_next, $changed) = @_;
+ my @l = map { may_apply($e->{format}, $_) } @{$e->{list}};
+
+ my $boxradio = gtkpack2__(new Gtk::VBox(0, 0),
+ my @radios = gtkradio(@l, ''));
+ $boxradio->show;
+ mapn {
+ my ($txt, $w) = @_;
+ $w->signal_connect(clicked => sub {
+ ${$e->{val}} = $txt;
+ &$changed;
+ });
+ } $e->{list}, \@radios;
+
+ $boxradio, sub {
+ my ($v) = @_;
+ mapn { $_[0]->set_active($_[1] eq $v) } \@radios, $e->{list};
+ }
+}
+
sub create_clist {
my ($e, $may_go_to_next, $changed) = @_;
- my (@widgets, $curr);
+ my $curr;
my @l = map { may_apply($e->{format}, $_) } @{$e->{list}};
my $list = new Gtk::CList(1);
@@ -358,7 +380,9 @@ sub ask_from_entries_refW {
} elsif ($e->{type} eq 'treelist') {
($w, $set) = create_ctree($e, $may_go_to_next, $changed);
} else {
- ($w, $set) = create_clist($e, $may_go_to_next, $changed);
+ ($w, $set) = $::isWizard ?
+ create_boxradio($e, $may_go_to_next, $changed) :
+ create_clist($e, $may_go_to_next, $changed);
}
if (@$l == 1) {
#- i'm the only one, double click means accepting