1Tk_GetDash(3)                Tk Library Procedures               Tk_GetDash(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tk_GetDash - convert from string to valid dash structure.
9

SYNOPSIS

11       #include <tk.h>
12
13       int
14       Tk_GetDash(interp, string, dashPtr)
15

ARGUMENTS

17       Tcl_Interp *interp (in)        Interpreter to use for error reporting.
18
19       const char * string (in)       Textual value to be converted.
20
21       Tk_Dash *dashPtr (out)         Points  to  place to store the dash pat‐
22                                      tern value converted from string.
23_________________________________________________________________
24
25

DESCRIPTION

27       These procedure parses the string  and  fills  in  the  result  in  the
28       Tk_Dash  structure. The string can be a list of integers or a character
29       string containing only “.,-_” or spaces. If all goes  well,  TCL_OK  is
30       returned.  If  string does not have the proper syntax then TCL_ERROR is
31       returned, an error message is left in  the  interpreter's  result,  and
32       nothing is stored at *dashPtr.
33
34       The  first  possible  syntax is a list of integers. Each element repre‐
35       sents the number of pixels of a line segment. Only the odd segments are
36       drawn using the “outline” color. The other segments are drawn transpar‐
37       ent.
38
39       The second possible syntax is a character list containing only 5 possi‐
40       ble  characters  “.,-_  ”.   The space can be used to enlarge the space
41       between other line elements, and can not occur as the first position in
42       the string. Some examples:
43                  -dash .     = -dash {2 4}
44                  -dash -     = -dash {6 4}
45                  -dash -.    = -dash {6 4 2 4}
46                  -dash -..   = -dash {6 4 2 4 2 4}
47                  -dash {. }  = -dash {2 8}
48                  -dash ,     = -dash {4 4}
49
50       The  main  difference  of  this  syntax with the previous is that it is
51       shape-conserving. This means that all values in the dash list  will  be
52       multiplied  by  the  line  width  before display. This assures that “.”
53       will always be displayed as a dot and “-” always as a  dash  regardless
54       of the line width.
55
56       On  systems where only a limited set of dash patterns, the dash pattern
57       will be displayed as the most close dash pattern that is available. For
58       example,  on  Windows only the first 4 of the above examples are avail‐
59       able. The last 2 examples will be displayed identically  as  the  first
60       one.
61
62

KEYWORDS

64       dash, conversion
65
66
67
68Tk                                    8.3                        Tk_GetDash(3)
Impressum