NAME
TkGetJustifyFromObj, TkGetJustify, TkNameOfJustify - translate
between strings and justification stylesSYNOPSIS
##iinncclluuddee <
int | TTkkGGeettJJuussttiiffyyFFrroommOObbjj((interp, objPtr, justifyPtr)) | int | TTkkGGeettJJuussttiiffyy((interp, string, justifyPtr)) | CONST char * | TTkkNNaammeeOOffJJuussttiiffyy((justify)) | AARRGGUUMMEENNTTSS | TclInterp *interp (in) || Interpreter to use for error | reporting, or NULL. | TclObj *objPtr (in/out) ||> String value contains name of jus- |
tification style (lleefftt, rriigghhtt, or | cceenntteerr). The internal rep will be | modified to cache corresponding | justify value. | CONST | char *string (in) | | Same as objPtr except description | of justification style is passed | as a string. int *justifyPtr (out) Pointer to location in which to store justify value corresponding to objPtr or string. TkJustify justify (in) Justification style (one of the values listed below).DESCRIPTION
TTkkGGeettJJuussttiiffyyFFrroommOObbjj places in *justifyPtr the justify value corre- |
sponding to objPtr's value. This value will be one of the following: TTKKJJUUSSTTIIFFYYLLEEFFTT Means that the text on each line should start at the left edge of the line; as a result, the right edges of lines may be ragged. TTKKJJUUSSTTIIFFYYRRIIGGHHTT Means that the text on each line should end at the right edge of the line; as a result, the left edges of lines may be ragged. TTKKJJUUSSTTIIFFYYCCEENNTTEERR Means that the text on each line should be centered; as a result, both the left and right edges of lines may be ragged. Under normal circumstances the return value is TTCCLLOOKK and interp is | unused. If objPtr doesn't contain a valid justification style or an | abbreviation of one of these names, TTCCLLEERRRROORR is returned, *justifyPtr | is unmodified, and an error message is stored in interp's result if | interp isn't NULL. TTkkGGeettJJuussttiiffyyFFrroommOObbjj caches information about the |return value in objPtr, which speeds up future calls to TTkkGGeettJJuussttii- |
ffyyFFrroommOObbjj with the same objPtr. | TTkkGGeettJJuussttiiffyy is identical to TTkkGGeettJJuussttiiffyyFFrroommOObbjj except that the | description of the justification is specified with a string instead of | an object. This prevents TTkkGGeettJJuussttiiffyy from caching the return value, | so TTkkGGeettJJuussttiiffyy is less efficient than TTkkGGeettJJuussttiiffyyFFrroommOObbjj.TTkkNNaammeeOOffJJuussttiiffyy is the logical inverse of TTkkGGeettJJuussttiiffyy. Given a jus-
tify value it returns a statically-allocated string corresponding to
justify. If justify isn't a legal justify value, then ``unknown justi-
fication style'' is returned. KKEEYYWWOORRDDSS center, fill, justification, string Tk 8.1 TkGetJustifyFromObj(3)