Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/overlayer.py
diff options
context:
space:
mode:
authorCharlie <charlie@tutorius-dev.(none)>2009-10-25 01:18:10 (GMT)
committer Charlie <charlie@tutorius-dev.(none)>2009-10-25 01:18:10 (GMT)
commit48ba2db44bb2054222cad3aca3e027e24c51c090 (patch)
tree13a25552db428a3a97e22e09f7936c4a988f11cf /tutorius/overlayer.py
parent2b4eaea8f46e846799595b3c7015f77c6156532b (diff)
parentaa4868af13437f4718e8ce7972b79b496d296068 (diff)
Merge branch 'demo' into activity
Diffstat (limited to 'tutorius/overlayer.py')
-rw-r--r--tutorius/overlayer.py14
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)