blob: 8ffdf034733100e135557a56cceaf9ff42b83c9c (
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
|
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()
|