def __init__(self, doc, tdw, x, y): """Initialize, attaching to the brush and to the tdw. Observer callbacks and canvas overlays are registered by this constructor, so cleanup() must be called when the owning mode leave()s. """ Overlay.__init__(self) self._doc = doc self._tdw = tdw self._x = int(x)+0.5 self._y = int(y)+0.5 alloc = tdw.get_allocation() self._tdw_w = alloc.width self._tdw_h = alloc.height self._color = self._get_app_brush_color() app = doc.app app.brush.observers.append(self._brush_color_changed_cb) tdw.display_overlays.append(self) self._previous_area = None self._queue_tdw_redraw()
def __init__(self, doc, tdw, x, y): """Initialize, attaching to the brush and to the tdw. Observer callbacks and canvas overlays are registered by this constructor, so cleanup() must be called when the owning mode leave()s. """ Overlay.__init__(self) self._doc = doc self._tdw = tdw self._x = int(x) + 0.5 self._y = int(y) + 0.5 alloc = tdw.get_allocation() self._tdw_w = alloc.width self._tdw_h = alloc.height self._color = self._get_app_brush_color() app = doc.app app.brush.observers.append(self._brush_color_changed_cb) tdw.display_overlays.append(self) self._previous_area = None self._queue_tdw_redraw()
def __init__(self, doc): """Initialize overlay""" Overlay.__init__(self) self.doc = doc self.app = doc.app
def __init__(self, doc): """Initialize overlay""" Overlay.__init__(self) self.doc = doc self.app = doc.app self._trash_icon_pixbuf = None