blob: 6cf48540c9b3a653a1bf2a450842f4b3a9000d01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# This file is a Tcl script to test out embedded Windows.
#
# Copyright (c) 1996-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id: embed.test,v 1.4 2005/02/15 03:22:10 chengyemao Exp $
package require tcltest 2.1
eval tcltest::configure $argv
tcltest::loadTestedCommands
global tcl_platform
test embed-1.1 {TkpUseWindow procedure, bad window identifier} {
deleteWindows
list [catch {toplevel .t -use xyz} msg] $msg
} {1 {expected integer but got "xyz"}}
test embed-1.2 {CreateFrame procedure, bad window identifier} {
deleteWindows
list [catch {toplevel .t -container xyz} msg] $msg
} {1 {expected boolean value but got "xyz"}}
test embed-1.3 {CreateFrame procedure, both -use and
-container is invalid } {
deleteWindows
toplevel .container -container 1
list [catch {toplevel .t -use [winfo id .container] \
-container 1} msg] $msg
} {1 {A window cannot have both the -use and the -container option set.}}
if {$tcl_platform(platform) == "windows"} {
# testing window embedding for Windows platform
test embed-1.4 {TkpUseWindow procedure, -container must be set} {
deleteWindows
toplevel .container
list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {the window to use is not a Tk container}}
test embed-1.5 {TkpUseWindow procedure, -container must be set} {
deleteWindows
frame .container
list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {the window to use is not a Tk container}}
} else {
# testing window embedding for other platforms
test embed-1.4 {TkpUseWindow procedure, -container must be set} {
deleteWindows
toplevel .container
list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {window ".container" doesn't have -container option set}}
test embed-1.5 {TkpUseWindow procedure, -container must be set} {
deleteWindows
frame .container
list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {window ".container" doesn't have -container option set}}
}
# FIXME: test cases common to unixEmbed.test and macEmbed.test should
# be moved here.
cleanupTests
return
|