The Button Widget
Create a simple button with the Button method:
$parentwidget->Button (options)The standard configuration options that apply to Button are: -activebackground, -activeforeground, -anchor, -background, -bg, -bitmap, -borderwidth, -bd, -cursor, -default, -disabledforeground, -font, -foreground, -fg, -height, -highlight-background, -highlightcolor, -highlightthickness, -image, -justify, -padx, -pady, -relief, -state, -takefocus, -underline, -width, and -wraplength.
Other options are:
-command =>callbackPointer to a function that will be called when the button is pressed.
-text =>'text'Defines the text string displayed on the button. See also
-textvariable.-textvariable =>\$variablePoints to the variable containing text to be displayed in the button. Button text will change as
$variabledoes.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access