ARGH
[matches/honours.git] / research / transmission_spectroscopy / simulator / pgu-0.18 / examples / gui3.py
1 """<title>Containers and more Connections</title>
2 A container is added, and centered a button within that
3 container.
4 """
5 import pygame
6 from pygame.locals import *
7
8 # the following line is not needed if pgu is installed
9 import sys; sys.path.insert(0, "..")
10
11 from pgu import gui
12
13 ##Using Desktop instead of App provides the GUI with a background.
14 ##::
15 app = gui.Desktop()
16 app.connect(gui.QUIT,app.quit,None)
17 ##
18
19 ##The container is a table
20 ##::
21 c = gui.Table(width=200,height=120)
22 ##
23
24 ##The button CLICK event is connected to the app.close method.  The button will fill the whole table cell.
25 ##::
26 e = gui.Button("Quit")
27 e.connect(gui.CLICK,app.quit,None)
28 c.add(e,0,0)
29 ##
30
31 app.run(c)

UCC git Repository :: git.ucc.asn.au