Pseudo-3D items

The Slate has two item pseudo-3D item types: rectangles and polygons. We did at one time implement a psuedo-3D oval but it's rather hard to make it look reasonable using just the Tk canvas.

Frame

Frame is a pseudo-3D rectangle. It has the following options: Frame implements its scaling code so that the borderwidth remains constant when the picture is resized. In all other respects, it can be treated like any other rectangular item.

Enhancements: In an earlier version of the Slate, the Frame had an additional option,-fill, which could take values none, gloss, and matt. In the first case, the Frame had no "surface" -- that is, it was transparent, which was particularly useful if -relief was ridge. This should be reimplemented.

Example: Create some Frames with various options:

  source $tycho/editors/slate/doc/internals/newslate.itcl
  $slate create Frame 30 30 70 50 -color green -tags moveable
  $slate create Frame 100 20 120 40 -color lightblue -relief ridge -tags moveable
  $slate create Frame 30 130 70 150 -relief sunken -borderwidth 4 -tags moveable

Solid

Solid is a pseudo-3D polygon. It has the following options: Solid implements its scaling code so that the borderwidth remains constant when the picture is resized. Its coordinates, (like the standard Tk canvas polygon item) are a list of vertex coordinates. They must, however, be in a "clockwise" direction for the borders to be drawn properly.

Enhancements: (i) See the remark about -fill option in the Frame section. (ii) In an earlier version of the Slate, Solid had methods to rotate and "flip" itself -- this should be reimplemented.

Example: Create some Solids with various options:

  source $tycho/editors/slate/doc/internals/newslate.itcl
  $slate create Solid 100 20 120 20 120 10 140 30 120 50 120 40 100 40 \
		  -color green -tags moveable
  $slate create Solid 60 20 60 40 40 40 \
		  -color grey -borderwidth 3 -tags moveable

Back up
Tycho Home Page


Copyright © 1996, The Regents of the University of California. All rights reserved.
Last updated: 96/12/11, comments to: johnr@eecs.berkeley.edu