diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-02-09 16:00:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-02-09 16:00:55 +0000 |
commit | c6a4cba373448243762242fd54c72726e7b204da (patch) | |
tree | c944dcac55f446e18c767f1355d0ae0b8b263573 /perl-install/interactive_newt.pm | |
parent | ebbb550f040057963c91b0e67076d80328d4a331 (diff) | |
download | drakx-backup-do-not-use-c6a4cba373448243762242fd54c72726e7b204da.tar drakx-backup-do-not-use-c6a4cba373448243762242fd54c72726e7b204da.tar.gz drakx-backup-do-not-use-c6a4cba373448243762242fd54c72726e7b204da.tar.bz2 drakx-backup-do-not-use-c6a4cba373448243762242fd54c72726e7b204da.tar.xz drakx-backup-do-not-use-c6a4cba373448243762242fd54c72726e7b204da.zip |
add button handling, quite weird behaviour though cuz of newt sillyness
Diffstat (limited to 'perl-install/interactive_newt.pm')
-rw-r--r-- | perl-install/interactive_newt.pm | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/perl-install/interactive_newt.pm b/perl-install/interactive_newt.pm index 0c8671f19..b260d60af 100644 --- a/perl-install/interactive_newt.pm +++ b/perl-install/interactive_newt.pm @@ -101,15 +101,9 @@ sub ask_from_entries_refW { $w = Newt::Component::Checkbox(-1, -1, $e->{text} || '', checkval(${$e->{val}}), " *"); $set = sub { $w->CheckboxSetValue(checkval($_[0])) }; $get = sub { $w->CheckboxGetValue == ord '*' }; -# } elsif ($e->{type} eq 'range') { -# my $adj = create_adjustment(${$e->{val}}, $e->{min}, $e->{max}); -# $adj->signal_connect(value_changed => $changed); -# $w = new Gtk::HScale($adj); -# $w->set_digits(0); -# $w->signal_connect(key_press_event => $may_go_to_next); -# $set = sub { $adj->set_value($_[0]) }; -# $get = sub { $adj->get_value }; - } elsif ($e->{type} =~ /list/) { + } elsif ($e->{type} eq 'button') { + $w = Newt::Component::Button(-1, -1, $e->{text} || ''); + } elsif ($e->{type} =~ /list/) { my ($h, $wi) = (5, 20); my $scroll = @{$e->{list}} > $h ? 1 << 2 : 0; $size = min(int @{$e->{list}}, $h); @@ -188,14 +182,19 @@ sub ask_from_entries_refW { !$error; }; - my $canceled; + my ($canceled, $r); do { - my $r = $form->RunForm; + $r = $form->RunForm; $canceled = $cancel && $$r == $$cancel; } until ($check->($common->{callbacks}{$canceled ? 'canceled' : 'complete'})); $form->FormDestroy; Newt::PopWindow; + + foreach (@widgets) { + $_->{e}{clicked}() if $$r == ${$_->{w}}; + } + !$canceled; } |