sbutton

dgw::sbuttonbar

dgw::sbuttonbar - - is a snit widget derived from a Steve Landers old gbutton code used in the old Tk Wikit application. It displays a nice buttonbar where buttons have rounded corners, more pleasant than the standard Tk buttons. The buttons can be configures as usually using the -command or the -state option. The -text option is however currently not available as the text per default currently is the given text at button creation time.

sbutton buttonbar

Below the example code to generate this buttonbar.

package require dgw::sbuttonbar
pack [frame .f -bg #fff] -side top -fill x -expand no
pack [dgw::sbuttonbar .f.t -bg #fff] -side top ;# -fill x -expand no
set b0 .f.t
$b0 insert Back  -command [list Cmd 0]
$b0 insert Forward -command [list Cmd 1] -state disabled
$b0 insert Home 
$b0 insert End -command [list puts End]
$b0 itemconfigure End -state disabled
proc Cmd {state} {
    global b0
    tk_messageBox -type ok -message "Cmd"
    if {$state == 0} {
        $b0 itemconfigure Forward -state normal
        $b0 itemconfigure Back -state disabled
    } else {
        $b0 itemconfigure Forward -state disabled
        $b0 itemconfigure Back -state normal
    }
 }