From 2e1d8e889749e278b2372a5b4651d941b6f733a1 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 20 Apr 2008 22:55:05 +0200 Subject: [PATCH] Use new style properties. --- sugar/graphics/window.py | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/sugar/graphics/window.py b/sugar/graphics/window.py index 60aa8fd5..ced55958 100644 --- a/sugar/graphics/window.py +++ b/sugar/graphics/window.py @@ -70,12 +70,6 @@ class UnfullscreenButton(gtk.Window): self._reposition() class Window(gtk.Window): - - __gproperties__ = { - 'enable-fullscreen-mode': (bool, None, None, True, - gobject.PARAM_READWRITE), - } - def __init__(self, **args): self._enable_fullscreen_mode = True @@ -108,18 +102,6 @@ class Window(gtk.Window): self._unfullscreen_button.connect_button_press( self.__unfullscreen_button_pressed) - def do_get_property(self, prop): - if prop.name == 'enable-fullscreen-mode': - return self._enable_fullscreen_mode - else: - return gtk.Window.do_get_property(self, prop) - - def do_set_property(self, prop, val): - if prop.name == 'enable-fullscreen-mode': - self._enable_fullscreen_mode = val - else: - gtk.Window.do_set_property(self, prop, val) - def set_canvas(self, canvas): if self.canvas: self._event_box.remove(self.canvas) @@ -217,3 +199,14 @@ class Window(gtk.Window): def __unfullscreen_button_pressed(self, widget, event): self.unfullscreen() + + def set_enable_fullscreen_mode(self, enable_fullscreen_mode): + self._enable_fullscreen_mode = enable_fullscreen_mode + + def get_enable_fullscreen_mode(self): + return self._enable_fullscreen_mode + + enable_fullscreen_mode = gobject.property(type=object, + setter=set_enable_fullscreen_mode, + getter=get_enable_fullscreen_mode) +