comparison gamelib/gameboard.py @ 152:702bc0eb2ac3

Fix Toolbar width to TOOLBAR_WIDTH by not allowing it to resize.
author Simon Cross <hodgestar@gmail.com>
date Thu, 03 Sep 2009 20:55:12 +0000
parents 082868bea873
children 065f43e19e09
comparison
equal deleted inserted replaced
151:082868bea873 152:702bc0eb2ac3
90 def add_counter(self, icon, label): 90 def add_counter(self, icon, label):
91 self.tr() 91 self.tr()
92 self.td(icon, align=-1, width=self.rect.w/2) 92 self.td(icon, align=-1, width=self.rect.w/2)
93 self.td(label, align=-1, width=self.rect.w/2) 93 self.td(label, align=-1, width=self.rect.w/2)
94 94
95 def resize(self, width=None, height=None):
96 width, height = gui.Table.resize(self, width, height)
97 width = GameBoard.TOOLBAR_WIDTH
98 return width, height
99
100
95 class VidWidget(gui.Widget): 101 class VidWidget(gui.Widget):
96 def __init__(self, gameboard, vid, **params): 102 def __init__(self, gameboard, vid, **params):
97 gui.Widget.__init__(self, **params) 103 gui.Widget.__init__(self, **params)
98 self.gameboard = gameboard 104 self.gameboard = gameboard
99 self.vid = vid 105 self.vid = vid
152 width, height = self.disp.rect.w, self.disp.rect.h 158 width, height = self.disp.rect.w, self.disp.rect.h
153 tbl = gui.Table() 159 tbl = gui.Table()
154 tbl.tr() 160 tbl.tr()
155 self.toolbar = ToolBar(self, width=self.TOOLBAR_WIDTH) 161 self.toolbar = ToolBar(self, width=self.TOOLBAR_WIDTH)
156 tbl.td(self.toolbar, valign=-1) 162 tbl.td(self.toolbar, valign=-1)
157 self.tvw = VidWidget(self, self.tv, width=width-self.TOOLBAR_WIDTH-19, height=height) 163 self.tvw = VidWidget(self, self.tv, width=width-self.TOOLBAR_WIDTH, height=height)
158 tbl.td(self.tvw) 164 tbl.td(self.tvw)
159 self.top_widget = tbl 165 self.top_widget = tbl
160 166
161 def update(self): 167 def update(self):
162 self.tvw.reupdate() 168 self.tvw.reupdate()