Mercurial > boomslang
changeset 97:60770ca02c1a
Fix message dialog mouse cursor freezing.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 07:51:42 +0200 |
parents | 397c5ff1528f |
children | e97244b1be30 |
files | gamelib/gamescreen.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gamescreen.py Tue Aug 24 01:02:57 2010 +0200 +++ b/gamelib/gamescreen.py Tue Aug 24 07:51:42 2010 +0200 @@ -48,9 +48,10 @@ self.state.set_tool(None) -class MessageDialog(BoomLabel): +class MessageDialog(BoomLabel, CursorWidget): def __init__(self, text, wrap_width, **kwds): + CursorWidget.__init__(self) paras = text.split("\n\n") text = "\n".join([textwrap.fill(para, wrap_width) for para in paras]) Label.__init__(self, text, **kwds) @@ -60,6 +61,10 @@ self.bg_color = (127, 127, 127) self.fg_color = (0, 0, 0) + def draw(self, surface): + BoomLabel.draw(self, surface) + CursorWidget.draw(self, surface) + def mouse_down(self, event): self.dismiss()