From b1009a800f4e64b17e19e578deedaf0c9bd18902 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 4 Jun 2013 15:42:16 -0400 Subject: Add qml example for UnityMenuModel --- examples/exportmenu.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/exportmenu.py') diff --git a/examples/exportmenu.py b/examples/exportmenu.py index 4be3deb..767d8b9 100755 --- a/examples/exportmenu.py +++ b/examples/exportmenu.py @@ -54,7 +54,7 @@ if __name__ == '__main__': GLib.Variant.new_string('lorem ipsum')) foo.set_attribute_value('x-enabled', GLib.Variant.new_boolean(True)) menu.append_item(foo) - bar = Gio.MenuItem.new('bar', 'app.bar') + bar = Gio.MenuItem.new('bar', 'bar') bar.set_attribute_value('x-defaultvalue', GLib.Variant.new_string('Hello World!')) bar.set_attribute_value('x-canonical-currentvalue', @@ -74,5 +74,9 @@ if __name__ == '__main__': menu.append('baz', 'app.baz') bus.export_menu_model(BUS_OBJECT_PATH, menu) + actions = Gio.SimpleActionGroup.new() + actions.add_action(Gio.SimpleAction.new("bar", None)) + bus.export_action_group(BUS_OBJECT_PATH, actions) + GLib.MainLoop().run() -- cgit v1.2.3