head	1.24;
access;
symbols
	core-8-5-9:1.18.4.3
	core-8-5-8:1.18.4.2
	macosx-cocoa-merge:1.23
	macosx-cocoa-premerge:1.23
	macosx-carbon-freeze:1.23
	core-8-5-7:1.18
	core-8-5-6:1.18
	core-8-6-b1:1.21
	core-8-6-a3:1.21
	core-8-5-5:1.18
	core-8-6-a2:1.19
	core-8-5-4:1.18
	core-8-5-3:1.18
	core-8-6-a1:1.18
	core-8-4-19:1.9.2.4
	core-8-5-branch:1.18.0.4
	core-8-5-2:1.18
	core-8-4-18:1.9.2.4
	core-8-5-1:1.18
	core-8-4-17:1.9.2.4
	core-8-5-0:1.18
	core-8-5-b3:1.18
	core-8-5-b2:1.18
	core-8-4-16:1.9.2.4
	core-8-5-b1:1.18
	core-stablilizer-merge:1.18
	core-stabilizer-branch:1.18.0.2
	core-stabilizer-merge:1.18
	core-8-4-15:1.9.2.4
	core-8-5-a6:1.18
	core-8-5-a5:1.17
	core-8-4-14:1.9.2.3
	core-8-5-a4:1.16
	core-8-4-13:1.9.2.3
	core-8-4-12:1.9.2.3
	core-8-4-11:1.9.2.3
	core-8-5-a3:1.16
	core-8-4-10:1.9.2.3
	core-8-4-9-branch:1.9.2.3.0.2
	core-8-5-a2:1.15
	core-8-4-9:1.9.2.3
	core-8-4-8:1.9.2.3
	core-8-4-7:1.9
	core-8-5-a1:1.10
	core-8-4-6:1.9
	core-8-4-5:1.9
	mistachkin-dev-branch:1.10.0.2
	core-8-4-4:1.9
	core-8-4-3:1.9
	core-8-4-branch:1.9.0.2
	core-8-4-2:1.9
	core-8-4-1:1.9
	core-8-3-5:1.4
	core-8-4-0:1.9
	macosx-8-4-merge-2002-08-31-trunk:1.9
	macosx-8-4-premerge-2002-08-31-branch:1.4.8.1
	macosx-8-4-premerge-2002-08-31-trunk:1.9
	macosx-8-4-merge-2002-08-30-branch:1.4.8.1
	macosx-8-4-merge-2002-08-30-trunk:1.9
	macosx-8-4-merge-2002-08-20-branch:1.4.8.1
	macosx-8-4-merge-2002-08-20-trunk:1.9
	core-8-4-b2:1.9
	core-8-4-b1:1.6
	macosx-premerge-6-9-02:1.4
	core-8-4-a4:1.4
	core-8-3-4:1.4
	macosx-8-4-branch:1.4.0.8
	macosx-8-4-branchpoint:1.4
	core-8-4-a3:1.4
	core-8-3-3:1.4
	dgp-privates-into-namespace:1.4.0.6
	tclpro-1-5-0:1.4
	core-8-4-win-speedup:1.4.0.4
	core-8-4-a2:1.4
	tclpro-1-4-1:1.4
	tclpro-1-4-0:1.4
	core-8-3-2:1.4
	ajuba-ajuba2-2-1-base:1.4
	ajuba-ajuba2-2-0:1.4
	core-8-4-a1:1.4
	core-8-3-1-branch:1.4.0.2
	core-8-3-1:1.4
	scriptics-sc-2-0-b5:1.4
	scriptics-sc-2-0-fixed:1.4
	scriptics-sc-2-0-b2:1.4
	scriptics-sc-2-0-b1:1.4
	core-8-3-0:1.4
	core-8-3-b2:1.4
	core-8-3-b1:1.3
	scriptics-sc-1-1:1.3
	scriptics-sc-1-1-b1:1.3
	core-8-2-3:1.3
	scriptics-sc-1-1-branch:1.3.0.10
	scriptics-sc-1-1-base:1.3
	scriptics-sc-1-0:1.3
	scriptics-sc-1-0-branch:1.3.0.8
	scriptics-sc-1-0-base:1.3
	core-8-2-2:1.3
	core-8-2-1:1.3
	scriptics-bc-1-0-b1:1.3
	core-8-2-1-branch:1.3.0.6
	scriptics-tclpro-1-3-0:1.3
	core-8-2-0:1.3
	core-8-2-b3-branch:1.3.0.4
	core-8-2-b3-base:1.3
	scriptics-tclpro-1-3-b4:1.3
	core-8-2-b2:1.3
	scriptics-tclpro-1-3-b3:1.3
	core-8-2-b1:1.3
	scriptics-tclpro-1-3-b2:1.3
	merge-to-mainline-5/21/99:1.3
	scriptics-tclpro-1-3-b2-branch:1.3.0.2
	core-8-1-1:1.3
	scriptics-tclpro-1-3-b1:1.3
	core-8-1-1-base:1.3
	core-8-1-0:1.3
	merge-to-mainline-4-29-99:1.3
	merge-to-mainline-4-23-99:1.3
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.4
	core-8-1-b2:1.1.4.2
	dev-8-1-stubs-branch:1.1.4.1.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.1
	core-8-0-4:1.2
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.24
date	2009.09.30.22.52.32;	author patthoyts;	state Exp;
branches;
next	1.23;

1.23
date	2009.06.13.12.02.14;	author dgp;	state Exp;
branches;
next	1.22;

1.22
date	2009.06.02.09.26.57;	author patthoyts;	state Exp;
branches;
next	1.21;

1.21
date	2008.10.06.23.13.19;	author patthoyts;	state Exp;
branches;
next	1.20;

1.20
date	2008.08.30.21.52.26;	author aniap;	state Exp;
branches;
next	1.19;

1.19
date	2008.07.23.23.24.24;	author nijtmans;	state Exp;
branches;
next	1.18;

1.18
date	2006.12.01.19.48.00;	author hobbs;	state Exp;
branches
	1.18.4.1;
next	1.17;

1.17
date	2006.10.17.10.21.50;	author patthoyts;	state Exp;
branches;
next	1.16;

1.16
date	2005.02.17.00.06.08;	author mdejong;	state Exp;
branches;
next	1.15;

1.15
date	2004.12.04.00.04.43;	author dkf;	state Exp;
branches;
next	1.14;

1.14
date	2004.10.05.22.04.46;	author hobbs;	state Exp;
branches;
next	1.13;

1.13
date	2004.09.17.23.26.21;	author hobbs;	state Exp;
branches;
next	1.12;

1.12
date	2004.09.17.22.44.34;	author hobbs;	state Exp;
branches;
next	1.11;

1.11
date	2004.06.24.12.45.44;	author dkf;	state Exp;
branches;
next	1.10;

1.10
date	2003.04.01.21.07.02;	author dgp;	state Exp;
branches;
next	1.9;

1.9
date	2002.07.25.21.35.23;	author pspjuth;	state Exp;
branches
	1.9.2.1;
next	1.8;

1.8
date	2002.07.13.20.28.36;	author dgp;	state Exp;
branches;
next	1.7;

1.7
date	2002.07.12.13.41.01;	author dgp;	state Exp;
branches;
next	1.6;

1.6
date	2002.06.24.20.34.40;	author mdejong;	state Exp;
branches;
next	1.5;

1.5
date	2002.06.22.10.13.26;	author hobbs;	state Exp;
branches;
next	1.4;

1.4
date	2000.01.12.11.45.36;	author hobbs;	state Exp;
branches
	1.4.8.1;
next	1.3;

1.3
date	99.04.16.01.51.44;	author stanton;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.23.53;	author stanton;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.58.21;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.19.08;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	99.03.11.18.51.23;	author hershey;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	99.03.24.01.17.20;	author hershey;	state Exp;
branches;
next	1.1.4.4;

1.1.4.4
date	99.03.24.02.55.15;	author hershey;	state Exp;
branches;
next	;

1.4.8.1
date	2002.08.20.20.27.16;	author das;	state Exp;
branches;
next	;

1.9.2.1
date	2004.09.17.22.45.07;	author hobbs;	state Exp;
branches;
next	1.9.2.2;

1.9.2.2
date	2004.09.17.23.45.57;	author hobbs;	state Exp;
branches;
next	1.9.2.3;

1.9.2.3
date	2004.10.05.22.27.27;	author hobbs;	state Exp;
branches;
next	1.9.2.4;

1.9.2.4
date	2006.12.01.19.47.42;	author hobbs;	state Exp;
branches;
next	;

1.18.4.1
date	2009.06.02.09.41.42;	author patthoyts;	state Exp;
branches;
next	1.18.4.2;

1.18.4.2
date	2009.06.23.14.26.49;	author dgp;	state Exp;
branches;
next	1.18.4.3;

1.18.4.3
date	2009.11.22.23.28.36;	author patthoyts;	state Exp;
branches;
next	;


desc
@@


1.24
log
@[Bug 2799589] added a test for grab on deleted window which
causes crashes on windows (fixed already).
@
text
@# This file tests  is a Tcl script to test the procedures in the file
# tkWinWm.c.  It is organized in the standard fashion for Tcl tests.
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands.  Sourcing this file into Tcl runs the tests and
# generates output for errors.  No output means no errors were found.
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @@(#) $Id: winWm.test,v 1.23 2009/06/13 12:02:14 dgp Exp $

package require tcltest 2.2
namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands


test winWm-1.1 {TkWmMapWindow} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm override .t 1
    wm geometry .t +0+0
    update
    list [winfo rootx .t] [winfo rooty .t]
} -cleanup {
    destroy .t
} -result {0 0}
test winWm-1.2 {TkWmMapWindow} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm transient .t .
    update
    wm iconify .
    update
    wm deiconify .
    update
    wm iconify .t
} -cleanup {
    destroy .t
} -returnCodes error -result {can't iconify ".t": it is a transient}
test winWm-1.3 {TkWmMapWindow} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    update
    toplevel .t2
    update
    expr {[winfo x .t] != [winfo x .t2]}
} -cleanup {
    destroy .t .t2
} -result 1
test winWm-1.4 {TkWmMapWindow} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm geometry .t +10+10
    update
    toplevel .t2
    wm geometry .t2 +40+10
    update
    list [winfo x .t] [winfo x .t2]
} -cleanup {
    destroy .t .t2
} -result {10 40}
test winWm-1.5 {TkWmMapWindow} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm iconify .t
    update
    wm state .t
} -result {iconic}


test winWm-2.1 {TkpWmSetState} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm geometry .t 150x50+10+10
    update
    set result [wm state .t]
    wm iconify .t
    update
    lappend result [wm state .t]
    wm deiconify .t
    update
    lappend result [wm state .t]
} -cleanup {
    destroy .t
} -result {normal iconic normal}
test winWm-2.2 {TkpWmSetState} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm geometry .t 150x50+10+10
    update
    set result [wm state .t]
    wm withdraw .t
    update
    lappend result [wm state .t]
    wm iconify .t
    update
    lappend result [wm state .t]
    wm deiconify .t
    update
    lappend result [wm state .t]
} -cleanup {
    destroy .t
} -result {normal withdrawn iconic normal}
test winWm-2.3 {TkpWmSetState} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm geometry .t 150x50+10+10
    update
    set result [wm state .t]
    wm state .t withdrawn
    update
    lappend result [wm state .t]
    wm state .t iconic
    update
    lappend result [wm state .t]
    wm state .t normal
    update
    lappend result [wm state .t]
} -cleanup {
    destroy .t
} -result {normal withdrawn iconic normal}
test winWm-2.4 {TkpWmSetState} -constraints win -setup {
    destroy .t
    set result {}
} -body {
    toplevel .t
    wm geometry .t 150x50+10+10
    update
    lappend result [list [wm state .t] [wm geometry .t]]
    wm iconify .t
    update
    lappend result [list [wm state .t] [wm geometry .t]]
    wm geometry .t 200x50+10+10
    update
    lappend result [list [wm state .t] [wm geometry .t]]
    wm deiconify .t
    update
    lappend result [list [wm state .t] [wm geometry .t]]
} -cleanup {
    destroy .t
} -result {{normal 150x50+10+10} {iconic 150x50+10+10} {iconic 150x50+10+10} {normal 200x50+10+10}}


test winWm-3.1 {ConfigureTopLevel: window geometry propagation} -constraints {
    win
} -setup {
    destroy .t
} -body {
    toplevel .t
    wm geometry .t +0+0
    button .t.b
    pack .t.b
    update
    set x [winfo x .t.b]
    destroy .t
    toplevel .t
    wm geometry .t +0+0
    button .t.b
    update
    pack .t.b
    update
    expr {$x == [winfo x .t.b]}
} -cleanup {
    destroy .t
} -result 1


test winWm-4.1 {ConfigureTopLevel: menu resizing} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    frame .t.f -width 100 -height 50
    pack .t.f
    menu .t.m
    .t.m add command -label "thisisreallylong"
    .t configure -menu .t.m
    wm geometry .t -0-0
    update
    set menuheight [winfo y .t]
    .t.m add command -label "thisisreallylong"
    wm geometry .t -0-0
    update
    set menuheight [expr {$menuheight - [winfo y .t]}]
    destroy .t

    toplevel .t
    frame .t.f -width 150 -height 50 -background red
    pack .t.f
    wm geometry .t -0-0
    update
    set y [winfo y .t]
    menu .t.m
    .t.m add command -label foo
    .t configure -menu .t.m
    update
    expr {$y - [winfo y .t]  eq  $menuheight + 1}
} -cleanup {
    destroy .t
} -result 1


# This test works on 8.0p2 but has not worked on anything since 8.2.
# It would be very strange to have a windows application increase the size
# of the clientarea when a menu wraps so I believe this test to be wrong.
# Original result was {50 50 50} new result may depend on the default menu
# font
test winWm-5.1 {UpdateGeometryInfo: menu resizing} -constraints win -setup {
    destroy .t
    set result {}
} -body {
    toplevel .t
    frame .t.f -width 150 -height 50 -background red
    pack .t.f
    update
    set result [winfo height .t]
    menu .t.m
    .t.m add command -label foo
    .t configure -menu .t.m
    update
    lappend result [winfo height .t]
    .t.m add command -label "thisisreallylong"
    .t.m add command -label "thisisreallylong"
    update
    lappend result [winfo height .t]
} -cleanup {
    destroy .t
} -result {50 50 31}
test winWm-5.2 {UpdateGeometryInfo: menu resizing} -constraints win -setup {
    destroy .t
} -body {
    set result {}
    toplevel .t
    frame .t.f -width 150 -height 50 -background red
    pack .t.f
    wm geometry .t -0-0
    update
    set y [winfo rooty .t]
    lappend result [winfo height .t]
    menu .t.m
    .t configure -menu .t.m
    .t.m add command -label foo
    .t.m add command -label "thisisreallylong"
    .t.m add command -label "thisisreallylong"
    update
    lappend result [winfo height .t]
    lappend result [expr {$y - [winfo rooty .t]}]
    destroy .t
    return $result
} -cleanup {
    destroy .t
} -result {50 50 0}

test winWm-6.1 {wm attributes} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm attributes .t
} -cleanup {
    destroy .t
} -result {-alpha 1.0 -transparentcolor {} -disabled 0 -fullscreen 0 -toolwindow 0 -topmost 0}
test winWm-6.2 {wm attributes} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm attributes .t -disabled
} -cleanup {
    destroy .t
} -result {0}
test winWm-6.3 {wm attributes} -constraints win -setup {
    destroy .t
} -body {
    # This isn't quite the correct error message yet, but it works.
    toplevel .t
    wm attributes .t -foo
} -cleanup {
    destroy .t
} -returnCodes error -result {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-transparentcolor ?color?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}

test winWm-6.4 {wm attributes -alpha} -constraints win -setup {
    destroy .t
} -body {
    # Expect this to return all 1.0 {} on pre-2K/XP
    toplevel .t
    set res [wm attributes .t -alpha]
    # we don't return on set yet
    lappend res [wm attributes .t -alpha 0.5]
    lappend res [wm attributes .t -alpha]
    lappend res [wm attributes .t -alpha -100]
    lappend res [wm attributes .t -alpha]
    lappend res [wm attributes .t -alpha 100]
    lappend res [wm attributes .t -alpha]
    return $res
} -cleanup {
    destroy .t
} -result {1.0 {} 0.5 {} 0.0 {} 1.0}

test winWm-6.5 {wm attributes -alpha} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    wm attributes .t -alpha foo
} -cleanup {
    destroy .t
} -returnCodes error -result {expected floating-point number but got "foo"}

test winWm-6.6 {wm attributes -alpha} -constraints win -setup {
    destroy .t
} -body {
    # This test is just to show off -alpha
    toplevel .t
    wm attributes .t -alpha 0.2
    pack [label .t.l -text "Alpha Toplevel" -font "Helvetica 18 bold"]
    tk::PlaceWindow .t center
    update
    if {$::tcl_platform(osVersion) >= 5.0} {
    for {set i 0.2} {$i < 0.99} {set i [expr {$i+0.02}]} {
        wm attributes .t -alpha $i
        update idle
        after 20
    }
    for {set i 0.99} {$i > 0.2} {set i [expr {$i-0.02}]} {
        wm attributes .t -alpha $i
        update idle
        after 20
    }
    }
} -cleanup {
    destroy .t
} -result {}

test winWm-6.7 {wm attributes -transparentcolor} -constraints win -setup {
    destroy .t
    set res {}
} -body {
    # Expect this to return all "" on pre-2K/XP
    toplevel .t
    lappend res [wm attributes .t -transparentcolor]
    # we don't return on set yet
    lappend res [wm attributes .t -trans black]
    lappend res [wm attributes .t -trans]
    lappend res [wm attributes .t -trans "#FFFFFF"]
    lappend res [wm attributes .t -trans]
} -cleanup {
    destroy .t
} -result [list {} {} black {} "#FFFFFF"]

test winWm-6.8 {wm attributes -transparentcolor} -constraints win -setup {
    destroy .t
} -body {
    destroy .t
    toplevel .t
    wm attributes .t -tr foo
} -cleanup {
    destroy .t
} -returnCodes error -result {unknown color name "foo"}


test winWm-7.1 {deiconify on an unmapped toplevel will raise \
        the window and set the focus} -constraints {
    win
} -setup {
    destroy .t
} -body {
    toplevel .t
    lower .t
    focus -force .
    wm deiconify .t
    update
    list [wm stackorder .t isabove .] [focus]
} -cleanup {
    destroy .t
} -result {1 .t}

test winWm-7.2 {deiconify on an already mapped toplevel\
        will raise the window and set the focus} -constraints {
    win
} -setup {
    destroy .t
} -body {
    toplevel .t
    lower .t
    update
    focus -force .
    wm deiconify .t
    update
    list [wm stackorder .t isabove .] [focus]
} -cleanup {
    destroy .t
} -result {1 .t}

test winWm-7.3 {UpdateWrapper must maintain Z order} -constraints win -setup {
    destroy .t
} -body {
    destroy .t
    toplevel .t
    lower .t
    update
    set res [wm stackorder .t isbelow .]
    wm resizable .t 0 0
    update
    list $res [wm stackorder .t isbelow .]
} -cleanup {
    destroy .t
} -result {1 1}

test winWm-7.4 {UpdateWrapper must maintain focus} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    focus -force .t
    update
    set res [focus]
    wm resizable .t 0 0
    update
    list $res [focus]
} -cleanup {
    destroy .t
} -result {.t .t}


test winWm-8.1 {Tk_WmCmd procedure, "iconphoto" option} -constraints win -body {
    wm iconph .
} -returnCodes error -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}
test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} -constraints win -setup {
    destroy .t
} -body {
    toplevel .t
    image create photo blank16 -width 16 -height 16
    image create photo blank32 -width 32 -height 32
    # This should just make blank icons for the window
    wm iconphoto .t blank16 blank32
    image delete blank16 blank32
} -cleanup {
    destroy .t
} -result {}

test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constraints win -setup {
    proc winwm90click {w} {
        if {![winfo ismapped $w]} { update }
        event generate $w <Enter>
        focus -force $w
        event generate $w <ButtonPress-1> -x 5 -y 5
        event generate $w <ButtonRelease-1> -x 5 -y 5
    }
    proc winwm90proc3 {} {
        global winwm90done winwm90check
        set w .sd
        toplevel $w
        pack [button $w.b -text "OK" -command {set winwm90check 1}]
        bind $w.b <Map> {after idle {winwm90click %W}}
        update idletasks
        tkwait visibility $w
        grab $w
        tkwait variable winwm90check
        grab release $w
        destroy $w
        after idle {set winwm90done ok}
    }
    proc winwm90proc2 {w} { winwm90proc3; destroy $w }
    proc winwm90proc1 {w} {
        toplevel $w
        pack [button $w.b -text "Do dialog" -command [list winwm90proc2 $w]]
        bind $w.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
    }
    global winwm90done
    set winwm90done wait
    toplevel .t
} -body {    
    pack [button .t.b -text "Show" -command {winwm90proc1 .tx}]
    bind .t.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
    after 5000 {set winwm90done timeout}
    vwait winwm90done
    set winwm90done
} -cleanup {
    foreach cmd {proc1 proc2 proc3 click} {
        rename winwm90$cmd {}
    }
    destroy .tx .t .sd
} -result {ok} 

test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win -setup {
    proc winwm91click {w} {
        if {![winfo ismapped $w]} { update }
        event generate $w <Enter>
        focus -force $w
        event generate $w <ButtonPress-1> -x 5 -y 5
        event generate $w <ButtonRelease-1> -x 5 -y 5
    }
    proc winwm91proc3 {} {
        global winwm91done winwm91check
        set w .sd
        toplevel $w
        pack [button $w.b -text "OK" -command {set winwm91check 1}]
        bind $w.b <Map> {after idle {winwm91click %W}}
        update idletasks
        tkwait visibility $w
        grab $w
        tkwait variable winwm91check
        #skip the release:  #grab release $w
        destroy $w
        after idle {set winwm91done ok}
    }
    proc winwm91proc2 {w} { winwm91proc3; destroy $w }
    proc winwm91proc1 {w} {
        toplevel $w
        pack [button $w.b -text "Do dialog" -command [list winwm91proc2 $w]]
        bind $w.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}}
    }
    destroy .t
    global winwm91done
    set winwm91done wait
    toplevel .t
} -body {    
    pack [button .t.b -text "Show" -command {winwm91proc1 .tx}]
    bind .t.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}}
    after 5000 {set winwm91done timeout}
    vwait winwm91done
    set winwm91done
} -cleanup {
    foreach cmd {proc1 proc2 proc3 click} {
        rename winwm91$cmd {}
    }
    destroy .tx .t .sd
} -result {ok}
destroy .t

# cleanup
cleanupTests
return

# Local variables:
# mode: tcl
# End:

@


1.23
log
@Missing constraint on new test winWm-9.0
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.22 2009/06/02 09:26:57 patthoyts Exp $
d492 44
@


1.22
log
@[Bug 2799589] Avoid setting the focus on a deleted window during delayed activation.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.21 2008/10/06 23:13:19 patthoyts Exp $
d448 1
a448 1
test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -setup {
d490 1
a490 1
} -result {ok}
@


1.21
log
@Fixed some incorrect error string results and removed precision dependencies in entry tests
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.20 2008/08/30 21:52:26 aniap Exp $
d448 44
@


1.20
log
@Update to tcltest2
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.19 2008/07/23 23:24:24 nijtmans Exp $
d434 1
a434 1
} -returnCodes error -result {wrong # args: should be "wm iconphoto window ?-default? image ?image ...?"}
@


1.19
log
@fix [2021443] inconsistant "wrong # args" messages (for Tk)
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.18 2006/12/01 19:48:00 hobbs Exp $
d14 3
a16 2
package require tcltest 2.1
eval tcltest::configure $argv
a18 1
# Measure the height of a single menu line
d20 3
a22 16
toplevel .t
frame .t.f -width 100 -height 50
pack .t.f
menu .t.m
.t.m add command -label "thisisreallylong"
.t configure -menu .t.m
wm geometry .t -0-0
update
set menuheight [winfo y .t]
.t.m add command -label "thisisreallylong"
wm geometry .t -0-0
update
set menuheight [expr {$menuheight - [winfo y .t]}]
destroy .t

test winWm-1.1 {TkWmMapWindow} win {
d27 2
a28 1
    set result [list [winfo rootx .t] [winfo rooty .t]]
d30 4
a33 3
    set result
} {0 0}
test winWm-1.2 {TkWmMapWindow} win {
d41 2
a42 1
    catch {wm iconify .t} msg
d44 4
a47 3
    set msg
} {can't iconify ".t": it is a transient}
test winWm-1.3 {TkWmMapWindow} win {
d52 2
a53 1
    set result [expr {[winfo x .t] != [winfo x .t2]}]
d55 4
a58 3
    set result
} 1
test winWm-1.4 {TkWmMapWindow} win {
d65 2
a66 1
    set result [list [winfo x .t] [winfo x .t2]]
d68 4
a71 3
    set result
} {10 40}
test winWm-1.5 {TkWmMapWindow} win {
d75 5
a79 1
    set result [wm state .t]
d81 1
a81 4
    set result
} iconic

test winWm-2.1 {TkpWmSetState} win {
d92 4
d97 1
a97 3
    set result
} {normal iconic normal}
test winWm-2.2 {TkpWmSetState} win {
d109 1
a109 1
    update 
d111 4
d116 1
a116 3
    set result
} {normal withdrawn iconic normal}
test winWm-2.3 {TkpWmSetState} win {
d128 1
a128 1
    update 
d130 4
a134 3
    set result
} {normal withdrawn iconic normal}
test winWm-2.4 {TkpWmSetState} win {
d136 1
d150 1
d152 1
a152 2
    set result
} {{normal 150x50+10+10} {iconic 150x50+10+10} {iconic 150x50+10+10} {normal 200x50+10+10}}
d154 6
a159 1
test winWm-3.1 {ConfigureTopLevel: window geometry propagation} win {
d173 22
a194 1
    set x [expr {$x == [winfo x .t.b]}]
a195 2
    set x
} 1
a196 2
test winWm-4.1 {ConfigureTopLevel: menu resizing} win {
    set result {}
d207 2
a208 1
    set result [expr {$y - [winfo y .t]}]
d210 2
a211 2
    set result
} [expr {$menuheight + 1}]
d218 2
a219 1
test winWm-5.1 {UpdateGeometryInfo: menu resizing} win {
d221 1
d236 4
d241 1
a241 4
    
    set result
} {50 50 31}
test winWm-5.2 {UpdateGeometryInfo: menu resizing} win {
d259 4
a262 2
    set result
} {50 50 0}
d264 1
a264 1
test winWm-6.1 {wm attributes} win {
d266 1
d269 4
a272 2
} {-alpha 1.0 -transparentcolor {} -disabled 0 -fullscreen 0 -toolwindow 0 -topmost 0}
test winWm-6.2 {wm attributes} win {
d274 1
d277 6
a282 2
} {0}
test winWm-6.3 {wm attributes} win {
d284 3
d288 1
a288 3
    toplevel .t
    list [catch {wm attributes .t -foo} msg] $msg
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-transparentcolor ?color?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
d290 3
a292 1
test winWm-6.4 {wm attributes -alpha} win {
a293 1
    destroy .t
d303 4
a306 2
    set res
} {1.0 {} 0.5 {} 0.0 {} 1.0}
d308 1
a308 1
test winWm-6.5 {wm attributes -alpha} win {
d310 1
d312 4
a315 2
    list [catch {wm attributes .t -alpha foo} msg] $msg
} {1 {expected floating-point number but got "foo"}}
d317 3
a319 1
test winWm-6.6 {wm attributes -alpha} win {
a320 1
    destroy .t
d327 10
a336 10
	for {set i 0.2} {$i < 0.99} {set i [expr {$i+0.02}]} {
	    wm attributes .t -alpha $i
	    update idle
	    after 20
	}
	for {set i 0.99} {$i > 0.2} {set i [expr {$i-0.02}]} {
	    wm attributes .t -alpha $i
	    update idle
	    after 20
	}
d338 3
a340 1
} {}
d342 4
a345 1
test winWm-6.7 {wm attributes -transparentcolor} win {
a346 1
    destroy .t
a347 1
    set res {}
d354 1
d356 1
a356 2
    set res
} [list {} {} black {} "#FFFFFF"]
d358 3
a360 1
test winWm-6.8 {wm attributes -transparentcolor} win {
d363 4
a366 2
    list [catch {wm attributes .t -tr foo} msg] $msg
} {1 {unknown color name "foo"}}
d368 5
a372 2
test winWm-7.1 {deiconify on an unmapped toplevel\
        will raise the window and set the focus} win {
d374 1
d381 3
a383 1
} {1 .t}
d386 3
a388 1
        will raise the window and set the focus} win {
d390 1
d398 3
a400 1
} {1 .t}
d402 3
a404 1
test winWm-7.3 {UpdateWrapper must maintain Z order} win {
d413 3
a415 1
} {1 1}
d417 1
a417 1
test winWm-7.4 {UpdateWrapper must maintain focus} win {
d419 1
d427 3
a429 1
} {.t .t}
d431 5
a435 4
test winWm-8.1 {Tk_WmCmd procedure, "iconphoto" option} win {
    list [catch {wm iconph .} msg] $msg
} {1 {wrong # args: should be "wm iconphoto window ?-default? image ?image ...?"}}
test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} win {
d437 1
d444 3
a446 1
} {}
d453 5
@


1.18
log
@	* doc/wm.n, tests/winWm.test:
	* win/tkWinWm.c: add -transparentcolor attribute for Windows.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.17 2006/10/17 10:21:50 patthoyts Exp $
d362 1
a362 1
} {1 {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}}
@


1.18.4.1
log
@[Bug 2799589] Backported fix for crash on delayed window activation.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id$
a372 45
test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -setup {
    proc winwm90click {w} {
        if {![winfo ismapped $w]} { update }
        event generate $w <Enter>
        focus -force $w
        event generate $w <ButtonPress-1> -x 5 -y 5
        event generate $w <ButtonRelease-1> -x 5 -y 5
    }
    proc winwm90proc3 {} {
        global winwm90done winwm90check
        set w .sd
        toplevel $w
        pack [button $w.b -text "OK" -command {set winwm90check 1}]
        bind $w.b <Map> {after idle {winwm90click %W}}
        update idletasks
        tkwait visibility $w
        grab $w
        tkwait variable winwm90check
        grab release $w
        destroy $w
        after idle {set winwm90done ok}
    }
    proc winwm90proc2 {w} { winwm90proc3; destroy $w }
    proc winwm90proc1 {w} {
        toplevel $w
        pack [button $w.b -text "Do dialog" -command [list winwm90proc2 $w]]
        bind $w.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
    }
    destroy .t
    global winwm90done
    set winwm90done wait
    toplevel .t
} -body {    
    pack [button .t.b -text "Show" -command {winwm90proc1 .tx}]
    bind .t.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
    after 5000 {set winwm90done timeout}
    vwait winwm90done
    set winwm90done
} -cleanup {
    foreach cmd {proc1 proc2 proc3 click} {
        rename winwm90$cmd {}
    }
    destroy .tx .t .sd
} -result {ok}

a377 4

# Local variables:
# mode: tcl
# End:
@


1.18.4.2
log
@missing constraint
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.18.4.1 2009/06/02 09:41:42 patthoyts Exp $
d373 1
a373 1
test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constraints win -setup {
@


1.18.4.3
log
@Make sure the window is still present when handling delayed activation [Bug 2899949]
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.18.4.2 2009/06/23 14:26:49 dgp Exp $
a417 45
test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win -setup {
    proc winwm91click {w} {
        if {![winfo ismapped $w]} { update }
        event generate $w <Enter>
        focus -force $w
        event generate $w <ButtonPress-1> -x 5 -y 5
        event generate $w <ButtonRelease-1> -x 5 -y 5
    }
    proc winwm91proc3 {} {
        global winwm91done winwm91check
        set w .sd
        toplevel $w
        pack [button $w.b -text "OK" -command {set winwm91check 1}]
        bind $w.b <Map> {after idle {winwm91click %W}}
        update idletasks
        tkwait visibility $w
        grab $w
        tkwait variable winwm91check
        #skip the release:  #grab release $w
        destroy $w
        after idle {set winwm91done ok}
    }
    proc winwm91proc2 {w} { winwm91proc3; destroy $w }
    proc winwm91proc1 {w} {
        toplevel $w
        pack [button $w.b -text "Do dialog" -command [list winwm91proc2 $w]]
        bind $w.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}}
    }
    destroy .t
    global winwm91done
    set winwm91done wait
    toplevel .t
} -body {    
    pack [button .t.b -text "Show" -command {winwm91proc1 .tx}]
    bind .t.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}}
    after 5000 {set winwm91done timeout}
    vwait winwm91done
    set winwm91done
} -cleanup {
    foreach cmd {proc1 proc2 proc3 click} {
        rename winwm91$cmd {}
    }
    destroy .tx .t .sd
} -result {ok}

@


1.17
log
@generic/tkText.c: Applied suggested patch from #1536735
tests/text.test:  Update test for above patch.
tests/textWind.test:  Corrected test to catch all messages
tests/safe.test: Silence spurious win32 failure awaiting TIP150
tests/winDialog.test: Updated test for file name length check.
test/winWm.test: Corrected test expectation for menu wrapping.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.16 2005/02/17 00:06:08 mdejong Exp $
d238 1
a238 1
} {-alpha 1.0 -disabled 0 -fullscreen 0 -toolwindow 0 -topmost 0}
d249 1
a249 1
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
d294 21
@


1.16
log
@	* doc/wm.n: Add documentation for -fullscreen attribute.
	* tests/winWm.test: Add -fullscreen to wm attribute
	usage message.
	* tests/wm.test: Add -fullscreen to wm attribute
	usage message. Add -fullscreen attribute test cases
	for Windows.
	* win/tkWinWm.c (WmInfo, UpdateWrapper, TkpWmSetFullScreen,
	WmAttributesCmd, UpdateGeometryInfo):
	Implement TIP 223 [wm attributes -fullscreen].
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.15 2004/12/04 00:04:43 dkf Exp $
d25 2
a26 2
.t conf -menu .t.m
wm geom .t -0-0
d30 1
a30 1
wm geom .t -0-0
d32 1
a32 1
set menuheight [expr $menuheight - [winfo y .t]]
d61 1
a61 1
    set result [expr [winfo x .t] != [winfo x .t2]]
d166 1
a166 1
    set x [expr $x == [winfo x .t.b]]
d174 1
a174 1
    frame .t.f -width 150 -height 50 -bg red
d181 1
a181 1
    .t conf -menu .t.m
d183 1
a183 1
    set result [expr $y - [winfo y .t]]
d186 1
a186 1
} [expr $menuheight + 1]
d188 5
d196 1
a196 1
    frame .t.f -width 150 -height 50 -bg red
d202 1
a202 1
    .t conf -menu .t.m
d210 1
d212 1
a212 1
} {50 50 50}
d216 1
a216 1
    frame .t.f -width 150 -height 50 -bg red
d218 1
a218 1
    wm geom .t -0-0
d223 1
a223 1
    .t conf -menu .t.m
d229 1
a229 1
    lappend result [expr $y - [winfo rooty .t]]
@


1.15
log
@Split duplicate test names [Bug 1078648]
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.14 2004/10/05 22:04:46 hobbs Exp $
d232 1
a232 1
} {-alpha 1.0 -disabled 0 -toolwindow 0 -topmost 0}
d243 1
a243 1
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
@


1.14
log
@	* doc/wm.n (iconphoto):           added support for Tk photo
	* generic/tkInt.h (TkDisplay):    images as titlebar icons. TIP #159
	* win/tkWinWm.c (WmIconphotoCmd): wm iconphoto ?-default? image1 ...
	* macosx/tkMacOSXWm.c (WmIconphotoCmd): Implemented for Win/Unix,
	* unix/tkUnixWm.c (WmIconphotoCmd):     stubbed out for OS X.
	* tests/wm.test, tests/unixWm.test, tests/winWm.test: [Bug 815751]
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.13 2004/09/17 23:26:21 hobbs Exp $
d116 1
a116 1
test winWm-2.2 {TkpWmSetState} win {
@


1.13
log
@	* doc/wm.n:
	* tests/winWm.test: Add 'wm attributes -alpha' to control toplevel
	* win/tkWinInt.h:   alpha transparency on Win2K/XP+.
	* win/tkWinWm.c:    TIP #222 [Patch 892194]
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.12 2004/09/17 22:44:34 hobbs Exp $
d333 13
@


1.12
log
@	* win/tkWinWm.c (UpdateWrapper): Ensure that we maintain Z order
	* tests/winWm.test:              and focus of preexisting window
	when replacing the wrapper window.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.11 2004/06/24 12:45:44 dkf Exp $
d232 1
a232 1
} {-disabled 0 -toolwindow 0 -topmost 0}
d243 44
a286 1
} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
@


1.11
log
@Use standard constraint names
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.10 2003/04/01 21:07:02 dgp Exp $
d245 1
a245 3
destroy .t

test winWm-6.1 {deiconify on an unmapped toplevel\
d256 1
a256 1
test winWm-6.2 {deiconify on an already mapped toplevel\
d268 23
@


1.10
log
@        * tests/all.tcl:                Made better use of a common
        * tests/constraints.tcl:        -loadfile to hold definitions
        * tests/*.test:                 common to all test files.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.9 2002/07/25 21:35:23 pspjuth Exp $
d35 1
a35 1
test winWm-1.1 {TkWmMapWindow} {pcOnly} {
d44 1
a44 1
test winWm-1.2 {TkWmMapWindow} {pcOnly} {
d56 1
a56 1
test winWm-1.3 {TkWmMapWindow} {pcOnly} {
d65 1
a65 1
test winWm-1.4 {TkWmMapWindow} {pcOnly} {
d76 1
a76 1
test winWm-1.5 {TkWmMapWindow} {pcOnly} {
d85 1
a85 1
test winWm-2.1 {TkpWmSetState} {pcOnly} {
d99 1
a99 1
test winWm-2.2 {TkpWmSetState} {pcOnly} {
d116 1
a116 1
test winWm-2.2 {TkpWmSetState} {pcOnly} {
d133 1
a133 1
test winWm-2.4 {TkpWmSetState} {pcOnly} {
d152 1
a152 1
test winWm-3.1 {ConfigureTopLevel: window geometry propagation} {pcOnly} {
d171 1
a171 1
test winWm-4.1 {ConfigureTopLevel: menu resizing} {pcOnly} {
d188 1
a188 1
test winWm-5.1 {UpdateGeometryInfo: menu resizing} {pcOnly} {
d207 1
a207 1
test winWm-5.2 {UpdateGeometryInfo: menu resizing} {pcOnly} {
d228 1
a228 1
test winWm-6.1 {wm attributes} {pcOnly} {
d233 1
a233 1
test winWm-6.2 {wm attributes} {pcOnly} {
d238 1
a238 1
test winWm-6.3 {wm attributes} {pcOnly} {
d247 2
a248 2
test winWm-6.1 {deiconify on an unmapped toplevel
        will raise the window and set the focus} {pcOnly} {
d258 2
a259 2
test winWm-6.2 {deiconify on an already mapped toplevel
        will raise the window and set the focus} {pcOnly} {
@


1.9
log
@Objectifed wm. [Patch #564521]
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.8 2002/07/13 20:28:36 dgp Exp $
d15 1
a15 4
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
d272 1
a272 1
::tcltest::cleanupTests
@


1.9.2.1
log
@	* win/tkWinWm.c (UpdateWrapper): Ensure that we maintain Z order
	* tests/winWm.test:              and focus of preexisting window
	when replacing the wrapper window.
	* win/tkWinWm.c (WmIconwindowCmd): Replace bogus call to
	XWithdrawWindow with proper code. (mdejong)
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.9 2002/07/25 21:35:23 pspjuth Exp $
d248 3
a250 1
test winWm-7.1 {deiconify on an unmapped toplevel
d261 1
a261 1
test winWm-7.2 {deiconify on an already mapped toplevel
a272 23
test winWm-7.3 {UpdateWrapper must maintain Z order} win {
    destroy .t
    toplevel .t
    lower .t
    update
    set res [wm stackorder .t isbelow .]
    wm resizable .t 0 0
    update
    list $res [wm stackorder .t isbelow .]
} {1 1}

test winWm-7.4 {UpdateWrapper must maintain focus} win {
    destroy .t
    toplevel .t
    focus -force .t
    update
    set res [focus]
    wm resizable .t 0 0
    update
    list $res [focus]
} {.t .t}

destroy .t
@


1.9.2.2
log
@patch 892194 TIP#222 changes
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.9.2.1 2004/09/17 22:45:07 hobbs Exp $
d231 1
a231 1
test winWm-6.1 {wm attributes} win {
d235 2
a236 2
} {-alpha 1.0 -disabled 0 -toolwindow 0 -topmost 0}
test winWm-6.2 {wm attributes} win {
d241 1
a241 1
test winWm-6.3 {wm attributes} win {
d246 1
a246 44
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}

test winWm-6.4 {wm attributes -alpha} win {
    # Expect this to return all 1.0 {} on pre-2K/XP
    destroy .t
    toplevel .t
    set res [wm attributes .t -alpha]
    # we don't return on set yet
    lappend res [wm attributes .t -alpha 0.5]
    lappend res [wm attributes .t -alpha]
    lappend res [wm attributes .t -alpha -100]
    lappend res [wm attributes .t -alpha]
    lappend res [wm attributes .t -alpha 100]
    lappend res [wm attributes .t -alpha]
    set res
} {1.0 {} 0.5 {} 0.0 {} 1.0}

test winWm-6.5 {wm attributes -alpha} win {
    destroy .t
    toplevel .t
    list [catch {wm attributes .t -alpha foo} msg] $msg
} {1 {expected floating-point number but got "foo"}}

test winWm-6.6 {wm attributes -alpha} win {
    # This test is just to show off -alpha
    destroy .t
    toplevel .t
    wm attributes .t -alpha 0.2
    pack [label .t.l -text "Alpha Toplevel" -font "Helvetica 18 bold"]
    tk::PlaceWindow .t center
    update
    if {$::tcl_platform(osVersion) >= 5.0} {
	for {set i 0.2} {$i < 0.99} {set i [expr {$i+0.02}]} {
	    wm attributes .t -alpha $i
	    update idle
	    after 20
	}
	for {set i 0.99} {$i > 0.2} {set i [expr {$i-0.02}]} {
	    wm attributes .t -alpha $i
	    update idle
	    after 20
	}
    }
} {}
@


1.9.2.3
log
@	Backport of 8.5 wm iconphoto that added support for Tk photo
	* generic/tkInt.h (TkDisplay):    images as titlebar icons. TIP #159
	* win/tkWinWm.c (WmIconphotoCmd): wm iconphoto ?-default? image1 ...
	* macosx/tkMacOSXWm.c (WmIconphotoCmd): Implemented for Win/Unix,
	* unix/tkUnixWm.c (WmIconphotoCmd):     stubbed out for OS X.
	* tests/wm.test, tests/unixWm.test, tests/winWm.test: [Bug 815751]
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.9.2.2 2004/09/17 23:45:57 hobbs Exp $
a335 13
test winWm-8.1 {Tk_WmCmd procedure, "iconphoto" option} win {
    list [catch {wm iconph .} msg] $msg
} {1 {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}}
test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} win {
    destroy .t
    toplevel .t
    image create photo blank16 -width 16 -height 16
    image create photo blank32 -width 32 -height 32
    # This should just make blank icons for the window
    wm iconphoto .t blank16 blank32
    image delete blank16 blank32
} {}

@


1.9.2.4
log
@	* doc/wm.n, tests/winWm.test:
	* win/tkWinWm.c: add -transparentcolor attribute for Windows.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.9.2.3 2004/10/05 22:27:27 hobbs Exp $
d235 1
a235 1
} {-alpha 1.0 -transparentcolor {} -disabled 0 -toolwindow 0 -topmost 0}
d246 1
a246 1
} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-transparentcolor ?color?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
a290 21
test winWm-6.7 {wm attributes -transparentcolor} win {
    # Expect this to return all "" on pre-2K/XP
    destroy .t
    toplevel .t
    set res {}
    lappend res [wm attributes .t -transparentcolor]
    # we don't return on set yet
    lappend res [wm attributes .t -trans black]
    lappend res [wm attributes .t -trans]
    lappend res [wm attributes .t -trans "#FFFFFF"]
    lappend res [wm attributes .t -trans]
    destroy .t
    set res
} [list {} {} black {} "#FFFFFF"]

test winWm-6.8 {wm attributes -transparentcolor} win {
    destroy .t
    toplevel .t
    list [catch {wm attributes .t -tr foo} msg] $msg
} {1 {unknown color name "foo"}}

@


1.8
log
@	* Converted more files to tcltest and factored out common code.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.7 2002/07/12 13:41:01 dgp Exp $
d246 1
a246 1
} {1 {wrong # arguments: must be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
@


1.7
log
@	* Converted several files in the Tk test suite for testing by
	tcltest 2.1.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.6 2002/06/24 20:34:40 mdejong Exp $
d15 5
a19 5
namespace import -force tcltest::test
eval tcltest::configure $argv
foreach i [winfo children .] {
    catch {destroy $i}
}
@


1.6
log
@	* tests/winWm.test: Verify that both an unmapped
	and already mapped toplevel are raised and receive
	the focus when deiconified.
	* tests/wm.test: Add wm deiconify tests. Check that
	a toplevel that has never been mapped is not mapped
	by the deiconify command since it should be done
	at idle by MapFrame.
	* win/tkWinWm.c (Tk_WmCmd): Check the WM_NEVER_MAPPED
	flag while processing the wm deiconify command.
	The WM_UPDATE_PENDING flag should never be set when
	WM_NEVER_MAPPED is set, but double check so that
	the implementation is more explicit and matches
	the comment just above.
	Return without invoking TkWmRestackToplevel or
	TkSetFocusWin on a toplevel that has never been
	mapped. This fixes a bug where a toplevel is mapped
	with the wrong size and is then resized by the
	idle call to MapFrame. [Tk bug 233150]
@
text
@d12 1
a12 5
# RCS: @@(#) $Id: winWm.test,v 1.5 2002/06/22 10:13:26 hobbs Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
}
d14 3
@


1.5
log
@	* doc/wm.n:                   TIP #95 Windows implementation and
	* mac/tkMacWm.c (Tk_WmCmd):   docs with mac and unix stubs.
	* unix/tkUnixWm.c (Tk_WmCmd):
	* win/tkWinWm.c (Tk_WmCmd):
	* tests/unixWm.test:
	* tests/winWm.test: more wm attr tests will be needed.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.4 2000/01/12 11:45:36 hobbs Exp $
d250 24
@


1.4
log
@	* tests/winWm.test:
	* tests/unixWm.test:
	* mac/tkMacWm.c:
	* unix/tkUnixWm.c: fixed possible X error being raised [Bug: 3377]
	* win/tkWinWm.c: wm deiconify in zoom state [Bug: 2077],
	fixed possible flashing of unmapped toplevel in deiconify [Bug: 3338]
	and fixed mapping of transient window [Bug: 572]
	Also, for all wm's, extended 'wm state' command to allow setting
	of the state, and added official support of 'zoomed' state on Win.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.3 1999/04/16 01:51:44 stanton Exp $
d232 19
a253 12












@


1.4.8.1
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d12 1
a12 1
# RCS: @@(#) $Id$
d14 7
a20 6
package require tcltest 2.1
namespace import -force tcltest::configure
namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands
d232 10
a241 16
test winWm-6.1 {wm attributes} {pcOnly} {
    destroy .t
    toplevel .t
    wm attributes .t
} {-disabled 0 -toolwindow 0 -topmost 0}
test winWm-6.2 {wm attributes} {pcOnly} {
    destroy .t
    toplevel .t
    wm attributes .t -disabled
} {0}
test winWm-6.3 {wm attributes} {pcOnly} {
    # This isn't quite the correct error message yet, but it works.
    destroy .t
    toplevel .t
    list [catch {wm attributes .t -foo} msg] $msg
} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
a242 1
destroy .t
a243 10
test winWm-6.1 {deiconify on an unmapped toplevel
        will raise the window and set the focus} {pcOnly} {
    destroy .t
    toplevel .t
    lower .t
    focus -force .
    wm deiconify .t
    update
    list [wm stackorder .t isabove .] [focus]
} {1 .t}
a244 11
test winWm-6.2 {deiconify on an already mapped toplevel
        will raise the window and set the focus} {pcOnly} {
    destroy .t
    toplevel .t
    lower .t
    update
    focus -force .
    wm deiconify .t
    update
    list [wm stackorder .t isabove .] [focus]
} {1 .t}
a246 3
# cleanup
::tcltest::cleanupTests
return
@


1.3
log
@* Merged 8.1 branch into the main trunk
@
text
@d12 1
a12 1
# RCS: @@(#) $Id$
d120 18
a137 1
test winWm-2.3 {TkpWmSetState} {pcOnly} {
a154 1

@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d9 2
a10 3
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d14 2
a15 6
if {$tcl_platform(platform) != "windows"} {
    return
}

if {[info procs test] != "test"} {
    source defs
d39 1
a39 1
test winWm-1.1 {TkWmMapWindow} {
d48 1
a48 1
test winWm-1.2 {TkWmMapWindow} {
d60 1
a60 1
test winWm-1.3 {TkWmMapWindow} {
d69 1
a69 1
test winWm-1.4 {TkWmMapWindow} {
d80 1
a80 1
test winWm-1.5 {TkWmMapWindow} {
d89 1
a89 1
test winWm-2.1 {TkpWmSetState} {
d103 1
a103 1
test winWm-2.2 {TkpWmSetState} {
d120 1
a120 1
test winWm-2.3 {TkpWmSetState} {
d140 1
a140 1
test winWm-3.1 {ConfigureTopLevel: window geometry propagation} {
d159 1
a159 1
test winWm-4.1 {ConfigureTopLevel: menu resizing} {
d176 1
a176 1
test winWm-5.1 {UpdateGeometryInfo: menu resizing} {
d195 1
a195 1
test winWm-5.2 {UpdateGeometryInfo: menu resizing} {
d215 16
@


1.1
log
@Initial revision
@
text
@d13 1
a13 1
# SCCS: @@(#) winWm.test 1.5 97/08/13 15:42:46
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d13 1
a13 1
# RCS: @@(#) $Id: winWm.test,v 1.2 1998/09/14 18:23:53 stanton Exp $
@


1.1.4.2
log
@Updated the testsuite to use "test" namespace and commandline args
to control verbose  level and which tests get run.  Tests now work from
any working dir.
@
text
@a8 2
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
d10 4
a13 1
# RCS: @@(#) $Id: winWm.test,v 1.1.4.1 1998/09/30 02:19:08 stanton Exp $
a15 1
    puts "skipping: Windows only tests..."
d19 2
a20 2
if {[lsearch [namespace children] ::test] == -1} {
    source [file join [pwd] [file dirname [info script]] defs.tcl]
a219 4

# cleanup
::test::cleanupTests
return
@


1.1.4.3
log
@- changed ::test to ::tcltest
- made many tests more atomic (still more work to do here)
- defs.tcl is now identicle for tcl and tk
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.1.4.2 1999/03/11 18:51:23 hershey Exp $
d14 6
a19 1
if {[lsearch [namespace children] ::tcltest] == -1} {
d44 1
a44 1
test winWm-1.1 {TkWmMapWindow} {pcOnly} {
d53 1
a53 1
test winWm-1.2 {TkWmMapWindow} {pcOnly} {
d65 1
a65 1
test winWm-1.3 {TkWmMapWindow} {pcOnly} {
d74 1
a74 1
test winWm-1.4 {TkWmMapWindow} {pcOnly} {
d85 1
a85 1
test winWm-1.5 {TkWmMapWindow} {pcOnly} {
d94 1
a94 1
test winWm-2.1 {TkpWmSetState} {pcOnly} {
d108 1
a108 1
test winWm-2.2 {TkpWmSetState} {pcOnly} {
d125 1
a125 1
test winWm-2.3 {TkpWmSetState} {pcOnly} {
d145 1
a145 1
test winWm-3.1 {ConfigureTopLevel: window geometry propagation} {pcOnly} {
d164 1
a164 1
test winWm-4.1 {ConfigureTopLevel: menu resizing} {pcOnly} {
d181 1
a181 1
test winWm-5.1 {UpdateGeometryInfo: menu resizing} {pcOnly} {
d200 1
a200 1
test winWm-5.2 {UpdateGeometryInfo: menu resizing} {pcOnly} {
d222 1
a222 1
::tcltest::cleanupTests
a223 11











@


1.1.4.4
log
@lint:  changed a tcltest namespace variable name from tmpDir to
       workingDir.
changes:  made more tests atomic.
README is now updated to match new test suite features.
@
text
@d12 1
a12 1
# RCS: @@(#) $Id: winWm.test,v 1.1.4.3 1999/03/24 01:17:20 hershey Exp $
a218 1

@


