Debian Codegraph @

pod/pTk/GetJustify.pod

raw
1 # Copyright (c) 1990-1994 The Regents of the University of California.
2 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
3 # See the file "license.terms" for information on usage and redistribution
4 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5 #
6 #
7
8 =head1 NAME
9
10 Tk_GetJustify, Tk_NameOfJustify - translate between strings and justification styles
11
12 =for category C Programming
13
14 =head1 SYNOPSIS
15
16 B<#include E<lt>tk.hE<gt>>
17
18 Tk_Justify
19 B<Tk_GetJustify(>I<interp, string, justifyPtr>B<)>
20
21 char *
22 B<Tk_NameOfJustify(>I<justify>B<)>
23
24 =head1 ARGUMENTS
25
26 =over 4
27
28 =item Tcl_Interp *interp (in)
29
30 Interpreter to use for error reporting.
31
32 =item char *string (in)
33
34 String containing name of justification style (``left'', ``right'', or
35 ``center'').
36
37 =item int *justifyPtr (out)
38
39 Pointer to location in which to store justify value corresponding to
40 I<string>.
41
42 =item Tk_Justify justify (in)
43
44 Justification style (one of the values listed below).
45
46 =back
47
48 =head1 DESCRIPTION
49
50 B<Tk_GetJustify> places in I<*justifyPtr> the justify value
51 corresponding to I<string>. This value will be one of the following:
52
53 =over 4
54
55 =item B<TK_JUSTIFY_LEFT>
56
57 Means that the text on each line should start at the left edge of
58 the line; as a result, the right edges of lines may be ragged.
59
60 =item B<TK_JUSTIFY_RIGHT>
61
62 Means that the text on each line should end at the right edge of
63 the line; as a result, the left edges of lines may be ragged.
64
65 =item B<TK_JUSTIFY_CENTER>
66
67 Means that the text on each line should be centered; as a result,
68 both the left and right edges of lines may be ragged.
69
70 Under normal circumstances the return value is B<TCL_OK> and
71 I<interp> is unused.
72 If I<string> doesn't contain a valid justification style
73 or an abbreviation of one of these names, then an error message is
74 stored in I<interp-E<gt>result>, B<TCL_ERROR> is returned, and
75 I<*justifyPtr> is unmodified.
76
77 B<Tk_NameOfJustify> is the logical inverse of B<Tk_GetJustify>.
78 Given a justify value it returns a statically-allocated string
79 corresponding to I<justify>.
80 If I<justify> isn't a legal justify value, then
81 ``unknown justification style'' is returned.
82
83 =back
84
85 =head1 KEYWORDS
86
87 center, fill, justification, string