[gnome-builder] docs: add blurb on action groups



commit b662ab0cd4f809887dae87135b4bd68dc2d4faed
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 6 13:46:43 2017 -0700

    docs: add blurb on action groups

 doc/plugins/workbench/actions.rst |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/doc/plugins/workbench/actions.rst b/doc/plugins/workbench/actions.rst
index d3c5894..8176b46 100644
--- a/doc/plugins/workbench/actions.rst
+++ b/doc/plugins/workbench/actions.rst
@@ -21,9 +21,18 @@ Additionally, actions registered on the workbench can be activated using the com
            action.connect('activate', self.hello_activate)
            workbench.add_action(action)
 
+           # If you have a lot of actions to add, you might
+           # consider creating an action group.
+           group = Gio.SimpleActionGroup.new()
+           group.add_action(action)
+           workbench.insert_action_group('my-actions', group)
+
        def do_unload(self, workbench):
            workbench.remove_action('hello')
 
+           # And if you used an action group
+           workbench.insert_action_group('my-actions', None)
+
        def hello_activate(self, action, param):
            print('Hello activated!')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]