summaryrefslogtreecommitdiffstats
path: root/python/examples/example-signal-emitter.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples/example-signal-emitter.py')
-rw-r--r--python/examples/example-signal-emitter.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/examples/example-signal-emitter.py b/python/examples/example-signal-emitter.py
new file mode 100644
index 00000000..edabfd70
--- /dev/null
+++ b/python/examples/example-signal-emitter.py
@@ -0,0 +1,18 @@
+import dbus
+import gtk
+
+class TestObject(dbus.Object):
+ def __init__(self, service):
+ dbus.Object.__init__(self, "/object", service, [self.HelloWorld])
+
+ def emitHelloSignal(self, message):
+ # Emit the signal
+ self.emit_signal(interface="org.designfu.TestService",
+ signal_name="hello")
+
+session_bus = dbus.SessionBus()
+service = dbus.Service("org.designfu.TestService", bus=session_bus)
+object = TestObject(service)
+
+gtk.main()
+A