~ubuntu-branches/ubuntu/gutsy/tk8.4/gutsy-updates

« back to all changes in this revision

Viewing changes to tests/panedwindow.test

  • Committer: Bazaar Package Importer
  • Author(s): Chris Waters
  • Date: 2005-09-06 14:35:13 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050906143513-7ns3rwufmpiq871b
Tags: 8.4.11-1
* New upstream release.
* Needed to fix mechanism for picking up SONAME.  Now uses special
  macro, TK_SHLIB_LD_EXTRAS, and only for Linux, Hurd and DebianBSD.
* Fixed some possible-bashisms in preinst.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# Copyright (c) 1998-1999 by Scriptics Corporation.
7
7
# All rights reserved.
8
8
#
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 $
10
10
 
11
11
package require tcltest 2.1
12
12
namespace import -force tcltest::configure
1895
1895
    destroy .p .f1 .f2
1896
1896
    set result
1897
1897
} 18
 
1898
test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
 
1899
    -body {
 
1900
        panedwindow .p -width 200 -borderwidth 0
 
1901
        frame .f1 -height 50 -bg blue
 
1902
        set result [list]
 
1903
        lappend result [winfo reqwidth .p] [winfo reqheight .p]
 
1904
        .p add .f1
 
1905
        pack .p
 
1906
        lappend result [winfo reqwidth .p] [winfo reqheight .p]
 
1907
    }
 
1908
    -cleanup {destroy .p .f1}
 
1909
    -result {200 1 200 50}
 
1910
}
 
1911
test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
 
1912
    -body {
 
1913
        panedwindow .p -height 200 -borderwidth 0 -orient vertical
 
1914
        frame .f1 -width 50 -bg blue
 
1915
        set result [list]
 
1916
        lappend result [winfo reqwidth .p] [winfo reqheight .p]
 
1917
        .p add .f1
 
1918
        pack .p
 
1919
        lappend result [winfo reqwidth .p] [winfo reqheight .p]
 
1920
    }
 
1921
    -cleanup {destroy .p .f1}
 
1922
    -result {1 200 50 200}
 
1923
}
 
1924
test panedwindow-22.16 {ArrangePanes, last pane grows} {
 
1925
    -body {
 
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
 
1930
        pack .p
 
1931
        update
 
1932
        set result [list]
 
1933
        lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
 
1934
                [winfo width .f4] [winfo width .p]
 
1935
        .p configure -width 300
 
1936
        update
 
1937
        lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
 
1938
                [winfo width .f4] [winfo width .p]
 
1939
    }
 
1940
    -cleanup {destroy .p .f1 .f2 .f3 .f4}
 
1941
    -result {50 150 1 1 222 50 150 1 78 300}
 
1942
}
 
1943
 
1898
1944
 
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
1908
1954
    set result
1909
1955
} {40 80}
 
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]
 
1962
    destroy .p .f1 .f2
 
1963
    expr {[lindex $result 1] - [lindex $result 0]}
 
1964
} {10}
 
1965
 
1910
1966
 
1911
1967
test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} {
1912
1968
    panedwindow .p
2337
2393
    destroy .p
2338
2394
    set result
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} {
2341
2397
    panedwindow .p
2342
2398
    set result [list [catch {.p identify 0 bar} msg] $msg]
2343
2399
    destroy .p