diff options
Diffstat (limited to 'sugargame/canvas.py')
-rw-r--r-- | sugargame/canvas.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sugargame/canvas.py b/sugargame/canvas.py index 9cbef63..1ce0250 100644 --- a/sugargame/canvas.py +++ b/sugargame/canvas.py @@ -1,18 +1,18 @@ import os -import gtk -import gobject +from gi.repository import Gtk +from gi.repository import GObject import pygame import event CANVAS = None -class PygameCanvas(gtk.EventBox): +class PygameCanvas(Gtk.EventBox): """ mainwindow is the activity intself. """ def __init__(self, mainwindow, pointer_hint = True): - gtk.EventBox.__init__(self) + GObject.GObject.__init__(self) global CANVAS assert CANVAS == None, "Only one PygameCanvas can be created, ever." @@ -23,9 +23,9 @@ class PygameCanvas(gtk.EventBox): self._mainwindow = mainwindow - self.set_flags(gtk.CAN_FOCUS) + self.set_can_focus(True) - self._socket = gtk.Socket() + self._socket = Gtk.Socket() self.add(self._socket) self.show_all() @@ -34,7 +34,7 @@ class PygameCanvas(gtk.EventBox): # Sugar activity is not properly created until after its constructor returns. # If the Pygame main loop is called from the activity constructor, the # constructor never returns and the activity freezes. - gobject.idle_add(self._run_pygame_cb, main_fn) + GObject.idle_add(self._run_pygame_cb, main_fn) def _run_pygame_cb(self, main_fn): assert pygame.display.get_surface() is None, "PygameCanvas.run_pygame can only be called once." @@ -45,7 +45,7 @@ class PygameCanvas(gtk.EventBox): pygame.init() # Restore the default cursor. - #self._socket.window.set_cursor(None) = no "phantom" cursor + self._socket.props.window.set_cursor(None) # Initialize the Pygame window. r = self.get_allocation() |