summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-03 15:03:39 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-11-24 23:28:14 +0100
commit53dba361fafaae5dbc07c0409cd7160f6f621f01 (patch)
treeb603ace12459a96ef6d8ef9baa9ebd85f004aa74 /perl-install
parent928857551788a8c9ea698cb09c3d50010e8a5c02 (diff)
downloaddrakx-53dba361fafaae5dbc07c0409cd7160f6f621f01.tar
drakx-53dba361fafaae5dbc07c0409cd7160f6f621f01.tar.gz
drakx-53dba361fafaae5dbc07c0409cd7160f6f621f01.tar.bz2
drakx-53dba361fafaae5dbc07c0409cd7160f6f621f01.tar.xz
drakx-53dba361fafaae5dbc07c0409cd7160f6f621f01.zip
add basic support for ActionGroup & UIManager widgets
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/mygtk3.pm28
1 files changed, 28 insertions, 0 deletions
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) = @_;