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 isn't specified, this command returns the name of the
24              application (the name that may be used in send commands to  com‐
25              municate  with  the application).  If newName is specified, then
26              the name of the application is changed to newName.  If the given
27              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
59              scaling 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 accomo‐
70              date the new scaling factor.
71
72       tk useinputmethods ?-displayof window? ?boolean?                        │
73              Sets and queries the state of whether Tk should use XIM (X Input │
74              Methods) for filtering events.  The resulting state is returned. │
75              XIM is used in some locales (ie: Japanese,  Korean),  to  handle │
76              special  input  devices.  This feature is only significant on X. │
77              If XIM support is not available, this will always return 0.   If │
78              the  window argument is omitted, it defaults to the main window. │
79              If the  boolean  argument  is  omitted,  the  current  state  is │
80              returned.  This is turned on by default for the main display.    │
81
82       tk windowingsystem                                                      
83              Returns the current Tk windowing system, one of x11 (X11-based), │
84              win32 (MS Windows), classic (Mac OS Classic), or aqua (Mac OS  X │
85              Aqua).
86

KEYWORDS

88       application name, send
89
90
91
92Tk                                    8.4                                tk(n)
Impressum