4 set frame {ulcorner hline urcorner vline lrcorner llcorner}
5 option add *CkFDialog*Background blue
6 option add *CkChooseColor*Background green
7 option add *MenuBar*foreground black
8 option add *MenuBar*background white
9 option add *MenuBar*activeBackground black
10 option add *MenuBar*activeForeground white
11 option add *MenuBar*selectedBackground black
12 option add *MenuBar*selectedForeground white
13 option add *MenuBar*underlineAttributes {underline bold}
14 option add *MenuBar*underlineForeground yellow
15 frame .menu -class MenuBar
16 menubutton .menu.file -text File -underline 0 -menu .menu.file.m
17 menu .menu.file.m -border $frame
18 .menu.file.m add command -label "New" -command {fileNew}
19 .menu.file.m add command -label "Open..." -command {fileOpen}
20 .menu.file.m add command -label "Save..." -command {fileSave}
21 .menu.file.m add separator
22 .menu.file.m add command -label "Exit" -command {destroy .}
23 menubutton .menu.dialog -text Dialogs -underline 0 -menu .menu.dialog.m
24 menu .menu.dialog.m -border $frame
25 .menu.dialog.m add command -label "Message box.." -command {ck_messageBox -title "MessageBox" -message "This is simple message box" -type ok}
26 .menu.dialog.m add command -label "Color Picker.." -command {ck_chooseColor}
27 .menu.dialog.m add command -label "Command window.." -command {ckCommand}
28 label .menu.hint -text "Press <F10> for menu" -foreground black -background white
29 pack .menu.hint -side right
30 pack .menu.file .menu.dialog -side left -padx 1
31 pack .menu -side top -fill x
33 text .f.t -yscrollcommand ".f.y set" -foreground yellow -attributes bold -background blue
34 scrollbar .f.y -orient vert -command ".f.t yview"
35 pack .f.t -side left -expand y -fill both
36 pack .f.y -side right -expand n -fill y
37 pack .f -side top -expand y -fill both
39 bind .f.t <F10> {focus .menu.file;.menu.file configure -state active}
42 set filename [ck_getOpenFile]
43 if {![string length filename]} return;
44 set f [open $filename]
46 .f.t insert 0.0 [read $f]
48 set fileName $filename
49 .f.t mark set insert 0.0
55 if {[info exists fileName]} {
56 set filename [ck_getSaveFile -initialfile $filename]
58 set filename [ck_getSaveFile]
60 if {![string length filename]} return;
61 set f [open $filename w]
62 puts -nonewline $f [.f.t get 0.0 end]
64 set fileName $filename
70 catch {unset fileName}