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()