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
Button.__init__
Switch
Checkbox
Checkbox.__init__
Radio
Radio.__init__
Tool
Tool.__init__
Icon
Link
Contains various types of button widgets.

Button

A button, buttons can be clicked, they are usually used to set up callbacks. Example: w = gui.Button("Click Me") w.connect(gui.CLICK, fnc, value)

Button.__init__

Button constructor, which takes either a string label or widget. See Widget documentation for additional style parameters.

Switch

A switch can have two states, on or off.

Checkbox

A type of switch that can be grouped with other checkboxes. Example: # The 'value' parameter indicates which checkboxes are on by default 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'))

Checkbox.__init__

Checkbox constructor. Keyword arguments: group -- the Group that this checkbox belongs to value -- the initial value (True or False) See Widget documentation for additional style parameters.

Radio

A type of switch that can be grouped with other radio buttons, except that only one radio button can be active at a time. 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'))

Radio.__init__

Radio constructor. Keyword arguments: group -- the Group this radio button belongs to value -- the initial value (True or False)

Tool

Within a Group of Tool widgets only one may be selected at a time. 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'))

Tool.__init__

Tool constructor. Keyword arguments: 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

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. Example: w = gui.Link("Click Me") w.connect(gui.CLICK,fnc,value)

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