Skip to content

check_box

pdwidgets.widgets.check_box

Checkbox toggle widget.

CheckBox(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, value=False, padding=None, size=ICON_SIZE.LARGE)

Bases: Toggle

Boolean toggle rendered as checked/unchecked icons.

Initialize a CheckBox widget.

Parameters:

Name Type Description Default
parent Widget

The parent widget or screen that contains this check box.

required
x int

The x-coordinate of the check box.

0
y int

The y-coordinate of the check box.

0
w int

The width of the check box.

None
h int

The height of the check box.

None
align int

The alignment of the check box.

None
align_to Widget

The widget to align to.

None
fg int

The color of the check box.

None
bg int

The background color of the check box.

None
visible bool

The visibility of the check box.

True
value bool

The initial state of the check box.

False
padding tuple

The padding on each side of the check box.

None
size int

The size of the check box (default is ICON_SIZE.LARGE).

LARGE
Usage

check_box = CheckBox(screen, size=ICON_SIZE.LARGE)