summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-13 16:23:45 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-13 16:23:45 +0000
commit39b51c96e54f880be2d2fb909f44118a6c209d7c (patch)
tree86b09fbe4e5042b5fa5b4269d79cf9042993a568 /perl-install/my_gtk.pm
parent925e58d2b3b5fc4adeefcf9f7c3062ba5efde627 (diff)
downloaddrakx-39b51c96e54f880be2d2fb909f44118a6c209d7c.tar
drakx-39b51c96e54f880be2d2fb909f44118a6c209d7c.tar.gz
drakx-39b51c96e54f880be2d2fb909f44118a6c209d7c.tar.bz2
drakx-39b51c96e54f880be2d2fb909f44118a6c209d7c.tar.xz
drakx-39b51c96e54f880be2d2fb909f44118a6c209d7c.zip
*** empty log message ***
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 8ab3054e7..99636cf21 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- all => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_adjustment gtksignal_connect gtkpack gtkpack_ gtkappend gtkadd gtkset_usize gtkset_justify gtkshow gtkdestroy) ],
+ all => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_adjustment gtksignal_connect gtkpack gtkpack_ gtkappend gtkadd gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -63,6 +63,7 @@ sub gtkshow($) { $_[0]->show; $_[0] }
sub gtkdestroy($) { $_[0] and $_[0]->destroy }
sub gtkset_usize($$$) { $_[0]->set_usize($_[1],$_[2]); $_[0] }
sub gtkset_justify($$) { $_[0]->set_justify($_[1]); $_[0] }
+sub gtkset_active($$) { $_[0]->set_active($_[1]); $_[0] }
sub gtksignal_connect($@) {
my $w = shift;
@@ -85,7 +86,7 @@ sub gtkpack_($@) {
my $l = $_[$i + 1];
ref $l or $l = new Gtk::Label($l);
$box->pack_start($l, $_[$i], 1, 0);
- $_[$i + 1]->show;
+ $l->show;
}
$box
}
@@ -237,11 +238,14 @@ sub _ask_from_entry($$@) {
);
$entry->grab_focus();
}
-sub _ask_from_list($\@$@) {
+sub _ask_from_list($$$@) {
my ($o, $l, @msgs) = @_;
- my $f = sub { $o->{retval} = $_[1]; Gtk->main_quit };
- my $list = new Gtk::List();
- map { gtksignal_connect(gtkadd($list, new Gtk::ListItem($_)), selection_changed => $f, $_) } @$l;
+ my $list = new Gtk::List;
+ $list->signal_connect(select_child => sub {
+ $o->{retval} = $l->[$list->child_position($_[1])];
+ Gtk->main_quit;
+ });
+ gtkadd($list, map { new Gtk::ListItem($_) } @$l);
# myadd($o->{window},
# mypack_(myset_usize(new Gtk::VBox(0,0), 0, 200),