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

NAME

8       Tk_GetJustifyFromObj,   Tk_GetJustify,   Tk_NameOfJustify  -  translate
9       between strings and justification styles
10

SYNOPSIS

12       #include <tk.h>
13
14       int                                                                     │
15       Tk_GetJustifyFromObj(interp, objPtr, justifyPtr)                        
16
17       int                                                                     │
18       Tk_GetJustify(interp, string, justifyPtr)                               
19
20       CONST char *                                                            │
21       Tk_NameOfJustify(justify)                                               
22

ARGUMENTS │

24       Tcl_Interp   *interp       (in)                                         │
25                                            Interpreter  to  use   for   error │
26                                            reporting, or NULL.                │
27
28       Tcl_Obj      *objPtr       (in/out)                                     │
29                                            String value contains name of jus‐ │
30                                            tification style (left, right,  or │
31                                            center).  The internal rep will be │
32                                            modified  to  cache  corresponding │
33                                            justify value.                     │
34
35       CONST char   *string       (in)                                         │
36                                            Same  as objPtr except description │
37                                            of justification style  is  passed │
38                                            as a string.
39
40       int          *justifyPtr   (out)     Pointer  to  location  in which to
41                                            store justify value  corresponding
42                                            to objPtr or string.
43
44       Tk_Justify   justify       (in)      Justification  style  (one  of the
45                                            values listed below).
46_________________________________________________________________
47
48

DESCRIPTION

50       Tk_GetJustifyFromObj places in *justifyPtr  the  justify  value  corre‐ │
51       sponding to objPtr's value.  This value will be one of the following:
52
53       TK_JUSTIFY_LEFT
54              Means  that  the text on each line should start at the left edge
55              of the line;  as a result, the  right  edges  of  lines  may  be
56              ragged.
57
58       TK_JUSTIFY_RIGHT
59              Means that the text on each line should end at the right edge of
60              the line;  as a result, the left edges of lines may be ragged.
61
62       TK_JUSTIFY_CENTER
63              Means that the text on each  line  should  be  centered;   as  a
64              result, both the left and right edges of lines may be ragged.
65
66       Under  normal  circumstances  the  return value is TCL_OK and interp is │
67       unused.  If objPtr doesn't contain a valid justification  style  or  an │
68       abbreviation  of one of these names, TCL_ERROR is returned, *justifyPtr
69       is unmodified, and an error message is stored  in  interp's  result  if │
70       interp  isn't  NULL.  Tk_GetJustifyFromObj caches information about the │
71       return value in objPtr, which speeds up future  calls  to  Tk_GetJusti‐ 
72       fyFromObj with the same objPtr.                                         │
73
74       Tk_GetJustify  is  identical  to  Tk_GetJustifyFromObj  except that the │
75       description of the justification is specified with a string instead  of │
76       an  object.  This prevents Tk_GetJustify from caching the return value, │
77       so Tk_GetJustify is less efficient than Tk_GetJustifyFromObj.
78
79       Tk_NameOfJustify is the logical inverse of Tk_GetJustify.  Given a jus‐
80       tify  value  it  returns a statically-allocated string corresponding to
81       justify.  If justify isn't a legal justify value, then ``unknown justi‐
82       fication style'' is returned.
83
84

KEYWORDS

86       center, fill, justification, string
87
88
89
90Tk                                    8.1              Tk_GetJustifyFromObj(3)
Impressum