1 """<title>Custom Widgets</title>
2 Same functionality as gui3, however gui.Button is subclassed. The
3 subclassed version is a fully featured Quit button.
6 from pygame.locals import *
8 # the following line is not needed if pgu is installed
9 import sys; sys.path.insert(0, "..")
14 app.connect(gui.QUIT,app.quit,None)
16 c = gui.Table(width=200,height=120)
19 class Quit(gui.Button):
20 def __init__(self,**params):
21 params['value'] = 'Quit'
22 gui.Button.__init__(self,**params)
23 self.connect(gui.CLICK,app.quit,None)
26 ##Adding the button to the container. By using the td method to add it, the button
27 ##is placed in a sub-container, and it will not have to fill the whole cell.