summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-10-10 07:25:23 (GMT)
committerhobbs <hobbs>2002-10-10 07:25:23 (GMT)
commit07bae53a89026d0bc2c8f6635c8586648a52b32e (patch)
tree250461cd6dd036597827c9fd5f9314674f2a8818 /tests
parentea99cee25a420695da7bd29c5192575f9d34907d (diff)
downloadtk-07bae53a89026d0bc2c8f6635c8586648a52b32e.zip
tk-07bae53a89026d0bc2c8f6635c8586648a52b32e.tar.gz
tk-07bae53a89026d0bc2c8f6635c8586648a52b32e.tar.bz2
* tests/canvPs.test: tests for canvas embedded window ps generation
* generic/tkCanvWind.c (CanvasPsWindow): removed dead code loop. * generic/tkCanvas.h: moved TkColormapData struct to tkCanvPs.c * generic/tkCanvPs.c (TkImageGetColor): corrected bogus use of TkColormapData on Windows. Non-separated data may need correction as well. * win/tkWinImage.c (XGetImage, XGetImageZPixmap): added support for generating ps for embedded windows on canvases.
Diffstat (limited to 'tests')
-rw-r--r--tests/canvPs.test32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/canvPs.test b/tests/canvPs.test
index 8faad75..8ab93a0 100644
--- a/tests/canvPs.test
+++ b/tests/canvPs.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: canvPs.test,v 1.4 2002/07/14 05:48:46 dgp Exp $
+# RCS: @(#) $Id: canvPs.test,v 1.5 2002/10/10 07:25:24 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -94,6 +94,36 @@ test canvPs-2.4 {test writing to channel and file, same output} {pcOnly} {
set status
} ok
+test canvPs-3.1 {test ps generation with an embedded window} {} {
+ removeFile bar.ps
+ destroy .c
+ pack [canvas .c -width 200 -height 200 -background white]
+ .c create rect 20 20 150 150 -tags rect0 -dash . -width 2
+ .c create arc 0 50 200 200 -tags arc0 \
+ -dash {4 4} -stipple question -outline red -fill green
+
+ image create photo logo \
+ -file [file join $tk_library images pwrdLogo150.gif]
+ .c create image 200 50 -image logo -anchor nw
+
+ entry .c.e -background pink -foreground blue -width 14
+ .c.e insert 0 "we gonna be postscripted"
+ .c create window 50 180 -anchor nw -window .c.e
+ update
+ .c postscript -file bar.ps
+ file exists bar.ps
+} 1
+test canvPs-3.2 {test ps generation with an embedded window not mapped} {} {
+ removeFile bar.ps
+ destroy .c
+ pack [canvas .c -width 200 -height 200 -background white]
+ entry .c.e -background pink -foreground blue -width 14
+ .c.e insert 0 "we gonna be postscripted"
+ .c create window 50 180 -anchor nw -window .c.e
+ .c postscript -file bar.ps
+ file exists bar.ps
+} 1
+
# cleanup
removeFile foo.ps
removeFile bar.ps