Tk Library Procedures Tk_GetDash(3TK)
_________________________________________________________________
NAME
Tk_GetDash - convert from string to valid dash structure.
SYNOPSIS
#include
intTk_GetDash(interp, string, dashPtr)
ARGUMENTSTcl_Interp *interp(in)
Interpreter to use for error reporting. CONST char * string(in)Textual value to be con-
verted.Tk_Dash *dashPtr (out) Points to place to store the
dash pattern value converted from string._________________________________________________________________
DESCRIPTION
These procedure parses the string and fills in the result inthe Tk_Dash structure. The string can be a list of integers
or a character string containing only [.,-_] or spaces. If
all goes well, TCL_OK is returned. If string doesn't have
the proper syntax then TCL_ERROR is returned, an error mes-
sage is left in the interpreter's result, and nothing is stored at *dashPtr.The first possible syntax is a list of integers. Each ele-
ment represents the number of pixels of a line segment. Only the odd segments are drawn using the "outline" color. The other segments are drawn transparent. The second possible syntax is a character list containingonly 5 possible characters [.,-_ ]. The space can be used to
enlarge the space between other line elements, and can not occur as the first posibion in the string. Some examples:-dash . = -dash {2 4}
-dash - = -dash {6 4}
-dash -. = -dash {6 4 2 4}
-dash -.. = -dash {6 4 2 4 2 4}
-dash {. } = -dash {2 8}
-dash , = -dash {4 4}
Tk Last change: 8.3 1Tk Library Procedures Tk_GetDash(3TK)
The main difference of this syntax with the previous is thatit it shape-conserving. This means that all values in the
dash list will be multiplied by the line width before display. This assures that "." will always be displayed as adot and "-" always as a dash regardless of the line width.
On systems where only a limited set of dash patterns, thedash pattern will be displayed as the most close dash pat-
tern that is available. For example, on Windows only the first 4 of the above examples are available. The last 2 examples will be displayed identically as the first one. KEYWORDS dash, conversionATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:_______________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE|
|____________________|__________________|_
| Availability | runtime/tk-8 |
|____________________|__________________|_
| Interface Stability| Uncommitted ||____________________|_________________|
NOTES Source for Tk is available on http://opensolaris.org. Tk Last change: 8.3 2