diff options
Diffstat (limited to 'tutorius/overlayer.py')
-rw-r--r-- | tutorius/overlayer.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tutorius/overlayer.py b/tutorius/overlayer.py index 931949d..b967739 100644 --- a/tutorius/overlayer.py +++ b/tutorius/overlayer.py @@ -58,13 +58,13 @@ class Overlayer(gtk.Layout): @param overlayed widget to be overlayed. Will be resized to full size. """ def __init__(self, overlayed=None): - gtk.Layout.__init__(self) + super(Overlayer, self).__init__() self._overlayed = overlayed if overlayed: self.put(overlayed, 0, 0) - self.__realizer = self.connect("expose-event", self.__init_realized) + self.__realizer = self.connect_after("realize", self.__init_realized) self.connect("size-allocate", self.__size_allocate) self.show() @@ -83,13 +83,13 @@ class Overlayer(gtk.Layout): if hasattr(child, "draw_with_context"): # if the widget has the CanvasDrawable protocol, use it. child.no_expose = True - gtk.Layout.put(self, child, x, y) + super(Overlayer, self).put(child, x, y) # be sure to redraw or the overlay may not show self.queue_draw() - def __init_realized(self, widget, event): + def __init_realized(self, widget): """ Initializer to set once widget is realized. Since an expose event is signaled only to realized widgets, we set this @@ -157,7 +157,7 @@ class TextBubble(gtk.Widget): A CanvasDrawableWidget drawing a round textbox and a tail pointing to a specified widget. """ - def __init__(self, text, speaker=None, tailpos=[0,0]): + def __init__(self, text, speaker=None, tailpos=(0,0)): """ Creates a new cairo rendered text bubble. @@ -199,7 +199,7 @@ class TextBubble(gtk.Widget): # TODO fetch speaker coordinates # draw bubble tail if present - if self.tailpos != [0,0]: + if self.tailpos != (0,0): context.move_to(xradius-width/4, yradius) context.line_to(self.tailpos[0], self.tailpos[1]) context.line_to(xradius+width/4, yradius) @@ -228,7 +228,7 @@ class TextBubble(gtk.Widget): context.fill() # bubble painting. Redrawing the inside after the tail will combine - if self.tailpos != [0,0]: + if self.tailpos != (0,0): context.move_to(xradius-width/4, yradius) context.line_to(self.tailpos[0], self.tailpos[1]) context.line_to(xradius+width/4, yradius) |