Version 3 of ttk::checkbutton

Updated 2009-12-13 13:15:43 by Mat

Ttk's checkbutton widget.

http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_checkbutton.htm

Mat To remove the indictator and have your checkbuttons look like normal buttons, use a custom style:

 # 1. create a new style "MatButton" based on the default style for checkbuttons
 ttk::style configure MatButton.TCheckbutton

 # 2. use the same layout, that normal buttons use
 ttk::style layout MatButton.TCheckbutton [ttk::style layout TButton]

 # 3. our style should adjust its relief to reflect the select state
 ttk::style map MatButton.TCheckbutton -relief {selected sunken !selected raised}

 # and we're done.. create a new checkbutton and enjoy :)
 pack [ttk::checkbutton .b -text "Check Me" -style MatButton.TCheckbutton]