wm title . "Menubar Example" ## ## This is the image directory in the demos directory ## set imagedir [file join ${iwidgets::library} demos images] ##========================================================= ## Create a mainwindow iwidget ##========================================================= ## iwidgets::mainwindow .mw \ -title "Mainwindow Example" \ -helpline 1 \ -statusline 1 ## ## Add some menu items via the menubar ## public method ## foreach m {file edit view} { .mw menubar add menubutton $m \ -text [string totitle $m] \ -underline 0 } ## ## Add some toolbar items via the ## toolbar public method ## foreach t {open close clear copy cut paste} { .mw toolbar add button $t \ -balloonstr "This is the balloon string for [string totitle $t]" \ -image [image create photo -file [file join $imagedir $t.gif]] \ -command [list puts "$t selected"] \ -helpstr "This is the help string for [string totitle $t]" } ## ## Add some mousebar items via the ## mousebar public method ## foreach m {save find print help exit} { .mw mousebar add button $m \ -balloonstr "This is the balloon string for [string totitle $m]" \ -image [image create photo -file [file join $imagedir $m.gif]] \ -command [list puts "$m selected"] \ -helpstr "This is the help string for [string totitle $m]" } ## ## Create a scrolledtext iwidget to place in ## the childsite ## set cs [.mw childsite] iwidgets::scrolledtext $cs.st $cs.st import [file join / usr local tcl8.3.3 README] pack $cs.st \ -fill both \ -expand true update idletasks .mw activate