Mercurial > boomslang
comparison gamelib/gamescreen.py @ 210:eb101b6fb3dd
Transparent message dialogs.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Thu, 26 Aug 2010 16:29:54 +0200 |
parents | 407d23635343 |
children | 146cec58ddd8 |
comparison
equal
deleted
inserted
replaced
209:aeb96ca5f76c | 210:eb101b6fb3dd |
---|---|
89 self._mouse_move(event.pos) | 89 self._mouse_move(event.pos) |
90 | 90 |
91 def _mouse_move(self, pos): | 91 def _mouse_move(self, pos): |
92 self.state.mouse_move(pos, self.screen) | 92 self.state.mouse_move(pos, self.screen) |
93 | 93 |
94 def show_message(self, message): | 94 def show_message(self, message, style=None): |
95 self.parent.cursor_highlight(False) | 95 self.parent.cursor_highlight(False) |
96 # Display the message as a modal dialog | 96 # Display the message as a modal dialog |
97 MessageDialog(self.screen, message, 60).present() | 97 MessageDialog(self.screen, message, 60, style=style).present() |
98 # queue a redraw to show updated state | 98 # queue a redraw to show updated state |
99 self.invalidate() | 99 self.invalidate() |
100 # The cursor could have gone anywhere | 100 # The cursor could have gone anywhere |
101 if self.subwidgets: | 101 if self.subwidgets: |
102 self.subwidgets[0]._mouse_move(mouse.get_pos()) | 102 self.subwidgets[0]._mouse_move(mouse.get_pos()) |
151 self._mouse_move(event.pos) | 151 self._mouse_move(event.pos) |
152 | 152 |
153 def _mouse_move(self, pos): | 153 def _mouse_move(self, pos): |
154 self.state.mouse_move_detail(self.global_to_local(pos), self.screen) | 154 self.state.mouse_move_detail(self.global_to_local(pos), self.screen) |
155 | 155 |
156 def show_message(self, message): | 156 def show_message(self, message, style=None): |
157 self.parent.show_message(message) | 157 self.parent.show_message(message, style) |
158 self.invalidate() | 158 self.invalidate() |
159 | 159 |
160 | 160 |
161 class ToolBar(Row): | 161 class ToolBar(Row): |
162 def __init__(self, items): | 162 def __init__(self, items): |