OSDN Git Service

* cgen-asm.in: Update copyright year.
[pf3gnuchains/pf3gnuchains3x.git] / tk / doc / tk.n
1 '\"
2 '\" Copyright (c) 1992 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\"
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 '\" 
8 '\" RCS: @(#) $Id$
9 '\" 
10 .so man.macros
11 .TH tk n 8.4 Tk "Tk Built-In Commands"
12 .BS
13 '\" Note:  do not modify the .SH NAME line immediately below!
14 .SH NAME
15 tk \- Manipulate Tk internal state
16 .SH SYNOPSIS
17 \fBtk\fR \fIoption \fR?\fIarg arg ...\fR?
18 .BE
19
20 .SH DESCRIPTION
21 .PP
22 The \fBtk\fR command provides access to miscellaneous
23 elements of Tk's internal state.
24 Most of the information manipulated by this command pertains to the
25 application as a whole, or to a screen or display, rather than to a
26 particular window.
27 The command can take any of a number of different forms
28 depending on the \fIoption\fR argument.  The legal forms are:
29 .TP
30 \fBtk appname \fR?\fInewName\fR?
31 If \fInewName\fR isn't specified, this command returns the name
32 of the application (the name that may be used in \fBsend\fR
33 commands to communicate with the application).
34 If \fInewName\fR is specified, then the name of the application
35 is changed to \fInewName\fR.
36 If the given name is already in use, then a suffix of the form
37 ``\fB #2\fR'' or ``\fB #3\fR'' is appended in order to make the name unique.
38 The command's result is the name actually chosen.
39 \fInewName\fR should not start with a capital letter.
40 This will interfere with option processing, since names starting with
41 capitals are assumed to be classes;  as a result, Tk may not
42 be able to find some options for the application.
43 If sends have been disabled by deleting the \fBsend\fR command,
44 this command will reenable them and recreate the \fBsend\fR
45 command.
46 .VS 8.4
47 .TP
48 \fBtk caret window \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR?
49 .
50 Sets and queries the caret location for the display of the specified
51 Tk window \fIwindow\fR.  The caret is the per-display cursor location
52 used for indicating global focus (e.g. to comply with Microsoft
53 Accessibility guidelines), as well as for location of the over-the-spot
54 XIM (X Input Methods) or Windows IME windows.  If no options are specified,
55 the last values used for setting the caret are return in option-value pair
56 format.  \fI\-x\fR and \fI\-y\fR represent window-relative coordinates, and
57 \fI\-height\fR is the height of the current cursor location, or the height
58 of the specified \fIwindow\fR if none is given.
59 .VE
60 .TP
61 \fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR?
62 .
63 Sets and queries the current scaling factor used by Tk to convert between
64 physical units (for example, points, inches, or millimeters) and pixels.  The
65 \fInumber\fR argument is a floating point number that specifies the number of
66 pixels per point on \fIwindow\fR's display.  If the \fIwindow\fR argument is
67 omitted, it defaults to the main window.  If the \fInumber\fR argument is 
68 omitted, the current value of the scaling factor is returned.
69 .RS
70 .PP
71 A ``point'' is a unit of measurement equal to 1/72 inch.  A scaling factor
72 of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard
73 72 dpi monitor.  A scaling factor of 1.25 would mean 1.25 pixels per point,
74 which is the setting for a 90 dpi monitor; setting the scaling factor to
75 1.25 on a 72 dpi monitor would cause everything in the application to be
76 displayed 1.25 times as large as normal.  The initial value for the scaling
77 factor is set when the application starts, based on properties of the
78 installed monitor, but it can be changed at any time.  Measurements made
79 after the scaling factor is changed will use the new scaling factor, but it
80 is undefined whether existing widgets will resize themselves dynamically to
81 accomodate the new scaling factor.
82 .RE
83 .VS 8.3
84 .TP
85 \fBtk useinputmethods \fR?\fB\-displayof \fIwindow\fR? ?\fIboolean\fR?
86 .
87 Sets and queries the state of whether Tk should use XIM (X Input Methods)
88 for filtering events.  The resulting state is returned.  XIM is used in
89 some locales (ie: Japanese, Korean), to handle special input devices.  This
90 feature is only significant on X.  If XIM support is not available, this
91 will always return 0.  If the \fIwindow\fR argument is omitted, it defaults
92 to the main window.  If the \fIboolean\fR argument is omitted, the current
93 state is returned.  This is turned on by default for the main display.
94 .VE
95 .VS 8.4
96 .TP
97 \fBtk windowingsystem\fR
98 .
99 Returns the current Tk windowing system, one of
100 \fBx11\fR (X11-based), \fBwin32\fR (MS Windows),
101 \fBclassic\fR (Mac OS Classic), or \fBaqua\fR (Mac OS X Aqua).
102 .VE
103 .SH KEYWORDS
104 application name, send