From 53dba361fafaae5dbc07c0409cd7160f6f621f01 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 3 Nov 2013 15:03:39 +0100 Subject: add basic support for ActionGroup & UIManager widgets --- perl-install/mygtk3.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/perl-install/mygtk3.pm b/perl-install/mygtk3.pm index e5b2e486b..1e78a7baa 100644 --- a/perl-install/mygtk3.pm +++ b/perl-install/mygtk3.pm @@ -539,6 +539,34 @@ sub _gtk__WeaknessCheckEntry { $w; } +sub _gtk__ActionGroup { + my ($w, $opts, $_class, $action) = @_; + + if (!$w) { + $w = Gtk3::ActionGroup->new(delete $opts->{name}); + if ($opts->{actions}) { + $w->add_actions(delete $opts->{actions}, undef); + $w->add_toggle_actions(delete $opts->{toggle_actions}, undef) if $opts->{toggle_actions}; + } + } + $w; +} + +sub _gtk__UIManager { + my ($w, $opts, $_class, $action) = @_; + + if (!$w) { + $w = Gtk3::UIManager->new; + if ($opts->{actions}) { + $w->insert_action_group(gtknew('ActionGroup', name => 'Actions', + map { exists $opts->{$_} ? ($_ => delete $opts->{$_}) : () } qw(actions toggle_actions)), + 0); + } + $w->add_ui_from_string(delete $opts->{string}) if exists $opts->{string}; + } + $w; +} + sub _gtk__TextView { my ($w, $opts, $_class, $action) = @_; -- cgit v1.2.1