Skip to content

radio_group

pdwidgets.widgets.radio_group

Radio button group coordinator.

RadioGroup(parent)

Bases: Widget

Invisible coordinator that enforces single radio selection.

Initialize a RadioGroup to manage a group of RadioButtons.

RadioGroup is a real (but invisible, zero-size) :class:Widget so it participates in the widget tree for lifecycle consistency with every other widget. It draws nothing and is skipped by the dirty-rect render pass (invalidate and draw are no-ops). The member RadioButtons are normal children of their own parent; the group only tracks them for mutual exclusion.

Parameters:

Name Type Description Default
parent Widget

The parent widget or screen that owns this group.

required
See Also

RadioButton

add(radio_button)

Add a RadioButton to the group.

Parameters:

Name Type Description Default
radio_button RadioButton

The RadioButton to add to the group.

required

draw(area=None)

No-op: the group draws nothing.

invalidate()

No-op: an invisible, zero-size group never needs redrawing.

set_checked(selected_button)

Ensure only the selected button is checked in the group.

Parameters:

Name Type Description Default
selected_button RadioButton

The RadioButton to check.

required