Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | merge trunk |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | tip-262 |
Files: | files | file ages | folders |
SHA3-256: |
5be7fdb0b39df958838ecf224703e35e |
User & Date: | dkf 2019-05-19 09:57:31.990 |
Context
2019-05-24
| ||
22:18 | Merge trunk and adjust frame tests. Closed-Leaf check-in: 64d5777d user: culler tags: tip-262 | |
2019-05-19
| ||
09:57 | merge trunk check-in: 5be7fdb0 user: dkf tags: tip-262 | |
08:17 | General cleanup of frame.test check-in: 5b36e643 user: dkf tags: trunk | |
07:33 | merge trunk check-in: f79e06d6 user: dkf tags: tip-262 | |
Changes
Changes to tests/frame.test.
|
| | | | | | | | 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 | # This file is a Tcl script to test out the "frame", "labelframe" and # "toplevel" commands of Tk. It is organized in the standard fashion for Tcl # tests. # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. package require tcltest 2.2 namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands tcltest::testConstraint x11 [expr {[tk windowingsystem] eq "x11"}] # eatColors -- # Creates a toplevel window and allocates enough colors in it to use up all # the slots in an 8-bit colormap. # # Arguments: # w - Name of toplevel window to create. proc eatColors {w} { catch {destroy $w} toplevel $w |
︙ | ︙ | |||
36 37 38 39 40 41 42 | } } update } # colorsFree -- # | | | | < | > > > > > > > > > > < < < | 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 | } } update } # colorsFree -- # # Returns 1 if there appear to be free colormap entries in a window, 0 # otherwise. # # Arguments: # w - Name of window in which to check. # red, green, blue - Intensities to use in a trial color allocation # to see if there are colormap entries free. proc colorsFree {w {red 31} {green 245} {blue 192}} { lassign [winfo rgb $w [format "#%02x%02x%02x" $red $green $blue]] r g b expr {($r/256 == $red) && ($g/256 == $green) && ($b/256 == $blue)} } # uniq -- # # Returns the unique items of a list in the order they first appear. # # Arguments: # list - The list to uniq-ify. proc uniq {list} { set d {} foreach item $list { dict set d $item {} } return [dict keys $d] } # optnames -- # # Returns the option names out of a list of option details. # # Arguments: # options - The option detail list. proc optnames {options} { lsort [lmap desc $options {lindex $desc 0}] } test frame-1.1 {frame configuration options} -setup { deleteWindows } -body { frame .f -class NewFrame .f configure -class } -cleanup { deleteWindows } -result {-class class Class Frame NewFrame} test frame-1.2 {frame configuration options} -setup { deleteWindows } -body { frame .f -class NewFrame .f configure -class Different } -returnCodes error -cleanup { deleteWindows } -result {can't modify -class option after widget is created} test frame-1.3 {frame configuration options} -setup { deleteWindows } -body { frame .f -colormap new .f configure -colormap } -cleanup { deleteWindows } -result {-colormap colormap Colormap {} new} test frame-1.4 {frame configuration options} -setup { deleteWindows } -body { frame .f -colormap new .f configure -colormap . } -returnCodes error -cleanup { deleteWindows } -result {can't modify -colormap option after widget is created} test frame-1.5 {frame configuration options} -setup { deleteWindows } -body { frame .f -visual default .f configure -visual } -cleanup { deleteWindows } -result {-visual visual Visual {} default} test frame-1.6 {frame configuration options} -setup { deleteWindows } -body { frame .f -visual default .f configure -visual best } -returnCodes error -cleanup { deleteWindows } -result {can't modify -visual option after widget is created} test frame-1.7 {frame configuration options} -setup { deleteWindows } -body { frame .f -screen bogus } -cleanup { deleteWindows } -returnCodes error -result {unknown option "-screen"} |
︙ | ︙ | |||
163 164 165 166 167 168 169 | frame .f set opts {} foreach opt [.f configure] { if {[llength $opt] == 5} { lappend opts [lindex $opt 0] [lindex $opt 4] } } | | < > | | | | 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 | frame .f set opts {} foreach opt [.f configure] { if {[llength $opt] == 5} { lappend opts [lindex $opt 0] [lindex $opt 4] } } frame .g {*}$opts } -cleanup { destroy .f .g deleteWindows } -result .g destroy .f frame .f test frame-1.13 {frame configuration options} -body { .f configure -background #ff0000 lindex [.f configure -background] 4 } -cleanup { .f configure -background [lindex [.f configure -background] 3] } -result "#ff0000" test frame-1.14 {frame configuration options} -body { .f configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-1.15 {frame configuration options} -body { .f configure -bd 4 lindex [.f configure -bd] 4 } -cleanup { .f configure -bd [lindex [.f configure -bd] 3] } -result {4} test frame-1.16 {frame configuration options} -body { .f configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-1.17 {frame configuration options} -body { .f configure -bg #00ff00 lindex [.f configure -bg] 4 } -cleanup { .f configure -bg [lindex [.f configure -bg] 3] } -result "#00ff00" test frame-1.18 {frame configuration options} -body { .f configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-1.19 {frame configuration options} -body { .f configure -borderwidth 1.3 lindex [.f configure -borderwidth] 4 } -cleanup { |
︙ | ︙ | |||
230 231 232 233 234 235 236 | .f configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-1.25 {frame configuration options} -body { .f configure -highlightbackground #112233 lindex [.f configure -highlightbackground] 4 } -cleanup { .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3] | | | | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | .f configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-1.25 {frame configuration options} -body { .f configure -highlightbackground #112233 lindex [.f configure -highlightbackground] 4 } -cleanup { .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3] } -result "#112233" test frame-1.26 {frame configuration options} -body { .f configure -highlightbackground ugly } -returnCodes error -result {unknown color name "ugly"} test frame-1.27 {frame configuration options} -body { .f configure -highlightcolor #123456 lindex [.f configure -highlightcolor] 4 } -cleanup { .f configure -highlightcolor [lindex [.f configure -highlightcolor] 3] } -result "#123456" test frame-1.28 {frame configuration options} -body { .f configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-1.29 {frame configuration options} -body { .f configure -highlightthickness 6 lindex [.f configure -highlightthickness] 4 } -cleanup { |
︙ | ︙ | |||
276 277 278 279 280 281 282 | } -returnCodes error -result {bad screen distance "badValue"} test frame-1.35 {frame configuration options} -body { .f configure -relief ridge lindex [.f configure -relief] 4 } -cleanup { .f configure -relief [lindex [.f configure -relief] 3] } -result {ridge} | | | | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | } -returnCodes error -result {bad screen distance "badValue"} test frame-1.35 {frame configuration options} -body { .f configure -relief ridge lindex [.f configure -relief] 4 } -cleanup { .f configure -relief [lindex [.f configure -relief] 3] } -result {ridge} test frame-1.36 {frame configuration options} -returnCodes error -body { .f configure -relief badValue } -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test frame-1.37 {frame configuration options} -body { .f configure -takefocus {any string} lindex [.f configure -takefocus] 4 } -cleanup { .f configure -takefocus [lindex [.f configure -takefocus] 3] } -result {any string} test frame-1.38 {frame configuration options} -body { |
︙ | ︙ | |||
311 312 313 314 315 316 317 | } -result {-class class Class Toplevel NewClass} test frame-2.2 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -class NewClass wm geometry .t +0+0 .t configure -class Another | | | | | | | < | < < < | < < < | < < < | < < < < < | | | | > > > > | | | | | | | < > | > | | | 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 | } -result {-class class Class Toplevel NewClass} test frame-2.2 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -class NewClass wm geometry .t +0+0 .t configure -class Another } -returnCodes error -cleanup { deleteWindows } -result {can't modify -class option after widget is created} test frame-2.3 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -colormap new wm geometry .t +0+0 .t configure -colormap } -cleanup { deleteWindows } -result {-colormap colormap Colormap {} new} test frame-2.4 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -colormap new wm geometry .t +0+0 .t configure -colormap . } -returnCodes error -cleanup { deleteWindows } -result {can't modify -colormap option after widget is created} test frame-2.5 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 .t configure -container 1 } -returnCodes error -cleanup { deleteWindows } -result {can't modify -container option after widget is created} test frame-2.6 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 catch {.t configure -container 1} .t configure -container } -cleanup { deleteWindows } -result {-container container Container 0 0} test frame-2.7 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -colormap bogus } -cleanup { deleteWindows } -returnCodes error -result {bad window path name "bogus"} test frame-2.8 {toplevel configuration options} -constraints win -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 .t configure -use 0x44022 } -cleanup { deleteWindows } -returnCodes error -result {window "0x44022" doesn't exist} test frame-2.9 {toplevel configuration options} -constraints win -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 catch {.t configure -use 0x44022} .t configure -use } -cleanup { deleteWindows } -result {-use use Use {} {}} test frame-2.10 {toplevel configuration options} -constraints nonwin -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 .t configure -use 0x44022 } -cleanup { deleteWindows } -returnCodes error -result {can't modify -use option after widget is created} test frame-2.11 {toplevel configuration options} -constraints nonwin -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 wm geometry .t +0+0 catch {.t configure -use 0x44022} .t configure -use } -cleanup { deleteWindows } -result {-use use Use {} {}} test frame-2.12 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -visual default wm geometry .t +0+0 .t configure -visual } -cleanup { deleteWindows } -result {-visual visual Visual {} default} test frame-2.13 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -visual default wm geometry .t +0+0 .t configure -visual best } -returnCodes error -cleanup { deleteWindows } -result {can't modify -visual option after widget is created} test frame-2.14 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -visual who_knows? } -returnCodes error -cleanup { deleteWindows } -result {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default} set expectedScreen "" if {[tcltest::testConstraint haveDISPLAY]} { set expectedScreen [list -screen screen Screen {} $env(DISPLAY)] } test frame-2.15 {toplevel configuration options} -constraints {x11 haveDISPLAY} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -screen $env(DISPLAY) wm geometry .t +0+0 .t configure -screen } -cleanup { deleteWindows } -result $expectedScreen test frame-2.16 {toplevel configuration options} -constraints {x11 haveDISPLAY} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -screen $env(DISPLAY) wm geometry .t +0+0 .t configure -screen another } -returnCodes error -cleanup { deleteWindows } -result {can't modify -screen option after widget is created} test frame-2.17 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -width 200 -height 100 -screen bogus } -cleanup { deleteWindows } -returnCodes error -result {couldn't connect to display "bogus"} test frame-2.18 {toplevel configuration options} -setup { deleteWindows } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 toplevel .x -container 1 -use [winfo id .t] } -returnCodes error -cleanup { deleteWindows } -result {windows cannot have both the -use and the -container option set} test frame-2.19 {toplevel configuration options} -setup { deleteWindows set opts {} } -body { # Make sure all options can be set to the default value toplevel .f foreach opt [.f configure] { if {[llength $opt] == 5} { lappend opts [lindex $opt 0] [lindex $opt 4] } } toplevel .g {*}$opts } -cleanup { destroy .f .g deleteWindows } -result .g destroy .t toplevel .t -width 300 -height 150 wm geometry .t +0+0 update test frame-2.20 {toplevel configuration options} -body { .t configure -background #ff0000 lindex [.t configure -background] 4 } -result "#ff0000" test frame-2.21 {toplevel configuration options} -body { .t configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.22 {toplevel configuration options} -body { .t configure -bd 4 lindex [.t configure -bd] 4 } -result {4} test frame-2.23 {toplevel configuration options} -body { .t configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.24 {toplevel configuration options} -body { .t configure -bg #00ff00 lindex [.t configure -bg] 4 } -result "#00ff00" test frame-2.25 {toplevel configuration options} -body { .t configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.26 {toplevel configuration options} -body { .t configure -borderwidth 1.3 lindex [.t configure -borderwidth] 4 } -result {1} |
︙ | ︙ | |||
535 536 537 538 539 540 541 | } -result {100} test frame-2.31 {toplevel configuration options} -body { .t configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-2.32 {toplevel configuration options} -body { .t configure -highlightcolor #123456 lindex [.t configure -highlightcolor] 4 | | | 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | } -result {100} test frame-2.31 {toplevel configuration options} -body { .t configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-2.32 {toplevel configuration options} -body { .t configure -highlightcolor #123456 lindex [.t configure -highlightcolor] 4 } -result "#123456" test frame-2.33 {toplevel configuration options} -body { .t configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.34 {toplevel configuration options} -body { .t configure -highlightthickness 3 lindex [.t configure -highlightthickness] 4 } -result {3} |
︙ | ︙ | |||
564 565 566 567 568 569 570 | test frame-2.39 {toplevel configuration options} -body { .t configure -pady badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.40 {toplevel configuration options} -body { .t configure -relief ridge lindex [.t configure -relief] 4 } -result {ridge} | | | | | | 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 | test frame-2.39 {toplevel configuration options} -body { .t configure -pady badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.40 {toplevel configuration options} -body { .t configure -relief ridge lindex [.t configure -relief] 4 } -result {ridge} test frame-2.41 {toplevel configuration options} -returnCodes error -body { .t configure -relief badValue } -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test frame-2.42 {toplevel configuration options} -body { .t configure -width 32 lindex [.t configure -width] 4 } -result {32} test frame-2.43 {toplevel configuration options} -body { .t configure -width badValue } -returnCodes error -result {bad screen distance "badValue"} destroy .t test frame-3.1 {TkCreateFrame procedure} -returnCodes error -body { frame } -result {wrong # args: should be "frame pathName ?-option value ...?"} test frame-3.2 {TkCreateFrame procedure} -setup { deleteWindows frame .f } -body { .f configure -class } -cleanup { deleteWindows |
︙ | ︙ | |||
665 666 667 668 669 670 671 | wm geometry .t +0+0 toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green tkwait visibility .x list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] } -cleanup { | | | | | | | 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | wm geometry .t +0+0 toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green tkwait visibility .x list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] } -cleanup { # This call to update idletasks was added to prevent a crash that was # observed on OSX 10.12 (Sierra) only. Any change, such as using the # Development version to make debugging symbols available, adding a print # statement, or calling update idletasks here, would make the test pass # with no segfault. update idletasks deleteWindows } -result {0 0 140 300} test frame-3.10 {TkCreateFrame procedure, -use option} -constraints { unix } -setup { deleteWindows |
︙ | ︙ | |||
692 693 694 695 696 697 698 | list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] } -cleanup { destroy .t option clear } -result {0 0 140 300} | | | | < | | | | | | | | | | | | | | | | | | < | | < | | 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 844 845 846 847 848 849 850 851 852 | list [expr {[winfo rootx .x] - [winfo rootx .t]}] \ [expr {[winfo rooty .x] - [winfo rooty .t]}] \ [winfo width .t] [winfo height .t] } -cleanup { destroy .t option clear } -result {0 0 140 300} # The tests below require specific display characteristics (i.e. that they are # run on a pseudocolor display of depth 8). Even so, they are non-portable: # some machines don't seem to ever run out of colors. if {[testConstraint defaultPseudocolor8]} { eatColors .t1 } test frame-3.11 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 wm geometry .t +0+0 update colorsFree .t } -cleanup { destroy .t } -result {0} test frame-3.12 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 -colormap new wm geometry .t +0+0 update colorsFree .t } -cleanup { destroy .t } -result {1} test frame-3.13 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { option add *t.class Toplevel2 option add *Toplevel2.colormap new toplevel .t -width 300 -height 200 -bg #475601 wm geometry .t +0+0 update option clear colorsFree .t } -cleanup { destroy .t } -result {1} test frame-3.14 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { option add *t.class Toplevel3 option add *Toplevel3.Colormap new toplevel .t -width 300 -height 200 -bg #475601 -colormap new wm geometry .t +0+0 update option clear colorsFree .t } -cleanup { destroy .t } -result {1} test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints { defaultPseudocolor8 unix nonPortable } -setup { destroy .t } -body { toplevel .t -container 1 -width 300 -height 120 wm geometry .t +0+0 toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green -colormap new tkwait visibility .x list [colorsFree .t] [colorsFree .x] } -cleanup { destroy .t } -result {0 1} test frame-3.16 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 -visual default wm geometry .t +0+0 update colorsFree .t } -cleanup { destroy .t } -result {0} test frame-3.17 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { toplevel .t -width 300 -height 200 -bg #475601 -visual default \ -colormap new wm geometry .t +0+0 update colorsFree .t } -cleanup { destroy .t } -result {1} test frame-3.18 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { destroy .t } -body { toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343 wm geometry .t +0+0 update colorsFree .t 131 131 131 } -cleanup { destroy .t } -result {1} test frame-3.19 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { destroy .t } -body { option add *t.class T4 option add *T4.visual {grayscale 8} toplevel .t -width 300 -height 200 -bg #434343 wm geometry .t +0+0 update option clear list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4] } -cleanup { destroy .t } -result {1 {grayscale 8}} test frame-3.20 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { destroy .t } -body { option add *t.class T5 option add *T5.Visual {grayscale 8} toplevel .t -width 300 -height 200 -bg #434343 wm geometry .t +0+0 update option clear list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4] } -cleanup { destroy .t } -result {1 {grayscale 8}} test frame-3.21 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 haveGrayscale8 nonPortable } -setup { destroy .t } -body { toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343 wm geometry .t +0+0 update colorsFree .t 131 131 131 } -cleanup { destroy .t } -result {1} if {[testConstraint defaultPseudocolor8]} { destroy .t1 } test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup { deleteWindows } -body { |
︙ | ︙ | |||
917 918 919 920 921 922 923 | destroy .t } -body { toplevel .t .t cget -screen } -cleanup { destroy .t } -returnCodes ok -match glob -result * | < < < < < < < | 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | destroy .t } -body { toplevel .t .t cget -screen } -cleanup { destroy .t } -returnCodes ok -match glob -result * test frame-5.8 {FrameWidgetCommand procedure, configure option} -body { optnames [.f configure] } -result {-background -backgroundimage -bd -bg -bgimg -borderwidth -class -colormap -container -cursor -height -highlightbackground -highlightcolor -highlightthickness -padx -pady -relief -takefocus -tile -visual -width} test frame-5.9 {FrameWidgetCommand procedure, configure option} -body { .f configure -gorp } -returnCodes error -result {unknown option "-gorp"} test frame-5.10 {FrameWidgetCommand procedure, configure option} -body { |
︙ | ︙ | |||
1021 1022 1023 1024 1025 1026 1027 | } -cleanup { deleteWindows } -result {{} {}} # # This one fails with the dash-patch!!!! Still don't know why :-( # #test frame-8.3 {FrameCmdDeletedProc procedure} -setup { | < < | 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 | } -cleanup { deleteWindows } -result {{} {}} # # This one fails with the dash-patch!!!! Still don't know why :-( # #test frame-8.3 {FrameCmdDeletedProc procedure} -setup { # deleteWindows #} -body { # toplevel .f1 -menu .m # wm geometry .f1 +0+0 # menu .m # update # rename .f1 {} # update # list [info command .f*] [winfo children .] #} -cleanup { # deleteWindows #} -result {{} .m} test frame-9.1 {MapFrame procedure} -setup { deleteWindows } -body { toplevel .t -width 100 -height 400 |
︙ | ︙ | |||
1073 1074 1075 1076 1077 1078 1079 | pack .t2.f -side top update idletasks winfo exists .t } -cleanup { deleteWindows } -result {0} | < | < < | < > | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 | pack .t2.f -side top update idletasks winfo exists .t } -cleanup { deleteWindows } -result {0} test frame-10.1 {frame widget vs hidden commands} -setup { deleteWindows } -body { frame .t interp hide {} .t destroy .t list [winfo children .] [lsort [interp hidden]] } -result [list {} [lsort [interp hidden]]] test frame-11.1 {TkInstallFrameMenu} -setup { deleteWindows } -body { menu .m1 .m1 add cascade -menu .m1.system menu .m1.system -tearoff 0 .m1.system add command -label foo toplevel .t -menu .m1 } -cleanup { deleteWindows } -result {.t} test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup { deleteWindows catch {rename foo {}} } -body { menu .m1 .m1 add cascade -menu .m1.system menu .m1.system -tearoff 0 .m1.system add command -label foo toplevel .t rename .t foo } -cleanup { |
︙ | ︙ | |||
1129 1130 1131 1132 1133 1134 1135 | test frame-12.2 {FrameWorldChanged procedure} -setup { deleteWindows } -body { # Test all -labelanchor positions set font {helvetica 12} labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \ -text "Mupp" | | | < < | | | > | 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 | test frame-12.2 {FrameWorldChanged procedure} -setup { deleteWindows } -body { # Test all -labelanchor positions set font {helvetica 12} labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \ -text "Mupp" set fh [expr {max([font metrics $font -linespace] + 2 - 3, 0)}] set fw [expr {max([font measure $font "Mupp"] + 2 - 3, 0)}] place .f -x 0 -y 0 -width 100 -height 100 pack [frame .f.f] -fill both -expand 1 set result {} foreach lp {nw n ne en e es se s sw ws w wn} { .f configure -labelanchor $lp update set expx 5 set expy 6 set expw 90 set exph 88 switch -glob $lp { n* {incr expy $fh ; incr exph -$fh} s* {incr exph -$fh} w* {incr expx $fw ; incr expw -$fw} e* {incr expw -$fw} } lappend result [expr { [winfo x .f.f] == $expx && [winfo y .f.f] == $expy && [winfo width .f.f] == $expw && [winfo height .f.f] == $exph }] } return $result } -cleanup { deleteWindows } -result {1 1 1 1 1 1 1 1 1 1 1 1} test frame-12.3 {FrameWorldChanged procedure} -setup { deleteWindows |
︙ | ︙ | |||
1191 1192 1193 1194 1195 1196 1197 | deleteWindows } -result {-class class Class Labelframe NewFrame} test frame-13.2 {labelframe configuration options} -setup { deleteWindows } -body { labelframe .f -class NewFrame .f configure -class Different | | | | 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 | deleteWindows } -result {-class class Class Labelframe NewFrame} test frame-13.2 {labelframe configuration options} -setup { deleteWindows } -body { labelframe .f -class NewFrame .f configure -class Different } -returnCodes error -cleanup { deleteWindows } -result {can't modify -class option after widget is created} test frame-13.3 {labelframe configuration options} -setup { deleteWindows } -body { labelframe .f -colormap new } -cleanup { deleteWindows } -result {.f} |
︙ | ︙ | |||
1242 1243 1244 1245 1246 1247 1248 | deleteWindows } -returnCodes error -result {expected boolean value but got "bogus"} test frame-13.9 {labelframe configuration options} -setup { deleteWindows } -body { labelframe .f .f configure -container 1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | deleteWindows } -returnCodes error -result {expected boolean value but got "bogus"} test frame-13.9 {labelframe configuration options} -setup { deleteWindows } -body { labelframe .f .f configure -container 1 } -returnCodes error -cleanup { deleteWindows } -result {can't modify -container option after widget is created} destroy .f labelframe .f test frame-13.10 {labelframe configuration options} -body { .f configure -background #ff0000 lindex [.f configure -background] 4 } -cleanup { .f configure -background [lindex [.f configure -background] 3] } -result "#ff0000" test frame-13.11 {labelframe configuration options} -body { .f configure -background non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.12 {labelframe configuration options} -body { .f configure -bd 4 lindex [.f configure -bd] 4 } -cleanup { .f configure -bd [lindex [.f configure -bd] 3] } -result {4} test frame-13.13 {labelframe configuration options} -body { .f configure -bd badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.14 {labelframe configuration options} -body { .f configure -bg #00ff00 lindex [.f configure -bg] 4 } -cleanup { .f configure -bg [lindex [.f configure -bg] 3] } -result "#00ff00" test frame-13.15 {labelframe configuration options} -body { .f configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.16 {labelframe configuration options} -body { .f configure -borderwidth 1.3 lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] } -result {1} test frame-13.17 {labelframe configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.18 {labelframe configuration options} -body { .f configure -cursor arrow lindex [.f configure -cursor] 4 } -cleanup { .f configure -cursor [lindex [.f configure -cursor] 3] } -result {arrow} test frame-13.19 {labelframe configuration options} -body { .f configure -cursor badValue } -returnCodes error -result {bad cursor spec "badValue"} test frame-13.20 {labelframe configuration options} -body { .f configure -fg #0000ff lindex [.f configure -fg] 4 } -cleanup { .f configure -fg [lindex [.f configure -fg] 3] } -result "#0000ff" test frame-13.21 {labelframe configuration options} -body { .f configure -fg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.22 {labelframe configuration options} -body { .f configure -font {courier 8} lindex [.f configure -font] 4 } -cleanup { .f configure -font [lindex [.f configure -font] 3] } -result {courier 8} test frame-13.23 {labelframe configuration options} -body { .f configure -foreground #ff0000 lindex [.f configure -foreground] 4 } -cleanup { .f configure -foreground [lindex [.f configure -foreground] 3] } -result "#ff0000" test frame-13.24 {labelframe configuration options} -body { .f configure -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.25 {labelframe configuration options} -body { .f configure -height 100 lindex [.f configure -height] 4 } -cleanup { .f configure -height [lindex [.f configure -height] 3] } -result {100} test frame-13.26 {labelframe configuration options} -body { .f configure -height not_a_number } -returnCodes error -result {bad screen distance "not_a_number"} test frame-13.27 {labelframe configuration options} -body { .f configure -highlightbackground #112233 lindex [.f configure -highlightbackground] 4 } -cleanup { .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3] } -result "#112233" test frame-13.28 {labelframe configuration options} -body { .f configure -highlightbackground ugly } -returnCodes error -result {unknown color name "ugly"} test frame-13.29 {labelframe configuration options} -body { .f configure -highlightcolor #123456 lindex [.f configure -highlightcolor] 4 } -cleanup { .f configure -highlightcolor [lindex [.f configure -highlightcolor] 3] } -result "#123456" test frame-13.30 {labelframe configuration options} -body { .f configure -highlightcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-13.31 {labelframe configuration options} -body { .f configure -highlightthickness 6 lindex [.f configure -highlightthickness] 4 } -cleanup { .f configure -highlightthickness [lindex [.f configure -highlightthickness] 3] } -result {6} test frame-13.32 {labelframe configuration options} -body { .f configure -highlightthickness badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.33 {labelframe configuration options} -body { .f configure -labelanchor se lindex [.f configure -labelanchor] 4 } -cleanup { .f configure -labelanchor [lindex [.f configure -labelanchor] 3] } -result {se} test frame-13.34 {labelframe configuration options} -returnCodes error -body { .f configure -labelanchor badValue } -result {bad labelanchor "badValue": must be e, en, es, n, ne, nw, s, se, sw, w, wn, or ws} test frame-13.35 {labelframe configuration options} -body { .f configure -padx 3 lindex [.f configure -padx] 4 } -cleanup { .f configure -padx [lindex [.f configure -padx] 3] } -result {3} test frame-13.36 {labelframe configuration options} -body { .f configure -padx badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.37 {labelframe configuration options} -body { .f configure -pady 4 lindex [.f configure -pady] 4 } -cleanup { .f configure -pady [lindex [.f configure -pady] 3] } -result {4} test frame-13.38 {labelframe configuration options} -body { .f configure -pady badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-13.39 {labelframe configuration options} -body { .f configure -relief ridge lindex [.f configure -relief] 4 } -cleanup { .f configure -relief [lindex [.f configure -relief] 3] } -result {ridge} test frame-13.40 {labelframe configuration options} -returnCodes error -body { .f configure -relief badValue } -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken} test frame-13.41 {labelframe configuration options} -body { .f configure -takefocus {any string} lindex [.f configure -takefocus] 4 } -cleanup { .f configure -takefocus [lindex [.f configure -takefocus] 3] } -result {any string} test frame-13.42 {labelframe configuration options} -body { .f configure -text {any string} lindex [.f configure -text] 4 } -cleanup { .f configure -text [lindex [.f configure -text] 3] } -result {any string} test frame-13.43 {labelframe configuration options} -body { .f configure -width 32 lindex [.f configure -width] 4 } -cleanup { .f configure -width [lindex [.f configure -width] 3] } -result {32} test frame-13.44 {labelframe configuration options} -body { .f configure -width badValue } -returnCodes error -result {bad screen distance "badValue"} destroy .f test frame-14.1 {labelframe labelwidget option} -setup { deleteWindows } -body { # Test that label is moved in stacking order |
︙ | ︙ | |||
1504 1505 1506 1507 1508 1509 1510 | lappend res [expr {[winfo width .f] > $first}] } -cleanup { deleteWindows } -result {12 12 1 12 1} test frame-14.6 {labelframe labelwidget option} -setup { deleteWindows } -body { | | | | | < < < | 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 | lappend res [expr {[winfo width .f] > $first}] } -cleanup { deleteWindows } -result {12 12 1 12 1} test frame-14.6 {labelframe labelwidget option} -setup { deleteWindows } -body { # Destroying a labelframe with a child label caused a crash when not # handling mapping of the label correctly. # This test does not test anything directly, it's just ment to catch if # the same mistake is made again. labelframe .f pack .f label .f.l -text Mupp .f configure -labelwidget .f.l update } -cleanup { deleteWindows } -result {} test frame-15.1 {TIP 262: frame background images} -setup { deleteWindows image create photo gorp -width 10 -height 10 gorp put black -to 2 2 7 7 } -body { frame .f -width 100 -height 100 |
︙ | ︙ | |||
1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 | return [uniq $result] } -cleanup { deleteWindows catch {image delete gorp} } -result {{gorp get} {gorp display 0 0 30 15} {gorp display 0 0 30 10} {gorp display 0 0 20 15} {gorp display 0 0 20 10}} # cleanup cleanupTests return # Local Variables: # mode: tcl # End: | > > > > > | 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 | return [uniq $result] } -cleanup { deleteWindows catch {image delete gorp} } -result {{gorp get} {gorp display 0 0 30 15} {gorp display 0 0 30 10} {gorp display 0 0 20 15} {gorp display 0 0 20 10}} # cleanup deleteWindows apply {cmds {foreach cmd $cmds {rename $cmd {}}}} { eatColors colorsFree uniq optnames } cleanupTests return # Local Variables: # mode: tcl # End: |