-
Notifications
You must be signed in to change notification settings - Fork 0
/
metris-activity.py
40 lines (32 loc) · 1.25 KB
/
metris-activity.py
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
import gi
import sugargame
import sugargame.canvas
import pygame
from sugar3.activity import activity
from sugar3.graphics.toolbarbox import ToolbarBox
from sugar3.activity.widgets import ActivityToolbarButton
from sugar3.graphics.toolbutton import ToolButton
from sugar3.activity.widgets import StopButton
from gettext import gettext as _
from Metris import *
class MetrisActivity(activity.Activity):
def __init__(self, handle):
activity.Activity.__init__(self, handle)
self.game = Metris() # call menu instead
self.game.runNewGame()
# self.game.buildMain()
# self.game.main()
toolbarbox = ToolbarBox()
activity_button = ActivityToolbarButton(self)
toolbarbox.toolbar.insert(activity_button, 0)
self.set_toolbar_box(toolbarbox)
#activity_button.show()
#toolbar_box.show()
stop_button = StopButton(self)
toolbarbox.toolbar.insert(stop_button, -1)
# save_bundle_button = ToolButton('save-as-bundle')
# save_bundle_button.set_tooltip(_('Create bundle (.xo file)'))
# activity_button.get_page().insert(save_bundle_btn, -1)
# save_bundle_button.connect('clicked', self.save_bundle)
# save_bundle_button.show()
self.show_all()