| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module RadioButton :: Class RadioButton |
|
object--+ |INotifyable--+ |BaseObject--+ |object--+ | | |Sprite--+ |BaseWidget--+ |Bin--+ |ButtonBase--+ |ToggleButton--+ | RadioButton
RadioButton (text, group=None) -> RadioButton
A button widget class, which switches its state in depedance of others.
The RadioButton can be grouped with other RadioButtons to allow a selection of a limited amount of choices. The constructor of the RadioButton allows you to assign it to an already existing group of RadioButtons. If no group is provided, the radio button will become a group.
The RadioButton can be assigned to a group of RadioButtons by setting the 'group' attribute to the specified RadioButton group or by using the set_group() method.
radiobutton.group = other_radio_button radiobutton.set_group (other_radio_button)
The 'active' attribute and set_active() method allow you to toggle the state of the RadioButton. Whenever a RadioButton of a respective group will be activated, any other active RadioButton of that group will lose its state.
radiobutton.active = True radiobutton.set_active (True)
It is possible to add and remove RadioButtons to or from a specific group using the add_button() and remove_button() methods.
radiobutton.add_button (other_radio_button) radiobutton.remove_button (other_radio_button)
Note: It is possible to create nested sub groups of radio buttons by adding a radio button to another one, which is already in a group.
Default action (invoked by activate()): See the ToggleButton class.
Mnemonic action (invoked by activate_mnemonic()): See the ToggleButton class.
Attributes: group - The radio button group the button belongs to. list - List of attached RadioButtons.| Method Summary | |
|---|---|
__init__(self,
text,
group)
| |
R.add_button (...) -> None | |
R.destroy () -> None | |
C.draw () -> None | |
R.draw_bg () -> Surface | |
R.remove_button (...) -> None | |
R.set_active (...) -> None | |
R.set_group (...) -> None | |
| Inherited from ToggleButton | |
T.activate () -> None | |
T.get_text () -> string | |
T.notify (event) -> None | |
T.set_border (...) -> None | |
B.set_child (...) -> None | |
T.set_state (...) -> None | |
T.set_text (...) -> None | |
| Inherited from ButtonBase | |
B.activate_mnemonic (...) -> bool | |
| Inherited from Bin | |
B.set_depth (...) -> None | |
B.set_event_manager (...) -> None | |
B.set_indexable (...) -> None | |
B.set_padding (...) -> None | |
B.set_sensitive (...) -> None | |
B.update (...) -> None | |
| Inherited from BaseWidget | |
W.check_sizes (...) -> int, int | |
W.create_style () -> WidgetStyle | |
For debugging usage only | |
W.get_style () -> WidgetStyle | |
B.initclass () -> None (Class method) | |
W.lock () -> None | |
W.rect_to_client (...) -> pygame.Rect | |
W.set_dirty (...) -> None | |
W.set_entered (...) -> None | |
W.set_event_area (...) -> None | |
W.set_focus (...) -> bool | |
W.set_index (...) -> None | |
W.set_maximum_size (...) -> None | |
W.set_minimum_size (...) -> None | |
W.set_opacity (...) -> None | |
W.set_position (...) -> None | |
W.set_size (...) -> None | |
W.set_style (...) -> None | |
W.set_tooltip (...) -> None | |
W.unlock () -> None | |
| Inherited from BaseObject | |
B.connect_signal (...) -> EventCallback | |
B.disconnect_signal (...) -> None | |
B.emit (...) -> bool | |
B.run_signal_handlers (...) -> None | |
| Inherited from Sprite | |
| |
add(group or list of of groups, ...) add a sprite to container | |
| |
alive() -> bool check to see if the sprite is in any groups | |
groups() -> list of groups list used sprite containers | |
kill() remove this sprite from all groups | |
remove(group or list of groups, ...) remove a sprite from container | |
| |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Property Summary | |
|---|---|
group: The group the RadioButton belongs to. | |
list: List of the attached RadionButtons. | |
| Inherited from ToggleButton | |
active: The state of the ToggleButton. | |
border: The border style to set for the ToggleButton. | |
text: The text of the ToggleButton. | |
| Inherited from Bin | |
child: The widget hold by the Bin. | |
padding: Additional padding between child and borders. | |
| Inherited from BaseWidget | |
bottom | |
bottomleft | |
bottomright | |
center | |
centerx | |
centery | |
controls: Widgets associated with the widget. | |
depth: The z-axis layer depth of the widget. | |
dirty: Indicates, whether the widget need to be redrawn. | |
entered: Indicates, whether the widget is entered. | |
eventarea: The area, which gets the events. | |
focus: The focus of the widget. | |
h | |
height | |
image: The visible surface of the widget. | |
index: The tab index position of the widget. | |
indexable: The IIndexable, the widget is attached to. | |
left | |
locked: Indicates, whether the widget is locked. | |
maxsize: The maximum size to occupy by the widget. | |
midbottom | |
midleft | |
midright | |
midtop | |
minsize: The guaranteed size of the widget. | |
opacity: The opacity of the widget. | |
position: The position of the topleft corner. | |
rect: The area occupied by the widget. | |
right | |
sensitive: The sensitivity of the widget. | |
size | |
state: The current state of the widget. | |
style: The style of the widget. | |
tooltip: The tool tip text to display for the widget. | |
top | |
topleft | |
topright | |
w | |
width | |
x | |
y | |
| Inherited from BaseObject | |
manager: The event manager to use by the object. | |
| Instance Method Details |
|---|
add_button(self, button)R.add_button (...) -> None Adds a RadioButton to the group of RadioButtons. Adds a RadioButton to the RadioButtons causing it to become a RadioButton group, if it was not before. Raises a TypeError, if the passed argument does not inherit from the RadioButton class. |
destroy(self)R.destroy () -> None Destroys the RadioButton and removes it from its event system.
|
draw(self)C.draw () -> None Draws the RadioButton surface. Creates the visible surface of the RadioButton and places a radio check and its Label on it. |
draw_bg(self)R.draw_bg () -> Surface Draws the RadioButton background surface and returns it. Creates the visible surface of the RadioButton and returns it to the caller. |
remove_button(self, button)R.remove_button (...) -> None Removes a RadioButton from the group of RadioButtons. Removes a RadioButton from the group and sets its 'group' attribute to None. |
set_active(self, active)R.set_active (...) -> None Sets the state of the radio button. Sets the state of the RadioButton. if the active argument evaluates to True, the radio button will be activated and any other button of the same group deactivated. |
set_group(self, group)R.set_group (...) -> None Sets the group of RadioButtons, the RadioButton belongs to. Adds the RadioButton to a group, which causes the group to act as a RadioButton group, if it is not already one. If the button is already in another group, it will be removed from that group first. Raises a TypeError, if the passed argument does not inherit from the RadioButton class. |
| Property Details |
|---|
groupThe group the RadioButton belongs to.
|
listList of the attached RadionButtons.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:43 2008 | http://epydoc.sf.net |