1 #!/usr/latest/bin/wish -f
3 # Tcl version: 7.2 (Tcl/Tk/XF)
9 # procedure to show window .
10 proc ShowWindow. {args} {# xf ignore me 7
12 # Window manager configurations
14 wm positionfrom . user
20 bind . <Button-3> {MenuPopupPost .frame0.menubutton3.m.menu4 %X %Y}
21 bind . <ButtonRelease-3> {MenuPopupRelease .frame0.menubutton3.m.menu4 %W}
23 # build widget .frame0
29 # build widget .frame0.menubutton0
30 menubutton .frame0.menubutton0 \
33 -menu {.frame0.menubutton0.m} \
36 # build widget .frame0.menubutton0.m
37 menu .frame0.menubutton0.m \
40 .frame0.menubutton0.m add command \
41 -command {loadfile $testbase/objdir/$host/$target/logs/gcc.sum
45 .frame0.menubutton0.m add command \
46 -command {loadfile $testbase/objdir/$host/$target/logs/g++.sum
50 .frame0.menubutton0.m add command \
51 -command {loadfile $testbase/objdir/$host/$target/logs/gdb.sum
55 .frame0.menubutton0.m add command \
56 -command {loadfile $testbase/objdir/$host/$target/logs/gas.sum
60 .frame0.menubutton0.m add command \
61 -command {loadfile $testbase/objdir/$host/$target/logs/binutils.sum
65 .frame0.menubutton0.m add command \
66 -command {loadfile $testbase/objdir/$host/$target/logs/runtest.sum
70 .frame0.menubutton0.m add command \
71 -command {loadfile $testbase/objdir/$host/$target/logs/tcl.sum
75 .frame0.menubutton0.m add command \
76 -command {loadfile $testbase/objdir/$host/$target/logs/expect.sum
80 .frame0.menubutton0.m add command \
81 -command {loadfile $testbase/objdir/$host/$target/logs/libg++.sum
85 .frame0.menubutton0.m add command \
86 -command {loadfile $testbase/objdir/$host/$target/logs/libio.sum
90 .frame0.menubutton0.m add command \
91 -command {loadfile $testbase/objdir/$host/$target/logs/libm.sum
96 # build widget .frame0.menubutton1
97 menubutton .frame0.menubutton1 \
100 -menu {.frame0.menubutton1.m} \
103 # build widget .frame0.menubutton1.m
104 menu .frame0.menubutton1.m \
105 -background {white} \
107 .frame0.menubutton1.m add command \
111 .frame0.menubutton1.m add command \
112 -command {.frame6.frame.text2 delete 0.0 end} \
113 -label {Clear window}
114 .frame0.menubutton1.m add command \
115 -command {dialogbox} \
117 .frame0.menubutton1.m add command \
118 -command {.frame6.frame.text2 insert 0.0 "Top of tree is $testbase\n"} \
119 -label {Show filename}
121 # build widget .frame0.menubutton3
122 menubutton .frame0.menubutton3 \
123 -background {white} \
124 -foreground {black} \
125 -menu {.frame0.menubutton3.m} \
128 # build widget .frame0.menubutton3.m
129 menu .frame0.menubutton3.m \
130 -background {white} \
132 .frame0.menubutton3.m add command \
133 -command {set host "alpha-dec-osf1.3"} \
134 -label {alpha-dec-osf1.3}
135 .frame0.menubutton3.m add command \
136 -command {set host "hppa1.1-hp-hpux"} \
137 -label {hppa1.1-hp-hpux}
138 .frame0.menubutton3.m add command \
139 -command {set host "i386-unknown-sysv4.2"} \
140 -label {i386-unknown-sysv4.2}
141 .frame0.menubutton3.m add command \
142 -command {set host "m68k-hp-hpux"} \
143 -label {m68k-hp-hpux}
144 .frame0.menubutton3.m add command \
145 -command {set host "m68k-sun-sunos4.1.1"} \
146 -label {m68k-sun-sunos4.1.1}
147 .frame0.menubutton3.m add command \
148 -command {set host "mips-dec-ultrix4.2"} \
149 -label {mips-dec-ultrix4.2}
150 .frame0.menubutton3.m add command \
151 -command {set host "mips-sgi-irix4.0.5H"} \
152 -label {mips-sgi-irix4.0.5H}
153 .frame0.menubutton3.m add command \
154 -command {set host "rs6000-ibm-aix3.2"} \
155 -label {rs6000-ibm-aix3.2}
156 .frame0.menubutton3.m add command \
157 -command {set host "sparc-sun-solaris2.3"} \
158 -label {sparc-sun-solaris2.3}
159 .frame0.menubutton3.m add command \
160 -command {set host "sparc-sun-sunos4.1.3"} \
161 -label {sparc-sun-sunos4.1.3}
163 # build widget .frame0.menubutton2
164 menubutton .frame0.menubutton2 \
165 -background {white} \
166 -foreground {black} \
167 -menu {.frame0.menubutton2.m} \
170 # build widget .frame0.menubutton2.m
171 menu .frame0.menubutton2.m \
172 -background {white} \
174 .frame0.menubutton2.m add command \
175 -command {set target "a29k-amd-udi"} \
176 -label {a29k-amd-udi}
177 .frame0.menubutton2.m add command \
178 -command {set target "h8300-hms"} \
180 .frame0.menubutton2.m add command \
181 -command {set target "i386-aout"} \
183 .frame0.menubutton2.m add command \
184 -command {set target "i386-lynx"} \
186 .frame0.menubutton2.m add command \
187 -command {set target "i960-intel-nindy"} \
188 -label {i960-intel-nindy}
189 .frame0.menubutton2.m add command \
190 -command {set target "i960-vxwork"} \
191 -label {i960-vxworks}
192 .frame0.menubutton2.m add command \
193 -command {set target "m68k-aout"} \
195 .frame0.menubutton2.m add command \
196 -command {set target "m68k-coff"} \
198 .frame0.menubutton2.m add command \
199 -command {set target "m68k-lynx"} \
201 .frame0.menubutton2.m add command \
202 -command {set target "m68k-vxworks"} \
203 -label {m68k-vxworks}
204 .frame0.menubutton2.m add command \
205 -command {set target "mips-idt-ecoff"} \
206 -label {mips-idt-ecoff}
207 .frame0.menubutton2.m add command \
208 -command {set target "sh-hms"} \
210 .frame0.menubutton2.m add command \
211 -command {set target "sparc-aout"} \
213 .frame0.menubutton2.m add command \
214 -command {set target "sparc-sun-sunos4.1.3"} \
215 -label {sparc-sun-sunos4.1.3}
216 .frame0.menubutton2.m add command \
217 -command {set target "sparc-vxworks"} \
218 -label {sparc-vxworks}
219 .frame0.menubutton2.m add command \
220 -command {set target "sparclite-aout"} \
221 -label {sparclite-aout}
222 .frame0.menubutton2.m add command \
223 -command {set target "sparclite-coff"} \
224 -label {sparclite-coff}
225 .frame0.menubutton2.m add command \
226 -command {set target "hppa1.1-hp-hpux"} \
227 -label {hppa1.1-hp-hpux}
228 .frame0.menubutton2.m add command \
229 -command {set target "i386-unknown-sysv4.2"} \
230 -label {i386-unknown-sysv4.2}
231 .frame0.menubutton2.m add command \
232 -command {set target "m68k-hp-hpux"} \
233 -label {m68k-hp-hpux}
234 .frame0.menubutton2.m add command \
235 -command {set target "m68k-sun-sunos4.1.1"} \
236 -label {m68k-sun-sunos4.1.1}
237 .frame0.menubutton2.m add command \
238 -command {set target "mips-dec-ultrix4.2"} \
239 -label {mips-dec-ultrix4.2}
240 .frame0.menubutton2.m add command \
241 -command {set target "mips-sgi-irix4.0.5H"} \
242 -label {mips-sgi-irix4.0.5H}
243 .frame0.menubutton2.m add command \
244 -command {set target "rs6000-ibm-aix3.2"} \
245 -label {rs6000-ibm-aix3.2}
246 .frame0.menubutton2.m add command \
247 -command {set target "sparc-sun-solaris2.3"} \
248 -label {sparc-sun-solaris2.3}
250 # build widget .frame0.menubutton9
251 menubutton .frame0.menubutton9 \
252 -background {white} \
253 -foreground {black} \
254 -menu {.frame0.menubutton9.m} \
257 # build widget .frame0.menubutton9.m
258 menu .frame0.menubutton9.m \
259 -background {white} \
261 .frame0.menubutton9.m add command \
262 -command {getresult $testbase/objdir/$host/$target/logs/gcc
266 .frame0.menubutton9.m add command \
267 -command {getresult $testbase/objdir/$host/$target/logs/g++
271 .frame0.menubutton9.m add command \
272 -command {getresult $testbase/objdir/$host/$target/logs/gdb
276 .frame0.menubutton9.m add command \
277 -command {getresult $testbase/objdir/$host/$target/logs/gas
281 .frame0.menubutton9.m add command \
282 -command {getresult $testbase/objdir/$host/$target/logs/binutils
286 .frame0.menubutton9.m add command \
287 -command {getresult $testbase/objdir/$host/$target/logs/runtest
290 .frame0.menubutton9.m add command \
291 -command {getresult $testbase/objdir/$host/$target/logs/tcl
295 .frame0.menubutton9.m add command \
296 -command {getresult $testbase/objdir/$host/$target/logs/expect
300 .frame0.menubutton9.m add command \
301 -command {getresult $testbase/objdir/$host/$target/logs/libg++
305 .frame0.menubutton9.m add command \
306 -command {getresult $testbase/objdir/$host/$target/logs/libio
309 .frame0.menubutton9.m add command \
310 -command {getresult $testbase/objdir/$host/$target/logs/libm
315 # build widget .frame0.menubutton10
316 menubutton .frame0.menubutton10 \
317 -background {white} \
318 -foreground {black} \
319 -menu {.frame0.menubutton10.m} \
322 # build widget .frame0.menubutton10.m
323 menu .frame0.menubutton10.m \
324 -background {white} \
326 .frame0.menubutton10.m add command \
327 -command {loadfile $testbase/objdir/$host/$target/logs/gcc.log
331 .frame0.menubutton10.m add command \
332 -command {loadfile $testbase/objdir/$host/$target/logs/g++.log
336 .frame0.menubutton10.m add command \
337 -command {loadfile $testbase/objdir/$host/$target/logs/gdb.log
341 .frame0.menubutton10.m add command \
342 -command {loadfile $testbase/objdir/$host/$target/logs/gas.log
346 .frame0.menubutton10.m add command \
347 -command {loadfile $testbase/objdir/$host/$target/logs/binutils.log
351 .frame0.menubutton10.m add command \
352 -command {loadfile $testbase/objdir/$host/$target/logs/runtest.log
356 .frame0.menubutton10.m add command \
357 -command {loadfile $testbase/objdir/$host/$target/logs/tcl.log
361 .frame0.menubutton10.m add command \
362 -command {loadfile $testbase/objdir/$host/$target/logs/expect.log
366 .frame0.menubutton10.m add command \
367 -command {loadfile $testbase/objdir/$host/$target/logs/libg++.log
371 .frame0.menubutton10.m add command \
372 -command {loadfile $testbase/objdir/$host/$target/logs/libio.log
376 .frame0.menubutton10.m add command \
377 -command {loadfile $testbase/objdir/$host/$target/logs/libm.log
382 # pack widget .frame0
383 pack append .frame0 \
384 .frame0.menubutton0 {left frame center} \
385 .frame0.menubutton1 {right frame center} \
386 .frame0.menubutton3 {left frame center} \
387 .frame0.menubutton2 {left frame center} \
388 .frame0.menubutton9 {left frame center} \
389 .frame0.menubutton10 {left frame center}
391 # build widget .frame1
393 -background {white} \
397 # build widget .frame1.message3
398 message .frame1.message3 \
400 -background {white} \
402 -foreground {black} \
406 -text {sparc-sun-sunos4.1.3} \
409 # build widget .frame1.message4
410 message .frame1.message4 \
412 -background {white} \
414 -foreground {black} \
418 -text {sparc-sun-sunos4.1.3} \
419 -textvariable {target}
421 # pack widget .frame1
422 pack append .frame1 \
423 .frame1.message3 {left frame center} \
424 .frame1.message4 {right frame center}
426 # build widget .frame6
428 -background {white} \
432 # build widget .frame6.frame
433 frame .frame6.frame \
434 -background {white} \
437 # build widget .frame6.frame.scrollbar1
438 scrollbar .frame6.frame.scrollbar1 \
439 -background {white} \
440 -command {.frame6.frame.text2 yview} \
441 -foreground {black} \
444 # build widget .frame6.frame.text2
445 text .frame6.frame.text2 \
446 -background {white} \
448 -foreground {black} \
451 -yscrollcommand {.frame6.frame.scrollbar1 set}
453 # pack widget .frame6.frame
454 pack append .frame6.frame \
455 .frame6.frame.scrollbar1 {left frame center filly} \
456 .frame6.frame.text2 {top frame center expand fill}
458 # pack widget .frame6
459 pack append .frame6 \
460 .frame6.frame {top frame center fill}
464 .frame0 {top frame center fillx} \
465 .frame1 {bottom frame center fillx} \
466 .frame6 {top frame center expand fill}
468 .frame6.frame.text2 insert end {}
472 if {"[info procs XFEdit]" != ""} {
473 catch "XFMiscBindWidgetTree ."
474 after 2 "catch {XFEditSetShowWindows}"
480 if {"[info procs Alias]" == ""} {
485 # Description: establish an alias for a procedure
486 # Arguments: args - no argument means that a list of all aliases
487 # is returned. Otherwise the first parameter is
488 # the alias name, and the second parameter is
489 # the procedure that is aliased.
490 # Returns: nothing, the command that is bound to the alias or a
491 # list of all aliases - command pairs.
492 # Sideeffects: internalAliasList is updated, and the alias
495 global internalAliasList
497 if {[llength $args] == 0} {
498 return $internalAliasList
500 if {[llength $args] == 1} {
501 set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"]
502 if {$xfTmpIndex != -1} {
503 return [lindex [lindex $internalAliasList $xfTmpIndex] 1]
506 if {[llength $args] == 2} {
507 eval "proc [lindex $args 0] {args} {#xf ignore me 4
508 return \[eval \"[lindex $args 1] \$args\"\]}"
509 set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"]
510 if {$xfTmpIndex != -1} {
511 set internalAliasList [lreplace $internalAliasList $xfTmpIndex $xfTmpIndex "[lindex $args 0] [lindex $args 1]"]
513 lappend internalAliasList "[lindex $args 0] [lindex $args 1]"
516 error "Alias: wrong number or args: $args"
524 # Procedure: GetSelection
525 if {"[info procs GetSelection]" == ""} {
526 proc GetSelection {} {
529 # Procedure: GetSelection
530 # Description: get current selection
538 catch "selection get" xfSelection
539 if {"$xfSelection" == "selection doesn't exist or form \"STRING\" not defined"} {
548 # Procedure: MenuPopupAdd
549 if {"[info procs MenuPopupAdd]" == ""} {
550 proc MenuPopupAdd { xfW xfButton xfMenu {xfModifier ""} {xfCanvasTag ""}} {
552 # the popup menu handling is from (I already gave up with popup handling :-):
554 # Copyright 1991,1992 by James Noble.
555 # Everyone is granted permission to copy, modify and redistribute.
556 # This notice must be preserved on all copies or derivates.
559 # Procedure: MenuPopupAdd
560 # Description: attach a popup menu to widget
561 # Arguments: xfW - the widget
562 # xfButton - the button we use
563 # xfMenu - the menu to attach
564 # {xfModifier} - a optional modifier
565 # {xfCanvasTag} - a canvas tagOrId
571 set tk_popupPriv($xfMenu,focus) ""
572 set tk_popupPriv($xfMenu,grab) ""
573 if {"$xfModifier" != ""} {
574 set press "$xfModifier-"
575 set motion "$xfModifier-"
583 bind $xfMenu "<${motion}B${xfButton}-Motion>" "MenuPopupMotion $xfMenu %W %X %Y"
584 bind $xfMenu "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W"
585 if {"$xfCanvasTag" == ""} {
586 bind $xfW "<${press}ButtonPress-${xfButton}>" "MenuPopupPost $xfMenu %X %Y"
587 bind $xfW "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W"
589 $xfW bind $xfCanvasTag "<${press}ButtonPress-${xfButton}>" "MenuPopupPost $xfMenu %X %Y"
590 $xfW bind $xfCanvasTag "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W"
596 # Procedure: MenuPopupMotion
597 if {"[info procs MenuPopupMotion]" == ""} {
598 proc MenuPopupMotion { xfMenu xfW xfX xfY} {
601 # Procedure: MenuPopupMotion
602 # Description: handle the popup menu motion
603 # Arguments: xfMenu - the topmost menu
605 # xfX - the root x coordinate
606 # xfY - the root x coordinate
612 if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] &&
613 "[winfo class $xfW]" == "Menu" &&
614 [info exists tk_popupPriv($xfMenu,focus)] &&
615 "$tk_popupPriv($xfMenu,focus)" != "" &&
616 [info exists tk_popupPriv($xfMenu,grab)] &&
617 "$tk_popupPriv($xfMenu,grab)" != ""} {
618 set xfPopMinX [winfo rootx $xfW]
619 set xfPopMaxX [expr $xfPopMinX+[winfo width $xfW]]
620 if {$xfX >= $xfPopMinX && $xfX <= $xfPopMaxX} {
621 $xfW activate @[expr $xfY-[winfo rooty $xfW]]
622 if {![catch "$xfW entryconfig @[expr $xfY-[winfo rooty $xfW]] -menu" result]} {
623 if {"[lindex $result 4]" != ""} {
624 foreach binding [bind $xfMenu] {
625 bind [lindex $result 4] $binding [bind $xfMenu $binding]
637 # Procedure: MenuPopupPost
638 if {"[info procs MenuPopupPost]" == ""} {
639 proc MenuPopupPost { xfMenu xfX xfY} {
642 # Procedure: MenuPopupPost
643 # Description: post the popup menu
644 # Arguments: xfMenu - the menu
645 # xfX - the root x coordinate
646 # xfY - the root x coordinate
652 if {"[info commands $xfMenu]" != ""} {
653 if {![info exists tk_popupPriv($xfMenu,focus)]} {
654 set tk_popupPriv($xfMenu,focus) [focus]
656 if {"$tk_popupPriv($xfMenu,focus)" == ""} {
657 set tk_popupPriv($xfMenu,focus) [focus]
660 set tk_popupPriv($xfMenu,grab) $xfMenu
662 catch "$xfMenu activate none"
663 catch "$xfMenu post $xfX $xfY"
664 catch "focus $xfMenu"
665 catch "grab -global $xfMenu"
671 # Procedure: MenuPopupRelease
672 if {"[info procs MenuPopupRelease]" == ""} {
673 proc MenuPopupRelease { xfMenu xfW} {
676 # Procedure: MenuPopupRelease
677 # Description: remove the popup menu
678 # Arguments: xfMenu - the topmost menu widget
679 # xfW - the menu widget
686 if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] &&
687 "[winfo class $xfW]" == "Menu" &&
688 [info exists tk_popupPriv($xfMenu,focus)] &&
689 "$tk_popupPriv($xfMenu,focus)" != "" &&
690 [info exists tk_popupPriv($xfMenu,grab)] &&
691 "$tk_popupPriv($xfMenu,grab)" != ""} {
692 if {$tkVersion >= 3.0} {
693 catch "grab release $tk_popupPriv($xfMenu,grab)"
697 catch "focus $tk_popupPriv($xfMenu,focus)"
698 set tk_popupPriv($xfMenu,focus) ""
699 set tk_popupPriv($xfMenu,grab) ""
700 if {"[$xfW index active]" != "none"} {
701 $xfW invoke active; catch "$xfMenu unpost"
704 catch "$xfMenu unpost"
709 # Procedure: NoFunction
710 if {"[info procs NoFunction]" == ""} {
711 proc NoFunction { args} {
714 # Procedure: NoFunction
715 # Description: do nothing (especially with scales and scrollbars)
716 # Arguments: args - a number of ignored parameters
725 if {"[info procs SN]" == ""} {
726 proc SN { {xfName ""}} {
730 # Description: map a symbolic name to the widget path
732 # Returns: the symbolic name
741 # Procedure: SymbolicName
742 if {"[info procs SymbolicName]" == ""} {
743 proc SymbolicName { {xfName ""}} {
746 # Procedure: SymbolicName
747 # Description: map a symbolic name to the widget path
749 # Returns: the symbolic name
755 if {"$xfName" != ""} {
757 append xfArrayName symbolicName ( $xfName )
758 if {![catch "set \"$xfArrayName\"" xfValue]} {
761 if {"[info commands XFProcError]" != ""} {
762 XFProcError "Unknown symbolic name:\n$xfName"
764 puts stderr "XF error: unknown symbolic name:\n$xfName"
774 if {"[info procs Unalias]" == ""} {
775 proc Unalias { aliasName} {
779 # Description: remove an alias for a procedure
780 # Arguments: aliasName - the alias name to remove
782 # Sideeffects: internalAliasList is updated, and the alias
785 global internalAliasList
787 set xfIndex [lsearch $internalAliasList "$aliasName *"]
788 if {$xfIndex != -1} {
790 set internalAliasList [lreplace $internalAliasList $xfIndex $xfIndex]
800 if [info exists env(TESTBASE)] then {
801 set testbase $env(TESTBASE)
803 set testbase /lisa/test/rob
809 # Procedure: getresult
810 proc getresult { name} {
811 set tmp "[lsort [glob -nocomplain $name-results-??????-????]]"
812 set tmp [lindex $tmp [expr [llength $tmp] - 1]]
813 if [string match "" $tmp] then {
814 .frame6.frame.text2 delete 0.0 end
815 .frame6.frame.text2 insert 0.0 "Couldn't find results for: $name\n"
818 return [loadfile $tmp]
822 # Procedure: dialogbox
826 catch {destroy $w.e1}
829 wm title $w "Change Editor"
830 wm iconname $w "Entries"
831 message $w.msg -font -Adobe-times-medium-r-normal--*-180* -aspect 200 \
832 -text "Hey Now. Click the \"OK\" button when you've seen enough."
833 frame $w.frame -borderwidth 10
834 button $w.ok -text OK -command "destroy $w"
835 pack $w.msg $w.frame $w.ok -side top -fill both
837 entry $w.frame.e1 -relief sunken -textvariable editor
838 pack $w.frame.e1 -side top -pady 5 -fill x
839 bind $w.frame.e1 <Return> "destroy $w"
842 # Procedure: loadfile
843 proc loadfile { name} {
844 if ![file exists $name] then {
845 .frame6.frame.text2 delete 0.0 end
846 .frame6.frame.text2 insert 0.0 "Couldn't find:\t$name\n"
851 if [info exists editor] then {
852 if ![string match "" $editor] then {
853 catch "exec $editor $name&" tmp
854 if [info exists tmp] then {
855 .frame6.frame.text2 delete 0.0 end
856 .frame6.frame.text2 insert 0.0 "Editor returned $tmp\n"
860 .frame6.frame.text2 delete 0.0 end
861 set fd [open $name r]
862 while { [gets $fd line]>=0 } {
863 .frame6.frame.text2 insert end "$line\n"
864 .frame6.frame.text2 mark set insert 0.0
872 # application parsing procedure
873 proc XFLocalParseAppDefs {xfAppDefFile} {
876 # basically from: Michael Moore
877 if {[file exists $xfAppDefFile] &&
878 [file readable $xfAppDefFile] &&
879 "[file type $xfAppDefFile]" == "link"} {
880 catch "file type $xfAppDefFile" xfType
881 while {"$xfType" == "link"} {
882 if {[catch "file readlink $xfAppDefFile" xfAppDefFile]} {
885 catch "file type $xfAppDefFile" xfType
888 if {!("$xfAppDefFile" != "" &&
889 [file exists $xfAppDefFile] &&
890 [file readable $xfAppDefFile] &&
891 "[file type $xfAppDefFile]" == "file")} {
894 if {![catch "open $xfAppDefFile r" xfResult]} {
895 set xfAppFileContents [read $xfResult]
897 foreach line [split $xfAppFileContents "\n"] {
898 # backup indicates how far to backup. It applies to the
899 # situation where a resource name ends in . and when it
900 # ends in *. In the second case you want to keep the *
901 # in the widget name for pattern matching, but you want
902 # to get rid of the . if it is the end of the name.
904 set line [string trim $line]
905 if {[string index $line 0] == "#" || "$line" == ""} {
906 # skip comments and empty lines
909 set list [split $line ":"]
910 set resource [string trim [lindex $list 0]]
911 set i [string last "." $resource]
912 set j [string last "*" $resource]
918 set name [string range $resource $i end]
920 set widname [string range $resource 0 $i]
921 set value [string trim [lindex $list 1]]
922 if {"$widname" != "" && "$widname" != "*"} {
923 # insert the widget and resourcename to the application
925 if {![info exists xfAppDefaults]} {
928 lappend xfAppDefaults [list $widname [string tolower $name] $value]
934 # application loading procedure
935 proc XFLocalLoadAppDefs {{xfClasses ""} {xfPriority "startupFile"} {xfAppDefFile ""}} {
938 if {"$xfAppDefFile" == ""} {
940 if {[info exists env(XUSERFILESEARCHPATH)]} {
941 append xfFileList [split $env(XUSERFILESEARCHPATH) :]
943 if {[info exists env(XAPPLRESDIR)]} {
944 append xfFileList [split $env(XAPPLRESDIR) :]
946 if {[info exists env(XFILESEARCHPATH)]} {
947 append xfFileList [split $env(XFILESEARCHPATH) :]
949 append xfFileList " /usr/lib/X11/app-defaults"
950 append xfFileList " /usr/X11/lib/X11/app-defaults"
952 foreach xfCounter1 $xfClasses {
953 foreach xfCounter2 $xfFileList {
954 set xfPathName $xfCounter2
955 if {[regsub -all "%N" "$xfPathName" "$xfCounter1" xfResult]} {
956 set xfPathName $xfResult
958 if {[regsub -all "%T" "$xfPathName" "app-defaults" xfResult]} {
959 set xfPathName $xfResult
961 if {[regsub -all "%S" "$xfPathName" "" xfResult]} {
962 set xfPathName $xfResult
964 if {[regsub -all "%C" "$xfPathName" "" xfResult]} {
965 set xfPathName $xfResult
967 if {[file exists $xfPathName] &&
968 [file readable $xfPathName] &&
969 ("[file type $xfPathName]" == "file" ||
970 "[file type $xfPathName]" == "link")} {
971 catch "option readfile $xfPathName $xfPriority"
972 if {"[info commands XFParseAppDefs]" != ""} {
973 XFParseAppDefs $xfPathName
975 if {"[info commands XFLocalParseAppDefs]" != ""} {
976 XFLocalParseAppDefs $xfPathName
980 if {[file exists $xfCounter2/$xfCounter1] &&
981 [file readable $xfCounter2/$xfCounter1] &&
982 ("[file type $xfCounter2/$xfCounter1]" == "file" ||
983 "[file type $xfCounter2/$xfCounter1]" == "link")} {
984 catch "option readfile $xfCounter2/$xfCounter1 $xfPriority"
985 if {"[info commands XFParseAppDefs]" != ""} {
986 XFParseAppDefs $xfCounter2/$xfCounter1
988 if {"[info commands XFLocalParseAppDefs]" != ""} {
989 XFLocalParseAppDefs $xfCounter2/$xfCounter1
997 # load a specific application defaults file
998 if {[file exists $xfAppDefFile] &&
999 [file readable $xfAppDefFile] &&
1000 ("[file type $xfAppDefFile]" == "file" ||
1001 "[file type $xfAppDefFile]" == "link")} {
1002 catch "option readfile $xfAppDefFile $xfPriority"
1003 if {"[info commands XFParseAppDefs]" != ""} {
1004 XFParseAppDefs $xfAppDefFile
1006 if {"[info commands XFLocalParseAppDefs]" != ""} {
1007 XFLocalParseAppDefs $xfAppDefFile
1014 # application setting procedure
1015 proc XFLocalSetAppDefs {{xfWidgetPath "."}} {
1016 global xfAppDefaults
1018 if {![info exists xfAppDefaults]} {
1021 foreach xfCounter $xfAppDefaults {
1022 if {"$xfCounter" == ""} {
1025 set widname [lindex $xfCounter 0]
1026 if {[string match $widname ${xfWidgetPath}] ||
1027 [string match "${xfWidgetPath}*" $widname]} {
1028 set name [string tolower [lindex $xfCounter 1]]
1029 set value [lindex $xfCounter 2]
1030 # Now lets see how many tcl commands match the name
1031 # pattern specified.
1032 set widlist [info command $widname]
1033 if {"$widlist" != ""} {
1034 foreach widget $widlist {
1035 # make sure this command is a widget.
1036 if {![catch "winfo id $widget"] &&
1037 [string match "${xfWidgetPath}*" $widget]} {
1038 catch "$widget configure -$name $value"
1049 proc StartupSrc {args} {
1055 set host [exec config.guess]
1062 .frame6.frame.text2 delete 0.0 end
1068 # initialize global variables
1072 set {fsBox(activeBackground)} {}
1073 set {fsBox(activeForeground)} {}
1074 set {fsBox(all)} {0}
1075 set {fsBox(background)} {}
1076 set {fsBox(button)} {0}
1077 set {fsBox(extensions)} {0}
1078 set {fsBox(font)} {}
1079 set {fsBox(foreground)} {}
1080 set {fsBox(internalPath)} {/offsite/rob/DejaGnu/devo/dejagnu}
1081 set {fsBox(name)} {}
1082 set {fsBox(path)} {/offsite/rob/DejaGnu/devo/dejagnu}
1083 set {fsBox(pattern)} {*}
1084 set {fsBox(scrollActiveForeground)} {}
1085 set {fsBox(scrollBackground)} {}
1086 set {fsBox(scrollForeground)} {}
1087 set {fsBox(scrollSide)} {left}
1088 set {fsBox(showPixmap)} {0}
1090 set {host} {sparc-sun-sunos4.1.3}
1092 set {result} {can't read "editor": no such variable}
1094 set {target} {sparc-sun-sunos4.1.3}
1096 set {testbase} {/lisa/test/rob}
1098 # please don't modify the following
1099 # variables. They are needed by xf.
1100 global {autoLoadList}
1101 set {autoLoadList(testit)} {0}
1102 global {internalAliasList}
1103 set {internalAliasList} {}
1105 set {moduleList(testit)} {}
1106 global {preloadList}
1107 set {preloadList(xfInternal)} {}
1108 global {symbolicName}
1109 set {symbolicName(binutils)} {.frame0.menubutton7}
1110 set {symbolicName(dialogbox)} {.top2}
1111 set {symbolicName(editor)} {.top2.entry4}
1112 set {symbolicName(g++)} {.frame0.menubutton4}
1113 set {symbolicName(gas)} {.frame0.menubutton6}
1114 set {symbolicName(gdb)} {.frame0.menubutton5}
1115 set {symbolicName(host)} {.frame0.menubutton3.m}
1116 set {symbolicName(hostlist)} {.frame0.menubutton3}
1117 set {symbolicName(logs)} {.frame0.menubutton10}
1118 set {symbolicName(misc)} {.frame0.menubutton1}
1119 set {symbolicName(ok)} {.top2.button7}
1120 set {symbolicName(results)} {.frame0.menubutton9}
1121 set {symbolicName(root)} {.}
1122 set {symbolicName(sum)} {.frame0.menubutton0}
1123 set {symbolicName(targlist)} {.frame0.menubutton2}
1124 global {xfWmSetPosition}
1125 set {xfWmSetPosition} {}
1126 global {xfWmSetSize}
1127 set {xfWmSetSize} {}
1128 global {xfAppDefToplevels}
1129 set {xfAppDefToplevels} {}
1131 # display/remove toplevel windows.
1134 # load default bindings.
1135 if {[info exists env(XF_BIND_FILE)] &&
1136 "[info procs XFShowHelp]" == ""} {
1137 source $env(XF_BIND_FILE)
1140 # parse and apply application defaults.
1141 XFLocalLoadAppDefs Testit