Skip to content

icon_button

pdwidgets.widgets.icon_button

Icon-only button.

IconButton(parent, x=0, y=0, w=None, h=None, align=None, align_to=None, fg=None, bg=None, visible=True, value=None, padding=None, icon_file=None)

Bases: Button

Button whose content is a centered icon.

Initialize an IconButton widget to display an icon on a button.

Parameters:

Name Type Description Default
parent Widget

The parent widget or screen that contains this icon button.

required
x int

The x-coordinate of the icon button.

0
y int

The y-coordinate of the icon button.

0
w int

The width of the icon button.

None
h int

The height of the icon button.

None
align int

The alignment of the icon button.

None
align_to Widget

The widget to align to.

None
fg int

The color of the icon button.

None
bg int

The background color of the icon button.

None
visible bool

The visibility of the icon button.

True
value str

The user-assigned value of the icon button.

None
padding tuple

The padding on each side of the icon button.

None
icon_file str

The icon file to display.

None
Usage

icon_button = IconButton(screen, icon_file="icon.pbm")