summaryrefslogtreecommitdiffstats
path: root/tests/button.test
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-02 23:32:35 (GMT)
committerhobbs <hobbs>2002-09-02 23:32:35 (GMT)
commit88426baa4bb76cec3887e6901f546dc492cdc29c (patch)
tree13a9357525ccdb65475757c44cf489c1b3da1493 /tests/button.test
parentc08fb932b2dfb648827eb09a3631db10ef7c6fd8 (diff)
downloadtk-88426baa4bb76cec3887e6901f546dc492cdc29c.zip
tk-88426baa4bb76cec3887e6901f546dc492cdc29c.tar.gz
tk-88426baa4bb76cec3887e6901f546dc492cdc29c.tar.bz2
* tests/button.test: added button-14.1
* win/tkWinButton.c (TkpComputeButtonGeometry): correct Win button sizing to be equal for one-line buttons with -height of 0 or 1, as well as -height 0 buttons with empty text and no image, which should be the same as single-line text buttons. [Bug #565485]
Diffstat (limited to 'tests/button.test')
-rw-r--r--tests/button.test32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/button.test b/tests/button.test
index d7f9028..794c7b4 100644
--- a/tests/button.test
+++ b/tests/button.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: button.test,v 1.12 2002/07/14 05:48:46 dgp Exp $
+# RCS: @(#) $Id: button.test,v 1.13 2002/09/02 23:32:35 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -775,6 +775,36 @@ test button-13.1 {button widget vs hidden commands} {
deleteWindows
+test button-14.1 {size behaviouor} {
+ set res {}
+ foreach class {label button radiobutton checkbutton} {
+ eval destroy [winfo children .]
+
+ $class .a -text Hej
+ $class .b -text Hej -width 10 -height 1
+ $class .c -text "" -width 10 -height 1
+
+ for {set t 0} {$t < 2} {incr t} {
+ set res2 {}
+ # With -width, width should not be affected by text change
+ lappend res2 [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+ # With -height, height should not be affected by text change
+ lappend res2 [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+ # A one line text should be as high as -height 1
+ lappend res2 [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+ lappend res $res2
+
+ # Do the second round with another font
+ .a configure -font "Arial 20"
+ .b configure -font "Arial 20"
+ .c configure -font "Arial 20"
+ }
+ }
+ set res
+} {{1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1}}
+
+deleteWindows
+
option clear
# cleanup