summaryrefslogtreecommitdiffstats
path: root/python/examples/example-signal-recipient.py
blob: b5306070caba7d00734a3edd31318b5f614e4a71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gtk
import dbus

bus = dbus.SessionBus()
service = bus.get_service("org.designfu.TestService")
object  = service.get_object("/org/designfu/TestService/object", "org.designfu.TestService")

def hello_signal_handler(sender):
        print ("Received signal '%s.%s' from object '%s%s'"
               % (sender.interface, sender.signal_name, sender.service, sender.path))


object.connect_to_signal("hello", hello_signal_handler)

# Tell the remote object to emit the signal
object.emitHelloSignal()

gtk.main()