Phil's pyGame Utilities Documentation

Overview

Scripts
tileedit | leveledit | tganew | levelfancy

Reference
algo | ani | engine | fonts | high | html | layout | text | timer | vid

Tutorials
1 | 2 | 3 | 4 | 5

GUI Ref.
theme | style | widget | surface | const

Containers
container | app | table | document | area

Forms
form | group

Widgets
basic | button | input | keysym | slider | select | misc

Other
menus | dialog

Tutorials
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

gui.button

sections
Button
Switch
Checkbox
Radio
Tool
Icon
Link

Button

A button, buttons can be clicked, they are usually used to set up callbacks.
Button(value=None)
value

either a widget or a string

Example
w = gui.Button("Click Me")
w.connect(gui.CLICK,fnc,value)

Switch

A switch can have two states, True or False.
Switch(value=False)
value

initial value, (True, False)

Example
w = gui.Switch(True)
w.connect(gui.CHANGE,fnc,value)

Checkbox

Within a Group of Checkbox widgets several may be selected at a time.
Checkbox(group,value=None)
group

a gui.Group for the Checkbox to belong to

value

the value

Example
g = gui.Group(name='colors',value=['r','b'])

t = gui.Table()
t.tr()
t.td(gui.Label('Red'))
t.td(gui.Checkbox(g,'r'))
t.tr()
t.td(gui.Label('Green'))
t.td(gui.Checkbox(g,'g'))
t.tr()
t.td(gui.Label('Blue'))
t.td(gui.Checkbox(g,'b'))

Radio

Within a Group of Radio widgets only one may be selected at a time.
Radio(group,value=None)
group

a gui.Group for the Radio to belong to

value

the value

Example
g = gui.Group(name='colors',value='g')

t = gui.Table()
t.tr()
t.td(gui.Label('Red'))
t.td(gui.Radio(g,'r'))
t.tr()
t.td(gui.Label('Green'))
t.td(gui.Radio(g,'g'))
t.tr()
t.td(gui.Label('Blue'))
t.td(gui.Radio(g,'b'))

Tool

Within a Group of Tool widgets only one may be selected at a time.
Tool(group,widget=None,value=None)
group

a gui.Group for the Tool to belong to

widget

a widget to appear on the Tool (similar to a Button)

value

the value

Example
g = gui.Group(name='colors',value='g')

t = gui.Table()
t.tr()
t.td(gui.Tool(g,'Red','r'))
t.tr()
t.td(gui.Tool(g,'Green','g'))
t.tr()
t.td(gui.Tool(g,'Blue','b'))

Icon

TODO - might be deprecated

Link

A link, links can be clicked, they are usually used to set up callbacks. Basically the same as the button widget, just text only with a different cls. Made for convenience.
Link(value=None)
value

a string

Example
w = gui.Link("Click Me")
w.connect(gui.CLICK,fnc,value)

all content (c) 2006 Phil Hassey - Phil's pyGame Utilities