From 762dee42a6cbe4a3e803d402ccadc8050897752e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 24 May 2004 13:10:24 +0000 Subject: switch from deprecated OptionMenu into new ComboBox widget --- perl-install/interactive/gtk.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perl-install/interactive') diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 88a102b41..b6dade81d 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -535,8 +535,8 @@ sub ask_fromW { my @l = sort { $b <=> $a } map { length } @formatted_list; my $width = $l[@l / 16]; # take the third octile (think quartile) - if ($e->{not_edit} && $width < 60) { #- OptionMenus do not have an horizontal scroll-bar. This can cause havoc for long strings (eg: diskdrake Create dialog box in expert mode) - $w = Gtk2::OptionMenu->new; + if ($e->{not_edit} && $width < 160) { #- ComboBoxes do not have an horizontal scroll-bar. This can cause havoc for long strings (eg: diskdrake Create dialog box in expert mode) + $w = Gtk2::ComboBox->new_text; } else { $w = Gtk2::Combo->new; $w->set_use_arrows_always(1); @@ -545,6 +545,7 @@ sub ask_fromW { } $w->set_popdown_strings(@formatted_list); + $w->set_text($formatted_list[0]) if $w->isa('Gtk2::ComboBox'); ($real_w, $w) = ($w, $w->entry); #- FIXME workaround gtk suckiness (set_text generates two 'change' signals, one when removing the whole, one for inserting the replacement..) -- cgit v1.2.1