Name
button
- button
pathName[option value...] The button command creates a new button widget named
pathname.
Standard Options
-activebackground | -activeforeground | -anchor |
-background | -bitmap | -borderwidth |
-cursor | -disabledforeground | -font |
-foreground | -highlightbackground | -highlightcolor |
-highlightthickness | -image | -justify |
-padx | -pady | -relief |
-takefocus | -text | -textvariable |
-underline | -wraplength |
Widget-Specific Options
- -command
tclCommand(command,Command) Command to be evaluated when button is invoked.
- -default
state(default,Default) State for the default ring, a platform-dependent border drawn around the button to indicate it is the default button. Must be
normal(button is not the default),active(button is the default), ordisabled(no ring is drawn).- -height
height(height,Height) Desired height, in lines for text content or in screen units for images and bitmaps.
- -state
state(state,State) State of the button.
Statemust benormal,active, ordisabled.- -width
width(width,Width) Desired width, in characters, for text content, or in screen units, for images and bitmaps.
Methods
pathNameflashFlash button by alternating between active and normal colors.
pathNameinvokeInvoke the Tcl command associated with the button and return its result. An empty string is returned if there is no command associated with the button. This command is ignored if the button's state is
disabled.
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