hwtk::toolbutton
A hwtk::toolbutton widget is a button placed on a toolbar.
hwtk::toolbutton - pathName ?option value? ...
-clientdata, clientData, ClientData
-helpcommand, helpcommand, Command
-textvariable, textvariable, Variable
-underline, underline, Underline
Command-Line Name: -command
Database Name: command
Database Class: Command
Specifies the prefix of a Tcl command to invoke whenever the scale’s value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale.
Command-Line Name: -default
Database Name: default
Database Class: Default
May be set to one of normal, active or disabled . In a toolbar, one button may be designated the default button (meaning, roughly, the one that gets invoked when the user presses <Enter>). active indicates that this is currently the default button; normal means that it may become the default button, and disabled means that it is not defaultable. The default is normal. Depending on the theme, the default button may be displayed with an extra highlight ring, or with a different border color.
Command-Line Name: -rbmcommand
Database Name: rbmcommand
Database Class: Command
A Tcl script/command to execute whenever the right mouse button (RMB) is clicked on the toolbutton.
Command-Line Name: -rmbhelp
Database Name: rmbhelp
Database Class: Text
The tooltip help information for the right mousebutton command specified by -rmbcommand.
In addition to the standard configure, cget, identify, instate, and state commands, scale support the following additional widget commands:
pathName invoke
Invokes the toolbutton widget.
# get preview frame
set w [hwtk::demo::getpreviewframe]
pack [hwtk::frame $w.frame] -fill x
pack [hwtk::toolbutton $w.frame.cut -image cut-24.png -help "Cut" -command [list $w.text insert end "pressed - Cut\n"]] -side left
pack [hwtk::toolbutton $w.frame.copy -image copy-24.png -help "Copy" -command [list $w.text insert end "pressed - Copy\n"]] -side left
pack [hwtk::toolbutton $w.frame.paste -image paste-24.png -help "Paste" -command [list $w.text insert end "pressed - Paste\n"]] -side left
pack [hwtk::toolbutton $w.frame.tool -text "Indent" -rmbcommand [list $w.text insert end "pressed - Indent selection Right\n"] \
-rmbhelp "Indent selection right" -command [list $w.text insert end "pressed - Indent selection Left\n"] \
-help "Indent selection left" ] -side left
pack [text $w.text] -fill both -expand true;