2 #############################################################################
3 # Visual Tcl v1.20 Project
4 # Author : Philippe Brochard
6 #################################
15 #################################
16 # USER DEFINED PROCEDURES
18 proc init {argc argv} {
32 if { $fullscreen == 1 } { set str_fullscreen "-fullscreen" }
34 if { $nosound == 1 } { set str_nosound "-nosound" }
36 if { $nogore == 1 } { set str_nogore "-nogore" }
38 if { $fireworks == 1 } { set str_fireworks "-fireworks" }
41 if { [ .top17.lis26 curselection ] != "" } then {
42 set file "data/[ .top17.lis26 get [.top17.lis26 curselection] ].dat"
45 exec ./jnb $str_fullscreen $str_nosound $str_nogore $str_fireworks -dat $file &
48 proc {fill_list_box} {} {
49 if [ catch { exec ls ./data } data ] {
54 .top17.lis26 insert end [ find_name $p ]
58 proc {find_name} {path} {
59 set alast [ string last "/" $path ];
62 if { $alast != [ string length $path ] } {
63 set name [ string range $path $alast end ];
66 set tmp [ string range $path 0 $alast ];
67 set alast [ string last "/" $tmp ];
69 set name [ string range $tmp $alast end ];
72 set fname [ split $name . ]
73 set firstname [ lindex $fname 0 ]
78 proc {main} {argc argv} {
81 bind .top17.lis26 <Double-Button-1> { exec_file }
84 proc {Window} {args} {
86 set cmd [lindex $args 0]
87 set name [lindex $args 1]
88 set newname [lindex $args 2]
89 set rest [lrange $args 3 end]
90 if {$name == "" || $cmd == ""} {return}
94 set exists [winfo exists $newname]
97 if {$exists == "1" && $name != "."} {wm deiconify $name; return}
98 if {[info procs vTclWindow(pre)$name] != ""} {
99 eval "vTclWindow(pre)$name $newname $rest"
101 if {[info procs vTclWindow$name] != ""} {
102 eval "vTclWindow$name $newname $rest"
104 if {[info procs vTclWindow(post)$name] != ""} {
105 eval "vTclWindow(post)$name $newname $rest"
108 hide { if $exists {wm withdraw $newname; return} }
109 iconify { if $exists {wm iconify $newname; return} }
110 destroy { if $exists {destroy $newname; return} }
114 #################################
115 # VTCL GENERATED GUI PROCEDURES
118 proc vTclWindow. {base} {
125 wm focusmodel $base passive
126 wm geometry $base 1x1+0+0
127 wm maxsize $base 1009 738
129 wm overrideredirect $base 0
130 wm resizable $base 1 1
132 wm title $base "vt.tcl"
138 proc vTclWindow.top17 {base} {
142 if {[winfo exists $base]} {
143 wm deiconify $base; return
148 toplevel $base -class Toplevel
149 wm focusmodel $base passive
150 wm geometry $base 416x314+246+193
151 wm maxsize $base 1009 738
153 wm overrideredirect $base 0
154 wm resizable $base 1 1
156 wm title $base "Jump 'n Bump"
158 -borderwidth 1 -relief raised -text {Run Jump 'n Bump}
160 -borderwidth 1 -relief sunken
161 checkbutton $base.che22 \
162 -text {Full screen} -variable fullscreen
163 checkbutton $base.che23 \
164 -text {no sound} -variable nosound
165 checkbutton $base.che24 \
166 -text {no gore} -variable nogore
167 checkbutton $base.che25 \
168 -text fireworks -variable fireworks
169 listbox $base.lis26 \
170 -yscrollcommand {.top17.scr27 set}
171 bind $base.lis26 <Double-Button-1> {
174 scrollbar $base.scr27 \
175 -command {.top17.lis26 yview}
177 -command { exec_file } -text Run
179 -command { exit } -text Quit
184 -x 25 -y 10 -width 366 -height 17 -anchor nw -bordermode ignore
186 -x 190 -y 40 -width 196 -height 257 -anchor nw -bordermode ignore
188 -x 220 -y 55 -anchor nw -bordermode ignore
190 -x 220 -y 85 -anchor nw -bordermode ignore
192 -x 220 -y 115 -anchor nw -bordermode ignore
194 -x 220 -y 145 -anchor nw -bordermode ignore
196 -x 30 -y 40 -width 103 -height 261 -anchor nw -bordermode ignore
198 -x 145 -y 40 -width 21 -height 262 -anchor nw -bordermode ignore
200 -x 240 -y 190 -width 117 -height 25 -anchor nw -bordermode ignore
202 -x 240 -y 245 -width 117 -height 25 -anchor nw -bordermode ignore