frame
widget in appearance.
Both of these item types have the following options:
-borderwidth
: The width of the border of the item. By
default, it is two.
-color
: The color of the item. This is a "generic" color as
implemented by the Shades class.
By default, the color is the same as the standard Tk background color
("grey85").
-relief
: The "relief" of the pseudo-3D item. This can
be one of: raised
, sunken
,
groove
, ridge
, or flat
. The
meanings of these are the same as for the Tk frame
widget. The default is raised
.
Example
: Create some Frames and Solids with various options:
set slate [::tycho::Slate::demoslate]
$slate create Frame 30 70 70 90 -color green -tags moveable
$slate create Frame 100 120 120 140 -color lightblue \
-relief ridge -tags moveable
$slate create Frame 30 130 70 150 -relief sunken \
-borderwidth 4 -tags moveable
$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
The Slate has a number of item types that extend simpler item with a text label and with arbitrary graphics. All of these item types inherit from the LabeledItem class. All of them thus have at least these options:
-anchor
: The anchor position of the text label
relative to the region occupied by the item. The anchor can be any of
the compass points -- n
, s
, e
,
w
, ne
, se
, nw
,
sw
-- and c
or center
.
-graphics
The graphics to draw on the item. The value is a
string of item specifications separated by new-lines or semi-colons,
where a specification is the arguments passed to the Slate's
create
command.
-text
: The label of the item. Displayed inside the item
if there are no graphics, and outside if there are.
-fill
. The color with which the item is filled. By default,
it is "", which means that the item is not filled.
-outline
. The color of the outline of the item. If "",
the item has no outline. By default, it is black.
-width
. The width of the item outline, in pixels. By
default, it is one.
Examples
: Create some labeled items with various options:
set slate [::tycho::Slate::demoslate]
$slate create LabeledOval 40 40 100 80 -fill white -outline blue \
-width 4 -text Foo -tags moveable
$slate create LabeledRect 120 120 180 160 -fill blue -outline red \
-anchor nw -text Foo -tags moveable \
-graphics "line 0 0 100 100; line 0 100 100 0"
$slate create LabeledFrame 200 40 260 80 -color green \
-text Foo -tags moveable \
-graphics "Frame 25 25 75 75 -color green -relief sunken"
Options of SmartLine include the following:
-alpha
and -beta
: parameters that
control the placement of the line.
-arrow
, -fill
, and -smooth
:
parameters control the appearance of the line. These have the same
effect as for the Tk canvas item.
-start
and -end
: The direction of the
line start and end-points. These can be any one of the four major
compass points: n
, s
, e
, or
w
.
Examples
: Create some lines:
set slate [::tycho::Slate::demoslate]
$slate create SmartLine 50 50 150 150 -tags moveable
$slate create SmartLine 200 50 240 60 -end w -tags moveable
$slate create SmartLine 50 100 50 180 -end s -tags moveable