Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/activity.py b/activity.py
new file mode 100644
index 0000000..8ffdf03
--- /dev/null
+++ b/activity.py
@@ -0,0 +1,43 @@
+import gtk
+from graph import Graph
+from sugar.activity import activity
+from sugar import profile
+
+class GraphActivity( activity.Activity ):
+ def __init__(self,handle):
+ activity.Activity.__init__(self,handle)
+ self._name = handle
+ self.set_title( 'graph' )
+
+ # Attach sugar toolbox
+ toolbox = activity.ActivityToolbox( self )
+ self.set_toolbox( toolbox )
+ toolbox.show()
+
+ # Create the main container
+ self._main_view = gtk.VBox()
+
+ # Read the user's profile
+ prof = profile.get_profile()
+
+ # Import our class and load it
+ self.graph = Graph()
+
+ # Setup the color scheme
+ c1 = profile.get_color().get_fill_color()
+ c2 = profile.get_color().get_stroke_color()
+ #self.graph.set_colors( c1, c2 )
+
+ # Remove the widget's parent
+ if self.graph.widget.parent:
+ self.graph.widget.parent.remove( self.graph.widget )
+
+ # Attach the widget to our window
+ self._main_view.pack_start( self.graph.widget )
+
+ # Display everything
+ self.graph.widget.show()
+ self._main_view.show()
+ self.set_canvas( self._main_view )
+ self.show_all()
+