1 """<title>Dialogs and Documents</title>
4 from pygame.locals import *
6 # the following line is not needed if pgu is installed
7 import sys; sys.path.insert(0, "..")
11 ##Documents layout widgets like words and images in a HTML document. This
12 ##example also demonstrates the ScrollBox container widget.
14 class AboutDialog(gui.Dialog):
15 def __init__(self,**params):
16 title = gui.Label("About Cuzco's Paint")
20 doc = gui.Document(width=width)
22 space = title.style.font.size(" ")
25 for word in """Cuzco's Paint v1.0 by Phil Hassey""".split(" "):
26 doc.add(gui.Label(word))
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))
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))
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))
49 gui.Dialog.__init__(self,title,gui.ScrollArea(doc,width,height))
53 if __name__ in '__main__':
55 app.connect(gui.QUIT,app.quit,None)
57 c = gui.Table(width=640,height=480)
59 ##The button CLICK event is connected to the dialog.open method.
61 dialog = AboutDialog()
63 e = gui.Button("About")
64 e.connect(gui.CLICK,dialog.open,None)