diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-11-22 19:06:38 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-11-24 23:53:09 +0100 |
commit | 07272233bbe52eaa714d1764d172b5553d7f8a34 (patch) | |
tree | 08f8af11c6b4d23372d3c1091a07b6779ee5ee20 /perl-install | |
parent | ca6a026a23f723a74dab9a7d3afc11c2a43c01f2 (diff) | |
download | drakx-07272233bbe52eaa714d1764d172b5553d7f8a34.tar drakx-07272233bbe52eaa714d1764d172b5553d7f8a34.tar.gz drakx-07272233bbe52eaa714d1764d172b5553d7f8a34.tar.bz2 drakx-07272233bbe52eaa714d1764d172b5553d7f8a34.tar.xz drakx-07272233bbe52eaa714d1764d172b5553d7f8a34.zip |
OptionMenu has been deprecated prior to Gtk3
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/ugtk3.pm | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/perl-install/ugtk3.pm b/perl-install/ugtk3.pm index e136d6701..ec24d92bc 100644 --- a/perl-install/ugtk3.pm +++ b/perl-install/ugtk3.pm @@ -1283,72 +1283,6 @@ sub toggle_expansion { } } - -# With GTK+, for more GUIes coherency, GtkOptionMenu is recommended instead of a -# combo if the user is selecting from a fixed set of options. -# -# That is, non-editable combo boxes are not encouraged. GtkOptionMenu is much -# easier to use than GtkCombo as well. Use GtkCombo only when you need the -# editable text entry. -# -# GtkOptionMenu is a much better-implemented widget and also the right UI for -# noneditable sets of choices.) -# -# GtkCombo is deprecated in 2.4.x because it still uses deprecated -# GtkList. GtkOption menu is deprecated in order to have an unified widget. -# -# GtkComBox widget replaces GtkOption menu whereas GtkComBoxEntry replaces GtkCombo. -# -# -# This layer try to make OptionMenu and ComboBox look being api -# compatible with Combo since its API is quite nice. - -package Gtk3::OptionMenu; -use MDK::Common; - -# try to get combox <==> option menu mapping -sub set_popdown_strings { - my ($w, @strs) = @_; - my $menu = Gtk3::Menu->new; - # keep string list around for ->set_text compatibilty helper - $w->{strings} = \@strs; - #$w->set_menu((ugtk3::create_factory_menu($window, [ "File", (undef) x 3, '<Branch>' ], map { [ "File/" . $_, (undef) x 3, '<Item>' ] } @strs))[0]); - $menu->append(ugtk3::gtkshow(Gtk3::MenuItem->new_with_label($_))) foreach @strs; - $w->set_menu($menu); - $w; -} - -sub new_with_strings { - my ($class, $strs, $o_val) = @_; - my $w = $class->new; - $w->set_popdown_strings(@$strs); - $w->set_text($o_val) if $o_val; - $w; -} - -sub entry { - my ($w) = @_; - return $w; -} - -sub get_text { - my ($w) = @_; - $w->get_history == -1 ? '' : $w->{strings}[$w->get_history]; -} - -sub set_text { - my ($w, $val) = @_; - each_index { - if ($_ eq $val) { - $w->set_history($::i); - return; - } - } @{$w->{strings}}; -} - - - - package Gtk3::ComboBox; use MDK::Common; |