Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorolpc user <olpc@localhost.localdomain>2010-01-30 13:13:29 (GMT)
committer olpc user <olpc@localhost.localdomain>2010-01-30 13:13:29 (GMT)
commitf8a54f5c2f4487f264fe4647cec62599db93d063 (patch)
tree8758b1412c524129dad7e90a4da6b463a85ed96f /examples
initial save 1-30-2010 bangladesh
Diffstat (limited to 'examples')
-rw-r--r--examples/HelloWorld.activity/HelloWorldActivity.py40
-rw-r--r--examples/HelloWorld.activity/MANIFEST4
-rw-r--r--examples/HelloWorld.activity/activity/activity-helloworld.svg8
-rw-r--r--examples/HelloWorld.activity/activity/activity.info7
-rwxr-xr-xexamples/HelloWorld.activity/setup.py3
-rw-r--r--examples/bundle-2.xobin0 -> 108815 bytes
6 files changed, 62 insertions, 0 deletions
diff --git a/examples/HelloWorld.activity/HelloWorldActivity.py b/examples/HelloWorld.activity/HelloWorldActivity.py
new file mode 100644
index 0000000..bf73963
--- /dev/null
+++ b/examples/HelloWorld.activity/HelloWorldActivity.py
@@ -0,0 +1,40 @@
+from sugar.activity import activity
+import logging
+
+import sys, os
+import gtk
+
+class HelloWorldActivity(activity.Activity):
+ def hello(self, widget, data=None):
+ logging.info('Hello World')
+
+ def __init__(self, handle):
+ print "running activity init", handle
+ activity.Activity.__init__(self, handle)
+ print "activity running"
+
+ self.set_title('Hello World')
+
+ # Creates the Toolbox. It contains the Activity Toolbar, which is the
+ # bar that appears on every Sugar window and contains essential
+ # functionalities, such as the 'Collaborate' and 'Close' buttons.
+ toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(toolbox)
+ toolbox.show()
+
+ # Creates a new button with the label "Hello World".
+ self.button = gtk.Button("Hello World")
+
+ # When the button receives the "clicked" signal, it will call the
+ # function hello() passing it None as its argument. The hello()
+ # function is defined above.
+ self.button.connect("clicked", self.hello, None)
+
+ # Set the button to be our canvas. The canvas is the main section of
+ # every Sugar Window. It fills all the area below the toolbox.
+ self.set_canvas(self.button)
+
+ # The final step is to display this newly created widget.
+ self.button.show()
+
+ print "AT END OF THE CLASS"
diff --git a/examples/HelloWorld.activity/MANIFEST b/examples/HelloWorld.activity/MANIFEST
new file mode 100644
index 0000000..5ce3fa1
--- /dev/null
+++ b/examples/HelloWorld.activity/MANIFEST
@@ -0,0 +1,4 @@
+setup.py
+HelloWorldActivity.py
+activity/activity.info
+activity/activity-helloworld.svg
diff --git a/examples/HelloWorld.activity/activity/activity-helloworld.svg b/examples/HelloWorld.activity/activity/activity-helloworld.svg
new file mode 100644
index 0000000..b9278b0
--- /dev/null
+++ b/examples/HelloWorld.activity/activity/activity-helloworld.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY fill_color "#FFFFFF">
+ <!ENTITY stroke_color "#000000">
+]>
+<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
+<rect x="1" y="1" width="48" height="48" style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:2"/>
+</svg>
diff --git a/examples/HelloWorld.activity/activity/activity.info b/examples/HelloWorld.activity/activity/activity.info
new file mode 100644
index 0000000..d44edf5
--- /dev/null
+++ b/examples/HelloWorld.activity/activity/activity.info
@@ -0,0 +1,7 @@
+[Activity]
+name = HelloWorld
+service_name = com.ywwg.HelloWorldActivity
+class = HelloWorldActivity.HelloWorldActivity
+icon = activity-helloworld
+activity_version = 1
+show_launcher = yes
diff --git a/examples/HelloWorld.activity/setup.py b/examples/HelloWorld.activity/setup.py
new file mode 100755
index 0000000..6ea61a6
--- /dev/null
+++ b/examples/HelloWorld.activity/setup.py
@@ -0,0 +1,3 @@
+#!/usr/bin/python
+from sugar.activity import bundlebuilder
+bundlebuilder.start()
diff --git a/examples/bundle-2.xo b/examples/bundle-2.xo
new file mode 100644
index 0000000..c715ac1
--- /dev/null
+++ b/examples/bundle-2.xo
Binary files differ