Mercurial > rinkhals
comparison gamelib/gameboard.py @ 148:225be1220053
Reduce gui glitch effect
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 20:00:10 +0000 |
parents | a9b800b4175e |
children | 082868bea873 |
comparison
equal
deleted
inserted
replaced
147:1cb47e6b8f61 | 148:225be1220053 |
---|---|
26 def mklabel(text=" ", color=constants.FG_COLOR): | 26 def mklabel(text=" ", color=constants.FG_COLOR): |
27 return OpaqueLabel(text, color=color) | 27 return OpaqueLabel(text, color=color) |
28 | 28 |
29 def mkcountupdate(counter): | 29 def mkcountupdate(counter): |
30 def update_counter(self, value): | 30 def update_counter(self, value): |
31 getattr(self, counter).update_value("%s" % value) | 31 getattr(self, counter).update_value("%5s" % value) |
32 self.repaint() | 32 self.repaint() |
33 return update_counter | 33 return update_counter |
34 | 34 |
35 class ToolBar(gui.Table): | 35 class ToolBar(gui.Table): |
36 def __init__(self, gameboard, **params): | 36 def __init__(self, gameboard, **params): |
81 | 81 |
82 def add_button(self, text, func): | 82 def add_button(self, text, func): |
83 button = gui.Button(text) | 83 button = gui.Button(text) |
84 button.connect(gui.CLICK, func) | 84 button.connect(gui.CLICK, func) |
85 self.tr() | 85 self.tr() |
86 self.add(button) | 86 self.add(button, colspan=2) |
87 | 87 |
88 def add_counter(self, icon, label): | 88 def add_counter(self, icon, label): |
89 self.tr() | 89 self.tr() |
90 if icon: | 90 if icon: |
91 self.td(icon, align=-1) | 91 self.td(icon, align=-1, width=self.rect.w/2) |
92 self.add(label) | 92 self.add(label) |
93 | 93 |
94 class VidWidget(gui.Widget): | 94 class VidWidget(gui.Widget): |
95 def __init__(self, gameboard, vid, **params): | 95 def __init__(self, gameboard, vid, **params): |
96 gui.Widget.__init__(self, **params) | 96 gui.Widget.__init__(self, **params) |