diff options
Diffstat (limited to 'physics.py')
-rw-r--r-- | physics.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -2,6 +2,7 @@ """ Physics, a 2D Physics Playground for Kids Copyright (C) 2008 Alex Levenson and Brian Jordan + Copyright (C) 2013 Ignacio Rodriguez This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +29,6 @@ Code: git://git.sugarlabs.org/physics/mainline.git import os import sys import math -import gtk import logging import pygame @@ -36,6 +36,9 @@ from pygame.locals import * from pygame.color import * import sugargame +from gi.repository import Gtk +from gi.repository import Gdk + sys.path.append("lib/") import pkg_resources # If your architecture is different, comment these lines and install @@ -105,8 +108,8 @@ class PhysicsGame: self.switch_on_fake_pygame_cursor_cb) self.canvas.connect("leave_notify_event", self.switch_off_fake_pygame_cursor_cb) - self.canvas.add_events(gtk.gdk.ENTER_NOTIFY_MASK - | gtk.gdk.LEAVE_NOTIFY_MASK) + self.canvas.add_events(Gdk.EventMask.ENTER_NOTIFY_MASK + | Gdk.EventMask.LEAVE_NOTIFY_MASK) self.world = elements.Elements(self.screen.get_size()) self.world.renderer.set_surface(self.screen) @@ -118,8 +121,8 @@ class PhysicsGame: self.world.json_load(path) while self.loop: - while gtk.events_pending(): - gtk.main_iteration() + while Gtk.events_pending(): + Gtk.main_iteration() if not self.loop: pygame.quit() |