GetJustify.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1990-1994 The Regents of the University of California.
- '" Copyright (c) 1994-1998 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: GetJustify.3,v 1.4 2002/08/05 04:30:38 dgp Exp $
- '"
- .so man.macros
- .TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify - translate between strings and justification styles
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- .VS 8.1
- int
- fBTk_GetJustifyFromObj(fIinterp, objPtr, justifyPtrfB)fR
- .sp
- int
- fBTk_GetJustify(fIinterp, string, justifyPtrfB)fR
- .sp
- CONST char *
- fBTk_NameOfJustify(fIjustifyfB)fR
- .SH ARGUMENTS
- .AS "Tk_Justify" *justifyPtr
- .AP Tcl_Interp *interp in
- Interpreter to use for error reporting, or NULL.
- .VS 8.1 br
- .AP Tcl_Obj *objPtr in/out
- String value contains name of justification style (fBleftfR, fBrightfR, or
- fBcenterfR). The
- internal rep will be modified to cache corresponding justify value.
- .AP "CONST char" *string in
- Same as fIobjPtrfR except description of justification style is passed as
- a string.
- .VE
- .AP int *justifyPtr out
- Pointer to location in which to store justify value corresponding to
- fIobjPtrfR or fIstringfR.
- .AP Tk_Justify justify in
- Justification style (one of the values listed below).
- .BE
- .SH DESCRIPTION
- .PP
- .VS 8.1
- fBTk_GetJustifyFromObjfR places in fI*justifyPtrfR the justify value
- corresponding to fIobjPtrfR's value.
- .VE
- This value will be one of the following:
- .TP
- fBTK_JUSTIFY_LEFTfR
- 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.
- .TP
- fBTK_JUSTIFY_RIGHTfR
- 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.
- .TP
- fBTK_JUSTIFY_CENTERfR
- Means that the text on each line should be centered; as a result,
- both the left and right edges of lines may be ragged.
- .PP
- .VS 8.1
- Under normal circumstances the return value is fBTCL_OKfR and
- fIinterpfR is unused.
- If fIobjPtrfR doesn't contain a valid justification style
- or an abbreviation of one of these names, fBTCL_ERRORfR is returned,
- fI*justifyPtrfR is unmodified, and an error message is
- stored in fIinterpfR's result if fIinterpfR isn't NULL.
- fBTk_GetJustifyFromObjfR caches information about the return
- value in fIobjPtrfR, which speeds up future calls to
- fBTk_GetJustifyFromObjfR with the same fIobjPtrfR.
- .PP
- fBTk_GetJustifyfR is identical to fBTk_GetJustifyFromObjfR except
- that the description of the justification is specified with a string instead
- of an object. This prevents fBTk_GetJustifyfR from caching the
- return value, so fBTk_GetJustifyfR is less efficient than
- fBTk_GetJustifyFromObjfR.
- .VE
- .PP
- fBTk_NameOfJustifyfR is the logical inverse of fBTk_GetJustifyfR.
- Given a justify value it returns a statically-allocated string
- corresponding to fIjustifyfR.
- If fIjustifyfR isn't a legal justify value, then
- ``unknown justification style'' is returned.
- .SH KEYWORDS
- center, fill, justification, string