6
6
# Copyright (c) 1998-1999 by Scriptics Corporation.
7
7
# All rights reserved.
9
# RCS: @(#) $Id: panedwindow.test,v 1.8.2.3 2004/05/03 19:17:39 hobbs Exp $
9
# RCS: @(#) $Id: panedwindow.test,v 1.8.2.4 2005/05/31 05:22:06 hobbs Exp $
11
11
package require tcltest 2.1
12
12
namespace import -force tcltest::configure
1895
1895
destroy .p .f1 .f2
1898
test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
1900
panedwindow .p -width 200 -borderwidth 0
1901
frame .f1 -height 50 -bg blue
1903
lappend result [winfo reqwidth .p] [winfo reqheight .p]
1906
lappend result [winfo reqwidth .p] [winfo reqheight .p]
1908
-cleanup {destroy .p .f1}
1909
-result {200 1 200 50}
1911
test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
1913
panedwindow .p -height 200 -borderwidth 0 -orient vertical
1914
frame .f1 -width 50 -bg blue
1916
lappend result [winfo reqwidth .p] [winfo reqheight .p]
1919
lappend result [winfo reqwidth .p] [winfo reqheight .p]
1921
-cleanup {destroy .p .f1}
1922
-result {1 200 50 200}
1924
test panedwindow-22.16 {ArrangePanes, last pane grows} {
1926
panedwindow .p -showhandle false -height 50
1927
.p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
1928
[frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
1929
.p sash place 1 250 0
1933
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
1934
[winfo width .f4] [winfo width .p]
1935
.p configure -width 300
1937
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
1938
[winfo width .f4] [winfo width .p]
1940
-cleanup {destroy .p .f1 .f2 .f3 .f4}
1941
-result {50 150 1 1 222 50 150 1 78 300}
1899
1945
test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
1900
1946
# Basically just want to make sure that the PanedWindowReqProc is called
1907
1953
destroy .p .f1 .f2
1956
test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} {
1957
panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
1958
.p add [frame .f1 -width 10] [frame .f2 -width 10]
1959
set result [winfo reqwidth .p]
1960
.f1 configure -width 20
1961
lappend result [winfo reqwidth .p]
1963
expr {[lindex $result 1] - [lindex $result 0]}
1911
1967
test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} {
2339
2395
} [list 1 "expected integer but got \"foo\""]
2340
test panedwindow-27.14 {identify subcommand errors} {
2396
test panedwindow-27.14a {identify subcommand errors} {
2342
2398
set result [list [catch {.p identify 0 bar} msg] $msg]