summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-05-31 05:22:05 (GMT)
committerhobbs <hobbs>2005-05-31 05:22:05 (GMT)
commitfc78e34773eccf9b18da80e95c97c21a9f95bdb7 (patch)
tree3ef6cf82a65462c23f70bf33cb38492c0044e91c /tests
parent953aa290e058aea0a6289ac56b5be357466d470c (diff)
downloadtk-fc78e34773eccf9b18da80e95c97c21a9f95bdb7.zip
tk-fc78e34773eccf9b18da80e95c97c21a9f95bdb7.tar.gz
tk-fc78e34773eccf9b18da80e95c97c21a9f95bdb7.tar.bz2
* generic/tkPanedWindow.c, tests/panedwindow.test: batch of fixes
to panedwindow from Daniel South. Improved auto-size to fit internal windows, fixed sash placement at edge of pane, fixed calculation of stretch amount for internal windows. [Bug 1124198 1161543 1054117 1010941 795869 690169 1192323]
Diffstat (limited to 'tests')
-rw-r--r--tests/panedwindow.test60
1 files changed, 58 insertions, 2 deletions
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index e4347c0..dd4d9a2 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: panedwindow.test,v 1.8.2.3 2004/05/03 19:17:39 hobbs Exp $
+# RCS: @(#) $Id: panedwindow.test,v 1.8.2.4 2005/05/31 05:22:06 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -1895,6 +1895,52 @@ test panedwindow-22.13 {ArrangePanes, last pane shrinks} {
destroy .p .f1 .f2
set result
} 18
+test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
+ -body {
+ panedwindow .p -width 200 -borderwidth 0
+ frame .f1 -height 50 -bg blue
+ set result [list]
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ .p add .f1
+ pack .p
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ }
+ -cleanup {destroy .p .f1}
+ -result {200 1 200 50}
+}
+test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
+ -body {
+ panedwindow .p -height 200 -borderwidth 0 -orient vertical
+ frame .f1 -width 50 -bg blue
+ set result [list]
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ .p add .f1
+ pack .p
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ }
+ -cleanup {destroy .p .f1}
+ -result {1 200 50 200}
+}
+test panedwindow-22.16 {ArrangePanes, last pane grows} {
+ -body {
+ panedwindow .p -showhandle false -height 50
+ .p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
+ [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
+ .p sash place 1 250 0
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
+ .p configure -width 300
+ update
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
+ }
+ -cleanup {destroy .p .f1 .f2 .f3 .f4}
+ -result {50 150 1 1 222 50 150 1 78 300}
+}
+
test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
# Basically just want to make sure that the PanedWindowReqProc is called
@@ -1907,6 +1953,16 @@ test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
destroy .p .f1 .f2
set result
} {40 80}
+test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} {
+ panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
+ .p add [frame .f1 -width 10] [frame .f2 -width 10]
+ set result [winfo reqwidth .p]
+ .f1 configure -width 20
+ lappend result [winfo reqwidth .p]
+ destroy .p .f1 .f2
+ expr {[lindex $result 1] - [lindex $result 0]}
+} {10}
+
test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} {
panedwindow .p
@@ -2337,7 +2393,7 @@ test panedwindow-27.14 {identify subcommand errors} {
destroy .p
set result
} [list 1 "expected integer but got \"foo\""]
-test panedwindow-27.14 {identify subcommand errors} {
+test panedwindow-27.14a {identify subcommand errors} {
panedwindow .p
set result [list [catch {.p identify 0 bar} msg] $msg]
destroy .p