blob: 1039b528b2a240afe3eb4319a490b1497aad6703 (
plain)
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
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
|
# This file is a Tcl script to test out the procedures in the file
# tkCursor.c. It is organized in the standard white-box fashion for
# Tcl tests.
#
# Copyright (c) 1998 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
# Tests 2.3 and 2.4 need a helper file with a very specific name and
# controlled format.
proc setWincur {wincurName} {
upvar $wincurName wincur
set wincur(data_octal) {
000 000 002 000 001 000 040 040 000 000 007 000 007 000 060 001
000 000 026 000 000 000 050 000 000 000 040 000 000 000 100 000
000 000 001 000 001 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 377 377 377 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 160 016 000 000 170 036
000 000 174 076 000 000 076 174 000 000 037 370 000 000 017 360
000 000 007 340 000 000 007 340 000 000 017 360 000 000 037 370
000 000 076 174 000 000 174 076 000 000 170 036 000 000 160 016
000 000 000 000 000 000 377 377 377 377 377 377 377 377 377 377
377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
377 377 377 377 377 377 017 360 377 377 007 340 377 377 003 300
377 377 001 200 377 377 200 001 377 377 300 003 377 377 340 007
377 377 360 017 377 377 360 017 377 377 340 007 377 377 300 003
377 377 200 001 377 377 001 200 377 377 003 300 377 377 007 340
377 377 017 360 377 377
}
set wincur(data_binary) {}
foreach wincur(num) $wincur(data_octal) {
append wincur(data_binary) [binary format c [scan $wincur(num) %o]]
}
set wincur(dir) [makeDirectory {dir with spaces}]
set wincur(file) [makeFile $wincur(data_binary) "test file.cur" $wincur(dir)]
}
test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} -constraints {
testcursor
} -body {
set x watch
lindex $x 0
button .b -cursor $x
lindex $x 0
testcursor watch
} -cleanup {
destroy .b
} -result {{1 0}}
test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} -constraints {
testcursor
} -body {
set x watch
set result {}
button .b1 -cursor $x
destroy .b1
lappend result [testcursor watch]
button .b2 -cursor $x
lappend result [testcursor watch]
} -cleanup {
destroy .b2
} -result {{} {{1 1}}}
test cursor-1.3 {Tk_AllocCursorFromObj - reuse existing cursor} -constraints {
testcursor
} -body {
set x watch
set result {}
button .b1 -cursor $x
lappend result [testcursor watch]
button .b2 -cursor $x
pack .b1 .b2 -side top
lappend result [testcursor watch]
} -cleanup {
destroy .b1 .b2
} -result {{{1 1}} {{2 1}}}
test cursor-2.1 {Tk_GetCursor procedure} -body {
button .b -cursor bad_name
} -cleanup {
destroy .b
} -returnCodes error -result {bad cursor spec "bad_name"}
test cursor-2.2 {Tk_GetCursor procedure} -body {
button .b -cursor @xyzzy
} -cleanup {
destroy .b
} -returnCodes error -result {bad cursor spec "@xyzzy"}
test cursor-2.3 {Tk_GetCursor procedure: cursor specs are lists} -constraints {
win
} -setup {
unset -nocomplain wincur
set wincur(file) ""
} -body {
setWincur wincur
button .b -cursor [list @$wincur(file)]
} -cleanup {
destroy .b
removeDirectory $wincur(dir)
unset wincur
} -result {.b}
test cursor-2.4 {Tk_GetCursor procedure: cursor specs are lists} -constraints {
win
} -setup {
unset -nocomplain wincur
set wincur(file) ""
} -body {
setWincur wincur
button .b -cursor @[regsub -all {[][ \\{}""$#]} $wincur(file) {\\&}]
} -cleanup {
destroy .b
removeDirectory $wincur(dir)
unset wincur
} -result {.b}
test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} -constraints {
testcursor
} -setup {
set x heart
set result {}
} -body {
button .b1 -cursor $x
button .b3 -cursor $x
button .b2 -cursor $x
lappend result [testcursor heart]
destroy .b1
lappend result [testcursor heart]
destroy .b2
lappend result [testcursor heart]
destroy .b3
lappend result [testcursor heart]
} -result {{{3 1}} {{2 1}} {{1 1}} {}}
test cursor-4.1 {FreeCursorObjProc} -constraints {
testcursor
} -body {
set x [format heart]
button .b -cursor $x
set y [format heart]
.b configure -cursor $y
set z [format heart]
.b configure -cursor $z
set result {}
lappend result [testcursor heart]
set x red
lappend result [testcursor heart]
set z 32
lappend result [testcursor heart]
destroy .b
lappend result [testcursor heart]
set y bogus
set result
} -cleanup {
destroy .b
} -result {{{1 3}} {{1 2}} {{1 1}} {}}
# -------------------------------------------------------------------------
test cursor-5.1 {assert consistent cursor configuration command} -setup {
button .b
} -body {
.b configure -cursor {watch red black}
} -cleanup {
destroy .b
} -result {}
# -------------------------------------------------------------------------
# Check for the standard set of cursors.
test cursor-6.1 {check cursor-font cursor X_cursor} -setup {
button .b -text X_cursor
} -body {
.b configure -cursor X_cursor
} -cleanup {
destroy .b
} -result {}
test cursor-6.2 {check cursor-font cursor arrow} -setup {
button .b -text arrow
} -body {
.b configure -cursor arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.3 {check cursor-font cursor based_arrow_down} -setup {
button .b -text based_arrow_down
} -body {
.b configure -cursor based_arrow_down
} -cleanup {
destroy .b
} -result {}
test cursor-6.4 {check cursor-font cursor based_arrow_up} -setup {
button .b -text based_arrow_up
} -body {
.b configure -cursor based_arrow_up
} -cleanup {
destroy .b
} -result {}
test cursor-6.5 {check cursor-font cursor boat} -setup {
button .b -text boat
} -body {
.b configure -cursor boat
} -cleanup {
destroy .b
} -result {}
test cursor-6.6 {check cursor-font cursor bogosity} -setup {
button .b -text bogosity
} -body {
.b configure -cursor bogosity
} -cleanup {
destroy .b
} -result {}
test cursor-6.7 {check cursor-font cursor bottom_left_corner} -setup {
button .b -text bottom_left_corner
} -body {
.b configure -cursor bottom_left_corner
} -cleanup {
destroy .b
} -result {}
test cursor-6.8 {check cursor-font cursor bottom_right_corner} -setup {
button .b -text bottom_right_corner
} -body {
.b configure -cursor bottom_right_corner
} -cleanup {
destroy .b
} -result {}
test cursor-6.9 {check cursor-font cursor bottom_side} -setup {
button .b -text bottom_side
} -body {
.b configure -cursor bottom_side
} -cleanup {
destroy .b
} -result {}
test cursor-6.10 {check cursor-font cursor bottom_tee} -setup {
button .b -text bottom_tee
} -body {
.b configure -cursor bottom_tee
} -cleanup {
destroy .b
} -result {}
test cursor-6.11 {check cursor-font cursor box_spiral} -setup {
button .b -text box_spiral
} -body {
.b configure -cursor box_spiral
} -cleanup {
destroy .b
} -result {}
test cursor-6.12 {check cursor-font cursor center_ptr} -setup {
button .b -text center_ptr
} -body {
.b configure -cursor center_ptr
} -cleanup {
destroy .b
} -result {}
test cursor-6.13 {check cursor-font cursor circle} -setup {
button .b -text circle
} -body {
.b configure -cursor circle
} -cleanup {
destroy .b
} -result {}
test cursor-6.14 {check cursor-font cursor clock} -setup {
button .b -text clock
} -body {
.b configure -cursor clock
} -cleanup {
destroy .b
} -result {}
test cursor-6.15 {check cursor-font cursor coffee_mug} -setup {
button .b -text coffee_mug
} -body {
.b configure -cursor coffee_mug
} -cleanup {
destroy .b
} -result {}
test cursor-6.16 {check cursor-font cursor cross} -setup {
button .b -text cross
} -body {
.b configure -cursor cross
} -cleanup {
destroy .b
} -result {}
test cursor-6.17 {check cursor-font cursor cross_reverse} -setup {
button .b -text cross_reverse
} -body {
.b configure -cursor cross_reverse
} -cleanup {
destroy .b
} -result {}
test cursor-6.18 {check cursor-font cursor crosshair} -setup {
button .b -text crosshair
} -body {
.b configure -cursor crosshair
} -cleanup {
destroy .b
} -result {}
test cursor-6.19 {check cursor-font cursor diamond_cross} -setup {
button .b -text diamond_cross
} -body {
.b configure -cursor diamond_cross
} -cleanup {
destroy .b
} -result {}
test cursor-6.20 {check cursor-font cursor dot} -setup {
button .b -text dot
} -body {
.b configure -cursor dot
} -cleanup {
destroy .b
} -result {}
test cursor-6.21 {check cursor-font cursor dotbox} -setup {
button .b -text dotbox
} -body {
.b configure -cursor dotbox
} -cleanup {
destroy .b
} -result {}
test cursor-6.22 {check cursor-font cursor double_arrow} -setup {
button .b -text double_arrow
} -body {
.b configure -cursor double_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.23 {check cursor-font cursor draft_large} -setup {
button .b -text draft_large
} -body {
.b configure -cursor draft_large
} -cleanup {
destroy .b
} -result {}
test cursor-6.24 {check cursor-font cursor draft_small} -setup {
button .b -text draft_small
} -body {
.b configure -cursor draft_small
} -cleanup {
destroy .b
} -result {}
test cursor-6.25 {check cursor-font cursor draped_box} -setup {
button .b -text draped_box
} -body {
.b configure -cursor draped_box
} -cleanup {
destroy .b
} -result {}
test cursor-6.26 {check cursor-font cursor exchange} -setup {
button .b -text exchange
} -body {
.b configure -cursor exchange
} -cleanup {
destroy .b
} -result {}
test cursor-6.27 {check cursor-font cursor fleur} -setup {
button .b -text fleur
} -body {
.b configure -cursor fleur
} -cleanup {
destroy .b
} -result {}
test cursor-6.28 {check cursor-font cursor gobbler} -setup {
button .b -text gobbler
} -body {
.b configure -cursor gobbler
} -cleanup {
destroy .b
} -result {}
test cursor-6.29 {check cursor-font cursor gumby} -setup {
button .b -text gumby
} -body {
.b configure -cursor gumby
} -cleanup {
destroy .b
} -result {}
test cursor-6.30 {check cursor-font cursor hand1} -setup {
button .b -text hand1
} -body {
.b configure -cursor hand1
} -cleanup {
destroy .b
} -result {}
test cursor-6.31 {check cursor-font cursor hand2} -setup {
button .b -text hand2
} -body {
.b configure -cursor hand2
} -cleanup {
destroy .b
} -result {}
test cursor-6.32 {check cursor-font cursor heart} -setup {
button .b -text heart
} -body {
.b configure -cursor heart
} -cleanup {
destroy .b
} -result {}
test cursor-6.33 {check cursor-font cursor icon} -setup {
button .b -text icon
} -body {
.b configure -cursor icon
} -cleanup {
destroy .b
} -result {}
test cursor-6.34 {check cursor-font cursor iron_cross} -setup {
button .b -text iron_cross
} -body {
.b configure -cursor iron_cross
} -cleanup {
destroy .b
} -result {}
test cursor-6.35 {check cursor-font cursor left_ptr} -setup {
button .b -text left_ptr
} -body {
.b configure -cursor left_ptr
} -cleanup {
destroy .b
} -result {}
test cursor-6.36 {check cursor-font cursor left_side} -setup {
button .b -text left_side
} -body {
.b configure -cursor left_side
} -cleanup {
destroy .b
} -result {}
test cursor-6.37 {check cursor-font cursor left_tee} -setup {
button .b -text left_tee
} -body {
.b configure -cursor left_tee
} -cleanup {
destroy .b
} -result {}
test cursor-6.38 {check cursor-font cursor leftbutton} -setup {
button .b -text leftbutton
} -body {
.b configure -cursor leftbutton
} -cleanup {
destroy .b
} -result {}
test cursor-6.39 {check cursor-font cursor ll_angle} -setup {
button .b -text ll_angle
} -body {
.b configure -cursor ll_angle
} -cleanup {
destroy .b
} -result {}
test cursor-6.40 {check cursor-font cursor lr_angle} -setup {
button .b -text lr_angle
} -body {
.b configure -cursor lr_angle
} -cleanup {
destroy .b
} -result {}
test cursor-6.41 {check cursor-font cursor man} -setup {
button .b -text man
} -body {
.b configure -cursor man
} -cleanup {
destroy .b
} -result {}
test cursor-6.42 {check cursor-font cursor middlebutton} -setup {
button .b -text middlebutton
} -body {
.b configure -cursor middlebutton
} -cleanup {
destroy .b
} -result {}
test cursor-6.43 {check cursor-font cursor mouse} -setup {
button .b -text mouse
} -body {
.b configure -cursor mouse
} -cleanup {
destroy .b
} -result {}
test cursor-6.44 {check cursor-font cursor pencil} -setup {
button .b -text pencil
} -body {
.b configure -cursor pencil
} -cleanup {
destroy .b
} -result {}
test cursor-6.45 {check cursor-font cursor pirate} -setup {
button .b -text pirate
} -body {
.b configure -cursor pirate
} -cleanup {
destroy .b
} -result {}
test cursor-6.46 {check cursor-font cursor plus} -setup {
button .b -text plus
} -body {
.b configure -cursor plus
} -cleanup {
destroy .b
} -result {}
test cursor-6.47 {check cursor-font cursor question_arrow} -setup {
button .b -text question_arrow
} -body {
.b configure -cursor question_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.48 {check cursor-font cursor right_ptr} -setup {
button .b -text right_ptr
} -body {
.b configure -cursor right_ptr
} -cleanup {
destroy .b
} -result {}
test cursor-6.49 {check cursor-font cursor right_side} -setup {
button .b -text right_side
} -body {
.b configure -cursor right_side
} -cleanup {
destroy .b
} -result {}
test cursor-6.50 {check cursor-font cursor right_tee} -setup {
button .b -text right_tee
} -body {
.b configure -cursor right_tee
} -cleanup {
destroy .b
} -result {}
test cursor-6.51 {check cursor-font cursor rightbutton} -setup {
button .b -text rightbutton
} -body {
.b configure -cursor rightbutton
} -cleanup {
destroy .b
} -result {}
test cursor-6.52 {check cursor-font cursor rtl_logo} -setup {
button .b -text rtl_logo
} -body {
.b configure -cursor rtl_logo
} -cleanup {
destroy .b
} -result {}
test cursor-6.53 {check cursor-font cursor sailboat} -setup {
button .b -text sailboat
} -body {
.b configure -cursor sailboat
} -cleanup {
destroy .b
} -result {}
test cursor-6.54 {check cursor-font cursor sb_down_arrow} -setup {
button .b -text sb_down_arrow
} -body {
.b configure -cursor sb_down_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.55 {check cursor-font cursor sb_h_double_arrow} -setup {
button .b -text sb_h_double_arrow
} -body {
.b configure -cursor sb_h_double_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.56 {check cursor-font cursor sb_left_arrow} -setup {
button .b -text sb_left_arrow
} -body {
.b configure -cursor sb_left_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.57 {check cursor-font cursor sb_right_arrow} -setup {
button .b -text sb_right_arrow
} -body {
.b configure -cursor sb_right_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.58 {check cursor-font cursor sb_up_arrow} -setup {
button .b -text sb_up_arrow
} -body {
.b configure -cursor sb_up_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.59 {check cursor-font cursor sb_v_double_arrow} -setup {
button .b -text sb_v_double_arrow
} -body {
.b configure -cursor sb_v_double_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.60 {check cursor-font cursor shuttle} -setup {
button .b -text shuttle
} -body {
.b configure -cursor shuttle
} -cleanup {
destroy .b
} -result {}
test cursor-6.61 {check cursor-font cursor sizing} -setup {
button .b -text sizing
} -body {
.b configure -cursor sizing
} -cleanup {
destroy .b
} -result {}
test cursor-6.62 {check cursor-font cursor spider} -setup {
button .b -text spider
} -body {
.b configure -cursor spider
} -cleanup {
destroy .b
} -result {}
test cursor-6.63 {check cursor-font cursor spraycan} -setup {
button .b -text spraycan
} -body {
.b configure -cursor spraycan
} -cleanup {
destroy .b
} -result {}
test cursor-6.64 {check cursor-font cursor star} -setup {
button .b -text star
} -body {
.b configure -cursor star
} -cleanup {
destroy .b
} -result {}
test cursor-6.65 {check cursor-font cursor target} -setup {
button .b -text target
} -body {
.b configure -cursor target
} -cleanup {
destroy .b
} -result {}
test cursor-6.66 {check cursor-font cursor tcross} -setup {
button .b -text tcross
} -body {
.b configure -cursor tcross
} -cleanup {
destroy .b
} -result {}
test cursor-6.67 {check cursor-font cursor top_left_arrow} -setup {
button .b -text top_left_arrow
} -body {
.b configure -cursor top_left_arrow
} -cleanup {
destroy .b
} -result {}
test cursor-6.68 {check cursor-font cursor top_left_corner} -setup {
button .b -text top_left_corner
} -body {
.b configure -cursor top_left_corner
} -cleanup {
destroy .b
} -result {}
test cursor-6.69 {check cursor-font cursor top_right_corner} -setup {
button .b -text top_right_corner
} -body {
.b configure -cursor top_right_corner
} -cleanup {
destroy .b
} -result {}
test cursor-6.70 {check cursor-font cursor top_side} -setup {
button .b -text top_side
} -body {
.b configure -cursor top_side
} -cleanup {
destroy .b
} -result {}
test cursor-6.71 {check cursor-font cursor top_tee} -setup {
button .b -text top_tee
} -body {
.b configure -cursor top_tee
} -cleanup {
destroy .b
} -result {}
test cursor-6.72 {check cursor-font cursor trek} -setup {
button .b -text trek
} -body {
.b configure -cursor trek
} -cleanup {
destroy .b
} -result {}
test cursor-6.73 {check cursor-font cursor ul_angle} -setup {
button .b -text ul_angle
} -body {
.b configure -cursor ul_angle
} -cleanup {
destroy .b
} -result {}
test cursor-6.74 {check cursor-font cursor umbrella} -setup {
button .b -text umbrella
} -body {
.b configure -cursor umbrella
} -cleanup {
destroy .b
} -result {}
test cursor-6.75 {check cursor-font cursor ur_angle} -setup {
button .b -text ur_angle
} -body {
.b configure -cursor ur_angle
} -cleanup {
destroy .b
} -result {}
test cursor-6.76 {check cursor-font cursor watch} -setup {
button .b -text watch
} -body {
.b configure -cursor watch
} -cleanup {
destroy .b
} -result {}
test cursor-6.77 {check cursor-font cursor xterm} -setup {
button .b -text xterm
} -body {
.b configure -cursor xterm
} -cleanup {
destroy .b
} -result {}
# Test cursor named "none", it is not defined in
# the X cursor table. It is defined in a Tk specific
# table of named cursors and should be available on
# all platforms.
test cursor-6.78 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
.b configure -cursor none
.b cget -cursor
} -cleanup {
destroy .b
} -result none
test cursor-6.79 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
.b configure -cursor none
.b configure -cursor {}
.b cget -cursor
} -cleanup {
destroy .b
} -result {}
test cursor-6.80 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
.b configure -cursor none
.b configure -cursor {}
.b configure -cursor none
.b cget -cursor
} -cleanup {
destroy .b
} -result none
test cursor-6.81 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
# Setting fg and bg does nothing for the none cursor
# because it displays no fg or bg pixels.
set results [list]
.b configure -cursor none
lappend results [.b cget -cursor]
.b configure -cursor {none blue}
lappend results [.b cget -cursor]
.b configure -cursor {none blue green}
lappend results [.b cget -cursor]
.b configure -cursor {}
lappend results [.b cget -cursor]
set results
} -cleanup {
destroy .b
unset results
} -result {none {none blue} {none blue green} {}}
# -------------------------------------------------------------------------
# Check the Windows specific cursors
test cursor-7.1 {check Windows cursor no} -constraints win -setup {
button .b -text no
} -body {
.b configure -cursor no
} -cleanup {
destroy .b
} -result {}
test cursor-7.2 {check Windows cursor starting} -constraints win -setup {
button .b -text starting
} -body {
.b configure -cursor starting
} -cleanup {
destroy .b
} -result {}
test cursor-7.3 {check Windows cursor size} -constraints win -setup {
button .b -text size
} -body {
.b configure -cursor size
} -cleanup {
destroy .b
} -result {}
test cursor-7.4 {check Windows cursor size_ne_sw} -constraints win -setup {
button .b -text size_ne_sw
} -body {
.b configure -cursor size_ne_sw
} -cleanup {
destroy .b
} -result {}
test cursor-7.5 {check Windows cursor size_ns} -constraints win -setup {
button .b -text size_ns
} -body {
.b configure -cursor size_ns
} -cleanup {
destroy .b
} -result {}
test cursor-7.6 {check Windows cursor size_nw_se} -constraints win -setup {
button .b -text size_nw_se
} -body {
.b configure -cursor size_nw_se
} -cleanup {
destroy .b
} -result {}
test cursor-7.7 {check Windows cursor size_we} -constraints win -setup {
button .b -text size_we
} -body {
.b configure -cursor size_we
} -cleanup {
destroy .b
} -result {}
test cursor-7.8 {check Windows cursor uparrow} -constraints win -setup {
button .b -text uparrow
} -body {
.b configure -cursor uparrow
} -cleanup {
destroy .b
} -result {}
test cursor-7.9 {check Windows cursor wait} -constraints win -setup {
button .b -text wait
} -body {
.b configure -cursor wait
} -cleanup {
destroy .b
} -result {}
# -------------------------------------------------------------------------
# cleanup
cleanupTests
return
|