pdwidgets.widgets.button

Button widget with optional icon and label.

class pdwidgets.widgets.button.Button(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, value=None, padding=None, radius=0, pressed_offset=2, pressed=False, label=None, text_color=None, text_height=16, scale=1, icon_file=None, icon_color=None, shadow=0, style='flat', bg_hi=None, bg_lo=None, rim=None, backdrop=None)[source]

Bases: Widget

Clickable control with optional icon and text label.

property style

Face style: "flat" or "raised".

property backdrop

Clear color under the face, or None to erase via the parent.

draw(_=None)[source]

Draw the button background and shape (with an optional drop shadow).

press(data=None, event=None)[source]

Mark pressed and dirty; flush via the display tick (not inline I80).

release(data=None, event=None)[source]

Clear pressed and dirty; flush via the display tick.