Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/example-activity/example-activity.py
blob: 56b1a73007642d496a5d13e55aed889505dc7ed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python

import string

import dbus
import dbus.service
import dbus.glib
import gobject
import pygtk
pygtk.require('2.0')
import gtk,sys

if len(sys.argv) != 2:
    print "usage: example-activity.py <name_of_activity>"
    sys.exit(1)

bus = dbus.SessionBus()
activity_container_object = bus.get_object("com.redhat.Sugar.Shell", \
					   "/com/redhat/Sugar/Shell/ActivityContainer")
activity_container = dbus.Interface(activity_container_object, \
				    "com.redhat.Sugar.Shell.ActivityContainer")

window_id = activity_container.add_activity(sys.argv[1])
print "got XEMBED window_id = %d"%window_id

plug = gtk.Plug(window_id)
entry = gtk.Entry()
entry.set_text(sys.argv[1])
plug.add(entry)
plug.show_all()

gtk.main()