summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-30 20:34:38 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-30 20:34:38 +0000
commit91419eac51774d733b905ac2d54b3bde60a208df (patch)
tree80b2b4ebd499f750df5a12a0237bf6ab736619d4 /perl-install/my_gtk.pm
parent5ed323fc9a6c7e36a81242fa4a104ba3ea514339 (diff)
downloaddrakx-91419eac51774d733b905ac2d54b3bde60a208df.tar
drakx-91419eac51774d733b905ac2d54b3bde60a208df.tar.gz
drakx-91419eac51774d733b905ac2d54b3bde60a208df.tar.bz2
drakx-91419eac51774d733b905ac2d54b3bde60a208df.tar.xz
drakx-91419eac51774d733b905ac2d54b3bde60a208df.zip
no_comment
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index ebce6f49d..e78cd2fda 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -8,7 +8,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK);
%EXPORT_TAGS = (
helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title) ],
wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkappend gtkadd gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_background) ],
- ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list ) ],
+ ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list ask_file) ],
);
$EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ];
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -262,6 +262,7 @@ sub ask_yesorno { my $w = my_gtk->new(shift @_); $w->_ask_okcancel(@_, _("Yes
sub ask_okcancel { my $w = my_gtk->new(shift @_); $w->_ask_okcancel(@_, _("Is it ok?"), _("Ok"), _("Cancel")); main($w); }
sub ask_from_entry { my $w = my_gtk->new(shift @_); $w->_ask_from_entry(@_); main($w); }
sub ask_from_list { my $w = my_gtk->new(shift @_); $w->_ask_from_list(@_); main($w); }
+sub ask_file { my $w = my_gtk->new(''); $w->_ask_file(@_); main($w); }
sub _ask_from_entry($$@) {
my ($o, @msgs) = @_;
@@ -351,6 +352,14 @@ sub _ask_okcancel($@) {
}
+sub _ask_file($$) {
+ my ($o, $title) = @_;
+ my $f = $o->{window} = new Gtk::FileSelection $title;
+ $f->ok_button->signal_connect(clicked => sub { $o->{retval} = $f->get_filename ; Gtk->main_quit });
+ $f->cancel_button->signal_connect(clicked => sub { Gtk->main_quit });
+ $f->hide_fileop_buttons;
+}
+
################################################################################
# rubbish
################################################################################