Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/olpcgames/canvas.py
diff options
context:
space:
mode:
Diffstat (limited to 'olpcgames/canvas.py')
-rw-r--r--olpcgames/canvas.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/olpcgames/canvas.py b/olpcgames/canvas.py
index 9dadeaa..4f0096e 100644
--- a/olpcgames/canvas.py
+++ b/olpcgames/canvas.py
@@ -7,17 +7,15 @@ log = logging.getLogger( 'olpcgames.canvas' )
import threading
from pprint import pprint
-import pygtk
-pygtk.require('2.0')
-import gtk
-import gobject
+from gi.repository import Gtk
+from gi.repository import GObject
import pygame
from olpcgames import gtkEvent, util
__all__ = ['PygameCanvas']
-class PygameCanvas(gtk.Layout):
+class PygameCanvas(Gtk.Layout):
"""Canvas providing bridge methods to run Pygame in GTK
The PygameCanvas creates a secondary thread in which the Pygame instance will
@@ -40,12 +38,13 @@ class PygameCanvas(gtk.Layout):
# Build the main widget
log.info( 'Creating the pygame canvas' )
super(PygameCanvas,self).__init__()
- self.set_flags(gtk.CAN_FOCUS)
+ #self.set_flags(Gtk.CAN_FOCUS)
# Build the sub-widgets
- self._align = gtk.Alignment(0.5, 0.5)
- self._inner_evb = gtk.EventBox()
- self._socket = gtk.Socket()
+ #self._align = Gtk.Alignment(0.5, 0.5)
+ self._align = Gtk.Alignment()
+ self._inner_evb = Gtk.EventBox()
+ self._socket = Gtk.Socket()
# Add internal widgets
@@ -134,7 +133,7 @@ class PygameCanvas(gtk.Layout):
eventwrap.clear()
finally:
log.info( 'Main function finished, calling main_quit' )
- gtk.main_quit()
+ Gtk.main_quit()
source_object_id = None
def view_source(self):