Copyright © 2008, 2009 Arndt Roger Schneider
The Rtl_gridwin may deploy Gstripes to draw its focus ring. This is useful whenever the Gstripes background differs starkly. Such as used in the X Window System screen shots.
Example 6.19. Activate Gstripes for a Rtl_gridwin
# Don't activate it for all Rtl_gridwins. option add *gridwin.stripes 1 rtl_gridwin .gridwin -widget .gridwin.listbox listbox .gridwin.listbox .gridwin update
As with Gstripes in general, Rtl_gridwin uses »adjustCommand« and »stripesCommand« to draw the background. A background frame »borderFrame« is added to the Rtl_gridwin structure to create the visible border –Under AQUA® with the »borderColor« set to gray57.
»adjustCommand« has an additional purpose inside a Rtl_gridwin: To inform Gstripes to redraw an eventual altered focus ring in response to a geometry change (The same applies for the Rtl_combobox; see the section called “Rtl_combobox ”).
Example 6.20. An adjustCommand for Rtl_gridwin
option add *Rtl_gridwin.stripes.adjustCommand \ gwadjust proc gwadjust {base canvas} { adjustCommon $base $canvas set gridwin [winfo parent $base] if ![string first $gridwin [focus]] { # Force to redraw the focus ring: $gridwin focusIn } }
The actual layout of a striped Rtl_gridwin is definable through the Option Database, too.
Example 6.21. The default layout for Rtl_gridwin
# The pre-defined settings for a Rtl_gridwin. # Alter these settings as you see fit. option add \ *Rtl_gridwin.borderFrame.gradient \ white option add \ *Rtl_gridwin.borderFrame.opacity \ 1.0 option add \ *Rtl_gridwin.borderFrame.borderColor \ gray57 option add \ *Rtl_gridwin.borderFrame.borderOpacity \ 1.0 option add \ *Rtl_gridwin.borderFrame.borderWidth 1 option add \ *Rtl_gridwin.borderFrame.radius 0 option add \ *Rtl_gridwin.borderFrame.lower 0
There is nothing to say about Rtl_comboboxes. In most cases a simple background colour will suffice for a striped Rtl_combobox. Since the only visible part originates from the focus ring and some extra pixels at the right side.
Gstripes draws the focus ring. The focus ring is rectangular on the left side –where the entry resides– and rounded to the right.
»adjustCommand« is used to recreate the focus ring after a resize operation was enacted. See Example 6.20, “An adjustCommand for Rtl_gridwin”.
The Rtl_combobox is very similar to a Rtl_gridwin and uses »adjustCommand« likewise.
The Rtl_chooseFont and Rtl_makeFont are used to select and create symbolic Tk fonts. Rtl_chooseFont can be striped.
Using Gstripes for the resize handles let them fade into white space. Preserving their resize capability.
Rtlysizer and Rtlxsizer do not adjust their stripes after a resize operation.
The package aquahead can be used to inject a striped checkbutton group into the Rtl_mlistbox. The header-row alone is affected by aquahead .
Loading the package aquahead is enough to make the column headers AQUA® compliant.
As I wrote in the Runtime Library book: the Rtl_tabset is similar to scrollbars and reflects the contents of its client in a single row.
The above statement defines the visual representation of a Rtl_tabset. The selected tab mirrors the white space of the managed window. If the managed window features a radial gradient running through the entire dialog, then the selected tab should display the very same gradient. Clipping is required to implement such a Rtl_tabset, which is currently not possible with vanilla Tk nor with TkPath. The package gtabset contains a compromise toward such a tabset and activates highlight management for individual tabs.
Example 6.23. Radial Gradients in a Rtl_tabset
package require gtabset; ... # Wait until at least a single TkPath # window exists... # ...otherwise the gradient may be empty. option add *Rtl_tabset.stripesCommand stripes
Figure 6.52, “Rtl_tabset with a Radial Gradient” displays a Rtl_tabset were the selected tab features a custom radial gradient. A »gstripes::focuspathes« focus frame is also present.