import Musicpainter

from sugar.activity import activity

class MusicpainterActivity(activity.Activity):
    def __init__(self, handle):
        activity.Activity.__init__(self, handle)
        self.connect('destroy', self._cleanup_cb)
        
        self.gamename = 'Musicpainter'
        self.set_title("Music Painter")
        
        # connect to the in/out events 
        self.connect('focus_in_event', self._focus_in)
        self.connect('focus_out_event', self._focus_out)

	musicpainter = Musicpainter.Musicpainter()
	musicpainter.init(self)

#	self.set_canvas(musicpainter.drawing_area)

    def _cleanup_cb(self, data=None):
        return

    def _focus_in(self, event, data=None):
        return

    def _focus_out(self, event, data=None):
        return
