3 set progname ypp-chatlog-alerter
6 foreach w {file edit} l {File Edit} {
7 menu .mbar.$w -tearoff 0
8 .mbar add cascade -menu .mbar.$w -label $l
10 proc menuent {w l a x} {
11 set c [list .mbar.$w add command -label $l -command $x]
12 if {[string length $a]} { lappend c -accel Command-$a }
15 foreach l {Open Quit} a {O Q} x {newfile exit} {
18 foreach l {Cut Copy Paste Clear} a {X C V {}} {
19 menuent edit $l $a [list event generate {[focus]} <<$l>>]]
21 . configure -menu .mbar
23 switch -exact [tk windowingsystem] {
25 set defaultfile ~/Library/Preferences/$progname.prefs
28 set defaultfile ~/.$progname.rc
36 global currentfile defaultfile
38 set newfile [tk_getOpenFile -multiple 0 -title "Select YPP log to track"]
39 if {![string length $newfile]} return
41 set currentfile $newfile
42 set newdefaults [open $defaultfile.new w]
43 puts $newdefaults "[list set currentfile $currentfile]"
45 file rename -force $defaultfile.new $defaultfile
54 if {[file exists $defaultfile]} {