summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-02-09 16:00:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-02-09 16:00:55 +0000
commitc6a4cba373448243762242fd54c72726e7b204da (patch)
treec944dcac55f446e18c767f1355d0ae0b8b263573 /perl-install/interactive_gtk.pm
parentebbb550f040057963c91b0e67076d80328d4a331 (diff)
downloaddrakx-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_gtk.pm')
-rw-r--r--perl-install/interactive_gtk.pm29
1 files changed, 18 insertions, 11 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index 8485d34ea..c26f72a4b 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -234,6 +234,13 @@ sub ask_from_entries_refW {
my $get_all = sub {
${$_->{e}{val}} = $_->{get}->() foreach @widgets_always, @widgets_advanced;
};
+ my $update = sub {
+ my ($f) = @_;
+ return if $ignore;
+ $get_all->();
+ $f->();
+ $set_all->();
+ };
my $create_widget = sub {
my ($e, $ind) = @_;
@@ -248,12 +255,7 @@ sub ask_from_entries_refW {
}
}
};
- my $changed = sub {
- return if $ignore;
- $get_all->();
- $common->{callbacks}{changed}->($ind);
- $set_all->();
- };
+ my $changed = sub { $update->(sub { $common->{callbacks}{changed}($ind) }) };
my ($w, $real_w, $set, $get, $expand, $size);
if ($e->{type} eq 'iconlist') {
@@ -277,6 +279,14 @@ sub ask_from_entries_refW {
$w->signal_connect(clicked => $changed);
$set = sub { $w->set_active($_[0]) };
$get = sub { $w->get_active };
+ } elsif ($e->{type} eq 'button') {
+ $w = Gtk::Button->new($e->{text});
+ $w->signal_connect(clicked => sub {
+ $o->{retval} = 1;
+ Gtk->main_quit;
+ $mainw->destroy;
+ $e->{clicked}();
+ });
} elsif ($e->{type} eq 'range') {
my $adj = create_adjustment(${$e->{val}}, $e->{min}, $e->{max});
$adj->signal_connect(value_changed => $changed);
@@ -317,11 +327,8 @@ sub ask_from_entries_refW {
$set = sub { $w->set_text($_[0]) };
$get = sub { $w->get_text };
}
- $w->signal_connect(focus_out_event => sub {
- return if $ignore;
- $get_all->();
- $common->{callbacks}{focus_out}->($ind);
- $set_all->();
+ $w->signal_connect(focus_out_event => sub {
+ $update->(sub { $common->{callbacks}{focus_out}($ind) });
});
$tooltips->set_tip($w, $e->{help}) if $e->{help} && !ref($e->{help});