diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-07-29 15:18:54 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-07-29 15:18:54 +0000 |
commit | 88a07c82cece62903ae68e1e2c482d810bbf8560 (patch) | |
tree | 5eee08b842d20f111fc82bba2e42425e253e8a50 /perl-install/interactive_gtk.pm | |
parent | 5dc2835bfbf1f53ad51ba540f4423c22cc94b26c (diff) | |
download | drakx-backup-do-not-use-88a07c82cece62903ae68e1e2c482d810bbf8560.tar drakx-backup-do-not-use-88a07c82cece62903ae68e1e2c482d810bbf8560.tar.gz drakx-backup-do-not-use-88a07c82cece62903ae68e1e2c482d810bbf8560.tar.bz2 drakx-backup-do-not-use-88a07c82cece62903ae68e1e2c482d810bbf8560.tar.xz drakx-backup-do-not-use-88a07c82cece62903ae68e1e2c482d810bbf8560.zip |
no_comment
Diffstat (limited to 'perl-install/interactive_gtk.pm')
-rw-r--r-- | perl-install/interactive_gtk.pm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm new file mode 100644 index 000000000..935766470 --- /dev/null +++ b/perl-install/interactive_gtk.pm @@ -0,0 +1,37 @@ +package interactive_gtk; + +use diagnostics; +use strict; +use vars qw(@ISA); + +@ISA = qw(interactive); + +use interactive; +use common qw(:common); +use my_gtk qw(:helpers :wrappers); + +1; + +sub ask_from_listW { + my ($o, $title, $messages, $l, $def) = @_; + + if (@$l < 5 && sum(map { length $_ } @$l) < 70) { + my $w = my_gtk->new($title); + my $f = sub { $w->{retval} = $_[1]; Gtk->main_quit }; + gtkadd($w->{window}, + gtkpack(create_box_with_title($o, @$messages), + gtkadd(create_hbox(), + map { + my $b = new Gtk::Button($_); + $b->signal_connect(clicked => [ $f, $_ ]); + $_ eq $def and $def = $b; + $b; + } @$l), + ), + ); + $def->grab_focus if $def; + $w->main; + } else { + my_gtk::ask_from_list($title, $messages, $l, $def); + } +} |