comparison gamelib/gamegui.py @ 53:655a6912e0ae

Split gui stuff out of main.py
author Neil Muller <drnlmuller@gmail.com>
date Mon, 07 May 2012 22:10:26 +0200
parents
children 78dfd429b9a6
comparison
equal deleted inserted replaced
52:1d3d20bdc8b9 53:655a6912e0ae
1 # -*- coding: utf-8 -*-
2 # vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4
3
4 """Gui for the actual game"""
5
6 from gamelib.gui_base import Window
7 from gamelib.gui import BigButton
8 from gamelib.engine import PopWindow
9 from gamelib.constants import WIDTH
10
11
12 class ExitGameButton(BigButton):
13
14 def __init__(self):
15 super(ExitGameButton, self).__init__(((WIDTH - 128), 10), 'Exit')
16
17 def on_click(self):
18 PopWindow.post()
19
20
21 class GameWindow(Window):
22 """Main window for the game"""
23
24 def __init__(self, screen):
25 super(GameWindow, self).__init__(screen)
26 exit = ExitGameButton()
27 self.add_child(exit)