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)              Interpreter  to  use   for   error
25                                            reporting, or NULL.
26
27       Tcl_Obj *objPtr (in/out)             String value contains name of jus‐
28                                            tification style, one  of  “left”,
29                                            “right”,  or “center”.  The inter‐
30                                            nal rep will be modified to  cache
31                                            corresponding justify value.
32
33       const char *string (in)              Same  as objPtr except description
34                                            of justification style  is  passed
35                                            as a string.
36
37       int *justifyPtr (out)                Pointer  to  location  in which to
38                                            store justify value  corresponding
39                                            to objPtr or string.
40
41       Tk_Justify justify (in)              Justification  style  (one  of the
42                                            values listed below).
43_________________________________________________________________
44

DESCRIPTION

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

KEYWORDS

82       center, fill, justification, string
83
84
85
86Tk                                    8.1              Tk_GetJustifyFromObj(3)
Impressum