summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
authorpad <pad@mandriva.com>1999-09-05 21:28:36 +0000
committerpad <pad@mandriva.com>1999-09-05 21:28:36 +0000
commit38dce4a6d02d689b7aefa2b5f925ac5441c51a89 (patch)
tree78e8513e786585460ab499c1614e46dfbf1e25be /perl-install/my_gtk.pm
parentfeaf2a529e993fee5bd71560d883ef354537ed6a (diff)
downloaddrakx-38dce4a6d02d689b7aefa2b5f925ac5441c51a89.tar
drakx-38dce4a6d02d689b7aefa2b5f925ac5441c51a89.tar.gz
drakx-38dce4a6d02d689b7aefa2b5f925ac5441c51a89.tar.bz2
drakx-38dce4a6d02d689b7aefa2b5f925ac5441c51a89.tar.xz
drakx-38dce4a6d02d689b7aefa2b5f925ac5441c51a89.zip
code clarification + bugfix
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm30
1 files changed, 26 insertions, 4 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index f0ccaa028..a6e594eba 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -334,7 +334,7 @@ sub _ask_from_entry($$@) {
}
sub _ask_from_list($$$$) {
my ($o, $messages, $l, $def) = @_;
- my $list = new Gtk::List;
+ my $list = new Gtk::List();
my ($first_time, $starting_word) = (1, '');
my (@widgets, $timeout);
$list->signal_connect(select_child => sub {
@@ -374,13 +374,35 @@ sub _ask_from_list($$$$) {
# push @::ask_from_list_widgets, $w; # hack!! to not get SIGSEGV
push @widgets, $w;
} @$l;
+# $scroll_win->set_policy("automatic","automatic");
+# my $scroll_win = @widgets > 15 ? gtkset_usize(createScrolledWindow($list), 200, 280) : $list;
gtkadd($list, @widgets);
+# $list->set_selection_mode("extended");
+ my $scroll_win = do {
+ if (@widgets > 15) {
+ my $win = createScrolledWindow($list);
+ gtkset_usize($win, 200, 280);
+ $list->set_focus_vadjustment($win->get_vadjustment);
+ $list->set_focus_hadjustment($win->get_hadjustment);
+# my $adj = create_adjustment(45,0,200);
+# $win->set_hadjustment($adj);
+# my $adj = $win->get_vadjustment;
+# $adj->set_value(45200);
+# $list->set_focus_vadjustment(new Gtk::Adjustment(45));
+# $widgets[$def]->visible(1);
+# $list->set_focus_child($widgets[$def]);
+# $list->select_item($def);
+# $widgets[$def]->toggle_focus_row();
+ $win;
+ } else {
+ $list;
+ }
+ };
gtkadd($o->{window},
gtkpack($o->create_box_with_title(@$messages),
- @widgets > 15 ?
- gtkset_usize(createScrolledWindow($list), 200, 280) :
- $list));
+ $scroll_win));
$widgets[$def]->grab_focus;
+
}
sub _ask_warn($@) {