diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2009-01-19 10:06:47 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2009-01-19 10:06:47 +0000 |
commit | 56192fde0cd4f267a3abc525a27d9774022e8fd3 (patch) | |
tree | 2fbf7cee3432fb6737927129249e07aeb5b2453a /perl-install/interactive | |
parent | 52eea1fba1a12e34dd3a98b6a1e27e4de2939ecf (diff) | |
download | drakx-56192fde0cd4f267a3abc525a27d9774022e8fd3.tar drakx-56192fde0cd4f267a3abc525a27d9774022e8fd3.tar.gz drakx-56192fde0cd4f267a3abc525a27d9774022e8fd3.tar.bz2 drakx-56192fde0cd4f267a3abc525a27d9774022e8fd3.tar.xz drakx-56192fde0cd4f267a3abc525a27d9774022e8fd3.zip |
- use "ComboBoxEntry" gtk2 widget instead of "Combo" (which is deprecated),
this also workarounds gtk2 bug with "hidden" Entry + "Combo"
Diffstat (limited to 'perl-install/interactive')
-rw-r--r-- | perl-install/interactive/gtk.pm | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 7a939dc0c..c4967e4f6 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -503,14 +503,10 @@ sub create_widget { ($w->child->get_cell_renderers)[0]->set_property('ellipsize', 'end') if !$e->{do_not_ellipsize}; $w->set_wrap_width($e->{gtk}{wrap_width}) if exists $e->{gtk}{wrap_width}; } else { - $w = Gtk2::Combo->new; - $w->set_use_arrows_always(1); - $w->entry->set_editable(1); - $w->disable_activate; - ($real_w, $w) = ($w, $w->entry); + $w = Gtk2::ComboBoxEntry->new_text; + ($real_w, $w) = ($w, $w->child); } $real_w->set_popdown_strings(@formatted_list); - $real_w->set_text(ref($e->{val}) ? may_apply($e->{format}, ${$e->{val}}) : $formatted_list[0]) if $real_w->isa('Gtk2::ComboBox'); } else { $model = __create_tree_model($e); $real_w = $w = Gtk2::ComboBox->new_with_model($model); @@ -533,16 +529,7 @@ sub create_widget { }; defined $i ? $e->{list}[$i] : $w->get_text; }; - if ($real_w->isa('Gtk2::Combo')) { - #- FIXME workaround gtk suckiness (set_text generates two 'change' signals, one when removing the whole, one for inserting the replacement..) - my $idle; - $w->signal_connect(changed => sub { - return if $$ignore_ref; - $idle ||= Glib::Idle->add(sub { undef $idle; $onchange_f->($get); 0 }); - }); - } else { - $w->signal_connect(changed => $onchange->($get)); - } + $w->signal_connect(changed => $onchange->($get)); $set = sub { my $s = may_apply($e->{format}, $_[0]); |