| [ Team LiB ] |
|
Borders and ReliefExample 40-2 illustrates the different relief options, which control the way the border around a widget is drawn: Example 40-2 3D relief sampler
frame .f -borderwidth 10
pack .f
foreach relief {raised sunken flat ridge groove solid} {
label .f.$relief -text $relief -relief $relief \
-bd 2 -padx 3
pack .f.$relief -side left -padx 4
}
The three-dimensional appearance of widgets is determined by two attributes: borderWidth and relief. The borderWidth adds extra space around the edge of a widget's display, and this area can be displayed in a number of ways according to the relief attribute. The solid relief was added in Tk 8.0 to support the Macintosh look for entry widget, and it works well against white backgrounds. Macintosh buttons do not support different reliefs or honor border width. The activeBorderWidth attribute defines the border width for the menu entries. The relief of a menu is not configurable. It probably is not worth adjusting the menu border width attributes because the default looks OK. The native menus on Windows and Macintosh do not honor this attribute. The activeRelief attribute applies to the elements of a scrollbar (the elevator and two arrows) when the mouse is over them. The elementBorderWidth sets the size of the relief on these elements. Changing the activeRelief does not look good. The native scrollbars on Macintosh and Windows do not honor this attribute. The offRelief and overRelief attributes describe a relief style to use when a widget is in the "off state" and its indicator is not drawn, or the mouse cursor is over the widget. They were added in Tk 8.4 to provide better support for creating toolbars. The overRelief attribute applies to buttons, checkbuttons, and radiobuttons. The offRelief attribute applies only to checkbuttons and radiobuttons. Table 40-2 lists the attributes for borders and relief. |
| [ Team LiB ] |
|