Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/addons/bubblemessagewimg.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/bubblemessagewimg.py')
-rw-r--r--addons/bubblemessagewimg.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/addons/bubblemessagewimg.py b/addons/bubblemessagewimg.py
index eb0f750..b214460 100644
--- a/addons/bubblemessagewimg.py
+++ b/addons/bubblemessagewimg.py
@@ -24,8 +24,9 @@ class BubbleMessageWImg(Action):
position = TArrayProperty((0,0), 2, 2)
# Do the same for the tail position
tail_pos = TArrayProperty((0,0), 2, 2)
-
- def __init__(self, message=None, position=None, speaker=None, tail_pos=None):
+ imgpath = TStringProperty("")
+
+ def __init__(self, message=None, position=None, speaker=None, tail_pos=None, imgpath=None):
"""
Shows a dialog with a given text, at the given position on the screen.
@@ -43,6 +44,11 @@ class BubbleMessageWImg(Action):
self.tail_pos = tail_pos
if message:
self.message = message
+ if imgpath:
+ self.imgpath = imgpath
+
+ # temporary image file path
+ self.imgpath = "/home/dave/Pictures/Favicon_01.png"
self.overlay = None
self._bubble = None
@@ -66,7 +72,7 @@ class BubbleMessageWImg(Action):
# TODO: tails are relative to tailpos. They should be relative to
# the speaking widget. Same of the bubble position.
self._bubble = overlayer.TextBubbleWImg(text=self.message,
- tailpos=self.tail_pos)
+ tailpos=self.tail_pos,imagepath=self.imgpath)
self._bubble.show()
self.overlay.put(self._bubble, x, y)
self.overlay.queue_draw()
@@ -89,7 +95,7 @@ class BubbleMessageWImg(Action):
assert not self._drag, "bubble action set to editmode twice"
x, y = self.position
self._bubble = overlayer.TextBubbleWImg(text=self.message,
- tailpos=self.tail_pos)
+ tailpos=self.tail_pos,imagepath=self.imgpath)
self.overlay.put(self._bubble, x, y)
self._bubble.show()
@@ -111,6 +117,6 @@ __action__ = {
"display_name" : "Message Bubble with image",
"icon" : "message-bubble",
"class" : BubbleMessageWImg,
- "mandatory_props" : ["message"]
+ "mandatory_props" : ["message",'imgpath']
}