OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tk8.6.12 / 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 .TH tk n 8.4 Tk "Tk Built-In Commands"
9 .so man.macros
10 .BS
11 '\" Note:  do not modify the .SH NAME line immediately below!
12 .SH NAME
13 tk \- Manipulate Tk internal state
14 .SH SYNOPSIS
15 \fBtk\fR \fIoption \fR?\fIarg arg ...\fR?
16 .BE
17 .SH DESCRIPTION
18 .PP
19 The \fBtk\fR command provides access to miscellaneous
20 elements of Tk's internal state.
21 Most of the information manipulated by this command pertains to the
22 application as a whole, or to a screen or display, rather than to a
23 particular window.
24 The command can take any of a number of different forms
25 depending on the \fIoption\fR argument.  The legal forms are:
26 .TP
27 \fBtk appname \fR?\fInewName\fR?
28 .
29 If \fInewName\fR is not specified, this command returns the name
30 of the application (the name that may be used in \fBsend\fR
31 commands to communicate with the application).
32 If \fInewName\fR is specified, then the name of the application
33 is changed to \fInewName\fR.
34 If the given name is already in use, then a suffix of the form
35 .QW "\fB #2\fR"
36 or
37 .QW "\fB #3\fR"
38 is appended in order to make the name unique.
39 The command's result is the name actually chosen.
40 \fInewName\fR should not start with a capital letter.
41 This will interfere with option processing, since names starting with
42 capitals are assumed to be classes;  as a result, Tk may not
43 be able to find some options for the application.
44 If sends have been disabled by deleting the \fBsend\fR command,
45 this command will reenable them and recreate the \fBsend\fR
46 command.
47 .TP
48 \fBtk busy \fIsubcommand\fR ...
49 .
50 This command controls the marking of window hierarchies as
51 .QW busy ,
52 rendering them non-interactive while some other operation is proceeding. For
53 more details see the \fBbusy\fR manual page.
54 .TP
55 \fBtk caret \fIwindow \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR?
56 .
57 Sets and queries the caret location for the display of the specified
58 Tk window \fIwindow\fR.  The caret is the per-display cursor location
59 used for indicating global focus (e.g. to comply with Microsoft
60 Accessibility guidelines), as well as for location of the over-the-spot
61 XIM (X Input Methods) or Windows IME windows.  If no options are specified,
62 the last values used for setting the caret are return in option-value pair
63 format.  \fB\-x\fR and \fB\-y\fR represent window-relative coordinates, and
64 \fB\-height\fR is the height of the current cursor location, or the height
65 of the specified \fIwindow\fR if none is given.
66 .TP
67 \fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR?
68 .
69 Returns a positive integer, the number of milliseconds since the last
70 time the user interacted with the system. If the \fB\-displayof\fR
71 option is given then the return value refers to the display of
72 \fIwindow\fR; otherwise it refers to the display of the application's
73 main window.
74 .RS
75 .PP
76 \fBtk inactive\fR will return \-1, if querying the user inactive time
77 is not supported by the system, and in safe interpreters.
78 .PP
79 If the literal string \fBreset\fR is given as an additional argument,
80 the timer is reset and an empty string is returned. Resetting the
81 inactivity time is forbidden in safe interpreters and will throw an
82 error if tried.
83 .RE
84 .TP
85 \fBtk fontchooser \fIsubcommand\fR ...
86 Controls the Tk font selection dialog. For more details see the
87 \fBfontchooser\fR manual page.
88 .TP
89 \fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR?
90 .
91 Sets and queries the current scaling factor used by Tk to convert between
92 physical units (for example, points, inches, or millimeters) and pixels.  The
93 \fInumber\fR argument is a floating point number that specifies the number of
94 pixels per point on \fIwindow\fR's display.  If the \fIwindow\fR argument is
95 omitted, it defaults to the main window.  If the \fInumber\fR argument is
96 omitted, the current value of the scaling factor is returned.
97 .RS
98 .PP
99 A
100 .QW point
101 is a unit of measurement equal to 1/72 inch.  A scaling factor
102 of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard
103 72 dpi monitor.  A scaling factor of 1.25 would mean 1.25 pixels per point,
104 which is the setting for a 90 dpi monitor; setting the scaling factor to
105 1.25 on a 72 dpi monitor would cause everything in the application to be
106 displayed 1.25 times as large as normal.  The initial value for the scaling
107 factor is set when the application starts, based on properties of the
108 installed monitor, but it can be changed at any time.  Measurements made
109 after the scaling factor is changed will use the new scaling factor, but it
110 is undefined whether existing widgets will resize themselves dynamically to
111 accommodate the new scaling factor.
112 .RE
113 .TP
114 \fBtk useinputmethods \fR?\fB\-displayof \fIwindow\fR? ?\fIboolean\fR?
115 .
116 Sets and queries the state of whether Tk should use XIM (X Input Methods)
117 for filtering events.  The resulting state is returned.  XIM is used in
118 some locales (i.e., Japanese, Korean), to handle special input devices. This
119 feature is only significant on X.  If XIM support is not available, this
120 will always return 0.  If the \fIwindow\fR argument is omitted, it defaults
121 to the main window.  If the \fIboolean\fR argument is omitted, the current
122 state is returned.  This is turned on by default for the main display.
123 .TP
124 \fBtk windowingsystem\fR
125 .
126 Returns the current Tk windowing system, one of
127 \fBx11\fR (X11-based), \fBwin32\fR (MS Windows),
128 or \fBaqua\fR (Mac OS X Aqua).
129 .SH "SEE ALSO"
130 busy(n), fontchooser(n), send(n), winfo(n)
131 .SH KEYWORDS
132 application name, send
133 '\" Local Variables:
134 '\" mode: nroff
135 '\" End: