home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!kithrup!stanford.edu!agate!bionet!uwm.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!mips!carbon!news.cs.indiana.edu!syscon!gator!fang!att!cbnewsl!cbnewsm!gah
- From: gah@att.com (George A. Howlett)
- Newsgroups: comp.lang.tcl
- Subject: Re: canvas problem
- Message-ID: <1992Aug19.182110.12233@cbnewsm.cb.att.com>
- Date: 19 Aug 92 18:21:10 GMT
- References: <1992Aug18.023804.25826@Arco.COM>
- Sender: news@cbnewsm.cb.att.com (NetNews Administrator)
- Reply-To: george.howlett@att.com
- Organization: AT&T Bell Laboratories
- Lines: 69
- X-Newsreader: Tin 1.1 PL5
- Nntp-Posting-Host: grenache.cnet.att.com
-
- Chris Phillips (214) 754-6419 (cgp@Arco.COM) wrote:
- : For some reason the following script doesn't give the expected results.
- : It creates two canvases: one horizontal and one vertical. They should
- : each create 10 squares, all in a row. The horizontal canvas is ok, but
- : only 2 squares show up in the vertical canvas.
- :
- :
- : #!/usr/local/bin/wish -f
- :
- : proc trash {w doy} {
- : toplevel $w
- : if {$doy == 1} {
- : canvas $w.c -width 1c -height 10c
- : $w.c create rectangle 0 0 1c 10c -fill red
- : for {set j 1} {$j <= 10} {incr j} {
- : $w.c create rectangle \
- : 0 [expr $j-1]c 1c ${j}c \
- : -outline black -fill blue
- : }
- : } else {
- : canvas $w.c -width 10c -height 1c
- : $w.c create rectangle 0 0 10c 1c -fill red
- : for {set i 1} {$i <= 10} {incr i} {
- : $w.c create rectangle \
- : [expr $i-1]c 0 ${i}c 1c \
- : -outline black -fill blue
- : }
- : }
- :
- : pack append $w $w.c {expand fill}
- : }
- :
- : trash .t0 0
- : trash .t1 1
- : message .m -text "Horizontal: 10 blue squares\nVertical: 2 blue squares" \
- : -aspect 1500 -justify center
- : pack append . .m {expand fill}
- :
- :
- : ----- End script -----
- :
- :
- : Any ideas?
- :
- : Chris
-
- In case you haven't already received the fix...
-
- --gah
-
- *** tkCanvas.c-dist Sat Aug 8 21:11:42 1992
- --- tkCanvas.c Wed Aug 19 13:57:39 1992
- ***************
- *** 1546,1552 ****
- screenX1 = canvasPtr->xOrigin;
- screenY1 = canvasPtr->yOrigin;
- screenX2 = screenX1 + Tk_Width(tkwin);
- ! screenY2 = screenY1 + Tk_Width(tkwin);
- if (canvasPtr->redrawX1 > screenX1) {
- screenX1 = canvasPtr->redrawX1;
- }
- --- 1546,1552 ----
- screenX1 = canvasPtr->xOrigin;
- screenY1 = canvasPtr->yOrigin;
- screenX2 = screenX1 + Tk_Width(tkwin);
- ! screenY2 = screenY1 + Tk_Height(tkwin);
- if (canvasPtr->redrawX1 > screenX1) {
- screenX1 = canvasPtr->redrawX1;
- }
-