ARGH
[matches/honours.git] / research / transmission_spectroscopy / simulator / pgu-0.18 / examples / gui6.py
1 """<title>Dialogs and Documents</title>
2 """
3 import pygame
4 from pygame.locals import *
5
6 # the following line is not needed if pgu is installed
7 import sys; sys.path.insert(0, "..")
8
9 from pgu import gui
10
11 ##Documents layout widgets like words and images in a HTML document.  This
12 ##example also demonstrates the ScrollBox container widget.
13 ##::
14 class AboutDialog(gui.Dialog):
15     def __init__(self,**params):
16         title = gui.Label("About Cuzco's Paint")
17         
18         width = 400
19         height = 200
20         doc = gui.Document(width=width)
21         
22         space = title.style.font.size(" ")
23         
24         doc.block(align=0)
25         for word in """Cuzco's Paint v1.0 by Phil Hassey""".split(" "): 
26             doc.add(gui.Label(word))
27             doc.space(space)
28         doc.br(space[1])
29         
30         doc.block(align=-1)
31         doc.add(gui.Image("cuzco.png"),align=1)
32         for word in """Cuzco's Paint is a revolutionary new paint program it has all the awesome features that you need to paint really great pictures.""".split(" "): 
33             doc.add(gui.Label(word))
34             doc.space(space)
35         doc.br(space[1])
36         
37         doc.block(align=-1)
38         for word in """Cuzco's Paint will drive you wild!  Cuzco's Paint was made as a demo of Phil's Pygame Gui.  We hope you enjoy it!""".split(" "): 
39             doc.add(gui.Label(word))
40             doc.space(space)
41             
42         for i in range(0,10):
43             doc.block(align=-1)
44             for word in """This text has been added so we can show off our ScrollArea widget.  It is a very nice widget built by Gal Koren!""".split(" "):
45                 doc.add(gui.Label(word))
46                 doc.space(space)
47             doc.br(space[1])
48                 
49         gui.Dialog.__init__(self,title,gui.ScrollArea(doc,width,height))
50 ##
51         
52         
53 if __name__ in '__main__':
54     app = gui.Desktop()
55     app.connect(gui.QUIT,app.quit,None)
56     
57     c = gui.Table(width=640,height=480)
58     
59     ##The button CLICK event is connected to the dialog.open method.
60     ##::
61     dialog = AboutDialog()
62             
63     e = gui.Button("About")
64     e.connect(gui.CLICK,dialog.open,None)
65     ##
66     c.tr()
67     c.td(e)
68     
69     app.run(c)

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