1tk(n)                        Tk Built-In Commands                        tk(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       tk - Manipulate Tk internal state
9

SYNOPSIS

11       tk option ?arg arg ...?
12_________________________________________________________________
13
14

DESCRIPTION

16       The tk command provides access to miscellaneous elements of Tk's inter‐
17       nal state.  Most of the information manipulated by  this  command  per‐
18       tains  to the application as a whole, or to a screen or display, rather
19       than to a particular window.  The command can take any of a  number  of
20       different forms depending on the option argument.  The legal forms are:
21
22       tk appname ?newName?
23              If  newName  is  not specified, this command returns the name of
24              the application (the name that may be used in send  commands  to
25              communicate  with  the  application).   If newName is specified,
26              then the name of the application is changed to newName.  If  the
27              given name is already in use, then a suffix of the form “ #2” or
28#3” is appended in order to make the name  unique.   The  com‐
29              mand's  result  is the name actually chosen.  newName should not
30              start with a capital letter.  This will  interfere  with  option
31              processing, since names starting with capitals are assumed to be
32              classes;  as a result, Tk may not be able to find  some  options
33              for  the  application.   If sends have been disabled by deleting
34              the send command, this command will reenable them  and  recreate
35              the send command.
36
37       tk caret window ?-x x? ?-y y? ?-height height?
38              Sets and queries the caret location for the display of the spec‐
39              ified Tk window window.  The caret  is  the  per-display  cursor
40              location  used  for indicating global focus (e.g. to comply with
41              Microsoft Accessibility guidelines), as well as for location  of
42              the  over-the-spot XIM (X Input Methods) or Windows IME windows.
43              If no options are specified, the last values  used  for  setting
44              the  caret  are  return  in option-value pair format.  -x and -y
45              represent window-relative coordinates, and -height is the height
46              of  the  current cursor location, or the height of the specified
47              window if none is given.
48
49       tk scaling ?-displayof window? ?number?
50              Sets and queries the current scaling factor used by Tk  to  con‐
51              vert  between  physical  units  (for example, points, inches, or
52              millimeters) and pixels.  The  number  argument  is  a  floating
53              point  number  that  specifies the number of pixels per point on
54              window's  display.   If  the  window  argument  is  omitted,  it
55              defaults to the main window.  If the number argument is omitted,
56              the current value of the scaling factor is returned.
57
58              A “point” is a unit of measurement equal to 1/72 inch.  A  scal‐
59              ing  factor  of  1.0  corresponds to 1 pixel per point, which is
60              equivalent to a standard 72 dpi monitor.  A  scaling  factor  of
61              1.25  would mean 1.25 pixels per point, which is the setting for
62              a 90 dpi monitor; setting the scaling factor to 1.25 on a 72 dpi
63              monitor  would  cause  everything  in the application to be dis‐
64              played 1.25 times as large as normal.  The initial value for the
65              scaling  factor  is  set  when  the application starts, based on
66              properties of the installed monitor, but it can  be  changed  at
67              any time.  Measurements made after the scaling factor is changed
68              will use the new scaling factor, but  it  is  undefined  whether
69              existing  widgets will resize themselves dynamically to accommo‐
70              date the new scaling factor.
71
72       tk inactive ?-displayof window? ?reset?
73              Returns a positive integer, the number of milliseconds since the
74              last time the user interacted with the system. If the -displayof
75              option is given then the return value refers to the  display  of
76              window;  otherwise it refers to the display of the application's
77              main window.
78
79              tk inactive will return -1, if querying the user  inactive  time
80              is not supported by the system, and in safe interpreters.
81
82              If  the literal string reset is given as an additional argument,
83              the timer is reset and an empty string  is  returned.  Resetting
84              the  inactivity  time is forbidden in safe interpreters and will
85              throw and error if tried.
86
87       tk useinputmethods ?-displayof window? ?boolean?
88              Sets and queries the state of whether Tk should use XIM (X Input
89              Methods) for filtering events.  The resulting state is returned.
90              XIM is used in some locales (i.e., Japanese, Korean), to  handle
91              special  input  devices.  This feature is only significant on X.
92              If XIM support is not available, this will always return 0.   If
93              the  window argument is omitted, it defaults to the main window.
94              If the  boolean  argument  is  omitted,  the  current  state  is
95              returned.  This is turned on by default for the main display.
96
97       tk windowingsystem
98              Returns the current Tk windowing system, one of x11 (X11-based),
99              win32 (MS Windows), or aqua (Mac OS X Aqua).
100

SEE ALSO

102       send(n), winfo(n)
103

KEYWORDS

105       application name, send
106
107
108
109Tk                                    8.4                                tk(n)
Impressum