1# This file creates a screen to exercise Postscript generation 2# for bitmaps in canvases. It is part of the Tk visual test suite, 3# which is invoked via the "visual" script. 4# 5# RCS: @(#) $Id$ 6 7catch {destroy .t} 8toplevel .t 9wm title .t "Postscript Tests for Canvases" 10wm iconname .t "Postscript" 11wm geom .t +0+0 12wm minsize .t 1 1 13 14set c .t.c 15 16message .t.m -text {This screen exercises the Postscript-generation abilities of Tk canvas widgets for bitmaps. Click on "Print" to print the canvas to your default printer. You can click on items in the canvas to delete them.} -width 6i 17pack .t.m -side top -fill both 18 19frame .t.bot 20pack .t.bot -side bottom -fill both 21button .t.bot.quit -text Quit -command {destroy .t} 22button .t.bot.print -text Print -command "lpr $c" 23pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1 24 25canvas $c -width 6i -height 6i -bd 2 -relief sunken 26pack $c -expand yes -fill both -padx 2m -pady 2m 27 28set canvPsBmapImageDir [file join [file dirname [info script]] images] 29 30$c create bitmap 0.5i 0.5i \ 31 -bitmap @[file join $canvPsBmapImageDir flagdown.xbm] \ 32 -background {} -foreground black -anchor nw 33$c create rect 0.47i 0.47i 0.53i 0.53i -fill {} -outline black 34 35$c create bitmap 3.0i 0.5i \ 36 -bitmap @[file join $canvPsBmapImageDir flagdown.xbm] \ 37 -background {} -foreground black -anchor n 38$c create rect 2.97i 0.47i 3.03i 0.53i -fill {} -outline black 39 40$c create bitmap 5.5i 0.5i \ 41 -bitmap @[file join $canvPsBmapImageDir flagdown.xbm] \ 42 -background black -foreground white -anchor ne 43$c create rect 5.47i 0.47i 5.53i 0.53i -fill {} -outline black 44 45$c create bitmap 0.5i 3.0i \ 46 -bitmap @[file join $canvPsBmapImageDir face.xbm] \ 47 -background {} -foreground black -anchor w 48$c create rect 0.47i 2.97i 0.53i 3.03i -fill {} -outline black 49 50$c create bitmap 3.0i 3.0i \ 51 -bitmap @[file join $canvPsBmapImageDir face.xbm] \ 52 -background {} -foreground black -anchor center 53$c create rect 2.97i 2.97i 3.03i 3.03i -fill {} -outline black 54 55$c create bitmap 5.5i 3.0i \ 56 -bitmap @[file join $canvPsBmapImageDir face.xbm] \ 57 -background blue -foreground black -anchor e 58$c create rect 5.47i 2.97i 5.53i 3.03i -fill {} -outline black 59 60$c create bitmap 0.5i 5.5i \ 61 -bitmap @[file join $canvPsBmapImageDir flagup.xbm] \ 62 -background black -foreground white -anchor sw 63$c create rect 0.47i 5.47i 0.53i 5.53i -fill {} -outline black 64 65$c create bitmap 3.0i 5.5i \ 66 -bitmap @[file join $canvPsBmapImageDir flagup.xbm] \ 67 -background green -foreground white -anchor s 68$c create rect 2.97i 5.47i 3.03i 5.53i -fill {} -outline black 69 70$c create bitmap 5.5i 5.5i \ 71 -bitmap @[file join $canvPsBmapImageDir flagup.xbm] \ 72 -background {} -foreground black -anchor se 73$c create rect 5.47i 5.47i 5.53i 5.53i -fill {} -outline black 74 75 76 77 78 79 80 81 82 83 84 85 86 87