diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-27 12:41:51 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-27 12:41:51 (GMT) |
commit | b04c19efb41f39f578e558031fa89f81559d89e2 (patch) | |
tree | 458238f3c48f1eeef0a56ebb4b41c1a04e9f2114 /shell | |
parent | abf84970b513a5e00eb6524244e19e398414f372 (diff) |
Add a window class to graphics, it contains a canvas.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/view/frame/PanelWindow.py | 17 | ||||
-rw-r--r-- | shell/view/frame/clipboardpanelwindow.py | 5 |
2 files changed, 9 insertions, 13 deletions
diff --git a/shell/view/frame/PanelWindow.py b/shell/view/frame/PanelWindow.py index 6edd4bd..cf3fc41 100644 --- a/shell/view/frame/PanelWindow.py +++ b/shell/view/frame/PanelWindow.py @@ -18,34 +18,27 @@ import gtk import hippo from sugar.graphics import units +from sugar.graphics.window import Window -class PanelWindow(gtk.Window): +class PanelWindow(Window): def __init__(self, orientation): - gtk.Window.__init__(self) + Window.__init__(self) self._orientation = orientation self.set_decorated(False) self.connect('realize', self._realize_cb) - self._canvas = hippo.Canvas() - self._bg = hippo.CanvasBox(background_color=0x414141ff, orientation=self._orientation) + self.set_root(self._bg) self._update_size() - self._canvas.set_root(self._bg) - - self.add(self._canvas) - self._canvas.show() - + screen = gtk.gdk.screen_get_default() screen.connect('size-changed', self._size_changed_cb) def get_root(self): return self._bg - - def get_canvas(self): - return self._canvas def _update_size(self): padding = units.grid_to_pixels(1) diff --git a/shell/view/frame/clipboardpanelwindow.py b/shell/view/frame/clipboardpanelwindow.py index 30b9cb2..cfdb4d5 100644 --- a/shell/view/frame/clipboardpanelwindow.py +++ b/shell/view/frame/clipboardpanelwindow.py @@ -33,7 +33,10 @@ class ClipboardPanelWindow(PanelWindow): self.add_events(gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.POINTER_MOTION_HINT_MASK) self.connect("motion_notify_event", box.motion_notify_event_cb) - self.get_canvas().connect("button_press_event", box.button_press_event_cb) + + # FIXME I'm not sure we should expose the canvas in the Window API + self._canvas.connect("button_press_event", box.button_press_event_cb) + self.connect("drag_end", box.drag_end_cb) self.connect("drag_data_get", box.drag_data_get_cb) |