Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
blob: 57c69c45ba6deafa33538f07b8e93ba5916d7069 (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
35
36
37
38
39
40
41
42
43
# Load GTK
import gtk

# Load our own source code from gtktest.py
# There you can find the main class gtktest()
from enjumble import enjumble

# Load sugar libraries
from sugar.activity import activity  

class enjumbleActivity(activity.Activity):
	def __init__(self, handle):
		activity.Activity.__init__(self, handle)
		self._name = handle

		# Set title for our Activity
		self.set_title('Enjumble')

		# Attach sugar toolbox (Share, ...)
		toolbox = activity.ActivityToolbox(self)
		self.set_toolbox(toolbox)
		toolbox.show()

		# Create the main container
		self._main_view = gtk.VBox()

		# Import our class enjumble():

		# Step 1: Load class, which creates enjumble.widget
		self.enjumble = enjumble()

		# Step 2: Remove the widget's parent
		if self.enjumble.widget.parent:
			self.enjumble.widget.parent.remove(self.enjumble.widget)
 
		# Step 3: We attach that widget to our window
		self._main_view.pack_start(self.enjumble.widget)

		# Display everything
		self.enjumble.widget.show()
		self._main_view.show()
		self.set_canvas(self._main_view)
		self.show_all()