comparison gamelib/toolbar.py @ 568:e813365af567

Add quit button to toolbar
author Neil Muller <drnlmuller@gmail.com>
date Sat, 28 Nov 2009 19:37:08 +0000
parents a8dde729000a
children 3ec614e6fd4a
comparison
equal deleted inserted replaced
567:37f7454518d5 568:e813365af567
203 203
204 def load_game(self): 204 def load_game(self):
205 """Load game 'dialog'.""" 205 """Load game 'dialog'."""
206 savegame.RestoreDialog(self.gameboard.restore_game).open() 206 savegame.RestoreDialog(self.gameboard.restore_game).open()
207 207
208 def quit_game(self):
209 self.gameboard._do_quit()
210
208 update_cash_counter = mkcountupdate('cash_counter') 211 update_cash_counter = mkcountupdate('cash_counter')
209 update_wood_counter = mkcountupdate('wood_counter') 212 update_wood_counter = mkcountupdate('wood_counter')
210 update_fox_counter = mkcountupdate('killed_foxes') 213 update_fox_counter = mkcountupdate('killed_foxes')
211 update_chicken_counter = mkcountupdate('chicken_counter') 214 update_chicken_counter = mkcountupdate('chicken_counter')
212 update_egg_counter = mkcountupdate('egg_counter') 215 update_egg_counter = mkcountupdate('egg_counter')
300 303
301 self.add_spacer(5) 304 self.add_spacer(5)
302 self.add_heading("Game") 305 self.add_heading("Game")
303 self.add_tool("Save Game", self.save_game) 306 self.add_tool("Save Game", self.save_game)
304 self.add_tool("Load Game", self.load_game) 307 self.add_tool("Load Game", self.load_game)
308 self.add_tool("Quit", self.quit_game)
305 309
306 self.add_heading(" ") 310 self.add_heading(" ")
307 ## Dear pgu, is there a better way to get the current height? 311 ## Dear pgu, is there a better way to get the current height?
308 #_cur_width, cur_height = self.resize() 312 #_cur_width, cur_height = self.resize()
309 #self.add_spacer(570-cur_height) 313 #self.add_spacer(570-cur_height)