home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / tcl / 1077 < prev    next >
Encoding:
Text File  |  1992-07-30  |  1.9 KB  |  53 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!stanford.edu!ames!pasteur!sickdog.CS.Berkeley.EDU!jiangwu
  3. From: jiangwu@sickdog.CS.Berkeley.EDU (Jiang Wu)
  4. Subject: Bugs in Canvas Rect/Oval item
  5. Message-ID: <1992Jul30.211531.13971@pasteur.Berkeley.EDU>
  6. Sender: nntp@pasteur.Berkeley.EDU (NNTP Poster)
  7. Nntp-Posting-Host: sickdog.cs.berkeley.edu
  8. Organization: University of California, Berkeley
  9. Date: Thu, 30 Jul 1992 21:15:31 GMT
  10. Lines: 41
  11.  
  12.  
  13. While developing an application using tk2.1, I found a bug in canvas
  14. rectangle/oval item.  I have a rectangle item that is being moved around in
  15. the screen by dragging it with the mouse.  I use canvas command "move tagOrId
  16. xAmount yAmount" to shift the rectangle around.  Everything is fine until I
  17. do a "xview" or "yview" on the canvas to shift origin of the canvas to
  18. none (0, 0).  Then, the rectangle does not redraw correctly after "move"
  19. command.  I think this only happens to rectangle/oval items.  Other canvas
  20. items behave correctly to the "move" command after "xview"/"yview" is
  21. applied to the canvas.
  22.  
  23. Type in the following commands in wish to see this bug:
  24.  
  25.     wish: canvas .c -scrollincrement 1 -background white
  26.     wish: place .c -in .
  27.     wish:
  28.     wish: .c addtag a withtag [.c create rectangle 0 0 20 20 -fill red]
  29.     wish: .c addtag a withtag [.c create oval 0 30 20 50 -fill yellow]
  30.     wish: 
  31.     wish: # Everything works when you do move here
  32.     wish: .c move a 10 0
  33.     wish: .c move 1 10 0
  34.     wish: .c move 2 10 0
  35.     wish: 
  36.     wish: # Now we do a xview on the canvas
  37.     wish: .c xview 10
  38.     wish: 
  39.     wish: # Then we do move, only half of the rectangle/oval are showing now
  40.     wish: .c move a 20 0
  41.     wish: 
  42.     wish: # Let's move the origin of the canvas back to (0, 0)
  43.     wish: .c xview 0
  44.     wish: 
  45.     wish: # Everything is o.k. again.
  46.     wish: .c move a 30 10
  47.  
  48.  
  49. Comments?
  50.  
  51. -- Jiang Wu
  52.    jiangwu@postgres.berkeley.edu
  53.