TclMacBag - Bag of Mac Widgets for Tcl/Tk
The viewbutton widget

HomeF.A.QChangelogLicenseAbout

In Brief

Supports a number of button styles:

Viewbuttons

Commands

::tclmacbag::viewbutton pathName ?Options?

Available options:

Example

::tclmacbag::viewbutton .f.b1 -background #B2B2B2 -image $img \
  -style steel-left -command {set ::a 1 ; puts Test} -force yes \
  -variable ::a -onwhen 1

Further Information

Supports the -force yes option to enable the Mac versions of the widget to be used on non-Mac platforms (as seen in the above screenshot from an ancient copy of Windows 98).

Without -force yes used, widgets appear on non-Mac platforms as standard Tile/Ttk buttons.

Images with this widget should be 13 pixels high and (usually but not always) 13 pixels in width.

By strong convention, icon images should be dark coloured greyscale, with a transparent background. (This reflects the history of this button class in the Mac OS range before OS X.) The exception to this rule is the 'mail' style (named for Apple's Mail.app) which uses colour icons.

© Peter Caffin, 2010-2017.