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”,
29right”, or “center” - or a unique
30                                            abbreviation of one.  The internal
31                                            rep will be modified to cache cor‐
32                                            responding justify value.
33
34       const char *string (in)              Same as objPtr except  description
35                                            of  justification  style is passed
36                                            as a string.
37
38       int *justifyPtr (out)                Pointer to location  in  which  to
39                                            store  justify value corresponding
40                                            to objPtr or string.
41
42       Tk_Justify justify (in)              Justification style  (one  of  the
43                                            values listed below).
44______________________________________________________________________________
45

DESCRIPTION

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

KEYWORDS

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