1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
|
# PANEL.GUI -- Test GUI for the frame and layout widgets.
# This gui can be run as "cl> hello gui=panel.gui".
reset-server
appInitialize panel2 Panel2 {
*objects:\
toplevel Layout panel \
panel Group viewBox \
panel Group enhancementBox \
panel Group blinkBox \
panel Group optionsBox \
panel Frame controlBox \
\
viewBox Layout view \
view Group frameSelect \
frameSelect Layout frame \
frame TextToggle frame1 \
frame TextToggle frame2 \
frame TextToggle frame3 \
frame TextToggle frame4 \
frame Command prevFrame \
frame Command nextFrame \
view Frame frameDataBox \
frameDataBox TextBox frameData \
view Group zoomBox \
zoomBox Layout zoom \
zoom TextButton toggleZoom \
zoom TextButton zoomIn \
zoom Command x1 \
zoom Command z2 \
zoom Command z3 \
zoom Command z4 \
zoom Command z5 \
zoom Command z8 \
zoom TextButton zoomOut \
zoom TextButton centerFrame \
zoom Command d2 \
zoom Command d3 \
zoom Command d4 \
zoom Command d5 \
zoom Command d8 \
view Layout viewButtons \
viewButtons Command clearFrame \
viewButtons Command flipX \
viewButtons Command flipY \
viewButtons Command flipXY \
viewButtons Command fitFrame \
\
enhancementBox Layout enhancement \
enhancement Scrollbar2 colorlistScroll \
enhancement Frame colorlistFrame \
colorlistFrame Porthole colorlistPort \
colorlistPort MultiList colorlist \
enhancement Frame colordataFrame \
colordataFrame TextBox colordata \
enhancement Label contrastLabel \
enhancement Slider2d contrastSlider \
enhancement Label brightnessLabel \
enhancement Slider2d brightnessSlider \
enhancement Command invertButton \
enhancement Command optimizeButton \
\
blinkBox Layout blink \
blink Label blinkFramesLabel \
blink Command blinkFrame1 \
blink Command blinkFrame2 \
blink Command blinkFrame3 \
blink Command blinkFrame4 \
blink Command blinkReset \
blink Label blinkRateLabel \
blink Frame BRframe \
BRframe Layout BRlayout \
BRlayout Arrow BRdecrease \
BRlayout TextBox BRtext \
BRlayout Arrow BRincrease \
blink Command registerButton \
blink Command matchButton \
blink Toggle blinkButton \
\
optionsBox TextToggle pannerButton \
optionsBox TextToggle coordsBoxButton \
optionsBox TextToggle autoscaleButton \
optionsBox TextToggle antialiasButton \
optionsBox TextToggle tileFramesButton \
optionsBox TextToggle warningsButton \
\
controlBox Layout control \
control Command initializeButton \
control Command normalizeButton \
control Command doneButton \
\
toplevel TransientShell warning \
warning Layout warn \
warn Frame warnFrame \
warnFrame Layout WFlayout \
WFlayout Icon warnIcon \
WFlayout TextBox warnText \
warn TextButton warnOk \
warn TextButton warnCancel \
warn TextButton warnHelp
*background: gray
*foreground: black
*TextBox.background: gray60
*internalWidth: 0
*borderWidth: 0
*Command.highlightThickness: 0
*TextBox.font: 7x13bold
*TextToggle.font: -adobe-times-medium-r-normal-*-12-*-*-*-*-*-iso8859-1
*Command.font: -adobe-times-medium-r-normal-*-12-*-*-*-*-*-iso8859-1
*Toggle.font: -adobe-times-medium-r-normal-*-12-*-*-*-*-*-iso8859-1
*Label.font: -*-helvetica-medium-r-normal-*-12-*-iso8859-1
*MultiList.font: -adobe-times-medium-r-normal-*-12-*-*-*-*-*-iso8859-1
*toggleZoom.font: -*-helvetica-medium-r-normal-*-12-*-iso8859-1
*centerFrame.font: -*-helvetica-medium-r-normal-*-12-*-iso8859-1
*zoom*Command.font: 7x13bold
*blinkFrame1.font: 7x13bold
*blinkFrame2.font: 7x13bold
*blinkFrame3.font: 7x13bold
*blinkFrame4.font: 7x13bold
*panel.debug: False
*panel.layout: vertical { \
5 < -5 > \
horizontal { \
-1 \
viewBox < +inf -inf * > \
-1 \
} \
5 < -5 > \
horizontal { \
-1 \
enhancementBox < +inf -inf * +inf -inf > \
-1 \
vertical { \
-1 \
blinkBox < * +inf -inf > \
-1 \
optionsBox < * +inf -inf > \
-1 \
} \
-1 \
} \
controlBox < +inf * > \
}
! VIEW
! ------------------
*viewBox.label: View
*viewBox.location: 0 0 400 0
*viewBox.shrinkToFit: True
*viewBox.outerOffset: 5
*view.debug: False
*view.layout: vertical { \
5 < +inf -5 > \
horizontal { \
-1 \
frameSelect \
-1 \
vertical { \
5 < -5 > \
frameDataBox < +inff -100% * +inff -100% > \
5 < -5 > \
} \
-1 \
zoomBox \
-1 \
} \
1 < +inf > \
viewButtons < +inf -inf * +inf -inf > \
5 < +inf -5 > \
}
*frameDataBox.frameType: sunken
*frameDataBox.frameWidth: 2
*frameData.width: 130
*frameData.height: 50
*frameData.label:\
-- Frame 1 --\nX center: 123.45\nY center: 345.67\nX scale: 4\nY scale: 4
*frameSelect.location: 0 0 72 0
*frameSelect.shrinkToFit: True
*frameSelect.outerOffset: 5
*frameSelect.innerOffset: 5
*frameSelect.frameWidth: 2
*frameSelect*offIcon: diamond0s
*frameSelect*onIcon: diamond1s
*frameSelect*highlightColor: blue
*frameSelect.label: Frame:
*frame.debug: False
*frame.layout: vertical { \
frame1 < +inf * > \
frame2 < +inf * > \
frame3 < +inf * > \
frame4 < +inf * > \
10 < +inf -10 > \
horizontal { \
-1 \
prevFrame \
10 < +inf -5 > \
nextFrame \
-1 \
} \
-1 \
}
*frame*location: 0 0 10 20
*frame*alignment: left
*frame*frameWidth: 0
*frame*highlightThickness: 0
*frame*frame1.label: \ 1\ \
*frame*frame2.label: \ 2\ \
*frame*frame3.label: \ 3\ \
*frame*frame4.label: \ 4\ \
*frame*Command.width: 24
*frame*prevFrame.label: xx
*frame*nextFrame.label: xx
*zoomBox.label: Zoom:
*zoomBox.location: 0 0 160 127
*zoomBox.outerOffset: 5
*zoomBox.shrinkToFit: True
*zoom.debug: False
*zoom*internalWidth: 4
*zoom.layout: vertical { \
space = ((50% of width zoom) - (50% of width z5)) \
1 < +inf > \
horizontal { \
vertical { \
toggleZoom < +inf * +inf > \
2 \
} \
2 \
vertical { \
2 < +inf > \
z5 \
1 < +inf > \
z3 \
0 < +inf > \
} \
2 \
vertical { \
zoomIn < +inf * +inf > \
2 \
} \
} \
1 < +inf > \
horizontal { \
2 < +inf > \
d8 d4 d2 x1 z2 z4 z8 \
2 < +inf > \
} \
1 < +inf > \
horizontal { \
vertical { \
2 \
zoomOut < +inf * +inf > \
} \
2 \
vertical { \
0 < +inf > \
d3 \
1 < +inf > \
d5 \
2 < +inf > \
} \
2 \
vertical { \
2 \
centerFrame < +inf * +inf > \
} \
} \
1 < +inf > \
}
*toggleZoom.label: Toggle\nZoom
*toggleZoom.outerOffset: 0
*toggleZoom.width: 30
*toggleZoom.height: 25
*zoomIn.label: Zoom\nIn
*zoomIn.outerOffset: 0
*zoomIn.width: 30
*zoomIn.height: 25
*x1.label: 1
*z2.label: 2
*z3.label: 3
*z4.label: 4
*z5.label: 5
*z8.label: 8
*zoomIn.foreground: royalBlue3
*z4.foreground: royalBlue3
*z5.foreground: royalBlue3
*z8.foreground: royalBlue3
*z2.foreground: royalBlue3
*z3.foreground: royalBlue3
*zoomOut.label: Zoom\nOut
*zoomOut.outerOffset: 0
*zoomOut.width: 30
*zoomOut.height: 25
*centerFrame.label: Center
*centerFrame.outerOffset: 0
*centerFrame.width: 30
*centerFrame.height: 25
*d2.label: 2
*d3.label: 3
*d4.label: 4
*d5.label: 5
*d8.label: 8
*zoomOut.foreground: mediumVioletRed
*d2.foreground: mediumVioletRed
*d3.foreground: mediumVioletRed
*d4.foreground: mediumVioletRed
*d5.foreground: mediumVioletRed
*d8.foreground: mediumVioletRed
*viewButtons.location: 0 0 100 80
*viewButtons.debug: False
*viewButtons.layout: horizontal { \
5 < -2 > \
flipX < +inf * > \
5 < -2 > \
flipY < +inf * > \
5 < -2 > \
flipXY < +inf * > \
5 < -2 > \
clearFrame < +inf * > \
5 < -2 > \
fitFrame < +inf * > \
5 < -2 > \
}
*nextFrame.label: Next Frame
*prevFrame.label: Previous Frame
*fitFrame.label: Fit Frame
*clearFrame.label: Clear Frame
*flipX.label: Flip X
*flipY.label: Flip Y
*flipXY.label: Flip XY
! ENHANCEMENT
! ------------------
*enhancementBox.label: Enhancement
*enhancementBox.location: 0 0 100 0
*enhancementBox.shrinkToFit: True
*enhancementBox.outerOffset: 5
*enhancement.debug: False
*enhancement.layout: vertical { \
3 < -3 > \
horizontal { \
2 < -2 > \
colorlistScroll < * +inf -inf > \
-1 \
colorlistFrame < +inf -inf * +inf -inf > \
2 < -2 > \
} \
-1 \
horizontal { \
2 < -2 > \
colordataFrame < +inf -inf * +inf -inf > \
2 < -2 > \
} \
5 < -5 > \
horizontal { \
2 < -2 > \
vertical { \
-1 \
contrastLabel \
3 < -3 > \
brightnessLabel \
-1 \
} \
3 < -3 > \
vertical { \
-1 \
contrastSlider < +inf -inf * > \
3 < -3 > \
brightnessSlider < +inf -inf * > \
-1 \
} \
2 < -2 > \
} \
5 < -5 > \
horizontal { \
3 < -3 > \
invertButton < +inf -inf * > \
5 < -5 > \
optimizeButton < +inf -inf * > \
3 < -3 > \
} \
3 < -3 > \
}
*enhancement*Minsize: 20
*enhancement*FrameType: sunken
*enhancement*FrameWidth: 2
*enhancement*BorderWidth: 0
*enhancement*Label.ShadowWidth: 0
*enhancement*thumbColor: gray
*colorlistScroll.location: 0 0 20 10
*colorlistScroll.vertical: True
*colorlist.width: 100
*colorlist.height: 78
*colordata.width: 100
*colordata.height: 45
*enhancement*colordata.frameWidth: 0
*contrastLabel.label: x
*contrastSlider.location: 0 0 100 20
*brightnessLabel.label: x
*brightnessSlider.location: 0 0 100 20
*invertButton.label: Invert
*optimizeButton.label: Optimize
! BLINK
! ---------------------
*blinkBox.label: Blink
*blinkBox.location: 0 0 230 0
*blinkBox.shrinkToFit: False
*blinkBox.outerOffset: 5
*blink.debug: False
*blink.layout: vertical { \
space = (width blinkFramesLabel - width blinkRateLabel) \
3 < -3 > \
horizontal { \
0 \
blinkFramesLabel \
3 < +inf > \
blinkFrame1 < -50% * > \
blinkFrame2 < -50% * > \
blinkFrame3 < -50% * > \
blinkFrame4 < -50% * > \
4 < +inf > \
blinkReset \
2 \
} \
5 < -5 > \
horizontal { \
$space \
blinkRateLabel \
2 \
BRframe < +inf * > \
} \
10 < +inf -100% > \
horizontal { \
3 \
registerButton < +inf * > \
5 < -5 > \
matchButton < +inf * > \
5 < -5 > \
blinkButton < +inf * > \
2 \
} \
3 < -3 > \
}
*BRlayout.layout: horizontal { \
BRdecrease \
BRtext < +inf -100% * > \
BRincrease \
}
*blink.Label.borderWidth: 0
*blink.Label.shadowWidth: 0
*blink*internalWidth: 4
*blink*Arrow.background: gray60
*blink*Arrow.foreground: gray
*blink*Arrow.width: 16
*blink*Arrow.height: 25
*blinkFramesLabel.label: Blink Frames:
*blinkFrame1.label: 1
*blinkFrame2.label: 2
*blinkFrame3.label: 3
*blinkFrame4.label: 4
*blinkReset.label: Reset
*blinkRateLabel.label: Blink Rate:
*BRframe.frameType: sunken
*BRframe.frameWidth: 2
*BRtext.width: 40
*BRtext.height: 25
*BRdecrease.direction: left
*BRincrease.direction: right
*registerButton.label: Register
*matchButton.label: Match LUTs
*blinkButton.label: Blink
! OPTIONS
! ---------------------
*optionsBox.label: Options
*optionsBox.location: 0 0 220 0
*optionsBox.shrinkToFit: False
*optionsBox.outerOffset: 5
*optionsBox*offIcon: square0s
*optionsBox*onIcon: square1s
*optionsBox*selectionStyle: multi
*optionsBox*highlightColor: yellow
*optionsBox.TextToggle.location: 0 0 102 25
*optionsBox.TextToggle.frameWidth: 0
*optionsBox*alignment: left
*pannerButton.label: Panner
*coordsBoxButton.label: Coords Box
*autoscaleButton.label: Autoscale
*antialiasButton.label: Antialias
*tileFramesButton.label: Tile Frames
*warningsButton.label: Warnings
! CONTROL
! ----------------------
*controlBox.frameType: chiseled
*controlBox.frameWidth: 2
*controlBox.outerOffset: 5
*controlBox.innerOffset: 5
*controlBox.height: 30
*control.debug: False
*control.layout: horizontal { \
1 \
initializeButton < +inf * > \
5 < -5 > \
normalizeButton < +inf * > \
80 < +inf -100% > \
doneButton < +inf * > \
1 \
}
*initializeButton.label: Initialize
*normalizeButton.label: Normalize
*doneButton.label: Done
! WARNING dialog.
! ---------------------
*warning.geometry: +400+300
*warning*Layout.debug: False
*warning*TextBox.frameWidth: 0
*warning*TextBox.background: gray
*warning*TextButton.frameWidth: 2
*warning*TextButton.width: 40
*warning*TextButton.height: 25
*warn.layout: vertical { \
5 < -5 > \
horizontal { \
5 < -5 > \
warnFrame < +inf * +inf > \
5 < -5 > \
} \
1 < -1 > \
horizontal { \
5 < -5 > \
warnOk < +inf * > \
5 < +inf -5 > \
warnCancel < +inf * > \
5 < +inf -5 > \
warnHelp < +inf * > \
5 < -5 > \
} \
1 < -1 > \
}
*WFlayout.layout: horizontal { \
5 < -5 > \
vertical { \
5 < +inf -5 > \
warnIcon \
5 < +inf -5 > \
} \
5 < -5 > \
warnText < +inf -inf * +inf -inf > \
5 < -5 > \
}
*warnLabel.label: Warning
*warnLabel.width: 280
*warnLabel.height: 20
*warnFrame.frameType: sunken
*warnFrame.frameWidth: 2
*warnIcon.location: 0 0 40 40
*warnIcon.image: WARNING
*warnText.label: generic warning text
*warnText.width: 250
*warnText.height: 60
*warnOk.label: OK
*warnCancel.label: Cancel
*warnHelp.label: Help
*warnHelp.sensitive: False
*allowShellResize: true
*beNiceToColormap: False
}
# Start up the GUI.
createObjects
activate
proc quit args { send client gkey q; deactivate unmap }
send doneButton addCallback quit
# Initialize icons.
createBitmap larrow 16 16 {
0x00, 0x00, 0x00, 0x03, 0x80, 0x03, 0xc0, 0x03, 0xe0, 0x1e, 0x70, 0x1e,
0x38, 0x18, 0x1c, 0x18, 0x1c, 0x18, 0x38, 0x18, 0x70, 0x1e, 0xe0, 0x1e,
0xc0, 0x03, 0x80, 0x03, 0x00, 0x03, 0x00, 0x00};
createBitmap rarrow 16 16 {
0x00, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0xc0, 0x03, 0x78, 0x07, 0x78, 0x0e,
0x18, 0x1c, 0x18, 0x38, 0x18, 0x38, 0x18, 0x1c, 0x78, 0x0e, 0x78, 0x07,
0xc0, 0x03, 0xc0, 0x01, 0xc0, 0x00, 0x00, 0x00};
createBitmap brightness 15 15 {
0x00, 0x00, 0x80, 0x00, 0x84, 0x10, 0xe8, 0x0b, 0x10, 0x04, 0x08, 0x08,
0x08, 0x08, 0x0e, 0x38, 0x08, 0x08, 0x08, 0x08, 0x10, 0x04, 0xe8, 0x0b,
0x84, 0x10, 0x80, 0x00, 0x00, 0x00};
createBitmap contrast 15 15 {
0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x30, 0x07, 0x08, 0x0f, 0x08, 0x0f,
0x04, 0x1f, 0x04, 0x1f, 0x04, 0x1f, 0x08, 0x0f, 0x08, 0x0f, 0x30, 0x07,
0xc0, 0x01, 0x00, 0x00, 0x00, 0x00};
send prevFrame set bitmap larrow
send nextFrame set bitmap rarrow
send contrastLabel set bitmap contrast
send brightnessLabel set bitmap brightness
# Initialize sliders.
send contrastSlider resizeThumb 0.1 1.0
send brightnessSlider resizeThumb 0.1 1.0
send colorlistScroll setScrollbar 0.5 0.1
# The following code doesn't do anything useful, but helps demonstrate the
# GUI and tests various callbacks and other capabilities.
# Frame selection.
set frame 1
proc setFrame {widget args} {
global frame
send frame$frame set on 0
set frame [expr [send $widget get label] + 1 - 1]
send frame$frame set on 1
}
proc nextFrame args {
global frame
send frame$frame set on 0
incr frame; if {$frame > 4} {set frame 1}
send frame$frame set on 1
}
proc prevFrame args {
global frame
send frame$frame set on 0
set frame [expr $frame - 1]
if {$frame < 1} {set frame 4}
send frame$frame set on 1
}
proc clearFrame args {
global warnings
if {$warnings} {
send warnText set label \
"Clearing the frame will destroy\n\
all data in the frame"
send warning map
}
}
proc warnDone args {
send warning unmap
}
send prevFrame addCallback prevFrame
send nextFrame addCallback nextFrame
send clearFrame addCallback clearFrame
foreach w {warnOk warnCancel} { send $w addCallback warnDone }
foreach i {1 2 3 4} { send frame$i addCallback setFrame }
send frame1 set on 1
# Enhancement stuff.
set scrollHeight 0
set colortable Grayscale
set contrast 0
set brightness 0
proc resizeScrollbar {widget cbtype flags x y w h cw ch} {
global scrollHeight
set newHeight [expr $ch - $h]
if {$newHeight != $scrollHeight} {
send colorlistScroll setScrollbar 0.0 [expr double($h) / $ch]
set scrollHeight $newHeight
}
}; send colorlistPort addCallback resizeScrollbar
proc scrollColorlist {widget cbtype pos} {
global scrollHeight
send colorlist set y [expr -int($scrollHeight * $pos)]
}; send colorlistScroll addCallback scrollColorlist scroll
proc selectColor {widget cbtype selections indices} {
global colortable
foreach selection $selections {
set colortable $selection; updateColordata
}
}; send colorlist addCallback selectColor
proc scrollContrast {widget cbtype x y} {
global contrast; set contrast $x; updateColordata
}; send contrastSlider addCallback scrollContrast
proc scrollBrightness {widget cbtype x y} {
global brightness; set brightness $x; updateColordata
}; send brightnessSlider addCallback scrollBrightness
proc updateColordata args {
global colortable contrast brightness
send colordata set label [format "-- %s --\nCon %4.2f Brt %4.2f" \
$colortable $contrast $brightness]
}
set colortables {
"Grayscale"
"Heat"
"Halley"
"Spectrum"
"Random"
"Ramp1"
"Ramp2"
}
send colorlist setList $colortables resize
updateColordata
# Blink stuff.
set blinkRate 2.0
proc setBlinkRate {widget args} {
global blinkRate
if {$widget == "BRincrease"} {
if {$blinkRate < 0.01} {
set blinkRate 0.125
} else {
set blinkRate [expr $blinkRate * 2.0]
}
} else {
set blinkRate [expr $blinkRate / 2.0]
if {$blinkRate < 0.01} {
set blinkRate 0
}
}
send BRtext set label $blinkRate
}
foreach widget {BRincrease BRdecrease} {
send $widget addCallback setBlinkRate
}
proc setBlinkFrame {widget args} {
set frame [send $widget get label]
if {$frame == " "} {
set frame 1
} else {
incr frame
if {$frame > 4} {
set frame " "
}
}
send $widget set label $frame
}
foreach i {1 2 3 4} {
send blinkFrame$i addCallback setBlinkFrame
}
proc toggleBlink {widget args} {
global blinkRate
if {$blinkRate < 0.01} {
send $widget set state 0
}
}
proc resetBlink args {
global blinkRate
foreach i {1 2 3 4} {
send blinkFrame$i set label " "
}
set blinkRate 2.0
send BRtext set label $blinkRate
}
send blinkButton addCallback toggleBlink
send blinkReset addCallback resetBlink
send BRtext set label 2.0
# Options stuff.
set warnings 1
proc setWarnings args {
global warnings
set warnings [send warningsButton get on]
}
send warningsButton addCallback setWarnings
send warningsButton set on 1
send coordsBoxButton set on 1
send autoscaleButton set on 1
|