Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/olpcgames/activity.py
diff options
context:
space:
mode:
Diffstat (limited to 'olpcgames/activity.py')
-rw-r--r--olpcgames/activity.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/olpcgames/activity.py b/olpcgames/activity.py
index 0f3ecd7..570f49a 100644
--- a/olpcgames/activity.py
+++ b/olpcgames/activity.py
@@ -27,16 +27,15 @@ logging.root.setLevel( logging.WARN )
log = logging.getLogger( 'olpcgames.activity' )
##log.setLevel( logging.DEBUG )
-import pygtk
-pygtk.require('2.0')
-import gtk
-import gtk.gdk
+from gi.repository import Gtk
+from gi.repository import Gdk
import os
from sugar3.activity import activity
from sugar3.graphics import style
from olpcgames.canvas import PygameCanvas
-from olpcgames import mesh, util
+from olpcgames import mesh
+from olpcgames import util
__all__ = ['PygameActivity']
@@ -98,7 +97,8 @@ class PygameActivity(activity.Activity):
super(PygameActivity, self).__init__(handle)
self.make_global()
if self.game_size is None:
- width,height = gtk.gdk.screen_width(), gtk.gdk.screen_height()
+ screen = self.get_screen()
+ width,height = (screen.get_width(), screen.get_height())
log.info( 'Total screen size: %s %s', width,height)
# for now just fudge the toolbar size...
self.game_size = width, height - (1*style.GRID_CELL_SIZE)
@@ -140,7 +140,6 @@ class PygameActivity(activity.Activity):
log.info( 'asserting focus' )
assert self._pgc.is_focus(), """Did not successfully set pygame canvas focus"""
log.info( 'callback finished' )
-
def joined_cb(*args, **kwargs):
log.info( 'joined: %s, %s', args, kwargs )
mesh.activity_joined(self)
@@ -169,7 +168,7 @@ class PygameActivity(activity.Activity):
self._pgc.connect_game(self.game_handler or self.game_name)
# XXX Bad coder, do not hide in a widely subclassed operation
# map signal does not appear to show up on socket instances
- gtk.gdk.threads_init()
+ Gdk.threads_init()
return self._pgc
else:
# FIXME Es necesario quitar hippo de aquĆ­
@@ -239,8 +238,8 @@ class PygameActivity(activity.Activity):
raise NotImplementedError( """Pygame Activity code did not produce a file for %s"""%( file_path, ))
else:
log.info( '''Stored file in %r''', file_path )
-
+
import olpcgames
olpcgames.PyGameActivity = PygameActivity
-PyGameActivity = PygameActivity
+PyGameActivity = PygameActivity \ No newline at end of file