From 824049f130f973f256d513bc8226caf18a6c7d7a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 11 Jan 2001 11:51:31 +0000 Subject: (ask_from_entries_refW): apply "format" on label when icon is missing for iconlist (ask_from_entries_refW): handle "canceled" callback. Permits to overrule the cancel. --- perl-install/interactive_gtk.pm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'perl-install') diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index e6e02c3be..87b6db89c 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -272,7 +272,7 @@ sub ask_from_entries_refW { my $f = $e->{icon2f}->($_[0]); $e->{icon} = -e $f ? new Gtk::Pixmap(gtkcreate_xpm($mainw->{window}, $f)) : - new Gtk::Label(translate($_[0])); + new Gtk::Label(may_apply($e->{format}, $_[0])); $w->add($e->{icon}); $e->{icon}->show; }; @@ -376,16 +376,20 @@ sub ask_from_entries_refW { $set_advanced->(0); (@widgets ? $widgets[0]{w} : $common->{focus_cancel} ? $mainw->{cancel} : $mainw->{ok})->grab_focus(); - $mainw->main(sub { - $get_all->(); - my ($error, $focus) = $common->{callbacks}{complete}->(); + my $check = sub { + my ($f) = @_; + sub { + $get_all->(); + my ($error, $focus) = $f->(); - if ($error) { - $set_all->(); - $widgets[$focus || 0]{w}->grab_focus(); + if ($error) { + $set_all->(); + $widgets[$focus || 0]{w}->grab_focus(); + } + !$error; } - !$error; - }); + }; + $mainw->main(map { $check->($common->{callbacks}{$_}) } 'complete', 'canceled'); } -- cgit v1.2.1