wm title . "Toolbar Example" ##========================================================= ## Create a toolbar iwidget ##========================================================= ## iwidgets::toolbar .tb \ -balloonbackground #336699 \ -balloonforeground white \ -balloondelay1 500 \ -balloondelay2 150 \ -orient vertical \ -helpvariable helpVar set dir [file join ${iwidgets::library} demos images] ## ## Add some buttons to the toolbar ## foreach b {copy paste clear} { .tb add button $b \ -balloonstr "[string totitle $b] it" \ -helpstr "this will $b the selection" \ -command "puts $b" \ -image [image create photo -file [file join $dir $b.gif]] } ## ## Add a spacer ## .tb add frame spacer \ -borderwidth 1 \ -width 10 \ -height 10 ## ## Add one more button ## .tb add button exit \ -balloonstr "Exit the application" \ -helpstr "this will exit the application" \ -command {exit} \ -image [image create photo -file [file join $dir exit.gif]] .tb itemconfigure exit \ -relief groove \ -bd 4 ## ## Add a status bar ## label .stat \ -textvariable helpVar \ -relief ridge \ -background white \ -foreground #336699 \ -width 25 pack .tb .stat \ -expand 1 \ -fill both \ -pady 5