Initial release

This commit is contained in:
unknown
2015-10-19 14:27:31 +04:00
commit 32f28094bf
644 changed files with 94529 additions and 0 deletions

24
hlp/en/tk/bell.htm Normal file
View File

@@ -0,0 +1,24 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bell manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
bell - Ring a display's bell
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>bell </B>?<B>-displayof </B><I>window</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command rings the bell on the display for <I>window</I> and
returns an empty string.
If the <B>-displayof</B> option is omitted, the display of the
application's main window is used by default.
The command uses the current bell-related settings for the display, which
may be modified with programs such as <B>xset</B>.
<P>
This command also resets the screen saver for the screen. Some
screen savers will ignore this, but others will reset so that the
screen becomes visible again.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#beep">beep</A>, <A href="../Keywords/B.htm#bell">bell</A>, <A href="../Keywords/R.htm#ring">ring</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

525
hlp/en/tk/bind.htm Normal file
View File

@@ -0,0 +1,525 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bind manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="bind.htm#M2" NAME="L51">NAME</A>
<DL><DD>bind - Arrange for X events to invoke Tcl scripts</DL>
<DD><A HREF="bind.htm#M3" NAME="L52">SYNOPSIS</A>
<DL>
<DD><B>bind</B><I> tag</I>
<DD><B>bind</B><I> tag sequence</I>
<DD><B>bind</B><I> tag sequence script</I>
<DD><B>bind</B><I> tag sequence </I><B>+</B><I>script</I>
</DL>
<DD><A HREF="bind.htm#M4" NAME="L53">INTRODUCTION</A>
<DD><A HREF="bind.htm#M5" NAME="L54">EVENT PATTERNS</A>
<DD><A HREF="bind.htm#M6" NAME="L55">MODIFIERS</A>
<DD><A HREF="bind.htm#M7" NAME="L56">EVENT TYPES</A>
<DL>
<DD><A HREF="bind.htm#M8" NAME="L57"><B>Activate</B></A>
<DD><A HREF="bind.htm#M9" NAME="L58"><B>Deactivate</B></A>
<DD><A HREF="bind.htm#M10" NAME="L59"><B>MouseWheel</B></A>
</DL>
<DD><A HREF="bind.htm#M11" NAME="L60">BINDING SCRIPTS AND SUBSTITUTIONS</A>
<DL>
<DD><A HREF="bind.htm#M12" NAME="L61"><B>%%</B></A>
<DD><A HREF="bind.htm#M13" NAME="L62"><B>%#</B></A>
<DD><A HREF="bind.htm#M14" NAME="L63"><B>%a</B></A>
<DD><A HREF="bind.htm#M15" NAME="L64"><B>%b</B></A>
<DD><A HREF="bind.htm#M16" NAME="L65"><B>%c</B></A>
<DD><A HREF="bind.htm#M17" NAME="L66"><B>%d</B></A>
<DD><A HREF="bind.htm#M18" NAME="L67"><B>%f</B></A>
<DD><A HREF="bind.htm#M19" NAME="L68"><B>%h</B></A>
<DD><A HREF="bind.htm#M20" NAME="L69"><B>%k</B></A>
<DD><A HREF="bind.htm#M21" NAME="L70"><B>%m</B></A>
<DD><A HREF="bind.htm#M22" NAME="L71"><B>%o</B></A>
<DD><A HREF="bind.htm#M23" NAME="L72"><B>%p</B></A>
<DD><A HREF="bind.htm#M24" NAME="L73"><B>%s</B></A>
<DD><A HREF="bind.htm#M25" NAME="L74"><B>%t</B></A>
<DD><A HREF="bind.htm#M26" NAME="L75"><B>%w</B></A>
<DD><A HREF="bind.htm#M27" NAME="L76"><B>%x</B></A>
<DD><A HREF="bind.htm#M28" NAME="L77"><B>%y</B></A>
<DD><A HREF="bind.htm#M29" NAME="L78"><B>%A</B></A>
<DD><A HREF="bind.htm#M30" NAME="L79"><B>%B</B></A>
<DD><A HREF="bind.htm#M31" NAME="L80"><B>%D</B></A>
<DD><A HREF="bind.htm#M32" NAME="L81"><B>%E</B></A>
<DD><A HREF="bind.htm#M33" NAME="L82"><B>%K</B></A>
<DD><A HREF="bind.htm#M34" NAME="L83"><B>%N</B></A>
<DD><A HREF="bind.htm#M35" NAME="L84"><B>%R</B></A>
<DD><A HREF="bind.htm#M36" NAME="L85"><B>%S</B></A>
<DD><A HREF="bind.htm#M37" NAME="L86"><B>%T</B></A>
<DD><A HREF="bind.htm#M38" NAME="L87"><B>%W</B></A>
<DD><A HREF="bind.htm#M39" NAME="L88"><B>%X</B></A>
<DD><A HREF="bind.htm#M40" NAME="L89"><B>%Y</B></A>
</DL>
<DD><A HREF="bind.htm#M41" NAME="L90">MULTIPLE MATCHES</A>
<DD><A HREF="bind.htm#M42" NAME="L91">MULTI-EVENT SEQUENCES AND IGNORED EVENTS</A>
<DD><A HREF="bind.htm#M43" NAME="L92">ERRORS</A>
<DD><A HREF="bind.htm#M44" NAME="L93">SEE ALSO</A>
<DD><A HREF="bind.htm#M45" NAME="L94">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
bind - Arrange for X events to invoke Tcl scripts
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>bind</B><I> tag</I><BR>
<B>bind</B><I> tag sequence</I><BR>
<B>bind</B><I> tag sequence script</I><BR>
<B>bind</B><I> tag sequence </I><B>+</B><I>script</I><BR>
<H3><A NAME="M4">INTRODUCTION</A></H3>
The <B>bind</B> command associates Tcl scripts with X events.
If all three arguments are specified, <B>bind</B> will
arrange for <I>script</I> (a Tcl script) to be evaluated whenever
the event(s) given by <I>sequence</I> occur in the window(s)
identified by <I>tag</I>.
If <I>script</I> is prefixed with a ``+'', then it is appended to
any existing binding for <I>sequence</I>; otherwise <I>script</I> replaces
any existing binding.
If <I>script</I> is an empty string then the current binding for
<I>sequence</I> is destroyed, leaving <I>sequence</I> unbound.
In all of the cases where a <I>script</I> argument is provided,
<B>bind</B> returns an empty string.
<P>
If <I>sequence</I> is specified without a <I>script</I>, then the
script currently bound to <I>sequence</I> is returned, or
an empty string is returned if there is no binding for <I>sequence</I>.
If neither <I>sequence</I> nor <I>script</I> is specified, then the
return value is a list whose elements are all the sequences
for which there exist bindings for <I>tag</I>.
<P>
The <I>tag</I> argument determines which window(s) the binding applies to.
If <I>tag</I> begins with a dot, as in <B>.a.b.c</B>, then it must
be the path name for a window; otherwise it may be an arbitrary
string.
Each window has an associated list of tags, and a binding applies
to a particular window if its tag is among those specified for
the window.
Although the <B><A HREF="../TclCmd/bindtags.htm">bindtags</A></B> command may be used to assign an
arbitrary set of binding tags to a window, the default binding
tags provide the following behavior:
<DL><P><DD>
If a tag is the name of an internal window the binding applies
to that window.
<P>
If the tag is the name of a toplevel window the binding applies
to the toplevel window and all its internal windows.
<P>
If the tag is the name of a class of widgets, such as <B><A HREF="../TclCmd/button.htm">Button</A></B>,
the binding applies to all widgets in that class;
<P>
If <I>tag</I> has the value <B>all</B>,
the binding applies to all windows in the application.
</DL>
<H3><A NAME="M5">EVENT PATTERNS</A></H3>
The <I>sequence</I> argument specifies a sequence of one or more
event patterns, with optional white space between the patterns. Each
event pattern may
take one of three forms. In the simplest case it is a single
printing ASCII character, such as <B>a</B> or <B>[</B>. The character
may not be a space character or the character <B>&lt;</B>. This form of
pattern matches a <B>KeyPress</B> event for the particular
character. The second form of pattern is longer but more general.
It has the following syntax:
<PRE><B>&lt;</B><I>modifier-modifier-type-detail</I><B>&gt;</B></PRE>
The entire event pattern is surrounded by angle brackets.
Inside the angle brackets are zero or more modifiers, an event
type, and an extra piece of information (<I>detail</I>) identifying
a particular button or keysym. Any of the fields may be omitted,
as long as at least one of <I>type</I> and <I>detail</I> is present.
The fields must be separated by white space or dashes.
<P>
The third form of pattern is used to specify a user-defined, named virtual
event. It has the following syntax:
<PRE><B>&lt;&lt;</B><I>name</I><B>&gt;&gt;</B></PRE>
The entire virtual event pattern is surrounded by double angle brackets.
Inside the angle brackets is the user-defined name of the virtual event.
Modifiers, such as <B>Shift</B> or <B>Control</B>, may not be combined with a
virtual event to modify it. Bindings on a virtual event may be created
before the virtual event is defined, and if the definition of a virtual
event changes dynamically, all windows bound to that virtual event will
respond immediately to the new definition.
<H3><A NAME="M6">MODIFIERS</A></H3>
Modifiers consist of any of the following values:
<PRE><B>Control</B> <B>Mod2, M2</B>
<B>Shift</B> <B>Mod3, M3</B>
<B>Lock</B> <B>Mod4, M4</B>
<B>Button1, B1</B> <B>Mod5, M5</B>
<B>Button2, B2</B> <B>Meta, M</B>
<B>Button3, B3</B> <B>Alt</B>
<B>Button4, B4</B> <B>Double</B>
<B>Button5, B5</B> <B>Triple</B>
<B>Mod1, M1</B> <B>Quadruple</B></PRE>
Where more than one value is listed, separated by commas, the values
are equivalent.
Most of the modifiers have the obvious X meanings.
For example, <B>Button1</B> requires that
button 1 be depressed when the event occurs.
For a binding to match a given event, the modifiers in the event
must include all of those specified in the event pattern.
An event may also contain additional modifiers not specified in
the binding.
For example, if button 1 is pressed while the shift and control keys
are down, the pattern <B>&lt;Control-Button-1&gt;</B> will match
the event, but <B>&lt;Mod1-Button-1&gt;</B> will not.
If no modifiers are specified, then any combination of modifiers may
be present in the event.
<P>
<B>Meta</B> and <B>M</B> refer to whichever of the
<B>M1</B> through <B>M5</B> modifiers is associated with the meta
key(s) on the keyboard (keysyms <B>Meta_R</B> and <B>Meta_L</B>).
If there are no meta keys, or if they are not associated with any
modifiers, then <B>Meta</B> and <B>M</B> will not match any events.
Similarly, the <B>Alt</B> modifier refers to whichever modifier
is associated with the alt key(s) on the keyboard (keysyms
<B>Alt_L</B> and <B>Alt_R</B>).
<P>
The <B>Double</B>, <B>Triple</B> and <B>Quadruple</B> modifiers are a
convenience for specifying double mouse clicks and other repeated
events. They cause a particular event pattern to be repeated 2, 3 or 4
times, and also place a time and space requirement on the sequence: for a
sequence of events to match a <B>Double</B>, <B>Triple</B> or <B>Quadruple</B>
pattern, all of the events must occur close together in time and without
substantial mouse motion in between. For example, <B>&lt;Double-Button-1&gt;</B>
is equivalent to <B>&lt;Button-1&gt;&lt;Button-1&gt;</B> with the extra time and space
requirement.
<H3><A NAME="M7">EVENT TYPES</A></H3>
The <I>type</I> field may be any of the standard X event types, with a
few extra abbreviations. The <I>type</I> field will also accept a
couple non-standard X event types that were added to better support
the Macintosh and Windows platforms. Below is a list of all the valid
types; where two names appear together, they are synonyms.
<PRE><B>Activate Enter Map
ButtonPress, Button Expose Motion
ButtonRelease FocusIn MouseWheel
Circulate FocusOut Property
Colormap Gravity Reparent
Configure KeyPress, Key Unmap
Deactivate KeyRelease Visibility
Destroy Leave</B></PRE>
<P>
Most of the above events have the same fields and behaviors as events
in the X Windowing system. You can find more detailed descriptions of
these events in any X window programming book. A couple of the events
are extensions to the X event system to support features unique to the
Macintosh and Windows platforms. We provide a little more detail on
these events here. These include:
<P>
<DL>
<P><DT><A NAME="M8"><B>Activate</B></A><DD>
<P><DT><A NAME="M9"><B>Deactivate</B></A><DD>
These two events are sent to every sub-window of a toplevel when they
change state. In addition to the focus Window, the Macintosh platform
and Windows platforms have a notion of an active window (which often
has but is not required to have the focus). On the Macintosh, widgets
in the active window have a different appearance than widgets in
deactive windows. The <B>Activate</B> event is sent to all the
sub-windows in a toplevel when it changes from being deactive to
active. Likewise, the <B>Deactive</B> event is sent when the window's
state changes from active to deactive. There are no useful percent
substitutions you would make when binding to these events.
<P><DT><A NAME="M10"><B>MouseWheel</B></A><DD>
Some mice on the Windows platform support a mouse wheel which is used
for scrolling documents without using the scrollbars. By rolling the
wheel, the system will generate <B>MouseWheel</B> events that the
application can use to scroll. Like <B>Key</B> events the event is
always routed to the window that currently has focus. When the event
is received you can use the <B>%D</B> substitution to get the
<I>delta</I> field for the event which is a integer value of motion
that the mouse wheel has moved. The smallest value for which the
system will report is defined by the OS. On Windows 95 &amp; 98 machines
this value is at least 120 before it is reported. However, higher
resolution devices may be available in the future. The sign of the
value determines which direction your widget should scroll. Positive
values should scroll up and negative values should scroll down.
<P></DL>
<P>
The last part of a long event specification is <I>detail</I>. In the
case of a <B>ButtonPress</B> or <B>ButtonRelease</B> event, it is the
number of a button (1-5). If a button number is given, then only an
event on that particular button will match; if no button number is
given, then an event on any button will match. Note: giving a
specific button number is different than specifying a button modifier;
in the first case, it refers to a button being pressed or released,
while in the second it refers to some other button that is already
depressed when the matching event occurs. If a button
number is given then <I>type</I> may be omitted: if will default
to <B>ButtonPress</B>. For example, the specifier <B>&lt;1&gt;</B>
is equivalent to <B>&lt;ButtonPress-1&gt;</B>.
<P>
If the event type is <B>KeyPress</B> or <B>KeyRelease</B>, then
<I>detail</I> may be specified in the form of an X keysym. Keysyms
are textual specifications for particular keys on the keyboard;
they include all the alphanumeric ASCII characters (e.g. ``a'' is
the keysym for the ASCII character ``a''), plus descriptions for
non-alphanumeric characters (``comma'' is the keysym for the comma
character), plus descriptions for all the non-ASCII keys on the
keyboard (``Shift_L'' is the keysm for the left shift key, and
``F1'' is the keysym for the F1 function key, if it exists). The
complete list of keysyms is not presented here; it is
available in other X documentation and may vary from system to
system.
If necessary, you can use the <B>%K</B> notation described below
to print out the keysym name for a particular key.
If a keysym <I>detail</I> is given, then the
<I>type</I> field may be omitted; it will default to <B>KeyPress</B>.
For example, <B>&lt;Control-comma&gt;</B> is equivalent to
<B>&lt;Control-KeyPress-comma&gt;</B>.
<H3><A NAME="M11">BINDING SCRIPTS AND SUBSTITUTIONS</A></H3>
The <I>script</I> argument to <B>bind</B> is a Tcl script,
which will be executed whenever the given event sequence occurs.
<I>Command</I> will be executed in the same interpreter that the
<B>bind</B> command was executed in, and it will run at global
level (only global variables will be accessible).
If <I>script</I> contains
any <B>%</B> characters, then the script will not be
executed directly. Instead, a new script will be
generated by replacing each <B>%</B>, and the character following
it, with information from the current event. The replacement
depends on the character following the <B>%</B>, as defined in the
list below. Unless otherwise indicated, the
replacement string is the decimal value of the given field from
the current event.
Some of the substitutions are only valid for
certain types of events; if they are used for other types of events
the value substituted is undefined.
<P>
<DL>
<P><DT><A NAME="M12"><B>%%</B></A><DD>
Replaced with a single percent.
<P><DT><A NAME="M13"><B>%#</B></A><DD>
The number of the last client request processed by the server
(the <I>serial</I> field from the event). Valid for all event
types.
<P><DT><A NAME="M14"><B>%a</B></A><DD>
The <I>above</I> field from the event,
formatted as a hexadecimal number.
Valid only for <B>Configure</B> events.
<P><DT><A NAME="M15"><B>%b</B></A><DD>
The number of the button that was pressed or released. Valid only
for <B>ButtonPress</B> and <B>ButtonRelease</B> events.
<P><DT><A NAME="M16"><B>%c</B></A><DD>
The <I>count</I> field from the event. Valid only for <B>Expose</B> events.
<P><DT><A NAME="M17"><B>%d</B></A><DD>
The <I>detail</I> field from the event. The <B>%d</B> is replaced by
a string identifying the detail. For <B>Enter</B>,
<B>Leave</B>, <B>FocusIn</B>, and <B>FocusOut</B> events,
the string will be one of the following:
<PRE><B>NotifyAncestor NotifyNonlinearVirtual
NotifyDetailNone NotifyPointer
NotifyInferior NotifyPointerRoot
NotifyNonlinear NotifyVirtual</B></PRE>
For events other than these, the substituted string is undefined.
<P><DT><A NAME="M18"><B>%f</B></A><DD>
The <I>focus</I> field from the event (<B>0</B> or <B>1</B>). Valid only
for <B>Enter</B> and <B>Leave</B> events.
<P><DT><A NAME="M19"><B>%h</B></A><DD>
The <I>height</I> field from the event. Valid for the <B>Configure</B> and
<B>Expose</B> events.
<P><DT><A NAME="M20"><B>%k</B></A><DD>
The <I>keycode</I> field from the event. Valid only for <B>KeyPress</B>
and <B>KeyRelease</B> events.
<P><DT><A NAME="M21"><B>%m</B></A><DD>
The <I>mode</I> field from the event. The substituted string is one of
<B>NotifyNormal</B>, <B>NotifyGrab</B>, <B>NotifyUngrab</B>, or
<B>NotifyWhileGrabbed</B>. Valid only for <B>Enter</B>,
<B>FocusIn</B>, <B>FocusOut</B>, and <B>Leave</B> events.
<P><DT><A NAME="M22"><B>%o</B></A><DD>
The <I>override_redirect</I> field from the event. Valid only for
<B>Map</B>, <B>Reparent</B>, and <B>Configure</B> events.
<P><DT><A NAME="M23"><B>%p</B></A><DD>
The <I>place</I> field from the event, substituted as one of the
strings <B>PlaceOnTop</B> or <B>PlaceOnBottom</B>. Valid only
for <B>Circulate</B> events.
<P><DT><A NAME="M24"><B>%s</B></A><DD>
The <I>state</I> field from the event. For <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>KeyPress</B>, <B>KeyRelease</B>,
<B>Leave</B>, and <B>Motion</B> events, a decimal string
is substituted. For <B>Visibility</B>, one of the strings
<B>VisibilityUnobscured</B>, <B>VisibilityPartiallyObscured</B>,
and <B>VisibilityFullyObscured</B> is substituted.
<P><DT><A NAME="M25"><B>%t</B></A><DD>
The <I>time</I> field from the event. Valid only for events that
contain a <I>time</I> field.
<P><DT><A NAME="M26"><B>%w</B></A><DD>
The <I>width</I> field from the event. Valid only for
<B>Configure</B> and <B>Expose</B> events.
<P><DT><A NAME="M27"><B>%x</B></A><DD>
The <I>x</I> field from the event. Valid only for events containing
an <I>x</I> field.
<P><DT><A NAME="M28"><B>%y</B></A><DD>
The <I>y</I> field from the event. Valid only for events containing
a <I>y</I> field.
<P><DT><A NAME="M29"><B>%A</B></A><DD>
Substitutes the ASCII character corresponding to the event, or
the empty string if the event doesn't correspond to an ASCII character
(e.g. the shift key was pressed). <B>XLookupString</B> does all the
work of translating from the event to an ASCII character.
Valid only for <B>KeyPress</B> and <B>KeyRelease</B> events.
<P><DT><A NAME="M30"><B>%B</B></A><DD>
The <I>border_width</I> field from the event. Valid only for
<B>Configure</B> events.
<P><DT><A NAME="M31"><B>%D</B></A><DD>
This reports the <I>delta</I> value of a <B>MouseWheel</B> event. The
<I>delta</I> value represents the rotation units the mouse wheel has
been moved. On Windows 95 &amp; 98 systems the smallest value for the
delta is 120. Future systems may support higher resolution values for
the delta. The sign of the value represents the direction the mouse
wheel was scrolled.
<P><DT><A NAME="M32"><B>%E</B></A><DD>
The <I>send_event</I> field from the event. Valid for all event types.
<P><DT><A NAME="M33"><B>%K</B></A><DD>
The keysym corresponding to the event, substituted as a textual
string. Valid only for <B>KeyPress</B> and <B>KeyRelease</B> events.
<P><DT><A NAME="M34"><B>%N</B></A><DD>
The keysym corresponding to the event, substituted as a decimal
number. Valid only for <B>KeyPress</B> and <B>KeyRelease</B> events.
<P><DT><A NAME="M35"><B>%R</B></A><DD>
The <I>root</I> window identifier from the event. Valid only for
events containing a <I>root</I> field.
<P><DT><A NAME="M36"><B>%S</B></A><DD>
The <I>subwindow</I> window identifier from the event,
formatted as a hexadecimal number.
Valid only for events containing a <I>subwindow</I> field.
<P><DT><A NAME="M37"><B>%T</B></A><DD>
The <I>type</I> field from the event. Valid for all event types.
<P><DT><A NAME="M38"><B>%W</B></A><DD>
The path name of the window to which the event was reported (the
<I>window</I> field from the event). Valid for all event types.
<P><DT><A NAME="M39"><B>%X</B></A><DD>
The <I>x_root</I> field from the event.
If a virtual-root window manager is being used then the substituted
value is the corresponding x-coordinate in the virtual root.
Valid only for
<B>ButtonPress</B>, <B>ButtonRelease</B>, <B>KeyPress</B>, <B>KeyRelease</B>,
and <B>Motion</B> events.
<P><DT><A NAME="M40"><B>%Y</B></A><DD>
The <I>y_root</I> field from the event.
If a virtual-root window manager is being used then the substituted
value is the corresponding y-coordinate in the virtual root.
Valid only for
<B>ButtonPress</B>, <B>ButtonRelease</B>, <B>KeyPress</B>, <B>KeyRelease</B>,
and <B>Motion</B> events.
<P></DL>
<P>
The replacement string for a %-replacement is formatted as a proper
Tcl list element.
This means that it will be surrounded with braces
if it contains spaces, or special characters such as <B>$</B> and
<B>{</B> may be preceded by backslashes.
This guarantees that the string will be passed through the Tcl
parser when the binding script is evaluated.
Most replacements are numbers or well-defined strings such
as <B>Above</B>; for these replacements no special formatting
is ever necessary.
The most common case where reformatting occurs is for the <B>%A</B>
substitution. For example, if <I>script</I> is
<PRE><B>insert %A</B></PRE>
and the character typed is an open square bracket, then the script
actually executed will be
<PRE><B>insert &#92;[</B></PRE>
This will cause the <B>insert</B> to receive the original replacement
string (open square bracket) as its first argument.
If the extra backslash hadn't been added, Tcl would not have been
able to parse the script correctly.
<H3><A NAME="M41">MULTIPLE MATCHES</A></H3>
It is possible for several bindings to match a given X event.
If the bindings are associated with different <I>tag</I>'s,
then each of the bindings will be executed, in order.
By default, a binding for the widget will be executed first, followed
by a class binding, a binding for its toplevel, and
an <B>all</B> binding.
The <B><A HREF="../TclCmd/bindtags.htm">bindtags</A></B> command may be used to change this order for
a particular window or to associate additional binding tags with
the window.
<P>
The <B><A HREF="../TkCmd/continue.htm">continue</A></B> and <B><A HREF="../TkCmd/break.htm">break</A></B> commands may be used inside a
binding script to control the processing of matching scripts.
If <B><A HREF="../TkCmd/continue.htm">continue</A></B> is invoked, then the current binding script
is terminated but Tk will continue processing binding scripts
associated with other <I>tag</I>'s.
If the <B><A HREF="../TkCmd/break.htm">break</A></B> command is invoked within a binding script,
then that script terminates and no other scripts will be invoked
for the event.
<P>
If more than one binding matches a particular event and they
have the same <I>tag</I>, then the most specific binding
is chosen and its script is evaluated.
The following tests are applied, in order, to determine which of
several matching sequences is more specific:
(a) an event pattern that specifies a specific button or key is more specific
than one that doesn't;
(b) a longer sequence (in terms of number
of events matched) is more specific than a shorter sequence;
(c) if the modifiers specified in one pattern are a subset of the
modifiers in another pattern, then the pattern with more modifiers
is more specific.
(d) a virtual event whose physical pattern matches the sequence is less
specific than the same physical pattern that is not associated with a
virtual event.
(e) given a sequence that matches two or more virtual events, one
of the virtual events will be chosen, but the order is undefined.
<P>
If the matching sequences contain more than one event, then tests
(c)-(e) are applied in order from the most recent event to the least recent
event in the sequences. If these tests fail to determine a winner, then the
most recently registered sequence is the winner.
<P>
If there are two (or more) virtual events that are both triggered by the
same sequence, and both of those virtual events are bound to the same window
tag, then only one of the virtual events will be triggered, and it will
be picked at random:
<PRE>event add &lt;&lt;Paste&gt;&gt; &lt;Control-y&gt;
event add &lt;&lt;Paste&gt;&gt; &lt;Button-2&gt;
event add &lt;&lt;Scroll&gt;&gt; &lt;Button-2&gt;
bind Entry &lt;&lt;Paste&gt;&gt; {puts Paste}
bind Entry &lt;&lt;Scroll&gt;&gt; {puts Scroll}</PRE>
If the user types Control-y, the <B>&lt;&lt;Paste&gt;&gt;</B> binding
will be invoked, but if the user presses button 2 then one of
either the <B>&lt;&lt;Paste&gt;&gt;</B> or the <B>&lt;&lt;Scroll&gt;&gt;</B> bindings will
be invoked, but exactly which one gets invoked is undefined.
<P>
If an X event does not match any of the existing bindings, then the
event is ignored.
An unbound event is not considered to be an error.
<H3><A NAME="M42">MULTI-EVENT SEQUENCES AND IGNORED EVENTS</A></H3>
When a <I>sequence</I> specified in a <B>bind</B> command contains
more than one event pattern, then its script is executed whenever
the recent events (leading up to and including the current event)
match the given sequence. This means, for example, that if button 1 is
clicked repeatedly the sequence <B>&lt;Double-ButtonPress-1&gt;</B> will match
each button press but the first.
If extraneous events that would prevent a match occur in the middle
of an event sequence then the extraneous events are
ignored unless they are <B>KeyPress</B> or <B>ButtonPress</B> events.
For example, <B>&lt;Double-ButtonPress-1&gt;</B> will match a sequence of
presses of button 1, even though there will be <B>ButtonRelease</B>
events (and possibly <B>Motion</B> events) between the
<B>ButtonPress</B> events.
Furthermore, a <B>KeyPress</B> event may be preceded by any number
of other <B>KeyPress</B> events for modifier keys without the
modifier keys preventing a match.
For example, the event sequence <B>aB</B> will match a press of the
<B>a</B> key, a release of the <B>a</B> key, a press of the <B>Shift</B>
key, and a press of the <B>b</B> key: the press of <B>Shift</B> is
ignored because it is a modifier key.
Finally, if several <B>Motion</B> events occur in a row, only
the last one is used for purposes of matching binding sequences.
<H3><A NAME="M43">ERRORS</A></H3>
If an error occurs in executing the script for a binding then the
<B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> mechanism is used to report the error.
The <B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> command will be executed at global level
(outside the context of any Tcl procedure).
<H3><A NAME="M44">SEE ALSO</A></H3>
<B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B>, <B><A HREF="../TclCmd/keysyms.htm">keysyms</A></B>
<H3><A NAME="M45">KEYWORDS</A></H3>
<A href="../Keywords/F.htm#form">form</A>, <A href="../Keywords/M.htm#manual">manual</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1998 by Scriptics Corporation.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

66
hlp/en/tk/bindtags.htm Normal file
View File

@@ -0,0 +1,66 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bindtags manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
bindtags - Determine which bindings apply to a window, and order of evaluation
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>bindtags </B><I>window </I>?<I>tagList</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
When a binding is created with the <B><A HREF="../TclCmd/bind.htm">bind</A></B> command, it is
associated either with a particular window such as <B>.a.b.c</B>,
a class name such as <B><A HREF="../TclCmd/button.htm">Button</A></B>, the keyword <B>all</B>, or any
other string.
All of these forms are called <I>binding tags</I>.
Each window contains a list of binding tags that determine how
events are processed for the window.
When an event occurs in a window, it is applied to each of the
window's tags in order: for each tag, the most specific binding
that matches the given tag and event is executed.
See the <B><A HREF="../TclCmd/bind.htm">bind</A></B> command for more information on the matching
process.
<P>
By default, each window has four binding tags consisting of the
name of the window, the window's class name, the name of the window's
nearest toplevel ancestor, and <B>all</B>, in that order.
Toplevel windows have only three tags by default, since the toplevel
name is the same as that of the window.
The <B>bindtags</B> command allows the binding tags for a window to be
read and modified.
<P>
If <B>bindtags</B> is invoked with only one argument, then the
current set of binding tags for <I>window</I> is returned as a list.
If the <I>tagList</I> argument is specified to <B>bindtags</B>,
then it must be a proper list; the tags for <I>window</I> are changed
to the elements of the list.
The elements of <I>tagList</I> may be arbitrary strings; however,
any tag starting with a dot is treated as the name of a window; if
no window by that name exists at the time an event is processed,
then the tag is ignored for that event.
The order of the elements in <I>tagList</I> determines the order in
which binding scripts are executed in response to events.
For example, the command
<PRE><B>bindtags .b {all . Button .b}</B></PRE>
reverses the order in which binding scripts will be evaluated for
a button named <B>.b</B> so that <B>all</B> bindings are invoked
first, following by bindings for <B>.b</B>'s toplevel (``.''), followed by
class bindings, followed by bindings for <B>.b</B>.
If <I>tagList</I> is an empty list then the binding tags for <I>window</I>
are returned to the default state described above.
<P>
The <B>bindtags</B> command may be used to introduce arbitrary
additional binding tags for a window, or to remove standard tags.
For example, the command
<PRE><B>bindtags .b {.b TrickyButton . all}</B></PRE>
replaces the <B><A HREF="../TclCmd/button.htm">Button</A></B> tag for <B>.b</B> with <B>TrickyButton</B>.
This means that the default widget bindings for buttons, which are
associated with the <B><A HREF="../TclCmd/button.htm">Button</A></B> tag, will no longer apply to <B>.b</B>,
but any bindings associated with <B>TrickyButton</B> (perhaps some
new button behavior) will apply.
<H3><A NAME="M5">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/bind.htm">bind</A></B>
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#binding">binding</A>, <A href="../Keywords/E.htm#event">event</A>, <A href="../Keywords/T.htm#tag">tag</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

122
hlp/en/tk/bitmap.htm Normal file
View File

@@ -0,0 +1,122 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bitmap manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="bitmap.htm#M2" NAME="L100">NAME</A>
<DL><DD>bitmap - Images that display two colors</DL>
<DD><A HREF="bitmap.htm#M3" NAME="L101">SYNOPSIS</A>
<DL>
<DD><B>image create bitmap </B>?<I>name</I>? ?<I>options</I>?
</DL>
<DD><A HREF="bitmap.htm#M4" NAME="L102">DESCRIPTION</A>
<DD><A HREF="bitmap.htm#M5" NAME="L103">CREATING BITMAPS</A>
<DL>
<DD><A HREF="bitmap.htm#M6" NAME="L104"><B>-background </B><I>color</I></A>
<DD><A HREF="bitmap.htm#M7" NAME="L105"><B>-data </B><I>string</I></A>
<DD><A HREF="bitmap.htm#M8" NAME="L106"><B>-file </B><I>name</I></A>
<DD><A HREF="bitmap.htm#M9" NAME="L107"><B>-foreground </B><I>color</I></A>
<DD><A HREF="bitmap.htm#M10" NAME="L108"><B>-maskdata </B><I>string</I></A>
<DD><A HREF="bitmap.htm#M11" NAME="L109"><B>-maskfile </B><I>name</I></A>
</DL>
<DD><A HREF="bitmap.htm#M12" NAME="L110">IMAGE COMMAND</A>
<DL>
<DD><A HREF="bitmap.htm#M13" NAME="L111"><I>imageName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="bitmap.htm#M14" NAME="L112"><I>imageName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="bitmap.htm#M15" NAME="L113">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
bitmap - Images that display two colors
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>image create bitmap </B>?<I>name</I>? ?<I>options</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
A bitmap is an image whose pixels can display either of two colors
or be transparent.
A bitmap image is defined by four things: a background color,
a foreground color, and two bitmaps, called the <I>source</I>
and the <I>mask</I>.
Each of the bitmaps specifies 0/1 values for a rectangular
array of pixels, and the two bitmaps must have the same
dimensions.
For pixels where the mask is zero, the image displays nothing,
producing a transparent effect.
For other pixels, the image displays the foreground color if
the source data is one and the background color if the source
data is zero.
<H3><A NAME="M5">CREATING BITMAPS</A></H3>
Like all images, bitmaps are created using the <B><A HREF="../TclCmd/image.htm">image create</A></B>
command.
Bitmaps support the following <I>options</I>:
<P>
<DL>
<P><DT><A NAME="M6"><B>-background </B><I>color</I></A><DD>
Specifies a background color for the image in any of the standard
ways accepted by Tk. If this option is set to an empty string
then the background pixels will be transparent. This effect
is achieved by using the source bitmap as the mask bitmap, ignoring
any <B>-maskdata</B> or <B>-maskfile</B> options.
<P><DT><A NAME="M7"><B>-data </B><I>string</I></A><DD>
Specifies the contents of the source bitmap as a string.
The string must adhere to X11 bitmap format (e.g., as generated
by the <B>bitmap</B> program).
If both the <B>-data</B> and <B>-file</B> options are specified,
the <B>-data</B> option takes precedence.
<P><DT><A NAME="M8"><B>-file </B><I>name</I></A><DD>
<I>name</I> gives the name of a file whose contents define the
source bitmap.
The file must adhere to X11 bitmap format (e.g., as generated
by the <B>bitmap</B> program).
<P><DT><A NAME="M9"><B>-foreground </B><I>color</I></A><DD>
Specifies a foreground color for the image in any of the standard
ways accepted by Tk.
<P><DT><A NAME="M10"><B>-maskdata </B><I>string</I></A><DD>
Specifies the contents of the mask as a string.
The string must adhere to X11 bitmap format (e.g., as generated
by the <B>bitmap</B> program).
If both the <B>-maskdata</B> and <B>-maskfile</B> options are specified,
the <B>-maskdata</B> option takes precedence.
<P><DT><A NAME="M11"><B>-maskfile </B><I>name</I></A><DD>
<I>name</I> gives the name of a file whose contents define the
mask.
The file must adhere to X11 bitmap format (e.g., as generated
by the <B>bitmap</B> program).
<P></DL>
<H3><A NAME="M12">IMAGE COMMAND</A></H3>
When a bitmap image is created, Tk also creates a new command
whose name is the same as the image.
This command may be used to invoke various operations
on the image.
It has the following general form:
<PRE><I>imageName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for bitmap images:
<P>
<DL>
<P><DT><A NAME="M13"><I>imageName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the
<B>image create bitmap</B> command.
<P><DT><A NAME="M14"><I>imageName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options for the image.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>imageName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the
<B>image create bitmap</B> command.
<P></DL>
<H3><A NAME="M15">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#bitmap">bitmap</A>, <A href="../Keywords/I.htm#image">image</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

244
hlp/en/tk/button.htm Normal file
View File

@@ -0,0 +1,244 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - button manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="button.htm#M2" NAME="L114">NAME</A>
<DL><DD>button - Create and manipulate button widgets</DL>
<DD><A HREF="button.htm#M3" NAME="L115">SYNOPSIS</A>
<DL>
<DD><B>button</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="button.htm#M4" NAME="L116">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A>
<DD><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-image">-image, image, Image</A>
<DD><A HREF="options.htm#M-justify">-justify, justify, Justify</A>
<DD><A HREF="options.htm#M-padx">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text">-text, text, Text</A>
<DD><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-underline">-underline, underline, Underline</A>
<DD><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A>
</DL>
<DD><A HREF="button.htm#M5" NAME="L117">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="button.htm#M6" NAME="L118">-command, command, Command</A>
<DD><A HREF="button.htm#M7" NAME="L119">-default, default, Default</A>
<DD><A HREF="button.htm#M8" NAME="L120">-height, height, Height</A>
<DD><A HREF="button.htm#M9" NAME="L121">-state, state, State</A>
<DD><A HREF="button.htm#M10" NAME="L122">-width, width, Width</A>
</DL>
<DD><A HREF="button.htm#M11" NAME="L123">DESCRIPTION</A>
<DD><A HREF="button.htm#M12" NAME="L124">WIDGET COMMAND</A>
<DL>
<DD><A HREF="button.htm#M13" NAME="L125"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="button.htm#M14" NAME="L126"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="button.htm#M15" NAME="L127"><I>pathName </I><B>flash</B></A>
<DD><A HREF="button.htm#M16" NAME="L128"><I>pathName </I><B>invoke</B></A>
</DL>
<DD><A HREF="button.htm#M17" NAME="L129">DEFAULT BINDINGS</A>
<DL>
</DL>
<DD><A HREF="button.htm#M18" NAME="L130">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
button - Create and manipulate button widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>button</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-image">-image, image, Image</A></B>
<DT><B><A HREF="options.htm#M-justify">-justify, justify, Justify</A></B>
<DT><B><A HREF="options.htm#M-padx">-padx, padX, Pad</A></B>
<DT><B><A HREF="options.htm#M-pady">-pady, padY, Pad</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-text">-text, text, Text</A></B>
<DT><B><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A></B>
<DT><B><A HREF="options.htm#M-underline">-underline, underline, Underline</A></B>
<DT><B><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-command</A></B>
<DT>Database Name: <B>command</B>
<DT>Database Class: <B>Command</B>
<DD>Specifies a Tcl command to associate with the button. This command
is typically invoked when mouse button 1 is released over the button
window.
<P><DT>Command-Line Name: <B><A NAME="M7">-default</A></B>
<DT>Database Name: <B>default</B>
<DT>Database Class: <B>Default</B>
<DD>Specifies one of three states for the default ring: <B>normal</B>,
<B>active</B>, or <B>disabled</B>. In active state, the button is drawn
with the platform specific appearance for a default button. In normal
state, the button is drawn with the platform specific appearance for a
non-default button, leaving enough space to draw the default button
appearance. The normal and active states will result in buttons of
the same size. In disabled state, the button is drawn with the
non-default button appearance without leaving space for the default
appearance. The disabled state may result in a smaller button than
the active state.
ring.
<P><DT>Command-Line Name: <B><A NAME="M8">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies a desired height for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in lines of text.
If this option isn't specified, the button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
<P><DT>Command-Line Name: <B><A NAME="M9">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the button: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the button is displayed using the
<B>foreground</B> and <B>background</B> options. The active state is
typically used when the pointer is over the button. In active state
the button is displayed using the <B>activeForeground</B> and
<B>activeBackground</B> options. Disabled state means that the button
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the <B>disabledForeground</B> and
<B>background</B> options determine how the button is displayed.
<P><DT>Command-Line Name: <B><A NAME="M10">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies a desired width for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in characters.
If this option isn't specified, the button's desired width is computed
from the size of the image or bitmap or text being displayed in it.
</DL>
<H3><A NAME="M11">DESCRIPTION</A></H3>
The <B>button</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a button widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the button such as its colors, font,
text, and initial relief. The <B>button</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A button is a widget that displays a textual string, bitmap or image.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the <B>wrapLength</B> option) and
one of the characters may optionally be underlined using the
<B>underline</B> option.
It can display itself in either of three different ways, according
to
the <B>state</B> option;
it can be made to appear raised, sunken, or flat;
and it can be made to flash. When a user invokes the
button (by pressing mouse button 1 with the cursor over the
button), then the Tcl command specified in the <B>-command</B>
option is invoked.
<H3><A NAME="M12">WIDGET COMMAND</A></H3>
The <B>button</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for button widgets:
<P>
<DL>
<P><DT><A NAME="M13"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>button</B>
command.
<P><DT><A NAME="M14"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>button</B>
command.
<P><DT><A NAME="M15"><I>pathName </I><B>flash</B></A><DD>
Flash the button. This is accomplished by redisplaying the button
several times, alternating between active and normal colors. At
the end of the flash the button is left in the same normal/active
state as when the command was invoked.
This command is ignored if the button's state is <B>disabled</B>.
<P><DT><A NAME="M16"><I>pathName </I><B>invoke</B></A><DD>
Invoke the Tcl command associated with the button, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the button.
This command is ignored if the button's state is <B>disabled</B>.
<P></DL>
<H3><A NAME="M17">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for buttons that give them
default behavior:
<P>
<DL>
<P><DT>[1]<DD>
A button activates whenever the mouse passes over it and deactivates
whenever the mouse leaves the button.
Under Windows, this binding is only active when mouse button 1 has
been pressed over the button.
<P><DT>[2]<DD>
A button's relief is changed to sunken whenever mouse button 1 is
pressed over the button, and the relief is restored to its original
value when button 1 is later released.
<P><DT>[3]<DD>
If mouse button 1 is pressed over a button and later released over
the button, the button is invoked. However, if the mouse is not
over the button when button 1 is released, then no invocation occurs.
<P><DT>[4]<DD>
When a button has the input focus, the space key causes the button
to be invoked.
<P></DL>
<P>
If the button's state is <B>disabled</B> then none of the above
actions occur: the button is completely non-responsive.
<P>
The behavior of buttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M18">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#button">button</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

1826
hlp/en/tk/canvas.htm Normal file

File diff suppressed because it is too large Load Diff

319
hlp/en/tk/checkbutton.htm Normal file
View File

@@ -0,0 +1,319 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - checkbutton manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="checkbutton.htm#M2" NAME="L296">NAME</A>
<DL><DD>checkbutton - Create and manipulate checkbutton widgets</DL>
<DD><A HREF="checkbutton.htm#M3" NAME="L297">SYNOPSIS</A>
<DL>
<DD><B>checkbutton</B><I> pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="checkbutton.htm#M4" NAME="L298">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A>
<DD><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-image">-image, image, Image</A>
<DD><A HREF="options.htm#M-justify">-justify, justify, Justify</A>
<DD><A HREF="options.htm#M-padx">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text">-text, text, Text</A>
<DD><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-underline">-underline, underline, Underline</A>
<DD><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A>
</DL>
<DD><A HREF="checkbutton.htm#M5" NAME="L299">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="checkbutton.htm#M6" NAME="L300">-command, command, Command</A>
<DD><A HREF="checkbutton.htm#M7" NAME="L301">-height, height, Height</A>
<DD><A HREF="checkbutton.htm#M8" NAME="L302">-indicatoron, indicatorOn, IndicatorOn</A>
<DD><A HREF="checkbutton.htm#M9" NAME="L303">-offvalue, offValue, Value</A>
<DD><A HREF="checkbutton.htm#M10" NAME="L304">-onvalue, onValue, Value</A>
<DD><A HREF="checkbutton.htm#M11" NAME="L305">-selectcolor, selectColor, Background</A>
<DD><A HREF="checkbutton.htm#M12" NAME="L306">-selectimage, selectImage, SelectImage</A>
<DD><A HREF="checkbutton.htm#M13" NAME="L307">-state, state, State</A>
<DD><A HREF="checkbutton.htm#M14" NAME="L308">-variable, variable, Variable</A>
<DD><A HREF="checkbutton.htm#M15" NAME="L309">-width, width, Width</A>
</DL>
<DD><A HREF="checkbutton.htm#M16" NAME="L310">DESCRIPTION</A>
<DD><A HREF="checkbutton.htm#M17" NAME="L311">WIDGET COMMAND</A>
<DL>
<DD><A HREF="checkbutton.htm#M18" NAME="L312"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="checkbutton.htm#M19" NAME="L313"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="checkbutton.htm#M20" NAME="L314"><I>pathName </I><B>deselect</B></A>
<DD><A HREF="checkbutton.htm#M21" NAME="L315"><I>pathName </I><B>flash</B></A>
<DD><A HREF="checkbutton.htm#M22" NAME="L316"><I>pathName </I><B>invoke</B></A>
<DD><A HREF="checkbutton.htm#M23" NAME="L317"><I>pathName </I><B>select</B></A>
<DD><A HREF="checkbutton.htm#M24" NAME="L318"><I>pathName </I><B>toggle</B></A>
</DL>
<DD><A HREF="checkbutton.htm#M25" NAME="L319">BINDINGS</A>
<DL>
</DL>
<DD><A HREF="checkbutton.htm#M26" NAME="L320">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
checkbutton - Create and manipulate checkbutton widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>checkbutton</B><I> pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-image">-image, image, Image</A></B>
<DT><B><A HREF="options.htm#M-justify">-justify, justify, Justify</A></B>
<DT><B><A HREF="options.htm#M-padx">-padx, padX, Pad</A></B>
<DT><B><A HREF="options.htm#M-pady">-pady, padY, Pad</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-text">-text, text, Text</A></B>
<DT><B><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A></B>
<DT><B><A HREF="options.htm#M-underline">-underline, underline, Underline</A></B>
<DT><B><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-command</A></B>
<DT>Database Name: <B>command</B>
<DT>Database Class: <B>Command</B>
<DD>Specifies a Tcl command to associate with the button. This command
is typically invoked when mouse button 1 is released over the button
window. The button's global variable (<B>-variable</B> option) will
be updated before the command is invoked.
<P><DT>Command-Line Name: <B><A NAME="M7">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies a desired height for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in lines of text.
If this option isn't specified, the button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
<P><DT>Command-Line Name: <B><A NAME="M8">-indicatoron</A></B>
<DT>Database Name: <B>indicatorOn</B>
<DT>Database Class: <B>IndicatorOn</B>
<DD>Specifies whether or not the indicator should be drawn. Must be a
proper boolean value. If false, the <B>relief</B> option is
ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise.
<P><DT>Command-Line Name: <B><A NAME="M9">-offvalue</A></B>
<DT>Database Name: <B>offValue</B>
<DT>Database Class: <B>Value</B>
<DD>Specifies value to store in the button's associated variable whenever
this button is deselected. Defaults to ``0''.
<P><DT>Command-Line Name: <B><A NAME="M10">-onvalue</A></B>
<DT>Database Name: <B>onValue</B>
<DT>Database Class: <B>Value</B>
<DD>Specifies value to store in the button's associated variable whenever
this button is selected. Defaults to ``1''.
<P><DT>Command-Line Name: <B><A NAME="M11">-selectcolor</A></B>
<DT>Database Name: <B>selectColor</B>
<DT>Database Class: <B>Background</B>
<DD>Specifies a background color to use when the button is selected.
If <B>indicatorOn</B> is true then the color applies to the indicator.
Under Windows, this color is used as the background for the indicator
regardless of the select state.
If <B>indicatorOn</B> is false, this color is used as the background
for the entire widget, in place of <B>background</B> or <B>activeBackground</B>,
whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
<P><DT>Command-Line Name: <B><A NAME="M12">-selectimage</A></B>
<DT>Database Name: <B>selectImage</B>
<DT>Database Class: <B>SelectImage</B>
<DD>Specifies an image to display (in place of the <B>image</B> option)
when the checkbutton is selected.
This option is ignored unless the <B>image</B> option has been
specified.
<P><DT>Command-Line Name: <B><A NAME="M13">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the checkbutton: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the checkbutton is displayed using the
<B>foreground</B> and <B>background</B> options. The active state is
typically used when the pointer is over the checkbutton. In active state
the checkbutton is displayed using the <B>activeForeground</B> and
<B>activeBackground</B> options. Disabled state means that the checkbutton
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the <B>disabledForeground</B> and
<B>background</B> options determine how the checkbutton is displayed.
<P><DT>Command-Line Name: <B><A NAME="M14">-variable</A></B>
<DT>Database Name: <B><A HREF="../TkCmd/variable.htm">variable</A></B>
<DT>Database Class: <B><A HREF="../TkCmd/variable.htm">Variable</A></B>
<DD>Specifies name of global variable to set to indicate whether
or not this button is selected. Defaults to the name of the
button within its parent (i.e. the last element of the button
window's path name).
<P><DT>Command-Line Name: <B><A NAME="M15">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies a desired width for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in characters.
If this option isn't specified, the button's desired width is computed
from the size of the image or bitmap or text being displayed in it.
</DL>
<H3><A NAME="M16">DESCRIPTION</A></H3>
The <B>checkbutton</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a checkbutton widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the checkbutton such as its colors, font,
text, and initial relief. The <B>checkbutton</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A checkbutton is a widget
that displays a textual string, bitmap or image
and a square called an <I>indicator</I>.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the <B>wrapLength</B> option) and
one of the characters may optionally be underlined using the
<B>underline</B> option.
A checkbutton has
all of the behavior of a simple button, including the
following: it can display itself in either of three different
ways, according to the <B>state</B> option;
it can be made to appear
raised, sunken, or flat; it can be made to flash; and it invokes
a Tcl command whenever mouse button 1 is clicked over the
checkbutton.
<P>
In addition, checkbuttons can be <I>selected</I>.
If a checkbutton is selected then the indicator is normally
drawn with a selected appearance, and
a Tcl variable associated with the checkbutton is set to a particular
value (normally 1).
Under Unix, the indicator is drawn with a sunken relief and a special
color. Under Windows, the indicator is drawn with a check mark inside.
If the checkbutton is not selected, then the indicator is drawn with a
deselected appearance, and the associated variable is
set to a different value (typically 0).
Under Unix, the indicator is drawn with a raised relief and no special
color. Under Windows, the indicator is drawn without a check mark inside.
By default, the name of the variable associated with a checkbutton is the
same as the <I>name</I> used to create the checkbutton.
The variable name, and the ``on'' and ``off'' values stored in it,
may be modified with options on the command line or in the option
database.
Configuration options may also be used to modify the way the
indicator is displayed (or whether it is displayed at all).
By default a checkbutton is configured to select and deselect
itself on alternate button clicks.
In addition, each checkbutton monitors its associated variable and
automatically selects and deselects itself when the variables value
changes to and from the button's ``on'' value.
<H3><A NAME="M17">WIDGET COMMAND</A></H3>
The <B>checkbutton</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for checkbutton widgets:
<P>
<DL>
<P><DT><A NAME="M18"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>checkbutton</B>
command.
<P><DT><A NAME="M19"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>checkbutton</B>
command.
<P><DT><A NAME="M20"><I>pathName </I><B>deselect</B></A><DD>
Deselects the checkbutton and sets the associated variable to its ``off''
value.
<P><DT><A NAME="M21"><I>pathName </I><B>flash</B></A><DD>
Flashes the checkbutton. This is accomplished by redisplaying the checkbutton
several times, alternating between active and normal colors. At
the end of the flash the checkbutton is left in the same normal/active
state as when the command was invoked.
This command is ignored if the checkbutton's state is <B>disabled</B>.
<P><DT><A NAME="M22"><I>pathName </I><B>invoke</B></A><DD>
Does just what would have happened if the user invoked the checkbutton
with the mouse: toggle the selection state of the button and invoke
the Tcl command associated with the checkbutton, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the checkbutton.
This command is ignored if the checkbutton's state is <B>disabled</B>.
<P><DT><A NAME="M23"><I>pathName </I><B>select</B></A><DD>
Selects the checkbutton and sets the associated variable to its ``on''
value.
<P><DT><A NAME="M24"><I>pathName </I><B>toggle</B></A><DD>
Toggles the selection state of the button, redisplaying it and
modifying its associated variable to reflect the new state.
<P></DL>
<H3><A NAME="M25">BINDINGS</A></H3>
Tk automatically creates class bindings for checkbuttons that give them
the following default behavior:
<P>
<DL>
<P><DT>[1]<DD>
On Unix systems, a checkbutton activates whenever the mouse passes
over it and deactivates whenever the mouse leaves the checkbutton. On
Mac and Windows systems, when mouse button 1 is pressed over a
checkbutton, the button activates whenever the mouse pointer is inside
the button, and deactivates whenever the mouse pointer leaves the
button.
<P><DT>[2]<DD>
When mouse button 1 is pressed over a checkbutton, it is invoked (its
selection state toggles and the command associated with the button is
invoked, if there is one).
<P><DT>[3]<DD>
When a checkbutton has the input focus, the space key causes the checkbutton
to be invoked. Under Windows, there are additional key bindings; plus
(+) and equal (=) select the button, and minus (-) deselects the button.
<P></DL>
<P>
If the checkbutton's state is <B>disabled</B> then none of the above
actions occur: the checkbutton is completely non-responsive.
<P>
The behavior of checkbuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M26">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#checkbutton">checkbutton</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

36
hlp/en/tk/chooseColor.htm Normal file
View File

@@ -0,0 +1,36 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_chooseColor manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tk_chooseColor - pops up a dialog box for the user to select a color.
<P>
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_chooseColor </B>?<I>option value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The procedure <B>tk_chooseColor</B> pops up a dialog box for the
user to select a color. The following <I>option-value</I> pairs are
possible as command line arguments:
<P>
<DL>
<P><DT><A NAME="M5"><B>-initialcolor</B> <I>color</I></A><DD>
Specifies the color to display in the color dialog when it pops
up. <I>color</I> must be in a form acceptable to the <B><A HREF="../TclLib/GetColor.htm">Tk_GetColor</A></B>
function.
<P><DT><A NAME="M6"><B>-parent</B> <I>window</I></A><DD>
Makes <I>window</I> the logical parent of the color dialog. The color
dialog is displayed on top of its parent window.
<P><DT><A NAME="M7"><B>-title</B> <I>titleString</I></A><DD>
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title will be displayed.
<P></DL>
<P>
If the user selects a color, <B>tk_chooseColor</B> will return the
name of the color in a form acceptable to <B><A HREF="../TclLib/GetColor.htm">Tk_GetColor</A></B>. If the
user cancels the operation, both commands will return the empty
string.
<H3><A NAME="M8">EXAMPLE</A></H3>
<PRE>button .b -fg [tk_chooseColor -initialcolor gray -title &quot;Choose color&quot;]</PRE>
<H3><A NAME="M9">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#color selection dialog">color selection dialog</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

View File

@@ -0,0 +1,58 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_chooseDirectory manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="chooseDirectory.htm#M2" NAME="L329">NAME</A>
<DL><DD>tk_chooseDirectory - pops up a dialog box for the user to select a directory.</DL>
<DD><A HREF="chooseDirectory.htm#M3" NAME="L330">SYNOPSIS</A>
<DL>
<DD><B>tk_chooseDirectory </B>?<I>option value ...</I>?
</DL>
<DD><A HREF="chooseDirectory.htm#M4" NAME="L331">DESCRIPTION</A>
<DL>
<DD><A HREF="chooseDirectory.htm#M5" NAME="L332"><B>-initialdir</B> <I>dirname</I></A>
<DD><A HREF="chooseDirectory.htm#M6" NAME="L333"><B>-parent</B> <I>window</I></A>
<DD><A HREF="chooseDirectory.htm#M7" NAME="L334"><B>-title</B> <I>titleString</I></A>
<DD><A HREF="chooseDirectory.htm#M8" NAME="L335"><B>-mustexist</B> <I>boolean</I></A>
</DL>
<DD><A HREF="chooseDirectory.htm#M9" NAME="L336">SEE ALSO</A>
<DD><A HREF="chooseDirectory.htm#M10" NAME="L337">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
tk_chooseDirectory - pops up a dialog box for the user to select a directory.
<P>
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_chooseDirectory </B>?<I>option value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The procedure <B>tk_chooseDirectory</B> pops up a dialog box for the
user to select a directory. The following <I>option-value</I> pairs are
possible as command line arguments:
<P>
<DL>
<P><DT><A NAME="M5"><B>-initialdir</B> <I>dirname</I></A><DD>
Specifies that the directories in <I>directory</I> should be displayed
when the dialog pops up. If this parameter is not specified, then
the directories in the current working directory are displayed. If the
parameter specifies a relative path, the return value will convert the
relative path to an absolute path. This option may not always work on
the Macintosh. This is not a bug. Rather, the <I>General Controls</I>
control panel on the Mac allows the end user to override the
application default directory.
<P><DT><A NAME="M6"><B>-parent</B> <I>window</I></A><DD>
Makes <I>window</I> the logical parent of the dialog. The dialog
is displayed on top of its parent window.
<P><DT><A NAME="M7"><B>-title</B> <I>titleString</I></A><DD>
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title will be displayed.
<P><DT><A NAME="M8"><B>-mustexist</B> <I>boolean</I></A><DD>
Specifies whether the user may specify non-existant directories. If
this parameter is true, then the user may only select directories that
already exist. The default value is <I>false</I>.
<P></DL>
<P>
<H3><A NAME="M9">SEE ALSO</A></H3>
<B>tk_getOpenFile</B>, <B>tk_getSaveFile</B>
<H3><A NAME="M10">KEYWORDS</A></H3>
<A href="../Keywords/D.htm#directory selection dialog">directory selection dialog</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1998-2000 by Scriptics Corporation.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

68
hlp/en/tk/clipboard.htm Normal file
View File

@@ -0,0 +1,68 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - clipboard manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
clipboard - Manipulate Tk clipboard
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>clipboard </B><I>option</I> ?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command provides a Tcl interface to the Tk clipboard,
which stores data for later retrieval using the selection mechanism.
In order to copy data into the clipboard, <B>clipboard clear</B> must
be called, followed by a sequence of one or more calls to <B>clipboard
append</B>. To ensure that the clipboard is updated atomically, all
appends should be completed before returning to the event loop.
<P>
The first argument to <B>clipboard</B> determines the format of the
rest of the arguments and the behavior of the command. The following
forms are currently supported:
<P>
<P>
<DL>
<P><DT><A NAME="M5"><B>clipboard clear</B> ?<B>-displayof</B> <I>window</I>?</A><DD>
Claims ownership of the clipboard on <I>window</I>'s display and removes
any previous contents. <I>Window</I> defaults to ``.''. Returns an
empty string.
<P><DT><A NAME="M6"><B>clipboard append</B> ?<B>-displayof</B> <I>window</I>? ?<B>-format</B> <I>format</I>? ?<B>-type</B> <I>type</I>? ?<B>-&nbsp;-</B>? <I>data</I></A><DD>
Appends <I>data</I> to the clipboard on <I>window</I>'s
display in the form given by <I>type</I> with the representation given
by <I>format</I> and claims ownership of the clipboard on <I>window</I>'s
display.
<P>
<I>Type</I> specifies the form in which the selection is to be returned
(the desired ``target'' for conversion, in ICCCM terminology), and
should be an atom name such as STRING or FILE_NAME; see the
Inter-Client Communication Conventions Manual for complete details.
<I>Type</I> defaults to STRING.
<P>
The <I>format</I> argument specifies the representation that should be
used to transmit the selection to the requester (the second column of
Table 2 of the ICCCM), and defaults to STRING. If <I>format</I> is
STRING, the selection is transmitted as 8-bit ASCII characters. If
<I>format</I> is ATOM, then the <I>data</I> is
divided into fields separated by white space; each field is converted
to its atom value, and the 32-bit atom value is transmitted instead of
the atom name. For any other <I>format</I>, <I>data</I> is divided
into fields separated by white space and each
field is converted to a 32-bit integer; an array of integers is
transmitted to the selection requester. Note that strings passed to
<B>clipboard append</B> are concatenated before conversion, so the
caller must take care to ensure appropriate spacing across string
boundaries. All items appended to the clipboard with the same
<I>type</I> must have the same <I>format</I>.
<P>
The <I>format</I> argument is needed only for compatibility with
clipboard requesters that don't use Tk. If the Tk toolkit is being
used to retrieve the CLIPBOARD selection then the value is converted back to
a string at the requesting end, so <I>format</I> is
irrelevant.
<P>A <B>-&nbsp;-</B> argument may be specified to mark the end of options: the
next argument will always be used as <I>data</I>.
This feature may be convenient if, for example, <I>data</I> starts
with a <B>-</B>.
<P></DL>
<H3><A NAME="M7">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#clear">clear</A>, <A href="../Keywords/F.htm#format">format</A>, <A href="../Keywords/C.htm#clipboard">clipboard</A>, <A href="../Keywords/A.htm#append">append</A>, <A href="../Keywords/S.htm#selection">selection</A>, <A href="../Keywords/T.htm#type">type</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

765
hlp/en/tk/colors.htm Normal file
View File

@@ -0,0 +1,765 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - colors manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
colors - symbolic color names recognized by Tk
<H3><A NAME="M3">DESCRIPTION</A></H3>
Tk recognizes many symbolic color names (eg, <B>red</B>) when
specifying colors. The symbolic names recognized by Tk and their
8-bit RGB values are:
<PRE>alice blue 240 248 248
AliceBlue 240 248 248
antique white 250 235 235
AntiqueWhite 250 235 235
AntiqueWhite1 255 239 239
AntiqueWhite2 238 223 223
AntiqueWhite3 205 192 192
AntiqueWhite4 139 131 131
aquamarine 127 255 255
aquamarine1 127 255 255
aquamarine2 118 238 238
aquamarine3 102 205 205
aquamarine4 69 139 139
azure 240 255 255
azure1 240 255 255
azure2 224 238 238
azure3 193 205 205
azure4 131 139 139
beige 245 245 245
bisque 255 228 228
bisque1 255 228 228
bisque2 238 213 213
bisque3 205 183 183
bisque4 139 125 125
black 0 0 0
blanched almond 255 235 235
BlanchedAlmond 255 235 235
blue 0 0 0
blue violet 138 43 43
blue1 0 0 0
blue2 0 0 0
blue3 0 0 0
blue4 0 0 0
BlueViolet 138 43 43
brown 165 42 42
brown1 255 64 64
brown2 238 59 59
brown3 205 51 51
brown4 139 35 35
burlywood 222 184 184
burlywood1 255 211 211
burlywood2 238 197 197
burlywood3 205 170 170
burlywood4 139 115 115
cadet blue 95 158 158
CadetBlue 95 158 158
CadetBlue1 152 245 245
CadetBlue2 142 229 229
CadetBlue3 122 197 197
CadetBlue4 83 134 134
chartreuse 127 255 255
chartreuse1 127 255 255
chartreuse2 118 238 238
chartreuse3 102 205 205
chartreuse4 69 139 139
chocolate 210 105 105
chocolate1 255 127 127
chocolate2 238 118 118
chocolate3 205 102 102
chocolate4 139 69 69
coral 255 127 127
coral1 255 114 114
coral2 238 106 106
coral3 205 91 91
coral4 139 62 62
cornflower blue 100 149 149
CornflowerBlue 100 149 149
cornsilk 255 248 248
cornsilk1 255 248 248
cornsilk2 238 232 232
cornsilk3 205 200 200
cornsilk4 139 136 136
cyan 0 255 255
cyan1 0 255 255
cyan2 0 238 238
cyan3 0 205 205
cyan4 0 139 139
dark blue 0 0 0
dark cyan 0 139 139
dark goldenrod 184 134 134
dark gray 169 169 169
dark green 0 100 100
dark grey 169 169 169
dark khaki 189 183 183
dark magenta 139 0 0
dark olive green 85 107 107
dark orange 255 140 140
dark orchid 153 50 50
dark red 139 0 0
dark salmon 233 150 150
dark sea green 143 188 188
dark slate blue 72 61 61
dark slate gray 47 79 79
dark slate grey 47 79 79
dark turquoise 0 206 206
dark violet 148 0 0
DarkBlue 0 0 0
DarkCyan 0 139 139
DarkGoldenrod 184 134 134
DarkGoldenrod1 255 185 185
DarkGoldenrod2 238 173 173
DarkGoldenrod3 205 149 149
DarkGoldenrod4 139 101 101
DarkGray 169 169 169
DarkGreen 0 100 100
DarkGrey 169 169 169
DarkKhaki 189 183 183
DarkMagenta 139 0 0
DarkOliveGreen 85 107 107
DarkOliveGreen1 202 255 255
DarkOliveGreen2 188 238 238
DarkOliveGreen3 162 205 205
DarkOliveGreen4 110 139 139
DarkOrange 255 140 140
DarkOrange1 255 127 127
DarkOrange2 238 118 118
DarkOrange3 205 102 102
DarkOrange4 139 69 69
DarkOrchid 153 50 50
DarkOrchid1 191 62 62
DarkOrchid2 178 58 58
DarkOrchid3 154 50 50
DarkOrchid4 104 34 34
DarkRed 139 0 0
DarkSalmon 233 150 150
DarkSeaGreen 143 188 188
DarkSeaGreen1 193 255 255
DarkSeaGreen2 180 238 238
DarkSeaGreen3 155 205 205
DarkSeaGreen4 105 139 139
DarkSlateBlue 72 61 61
DarkSlateGray 47 79 79
DarkSlateGray1 151 255 255
DarkSlateGray2 141 238 238
DarkSlateGray3 121 205 205
DarkSlateGray4 82 139 139
DarkSlateGrey 47 79 79
DarkTurquoise 0 206 206
DarkViolet 148 0 0
deep pink 255 20 20
deep sky blue 0 191 191
DeepPink 255 20 20
DeepPink1 255 20 20
DeepPink2 238 18 18
DeepPink3 205 16 16
DeepPink4 139 10 10
DeepSkyBlue 0 191 191
DeepSkyBlue1 0 191 191
DeepSkyBlue2 0 178 178
DeepSkyBlue3 0 154 154
DeepSkyBlue4 0 104 104
dim gray 105 105 105
dim grey 105 105 105
DimGray 105 105 105
DimGrey 105 105 105
dodger blue 30 144 144
DodgerBlue 30 144 144
DodgerBlue1 30 144 144
DodgerBlue2 28 134 134
DodgerBlue3 24 116 116
DodgerBlue4 16 78 78
firebrick 178 34 34
firebrick1 255 48 48
firebrick2 238 44 44
firebrick3 205 38 38
firebrick4 139 26 26
floral white 255 250 250
FloralWhite 255 250 250
forest green 34 139 139
ForestGreen 34 139 139
gainsboro 220 220 220
ghost white 248 248 248
GhostWhite 248 248 248
gold 255 215 215
gold1 255 215 215
gold2 238 201 201
gold3 205 173 173
gold4 139 117 117
goldenrod 218 165 165
goldenrod1 255 193 193
goldenrod2 238 180 180
goldenrod3 205 155 155
goldenrod4 139 105 105
gray 190 190 190
gray0 0 0 0
gray1 3 3 3
gray2 5 5 5
gray3 8 8 8
gray4 10 10 10
gray5 13 13 13
gray6 15 15 15
gray7 18 18 18
gray8 20 20 20
gray9 23 23 23
gray10 26 26 26
gray11 28 28 28
gray12 31 31 31
gray13 33 33 33
gray14 36 36 36
gray15 38 38 38</PRE>
<PRE>gray16 41 41 41
gray17 43 43 43
gray18 46 46 46
gray19 48 48 48
gray20 51 51 51
gray21 54 54 54
gray22 56 56 56
gray23 59 59 59
gray24 61 61 61
gray25 64 64 64
gray26 66 66 66
gray27 69 69 69
gray28 71 71 71
gray29 74 74 74
gray30 77 77 77
gray31 79 79 79
gray32 82 82 82
gray33 84 84 84
gray34 87 87 87
gray35 89 89 89
gray36 92 92 92
gray37 94 94 94
gray38 97 97 97
gray39 99 99 99
gray40 102 102 102
gray41 105 105 105
gray42 107 107 107
gray43 110 110 110
gray44 112 112 112
gray45 115 115 115
gray46 117 117 117
gray47 120 120 120
gray48 122 122 122
gray49 125 125 125
gray50 127 127 127
gray51 130 130 130
gray52 133 133 133
gray53 135 135 135
gray54 138 138 138
gray55 140 140 140
gray56 143 143 143
gray57 145 145 145
gray58 148 148 148
gray59 150 150 150
gray60 153 153 153
gray61 156 156 156
gray62 158 158 158
gray63 161 161 161
gray64 163 163 163
gray65 166 166 166
gray66 168 168 168
gray67 171 171 171
gray68 173 173 173
gray69 176 176 176
gray70 179 179 179
gray71 181 181 181
gray72 184 184 184
gray73 186 186 186
gray74 189 189 189
gray75 191 191 191
gray76 194 194 194
gray77 196 196 196
gray78 199 199 199
gray79 201 201 201
gray80 204 204 204
gray81 207 207 207
gray82 209 209 209
gray83 212 212 212
gray84 214 214 214
gray85 217 217 217
gray86 219 219 219
gray87 222 222 222
gray88 224 224 224
gray89 227 227 227
gray90 229 229 229
gray91 232 232 232
gray92 235 235 235
gray93 237 237 237
gray94 240 240 240
gray95 242 242 242
gray96 245 245 245
gray97 247 247 247
gray98 250 250 250
gray99 252 252 252
gray100 255 255 255
green 0 255 255
green yellow 173 255 255
green1 0 255 255
green2 0 238 238
green3 0 205 205
green4 0 139 139
GreenYellow 173 255 255
grey 190 190 190
grey0 0 0 0
grey1 3 3 3
grey2 5 5 5
grey3 8 8 8
grey4 10 10 10
grey5 13 13 13
grey6 15 15 15
grey7 18 18 18
grey8 20 20 20
grey9 23 23 23
grey10 26 26 26
grey11 28 28 28
grey12 31 31 31
grey13 33 33 33
grey14 36 36 36
grey15 38 38 38
grey16 41 41 41
grey17 43 43 43
grey18 46 46 46
grey19 48 48 48
grey20 51 51 51
grey21 54 54 54
grey22 56 56 56
grey23 59 59 59
grey24 61 61 61
grey25 64 64 64
grey26 66 66 66
grey27 69 69 69
grey28 71 71 71
grey29 74 74 74
grey30 77 77 77
grey31 79 79 79
grey32 82 82 82
grey33 84 84 84
grey34 87 87 87
grey35 89 89 89
grey36 92 92 92
grey37 94 94 94
grey38 97 97 97
grey39 99 99 99
grey40 102 102 102
grey41 105 105 105
grey42 107 107 107
grey43 110 110 110
grey44 112 112 112
grey45 115 115 115
grey46 117 117 117
grey47 120 120 120
grey48 122 122 122
grey49 125 125 125
grey50 127 127 127
grey51 130 130 130
grey52 133 133 133
grey53 135 135 135
grey54 138 138 138
grey55 140 140 140
grey56 143 143 143
grey57 145 145 145
grey58 148 148 148
grey59 150 150 150
grey60 153 153 153
grey61 156 156 156
grey62 158 158 158
grey63 161 161 161
grey64 163 163 163
grey65 166 166 166
grey66 168 168 168
grey67 171 171 171
grey68 173 173 173
grey69 176 176 176
grey70 179 179 179
grey71 181 181 181
grey72 184 184 184
grey73 186 186 186
grey74 189 189 189
grey75 191 191 191
grey76 194 194 194
grey77 196 196 196
grey78 199 199 199
grey79 201 201 201
grey80 204 204 204
grey81 207 207 207
grey82 209 209 209
grey83 212 212 212
grey84 214 214 214
grey85 217 217 217
grey86 219 219 219
grey87 222 222 222
grey88 224 224 224
grey89 227 227 227
grey90 229 229 229
grey91 232 232 232
grey92 235 235 235
grey93 237 237 237
grey94 240 240 240
grey95 242 242 242
grey96 245 245 245
grey97 247 247 247
grey98 250 250 250
grey99 252 252 252
grey100 255 255 255
honeydew 240 255 255
honeydew1 240 255 255
honeydew2 224 238 238
honeydew3 193 205 205
honeydew4 131 139 139
hot pink 255 105 105</PRE>
<PRE>HotPink 255 105 105
HotPink1 255 110 110
HotPink2 238 106 106
HotPink3 205 96 96
HotPink4 139 58 58
indian red 205 92 92
IndianRed 205 92 92
IndianRed1 255 106 106
IndianRed2 238 99 99
IndianRed3 205 85 85
IndianRed4 139 58 58
ivory 255 255 255
ivory1 255 255 255
ivory2 238 238 238
ivory3 205 205 205
ivory4 139 139 139
khaki 240 230 230
khaki1 255 246 246
khaki2 238 230 230
khaki3 205 198 198
khaki4 139 134 134
lavender 230 230 230
lavender blush 255 240 240
LavenderBlush 255 240 240
LavenderBlush1 255 240 240
LavenderBlush2 238 224 224
LavenderBlush3 205 193 193
LavenderBlush4 139 131 131
lawn green 124 252 252
LawnGreen 124 252 252
lemon chiffon 255 250 250
LemonChiffon 255 250 250
LemonChiffon1 255 250 250
LemonChiffon2 238 233 233
LemonChiffon3 205 201 201
LemonChiffon4 139 137 137
light blue 173 216 216
light coral 240 128 128
light cyan 224 255 255
light goldenrod 238 221 221
light goldenrod yellow 250 250 250
light gray 211 211 211
light green 144 238 238
light grey 211 211 211
light pink 255 182 182
light salmon 255 160 160
light sea green 32 178 178
light sky blue 135 206 206
light slate blue 132 112 112
light slate gray 119 136 136
light slate grey 119 136 136
light steel blue 176 196 196
light yellow 255 255 255
LightBlue 173 216 216
LightBlue1 191 239 239
LightBlue2 178 223 223
LightBlue3 154 192 192
LightBlue4 104 131 131
LightCoral 240 128 128
LightCyan 224 255 255
LightCyan1 224 255 255
LightCyan2 209 238 238
LightCyan3 180 205 205
LightCyan4 122 139 139
LightGoldenrod 238 221 221
LightGoldenrod1 255 236 236
LightGoldenrod2 238 220 220
LightGoldenrod3 205 190 190
LightGoldenrod4 139 129 129
LightGoldenrodYellow 250 250 250
LightGray 211 211 211
LightGreen 144 238 238
LightGrey 211 211 211
LightPink 255 182 182
LightPink1 255 174 174
LightPink2 238 162 162
LightPink3 205 140 140
LightPink4 139 95 95
LightSalmon 255 160 160
LightSalmon1 255 160 160
LightSalmon2 238 149 149
LightSalmon3 205 129 129
LightSalmon4 139 87 87
LightSeaGreen 32 178 178
LightSkyBlue 135 206 206
LightSkyBlue1 176 226 226
LightSkyBlue2 164 211 211
LightSkyBlue3 141 182 182
LightSkyBlue4 96 123 123
LightSlateBlue 132 112 112
LightSlateGray 119 136 136
LightSlateGrey 119 136 136
LightSteelBlue 176 196 196
LightSteelBlue1 202 225 225
LightSteelBlue2 188 210 210
LightSteelBlue3 162 181 181
LightSteelBlue4 110 123 123
LightYellow 255 255 255
LightYellow1 255 255 255
LightYellow2 238 238 238
LightYellow3 205 205 205
LightYellow4 139 139 139
lime green 50 205 205
LimeGreen 50 205 205
linen 250 240 240
magenta 255 0 0
magenta1 255 0 0
magenta2 238 0 0
magenta3 205 0 0
magenta4 139 0 0
maroon 176 48 48
maroon1 255 52 52
maroon2 238 48 48
maroon3 205 41 41
maroon4 139 28 28
medium aquamarine 102 205 205
medium blue 0 0 0
medium orchid 186 85 85
medium purple 147 112 112
medium sea green 60 179 179
medium slate blue 123 104 104
medium spring green 0 250 250
medium turquoise 72 209 209
medium violet red 199 21 21
MediumAquamarine 102 205 205
MediumBlue 0 0 0
MediumOrchid 186 85 85
MediumOrchid1 224 102 102
MediumOrchid2 209 95 95
MediumOrchid3 180 82 82
MediumOrchid4 122 55 55
MediumPurple 147 112 112
MediumPurple1 171 130 130
MediumPurple2 159 121 121
MediumPurple3 137 104 104
MediumPurple4 93 71 71
MediumSeaGreen 60 179 179
MediumSlateBlue 123 104 104
MediumSpringGreen 0 250 250
MediumTurquoise 72 209 209
MediumVioletRed 199 21 21
midnight blue 25 25 25
MidnightBlue 25 25 25
mint cream 245 255 255
MintCream 245 255 255
misty rose 255 228 228
MistyRose 255 228 228
MistyRose1 255 228 228
MistyRose2 238 213 213
MistyRose3 205 183 183
MistyRose4 139 125 125
moccasin 255 228 228
navajo white 255 222 222
NavajoWhite 255 222 222
NavajoWhite1 255 222 222
NavajoWhite2 238 207 207
NavajoWhite3 205 179 179
NavajoWhite4 139 121 121
navy 0 0 0
navy blue 0 0 0
NavyBlue 0 0 0
old lace 253 245 245
OldLace 253 245 245
olive drab 107 142 142
OliveDrab 107 142 142
OliveDrab1 192 255 255
OliveDrab2 179 238 238
OliveDrab3 154 205 205
OliveDrab4 105 139 139
orange 255 165 165
orange red 255 69 69
orange1 255 165 165
orange2 238 154 154
orange3 205 133 133
orange4 139 90 90
OrangeRed 255 69 69
OrangeRed1 255 69 69
OrangeRed2 238 64 64
OrangeRed3 205 55 55
OrangeRed4 139 37 37
orchid 218 112 112
orchid1 255 131 131
orchid2 238 122 122
orchid3 205 105 105
orchid4 139 71 71
pale goldenrod 238 232 232
pale green 152 251 251
pale turquoise 175 238 238
pale violet red 219 112 112
PaleGoldenrod 238 232 232
PaleGreen 152 251 251
PaleGreen1 154 255 255
PaleGreen2 144 238 238
PaleGreen3 124 205 205
PaleGreen4 84 139 139
PaleTurquoise 175 238 238
PaleTurquoise1 187 255 255
PaleTurquoise2 174 238 238
PaleTurquoise3 150 205 205
PaleTurquoise4 102 139 139</PRE>
<PRE>PaleVioletRed 219 112 112
PaleVioletRed1 255 130 130
PaleVioletRed2 238 121 121
PaleVioletRed3 205 104 104
PaleVioletRed4 139 71 71
papaya whip 255 239 239
PapayaWhip 255 239 239
peach puff 255 218 218
PeachPuff 255 218 218
PeachPuff1 255 218 218
PeachPuff2 238 203 203
PeachPuff3 205 175 175
PeachPuff4 139 119 119
peru 205 133 133
pink 255 192 192
pink1 255 181 181
pink2 238 169 169
pink3 205 145 145
pink4 139 99 99
plum 221 160 160
plum1 255 187 187
plum2 238 174 174
plum3 205 150 150
plum4 139 102 102
powder blue 176 224 224
PowderBlue 176 224 224
purple 160 32 32
purple1 155 48 48
purple2 145 44 44
purple3 125 38 38
purple4 85 26 26
red 255 0 0
red1 255 0 0
red2 238 0 0
red3 205 0 0
red4 139 0 0
rosy brown 188 143 143
RosyBrown 188 143 143
RosyBrown1 255 193 193
RosyBrown2 238 180 180
RosyBrown3 205 155 155
RosyBrown4 139 105 105
royal blue 65 105 105
RoyalBlue 65 105 105
RoyalBlue1 72 118 118
RoyalBlue2 67 110 110
RoyalBlue3 58 95 95
RoyalBlue4 39 64 64
saddle brown 139 69 69
SaddleBrown 139 69 69
salmon 250 128 128
salmon1 255 140 140
salmon2 238 130 130
salmon3 205 112 112
salmon4 139 76 76
sandy brown 244 164 164
SandyBrown 244 164 164
sea green 46 139 139
SeaGreen 46 139 139
SeaGreen1 84 255 255
SeaGreen2 78 238 238
SeaGreen3 67 205 205
SeaGreen4 46 139 139
seashell 255 245 245
seashell1 255 245 245
seashell2 238 229 229
seashell3 205 197 197
seashell4 139 134 134
sienna 160 82 82
sienna1 255 130 130
sienna2 238 121 121
sienna3 205 104 104
sienna4 139 71 71
sky blue 135 206 206
SkyBlue 135 206 206
SkyBlue1 135 206 206
SkyBlue2 126 192 192
SkyBlue3 108 166 166
SkyBlue4 74 112 112
slate blue 106 90 90
slate gray 112 128 128
slate grey 112 128 128
SlateBlue 106 90 90
SlateBlue1 131 111 111
SlateBlue2 122 103 103
SlateBlue3 105 89 89
SlateBlue4 71 60 60
SlateGray 112 128 128
SlateGray1 198 226 226
SlateGray2 185 211 211
SlateGray3 159 182 182
SlateGray4 108 123 123
SlateGrey 112 128 128
snow 255 250 250
snow1 255 250 250
snow2 238 233 233
snow3 205 201 201
snow4 139 137 137
spring green 0 255 255
SpringGreen 0 255 255
SpringGreen1 0 255 255
SpringGreen2 0 238 238
SpringGreen3 0 205 205
SpringGreen4 0 139 139
steel blue 70 130 130
SteelBlue 70 130 130
SteelBlue1 99 184 184
SteelBlue2 92 172 172
SteelBlue3 79 148 148
SteelBlue4 54 100 100
tan 210 180 180
tan1 255 165 165
tan2 238 154 154
tan3 205 133 133
tan4 139 90 90
thistle 216 191 191
thistle1 255 225 225
thistle2 238 210 210
thistle3 205 181 181
thistle4 139 123 123
tomato 255 99 99
tomato1 255 99 99
tomato2 238 92 92
tomato3 205 79 79
tomato4 139 54 54
turquoise 64 224 224
turquoise1 0 245 245
turquoise2 0 229 229
turquoise3 0 197 197
turquoise4 0 134 134
violet 238 130 130
violet red 208 32 32
VioletRed 208 32 32
VioletRed1 255 62 62
VioletRed2 238 58 58
VioletRed3 205 50 50
VioletRed4 139 34 34
wheat 245 222 222
wheat1 255 231 231
wheat2 238 216 216
wheat3 205 186 186
wheat4 139 126 126
white 255 255 255
white smoke 245 245 245
WhiteSmoke 245 245 245
yellow 255 255 255
yellow green 154 205 205
yellow1 255 255 255
yellow2 238 238 238
yellow3 205 205 205
yellow4 139 139 139
YellowGreen 154 205 205</PRE>
<H3><A NAME="M4">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#color">color</A>, <A href="../Keywords/O.htm#option">option</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1998-2000 by Scriptics Corporation.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

128
hlp/en/tk/cursors.htm Normal file
View File

@@ -0,0 +1,128 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - cursors manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
cursors - mouse cursors available in Tk
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>-cursor</B> widget option allows a Tk programmer to change the
mouse cursor for a particular widget. The cursor names recognized by
Tk on all platforms are:
<PRE>X_cursor
arrow
based_arrow_down
based_arrow_up
boat
bogosity
bottom_left_corner
bottom_right_corner
bottom_side
bottom_tee
box_spiral
center_ptr
circle
clock
coffee_mug
cross
cross_reverse
crosshair
diamond_cross
dot
dotbox
double_arrow
draft_large
draft_small
draped_box
exchange
fleur
gobbler
gumby
hand1
hand2
heart
icon
iron_cross
left_ptr
left_side
left_tee
leftbutton
ll_angle
lr_angle
man
middlebutton
mouse
pencil
pirate
plus
question_arrow
right_ptr
right_side
right_tee
rightbutton
rtl_logo
sailboat
sb_down_arrow
sb_h_double_arrow
sb_left_arrow
sb_right_arrow
sb_up_arrow
sb_v_double_arrow
shuttle
sizing
spider
spraycan
star
target
tcross
top_left_arrow
top_left_corner
top_right_corner
top_side
top_tee
trek
ul_angle
umbrella
ur_angle
watch
xterm</PRE>
<H3><A NAME="M4">PORTABILITY ISSUES</A></H3>
<DL>
<P><DT><A NAME="M5"><B>Windows</B></A><DD>
On Windows systems, the following cursors are mapped to native cursors:
<PRE>arrow
center_ptr
crosshair
fleur
ibeam
icon
sb_h_double_arrow
sb_v_double_arrow
watch
xterm</PRE>
And the following additional cursors are available:
<PRE>no
starting
size
size_ne_sw
size_ns
size_nw_se
size_we
uparrow
wait</PRE>
The <B>no</B> cursor can be specified to eliminate the cursor.
<P><DT><A NAME="M6"><B>Macintosh</B></A><DD>
On Macintosh systems, the following cursors are mapped to native cursors:
<PRE>arrow
cross
crosshair
ibeam
plus
watch
xterm</PRE>
And the following additional cursors are available:
<PRE>text
cross-hair</PRE>
<P></DL>
<H3><A NAME="M7">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#cursor">cursor</A>, <A href="../Keywords/O.htm#option">option</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1998-2000 by Scriptics Corporation.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

22
hlp/en/tk/destroy.htm Normal file
View File

@@ -0,0 +1,22 @@
<HTML><HEAD><TITLE>Built-In Commands - destroy manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
destroy - Destroy one or more windows
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>destroy </B>?<I>window window ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command deletes the windows given by the
<I>window</I> arguments, plus all of their descendants.
If a <I>window</I> ``.'' is deleted then the entire application
will be destroyed.
The <I>window</I>s are destroyed in order, and if an error occurs
in destroying a window the command aborts without destroying the
remaining windows.
No error is returned if <I>window</I> does not exist.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#application">application</A>, <A href="../Keywords/D.htm#destroy">destroy</A>, <A href="../Keywords/W.htm#window">window</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

70
hlp/en/tk/dialog.htm Normal file
View File

@@ -0,0 +1,70 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_dialog manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="dialog.htm#M2" NAME="L357">NAME</A>
<DL><DD>tk_dialog - Create modal dialog and wait for response</DL>
<DD><A HREF="dialog.htm#M3" NAME="L358">SYNOPSIS</A>
<DL>
<DD><B>tk_dialog </B><I>window title text bitmap default string string ...</I>
</DL>
<DD><A HREF="dialog.htm#M4" NAME="L359">DESCRIPTION</A>
<DL>
<DD><A HREF="dialog.htm#M5" NAME="L360"><I>window</I></A>
<DD><A HREF="dialog.htm#M6" NAME="L361"><I>title</I></A>
<DD><A HREF="dialog.htm#M7" NAME="L362"><I>text</I></A>
<DD><A HREF="dialog.htm#M8" NAME="L363"><I>bitmap</I></A>
<DD><A HREF="dialog.htm#M9" NAME="L364"><I>default</I></A>
<DD><A HREF="dialog.htm#M10" NAME="L365"><I>string</I></A>
</DL>
<DD><A HREF="dialog.htm#M11" NAME="L366">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
tk_dialog - Create modal dialog and wait for response
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_dialog </B><I>window title text bitmap default string string ...</I><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This procedure is part of the Tk script library.
Its arguments describe a dialog box:
<P>
<DL>
<P><DT><A NAME="M5"><I>window</I></A><DD>
Name of top-level window to use for dialog. Any existing window
by this name is destroyed.
<P><DT><A NAME="M6"><I>title</I></A><DD>
Text to appear in the window manager's title bar for the dialog.
<P><DT><A NAME="M7"><I>text</I></A><DD>
Message to appear in the top portion of the dialog box.
<P><DT><A NAME="M8"><I>bitmap</I></A><DD>
If non-empty, specifies a bitmap to display in the top portion of
the dialog, to the left of the text.
If this is an empty string then no bitmap is displayed in the dialog.
<P><DT><A NAME="M9"><I>default</I></A><DD>
If this is an integer greater than or equal to zero, then it gives
the index of the button that is to be the default button for the dialog
(0 for the leftmost button, and so on).
If less than zero or an empty string then there won't be any default
button.
<P><DT><A NAME="M10"><I>string</I></A><DD>
There will be one button for each of these arguments.
Each <I>string</I> specifies text to display in a button,
in order from left to right.
<P></DL>
<P>
After creating a dialog box, <B>tk_dialog</B> waits for the user to
select one of the buttons either by clicking on the button with the
mouse or by typing return to invoke the default button (if any).
Then it returns the index of the selected button: 0 for the leftmost
button, 1 for the button next to it, and so on.
If the dialog's window is destroyed before the user selects one
of the buttons, then -1 is returned.
<P>
While waiting for the user to respond, <B>tk_dialog</B> sets a local
grab. This prevents the user from interacting with the application
in any way except to invoke the dialog box.
<H3><A NAME="M11">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#bitmap">bitmap</A>, <A href="../Keywords/D.htm#dialog">dialog</A>, <A href="../Keywords/M.htm#modal">modal</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1992 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

623
hlp/en/tk/entry.htm Normal file
View File

@@ -0,0 +1,623 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - entry manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="entry.htm#M2" NAME="L367">NAME</A>
<DL><DD>entry - Create and manipulate entry widgets</DL>
<DD><A HREF="entry.htm#M3" NAME="L368">SYNOPSIS</A>
<DL>
<DD><B>entry</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="entry.htm#M4" NAME="L369">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-exportselection">-exportselection, exportSelection, ExportSelection</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-insertbackground">-insertbackground, insertBackground, Foreground</A>
<DD><A HREF="options.htm#M-insertborderwidth">-insertborderwidth, insertBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-insertofftime">-insertofftime, insertOffTime, OffTime</A>
<DD><A HREF="options.htm#M-insertontime">-insertontime, insertOnTime, OnTime</A>
<DD><A HREF="options.htm#M-insertwidth">-insertwidth, insertWidth, InsertWidth</A>
<DD><A HREF="options.htm#M-justify">-justify, justify, Justify</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-selectbackground">-selectbackground, selectBackground, Foreground</A>
<DD><A HREF="options.htm#M-selectborderwidth">-selectborderwidth, selectBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-selectforeground">-selectforeground, selectForeground, Background</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-xscrollcommand">-xscrollcommand, xScrollCommand, ScrollCommand</A>
</DL>
<DD><A HREF="entry.htm#M5" NAME="L370">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="entry.htm#M6" NAME="L371">-invalidcommand or -invcmd, invalidCommand, InvalidCommand</A>
<DD><A HREF="entry.htm#M7" NAME="L372">-show, show, Show</A>
<DD><A HREF="entry.htm#M8" NAME="L373">-state, state, State</A>
<DD><A HREF="entry.htm#M9" NAME="L374">-validate, validate, Validate</A>
<DD><A HREF="entry.htm#M10" NAME="L375">-validatecommand or -vcmd, validateCommand, ValidateCommand</A>
<DD><A HREF="entry.htm#M11" NAME="L376">-width, width, Width</A>
</DL>
<DD><A HREF="entry.htm#M12" NAME="L377">DESCRIPTION</A>
<DD><A HREF="entry.htm#M13" NAME="L378">VALIDATION</A>
<DL>
<DD><A HREF="entry.htm#M14" NAME="L379"><B>none</B></A>
<DD><A HREF="entry.htm#M15" NAME="L380"><B>focus</B></A>
<DD><A HREF="entry.htm#M16" NAME="L381"><B>focusin</B></A>
<DD><A HREF="entry.htm#M17" NAME="L382"><B>focusout</B></A>
<DD><A HREF="entry.htm#M18" NAME="L383"><B>key</B></A>
<DD><A HREF="entry.htm#M19" NAME="L384"><B>all</B></A>
</DL>
<DL>
<DD><A HREF="entry.htm#M20" NAME="L385"><B>%d</B></A>
<DD><A HREF="entry.htm#M21" NAME="L386"><B>%i</B></A>
<DD><A HREF="entry.htm#M22" NAME="L387"><B>%P</B></A>
<DD><A HREF="entry.htm#M23" NAME="L388"><B>%s</B></A>
<DD><A HREF="entry.htm#M24" NAME="L389"><B>%S</B></A>
<DD><A HREF="entry.htm#M25" NAME="L390"><B>%v</B></A>
<DD><A HREF="entry.htm#M26" NAME="L391"><B>%V</B></A>
<DD><A HREF="entry.htm#M27" NAME="L392"><B>%W</B></A>
</DL>
<DD><A HREF="entry.htm#M28" NAME="L393">WIDGET COMMAND</A>
<DL>
<DD><A HREF="entry.htm#M29" NAME="L394"><I>number</I></A>
<DD><A HREF="entry.htm#M30" NAME="L395"><B>anchor</B></A>
<DD><A HREF="entry.htm#M31" NAME="L396"><B>end</B></A>
<DD><A HREF="entry.htm#M32" NAME="L397"><B>insert</B></A>
<DD><A HREF="entry.htm#M33" NAME="L398"><B>sel.first</B></A>
<DD><A HREF="entry.htm#M34" NAME="L399"><B>sel.last</B></A>
<DD><A HREF="entry.htm#M35" NAME="L400"><B>@</B><I>number</I></A>
</DL>
<DL>
<DD><A HREF="entry.htm#M36" NAME="L401"><I>pathName </I><B>bbox </B><I>index</I></A>
<DD><A HREF="entry.htm#M37" NAME="L402"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="entry.htm#M38" NAME="L403"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="entry.htm#M39" NAME="L404"><I>pathName </I><B>delete </B><I>first </I>?<I>last</I>?</A>
<DD><A HREF="entry.htm#M40" NAME="L405"><I>pathName </I><B>get</B></A>
<DD><A HREF="entry.htm#M41" NAME="L406"><I>pathName </I><B>icursor </B><I>index</I></A>
<DD><A HREF="entry.htm#M42" NAME="L407"><I>pathName </I><B>index</B><I> index</I></A>
<DD><A HREF="entry.htm#M43" NAME="L408"><I>pathName </I><B>insert </B><I>index string</I></A>
<DD><A HREF="entry.htm#M44" NAME="L409"><I>pathName </I><B>scan</B> <I>option args</I></A>
<DL>
<DD><A HREF="entry.htm#M45" NAME="L410"><I>pathName </I><B>scan mark </B><I>x</I></A>
<DD><A HREF="entry.htm#M46" NAME="L411"><I>pathName </I><B>scan dragto </B><I>x</I></A>
</DL>
<DD><A HREF="entry.htm#M47" NAME="L412"><I>pathName </I><B>selection </B><I>option arg</I></A>
<DL>
<DD><A HREF="entry.htm#M48" NAME="L413"><I>pathName </I><B>selection adjust </B><I>index</I></A>
<DD><A HREF="entry.htm#M49" NAME="L414"><I>pathName </I><B>selection clear</B></A>
<DD><A HREF="entry.htm#M50" NAME="L415"><I>pathName </I><B>selection from </B><I>index</I></A>
<DD><A HREF="entry.htm#M51" NAME="L416"><I>pathName </I><B>selection present</B></A>
<DD><A HREF="entry.htm#M52" NAME="L417"><I>pathName </I><B>selection range </B><I>start</I> <I>end</I></A>
<DD><A HREF="entry.htm#M53" NAME="L418"><I>pathName </I><B>selection to </B><I>index</I></A>
</DL>
<DD><A HREF="entry.htm#M54" NAME="L419">.VS 8.3</A>
<DD><A HREF="entry.htm#M55" NAME="L420"><I>pathName </I><B>xview </B><I>args</I></A>
<DL>
<DD><A HREF="entry.htm#M56" NAME="L421"><I>pathName </I><B>xview</B></A>
<DD><A HREF="entry.htm#M57" NAME="L422"><I>pathName </I><B>xview</B> <I>index</I></A>
<DD><A HREF="entry.htm#M58" NAME="L423"><I>pathName </I><B>xview moveto</B><I> fraction</I></A>
<DD><A HREF="entry.htm#M59" NAME="L424"><I>pathName </I><B>xview scroll </B><I>number what</I></A>
</DL>
</DL>
<DD><A HREF="entry.htm#M60" NAME="L425">DEFAULT BINDINGS</A>
<DL>
</DL>
<DD><A HREF="entry.htm#M61" NAME="L426">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
entry - Create and manipulate entry widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>entry</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-exportselection">-exportselection, exportSelection, ExportSelection</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-insertbackground">-insertbackground, insertBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-insertborderwidth">-insertborderwidth, insertBorderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-insertofftime">-insertofftime, insertOffTime, OffTime</A></B>
<DT><B><A HREF="options.htm#M-insertontime">-insertontime, insertOnTime, OnTime</A></B>
<DT><B><A HREF="options.htm#M-insertwidth">-insertwidth, insertWidth, InsertWidth</A></B>
<DT><B><A HREF="options.htm#M-justify">-justify, justify, Justify</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-selectbackground">-selectbackground, selectBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-selectborderwidth">-selectborderwidth, selectBorderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-selectforeground">-selectforeground, selectForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A></B>
<DT><B><A HREF="options.htm#M-xscrollcommand">-xscrollcommand, xScrollCommand, ScrollCommand</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-invalidcommand or -invcmd</A></B>
<DT>Database Name: <B>invalidCommand</B>
<DT>Database Class: <B>InvalidCommand</B>
<DD>Specifies a script to eval when <B>validateCommand</B> returns 0.
Setting it to {} disables this feature (the default). The best use
of this option is to set it to <I>bell</I>. See <B>Validation</B>
below for more information.
<P><DT>Command-Line Name: <B><A NAME="M7">-show</A></B>
<DT>Database Name: <B>show</B>
<DT>Database Class: <B>Show</B>
<DD>If this option is specified, then the true contents of the entry
are not displayed in the window.
Instead, each character in the entry's value will be displayed as
the first character in the value of this option, such as ``*''.
This is useful, for example, if the entry is to be used to enter
a password.
If characters in the entry are selected and copied elsewhere, the
information copied will be what is displayed, not the true contents
of the entry.
<P><DT>Command-Line Name: <B><A NAME="M8">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of two states for the entry: <B>normal</B> or <B>disabled</B>.
If the entry is disabled then the value may not be changed using widget
commands and no insertion cursor will be displayed, even if the input focus is
in the widget.
<P><DT>Command-Line Name: <B><A NAME="M9">-validate</A></B>
<DT>Database Name: <B>validate</B>
<DT>Database Class: <B>Validate</B>
<DD>Specifies the mode in which validation should operate: <B>none</B>,
<B><A HREF="../TclCmd/focus.htm">focus</A></B>, <B>focusin</B>, <B>focusout</B>, <B>key</B>, or <B>all</B>.
It defaults to <B>none</B>. When you want validation, you must explicitly
state which mode you wish to use. See <B>Validation</B> below for more.
<P><DT>Command-Line Name: <B><A NAME="M10">-validatecommand or -vcmd</A></B>
<DT>Database Name: <B>validateCommand</B>
<DT>Database Class: <B>ValidateCommand</B>
<DD>Specifies a script to eval when you want to validate the input into
the entry widget. Setting it to {} disables this feature (the default).
This command must return a valid tcl boolean value. If it returns 0 (or
the valid tcl boolean equivalent) then it means you reject the new edition
and it will not occur and the <B>invalidCommand</B> will be evaluated if it
is set. If it returns 1, then the new edition occurs.
See <B>Validation</B> below for more information.
<P><DT>Command-Line Name: <B><A NAME="M11">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies an integer value indicating the desired width of the entry window,
in average-size characters of the widget's font.
If the value is less than or equal to zero, the widget picks a
size just large enough to hold its current text.
</DL>
<H3><A NAME="M12">DESCRIPTION</A></H3>
The <B>entry</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into an entry widget.
Additional options, described above, may be specified on the
command line or in the option database
to configure aspects of the entry such as its colors, font,
and relief. The <B>entry</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
An entry is a widget that displays a one-line text string and
allows that string to be edited using widget commands described below, which
are typically bound to keystrokes and mouse actions.
When first created, an entry's string is empty.
A portion of the entry may be selected as described below.
If an entry is exporting its selection (see the <B>exportSelection</B>
option), then it will observe the standard X11 protocols for handling the
selection; entry selections are available as type <B><A HREF="../TkCmd/string.htm">STRING</A></B>.
Entries also observe the standard Tk rules for dealing with the
input focus. When an entry has the input focus it displays an
<I>insertion cursor</I> to indicate where new characters will be
inserted.
<P>
Entries are capable of displaying strings that are too long to
fit entirely within the widget's window. In this case, only a
portion of the string will be displayed; commands described below
may be used to change the view in the window. Entries use
the standard <B>xScrollCommand</B> mechanism for interacting with
scrollbars (see the description of the <B>xScrollCommand</B> option
for details). They also support scanning, as described below.
<H3><A NAME="M13">VALIDATION</A></H3>
Validation works by setting the <B>validateCommand</B>
option to a script which will be evaluated according to the <B>validate</B>
option as follows:
<P>
<P>
<DL>
<P><DT><A NAME="M14"><B>none</B></A><DD>
Default. This means no validation will occur.
<P><DT><A NAME="M15"><B>focus</B></A><DD>
<B>validateCommand</B> will be called when the entry receives or
loses focus.
<P><DT><A NAME="M16"><B>focusin</B></A><DD>
<B>validateCommand</B> will be called when the entry receives focus.
<P><DT><A NAME="M17"><B>focusout</B></A><DD>
<B>validateCommand</B> will be called when the entry loses focus.
<P><DT><A NAME="M18"><B>key</B></A><DD>
<B>validateCommand</B> will be called when the entry is edited.
<P><DT><A NAME="M19"><B>all</B></A><DD>
<B>validateCommand</B> will be called for all above conditions.
<P></DL>
<P>
It is posible to perform percent substitutions on the <B>validateCommand</B>
and <B>invalidCommand</B>,
just as you would in a <B><A HREF="../TclCmd/bind.htm">bind</A></B> script. The following substitutions
are recognized:
<P>
<P>
<DL>
<P><DT><A NAME="M20"><B>%d</B></A><DD>
Type of action: 1 for <B>insert</B>, 0 for <B>delete</B>,
or -1 for focus, forced or textvariable validation.
<P><DT><A NAME="M21"><B>%i</B></A><DD>
Index of char string to be inserted/deleted, if any, otherwise -1.
<P><DT><A NAME="M22"><B>%P</B></A><DD>
The value of the entry should edition occur. If you are configuring the
entry widget to have a new textvariable, this will be the value of that
textvariable.
<P><DT><A NAME="M23"><B>%s</B></A><DD>
The current value of entry before edition.
<P><DT><A NAME="M24"><B>%S</B></A><DD>
The text string being inserted/deleted, if any, {} otherwise.
<P><DT><A NAME="M25"><B>%v</B></A><DD>
The type of validation currently set.
<P><DT><A NAME="M26"><B>%V</B></A><DD>
The type of validation that triggered the callback
(key, focusin, focusout, forced).
<P><DT><A NAME="M27"><B>%W</B></A><DD>
The name of the entry widget.
<P></DL>
<P>
In general, the <B>textVariable</B> and <B>validateCommand</B> can be
dangerous to mix. Any problems have been overcome so that using the
<B>validateCommand</B> will not interfere with the traditional behavior of
the entry widget. Using the <B>textVariable</B> for read-only purposes will
never cause problems. The danger comes when you try set the
<B>textVariable</B> to something that the <B>validateCommand</B> would not
accept, which causes <B>validate</B> to become <I>none</I> (the
<B>invalidCommand</B> will not be triggered). The same happens
when an error occurs evaluating the <B>validateCommand</B>.
<P>
Primarily, an error will occur when the <B>validateCommand</B> or
<B>invalidCommand</B> encounters an error in its script while evaluating or
<B>validateCommand</B> does not return a valid tcl boolean value. The
<B>validate</B> option will also set itself to <B>none</B> when you edit the
entry widget from within either the <B>validateCommand</B> or the
<B>invalidCommand</B>. Such editions will override the one that was being
validated. If you wish to edit the entry widget (for example set it to {})
during validation and still have the <B>validate</B> option set, you should
include the command
<PRE><I>after idle {%W config -validate %v}</I></PRE>
in the <B>validateCommand</B> or <B>invalidCommand</B> (whichever one you
were editing the entry widget from). It is also recommended to not set an
associated <B>textVariable</B> during validation, as that can cause the
entry widget to become out of sync with the <B>textVariable</B>.
<H3><A NAME="M28">WIDGET COMMAND</A></H3>
The <B>entry</B> command creates a new Tcl command whose
name is <I>pathName</I>. This command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command.
<P>
Many of the widget commands for entries take one or more indices as
arguments. An index specifies a particular character in the entry's
string, in any of the following ways:
<P>
<DL>
<P><DT><A NAME="M29"><I>number</I></A><DD>
Specifies the character as a numerical index, where 0 corresponds
to the first character in the string.
<P><DT><A NAME="M30"><B>anchor</B></A><DD>
Indicates the anchor point for the selection, which is set with the
<B>select from</B> and <B>select adjust</B> widget commands.
<P><DT><A NAME="M31"><B>end</B></A><DD>
Indicates the character just after the last one in the entry's string.
This is equivalent to specifying a numerical index equal to the length
of the entry's string.
<P><DT><A NAME="M32"><B>insert</B></A><DD>
Indicates the character adjacent to and immediately following the
insertion cursor.
<P><DT><A NAME="M33"><B>sel.first</B></A><DD>
Indicates the first character in the selection. It is an error to
use this form if the selection isn't in the entry window.
<P><DT><A NAME="M34"><B>sel.last</B></A><DD>
Indicates the character just after the last one in the selection.
It is an error to use this form if the selection isn't in the
entry window.
<P><DT><A NAME="M35"><B>@</B><I>number</I></A><DD>
In this form, <I>number</I> is treated as an x-coordinate in the
entry's window; the character spanning that x-coordinate is used.
For example, ``<B>@0</B>'' indicates the left-most character in the
window.
<P></DL>
<P>
Abbreviations may be used for any of the forms above, e.g. ``<B>e</B>''
or ``<B>sel.f</B>''. In general, out-of-range indices are automatically
rounded to the nearest legal value.
<P>
The following commands are possible for entry widgets:
<P>
<DL>
<P><DT><A NAME="M36"><I>pathName </I><B>bbox </B><I>index</I></A><DD>
Returns a list of four numbers describing the bounding box of the
character given by <I>index</I>.
The first two elements of the list give the x and y coordinates of
the upper-left corner of the screen area covered by the character
(in pixels relative to the widget) and the last two elements give
the width and height of the character, in pixels.
The bounding box may refer to a region outside the visible area
of the window.
<P><DT><A NAME="M37"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>entry</B>
command.
<P><DT><A NAME="M38"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>entry</B>
command.
<P><DT><A NAME="M39"><I>pathName </I><B>delete </B><I>first </I>?<I>last</I>?</A><DD>
Delete one or more elements of the entry.
<I>First</I> is the index of the first character to delete, and
<I>last</I> is the index of the character just after the last
one to delete.
If <I>last</I> isn't specified it defaults to <I>first</I>+1,
i.e. a single character is deleted.
This command returns an empty string.
<P><DT><A NAME="M40"><I>pathName </I><B>get</B></A><DD>
Returns the entry's string.
<P><DT><A NAME="M41"><I>pathName </I><B>icursor </B><I>index</I></A><DD>
Arrange for the insertion cursor to be displayed just before the character
given by <I>index</I>. Returns an empty string.
<P><DT><A NAME="M42"><I>pathName </I><B>index</B><I> index</I></A><DD>
Returns the numerical index corresponding to <I>index</I>.
<P><DT><A NAME="M43"><I>pathName </I><B>insert </B><I>index string</I></A><DD>
Insert the characters of <I>string</I> just before the character
indicated by <I>index</I>. Returns an empty string.
<P><DT><A NAME="M44"><I>pathName </I><B>scan</B> <I>option args</I></A><DD>
This command is used to implement scanning on entries. It has
two forms, depending on <I>option</I>:
<P>
<DL>
<P><DT><A NAME="M45"><I>pathName </I><B>scan mark </B><I>x</I></A><DD>
Records <I>x</I> and the current view in the entry window; used in
conjunction with later <B>scan dragto</B> commands. Typically this
command is associated with a mouse button press in the widget. It
returns an empty string.
<P><DT><A NAME="M46"><I>pathName </I><B>scan dragto </B><I>x</I></A><DD>
This command computes the difference between its <I>x</I> argument
and the <I>x</I> argument to the last <B>scan mark</B> command for
the widget. It then adjusts the view left or right by 10 times the
difference in x-coordinates. This command is typically associated
with mouse motion events in the widget, to produce the effect of
dragging the entry at high speed through the window. The return
value is an empty string.
<P></DL>
<P><DT><A NAME="M47"><I>pathName </I><B>selection </B><I>option arg</I></A><DD>
This command is used to adjust the selection within an entry. It
has several forms, depending on <I>option</I>:
<P>
<DL>
<P><DT><A NAME="M48"><I>pathName </I><B>selection adjust </B><I>index</I></A><DD>
Locate the end of the selection nearest to the character given by
<I>index</I>, and adjust that end of the selection to be at <I>index</I>
(i.e including but not going beyond <I>index</I>). The other
end of the selection is made the anchor point for future
<B>select to</B> commands. If the selection
isn't currently in the entry, then a new selection is created to
include the characters between <I>index</I> and the most recent
selection anchor point, inclusive.
Returns an empty string.
<P><DT><A NAME="M49"><I>pathName </I><B>selection clear</B></A><DD>
Clear the selection if it is currently in this widget. If the
selection isn't in this widget then the command has no effect.
Returns an empty string.
<P><DT><A NAME="M50"><I>pathName </I><B>selection from </B><I>index</I></A><DD>
Set the selection anchor point to just before the character
given by <I>index</I>. Doesn't change the selection.
Returns an empty string.
<P><DT><A NAME="M51"><I>pathName </I><B>selection present</B></A><DD>
Returns 1 if there is are characters selected in the entry,
0 if nothing is selected.
<P><DT><A NAME="M52"><I>pathName </I><B>selection range </B><I>start</I> <I>end</I></A><DD>
Sets the selection to include the characters starting with
the one indexed by <I>start</I> and ending with the one just
before <I>end</I>.
If <I>end</I> refers to the same character as <I>start</I> or an
earlier one, then the entry's selection is cleared.
<P><DT><A NAME="M53"><I>pathName </I><B>selection to </B><I>index</I></A><DD>
If <I>index</I> is before the anchor point, set the selection
to the characters from <I>index</I> up to but not including
the anchor point.
If <I>index</I> is the same as the anchor point, do nothing.
If <I>index</I> is after the anchor point, set the selection
to the characters from the anchor point up to but not including
<I>index</I>.
The anchor point is determined by the most recent <B>select from</B>
or <B>select adjust</B> command in this widget.
If the selection isn't in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
<P></DL>
<P><DT><A NAME="M54">.VS 8.3</A><DD>
<I>pathName </I><B>validate</B>
This command is used to force an evaluation of the <B>validateCommand</B>
independent of the conditions specified by the <B>validate</B> option.
This is done by temporarily setting the <B>validate</B> option to <B>all</B>.
It returns 0 or 1.
<P><DT><A NAME="M55"><I>pathName </I><B>xview </B><I>args</I></A><DD>
This command is used to query and change the horizontal position of the
text in the widget's window. It can take any of the following
forms:
<P>
<DL>
<P><DT><A NAME="M56"><I>pathName </I><B>xview</B></A><DD>
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
For example, if the first element is .2 and the second element is .6,
20% of the entry's text is off-screen to the left, the middle 40% is visible
in the window, and 40% of the text is off-screen to the right.
These are the same values passed to scrollbars via the <B>-xscrollcommand</B>
option.
<P><DT><A NAME="M57"><I>pathName </I><B>xview</B> <I>index</I></A><DD>
Adjusts the view in the window so that the character given by <I>index</I>
is displayed at the left edge of the window.
<P><DT><A NAME="M58"><I>pathName </I><B>xview moveto</B><I> fraction</I></A><DD>
Adjusts the view in the window so that the character <I>fraction</I> of the
way through the text appears at the left edge of the window.
<I>Fraction</I> must be a fraction between 0 and 1.
<P><DT><A NAME="M59"><I>pathName </I><B>xview scroll </B><I>number what</I></A><DD>
This command shifts the view in the window left or right according to
<I>number</I> and <I>what</I>.
<I>Number</I> must be an integer.
<I>What</I> must be either <B>units</B> or <B>pages</B> or an abbreviation
of one of these.
If <I>what</I> is <B>units</B>, the view adjusts left or right by
<I>number</I> average-width characters on the display; if it is
<B>pages</B> then the view adjusts by <I>number</I> screenfuls.
If <I>number</I> is negative then characters farther to the left
become visible; if it is positive then characters farther to the right
become visible.
<P></DL>
<P></DL>
<H3><A NAME="M60">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for entries that give them
the following default behavior.
In the descriptions below, ``word'' refers to a contiguous group
of letters, digits, or ``_'' characters, or any single character
other than these.
<P>
<DL>
<P><DT>[1]<DD>
Clicking mouse button 1 positions the insertion cursor
just before the character underneath the mouse cursor, sets the
input focus to this widget, and clears any selection in the widget.
Dragging with mouse button 1 strokes out a selection between
the insertion cursor and the character under the mouse.
<P><DT>[2]<DD>
Double-clicking with mouse button 1 selects the word under the mouse
and positions the insertion cursor at the beginning of the word.
Dragging after a double click will stroke out a selection consisting
of whole words.
<P><DT>[3]<DD>
Triple-clicking with mouse button 1 selects all of the text in the
entry and positions the insertion cursor before the first character.
<P><DT>[4]<DD>
The ends of the selection can be adjusted by dragging with mouse
button 1 while the Shift key is down; this will adjust the end
of the selection that was nearest to the mouse cursor when button
1 was pressed.
If the button is double-clicked before dragging then the selection
will be adjusted in units of whole words.
<P><DT>[5]<DD>
Clicking mouse button 1 with the Control key down will position the
insertion cursor in the entry without affecting the selection.
<P><DT>[6]<DD>
If any normal printing characters are typed in an entry, they are
inserted at the point of the insertion cursor.
<P><DT>[7]<DD>
The view in the entry can be adjusted by dragging with mouse button 2.
If mouse button 2 is clicked without moving the mouse, the selection
is copied into the entry at the position of the mouse cursor.
<P><DT>[8]<DD>
If the mouse is dragged out of the entry on the left or right sides
while button 1 is pressed, the entry will automatically scroll to
make more text visible (if there is more text off-screen on the side
where the mouse left the window).
<P><DT>[9]<DD>
The Left and Right keys move the insertion cursor one character to the
left or right; they also clear any selection in the entry and set
the selection anchor.
If Left or Right is typed with the Shift key down, then the insertion
cursor moves and the selection is extended to include the new character.
Control-Left and Control-Right move the insertion cursor by words, and
Control-Shift-Left and Control-Shift-Right move the insertion cursor
by words and also extend the selection.
Control-b and Control-f behave the same as Left and Right, respectively.
Meta-b and Meta-f behave the same as Control-Left and Control-Right,
respectively.
<P><DT>[10]<DD>
The Home key, or Control-a, will move the insertion cursor to the
beginning of the entry and clear any selection in the entry.
Shift-Home moves the insertion cursor to the beginning of the entry
and also extends the selection to that point.
<P><DT>[11]<DD>
The End key, or Control-e, will move the insertion cursor to the
end of the entry and clear any selection in the entry.
Shift-End moves the cursor to the end and extends the selection
to that point.
<P><DT>[12]<DD>
The Select key and Control-Space set the selection anchor to the position
of the insertion cursor. They don't affect the current selection.
Shift-Select and Control-Shift-Space adjust the selection to the
current position of the insertion cursor, selecting from the anchor
to the insertion cursor if there was not any selection previously.
<P><DT>[13]<DD>
Control-/ selects all the text in the entry.
<P><DT>[14]<DD>
Control-&#92; clears any selection in the entry.
<P><DT>[15]<DD>
The F16 key (labelled Copy on many Sun workstations) or Meta-w
copies the selection in the widget to the clipboard, if there is a selection.
<P><DT>[16]<DD>
The F20 key (labelled Cut on many Sun workstations) or Control-w
copies the selection in the widget to the clipboard and deletes
the selection.
If there is no selection in the widget then these keys have no effect.
<P><DT>[17]<DD>
The F18 key (labelled Paste on many Sun workstations) or Control-y
inserts the contents of the clipboard at the position of the
insertion cursor.
<P><DT>[18]<DD>
The Delete key deletes the selection, if there is one in the entry.
If there is no selection, it deletes the character to the right of
the insertion cursor.
<P><DT>[19]<DD>
The BackSpace key and Control-h delete the selection, if there is one
in the entry.
If there is no selection, it deletes the character to the left of
the insertion cursor.
<P><DT>[20]<DD>
Control-d deletes the character to the right of the insertion cursor.
<P><DT>[21]<DD>
Meta-d deletes the word to the right of the insertion cursor.
<P><DT>[22]<DD>
Control-k deletes all the characters to the right of the insertion
cursor.
<P><DT>[23]<DD>
Control-t reverses the order of the two characters to the right of
the insertion cursor.
<P></DL>
<P>
If the entry is disabled using the <B>-state</B> option, then the entry's
view can still be adjusted and text in the entry can still be selected,
but no insertion cursor will be displayed and no text modifications will
take place.
<P>
The behavior of entries can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M61">KEYWORDS</A></H3>
<A href="../Keywords/E.htm#entry">entry</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1998-2000 Scriptics Corporation.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

368
hlp/en/tk/event.htm Normal file
View File

@@ -0,0 +1,368 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - event manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="event.htm#M2" NAME="L427">NAME</A>
<DL><DD>event - Miscellaneous event facilities: define virtual events and generate events</DL>
<DD><A HREF="event.htm#M3" NAME="L428">SYNOPSIS</A>
<DL>
<DD><B>event</B><I> option </I>?<I>arg arg ...</I>?
</DL>
<DD><A HREF="event.htm#M4" NAME="L429">DESCRIPTION</A>
<DL>
<DD><A HREF="event.htm#M5" NAME="L430"><B>event add &lt;&lt;</B><I>virtual</I><B>&gt;&gt;</B><I> sequence </I>?<I>sequence ...</I>?</A>
<DD><A HREF="event.htm#M6" NAME="L431"><B>event delete &lt;&lt;</B><I>virtual</I><B>&gt;&gt; </B>?<I>sequence</I> <I>sequence ...</I>?</A>
<DD><A HREF="event.htm#M7" NAME="L432"><B>event generate </B><I>window event </I>?<I>option value option value ...</I>?</A>
<DD><A HREF="event.htm#M8" NAME="L433"><B>event info </B>?&lt;&lt;<I>virtual</I><B>&gt;&gt;</B>?</A>
</DL>
<DD><A HREF="event.htm#M9" NAME="L434">EVENT FIELDS</A>
<DL>
<DD><A HREF="event.htm#M10" NAME="L435"><B>-above</B><I> window</I></A>
<DD><A HREF="event.htm#M11" NAME="L436"><B>-borderwidth</B><I> size</I></A>
<DD><A HREF="event.htm#M12" NAME="L437"><B>-button</B><I> number</I></A>
<DD><A HREF="event.htm#M13" NAME="L438"><B>-count</B><I> number</I></A>
<DD><A HREF="event.htm#M14" NAME="L439"><B>-delta</B><I> number</I></A>
<DD><A HREF="event.htm#M15" NAME="L440"><B>-detail</B><I> detail</I></A>
<DD><A HREF="event.htm#M16" NAME="L441"><B>-focus</B><I> boolean</I></A>
<DD><A HREF="event.htm#M17" NAME="L442"><B>-height</B><I> size</I></A>
<DD><A HREF="event.htm#M18" NAME="L443"><B>-keycode</B><I> number</I></A>
<DD><A HREF="event.htm#M19" NAME="L444"><B>-keysym</B><I> name</I></A>
<DD><A HREF="event.htm#M20" NAME="L445"><B>-mode</B><I> notify</I></A>
<DD><A HREF="event.htm#M21" NAME="L446"><B>-override</B><I> boolean</I></A>
<DD><A HREF="event.htm#M22" NAME="L447"><B>-place</B><I> where</I></A>
<DD><A HREF="event.htm#M23" NAME="L448"><B>-root</B><I> window</I></A>
<DD><A HREF="event.htm#M24" NAME="L449"><B>-rootx</B><I> coord</I></A>
<DD><A HREF="event.htm#M25" NAME="L450"><B>-rooty</B><I> coord</I></A>
<DD><A HREF="event.htm#M26" NAME="L451"><B>-sendevent</B><I> boolean</I></A>
<DD><A HREF="event.htm#M27" NAME="L452"><B>-serial</B><I> number</I></A>
<DD><A HREF="event.htm#M28" NAME="L453"><B>-state</B><I> state</I></A>
<DD><A HREF="event.htm#M29" NAME="L454"><B>-subwindow</B><I> window</I></A>
<DD><A HREF="event.htm#M30" NAME="L455"><B>-time</B><I> integer</I></A>
<DD><A HREF="event.htm#M31" NAME="L456"><B>-warp</B><I> boolean</I></A>
<DD><A HREF="event.htm#M32" NAME="L457"><B>-width</B><I> size</I></A>
<DD><A HREF="event.htm#M33" NAME="L458"><B>-when</B><I> when</I></A>
<DL>
<DD><A HREF="event.htm#M34" NAME="L459"><B>now</B></A>
<DD><A HREF="event.htm#M35" NAME="L460"><B>tail</B></A>
<DD><A HREF="event.htm#M36" NAME="L461"><B>head</B></A>
<DD><A HREF="event.htm#M37" NAME="L462"><B>mark</B></A>
</DL>
<DD><A HREF="event.htm#M38" NAME="L463"><B>-x</B><I> coord</I></A>
<DD><A HREF="event.htm#M39" NAME="L464"><B>-y</B><I> coord</I></A>
</DL>
<DD><A HREF="event.htm#M40" NAME="L465">VIRTUAL EVENT EXAMPLES</A>
<DD><A HREF="event.htm#M41" NAME="L466">SEE ALSO</A>
<DD><A HREF="event.htm#M42" NAME="L467">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
event - Miscellaneous event facilities: define virtual events and generate events
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>event</B><I> option </I>?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>event</B> command provides several facilities for dealing with
window system events, such as defining virtual events and synthesizing
events. The command has several different forms, determined by the
first argument. The following forms are currently supported:
<P>
<DL>
<P><DT><A NAME="M5"><B>event add &lt;&lt;</B><I>virtual</I><B>&gt;&gt;</B><I> sequence </I>?<I>sequence ...</I>?</A><DD>
Associates the virtual event <I>virtual</I> with the physical
event sequence(s) given by the <I>sequence</I> arguments, so that
the virtual event will trigger whenever any one of the <I>sequence</I>s
occurs.
<I>Virtual</I> may be any string value and <I>sequence</I> may have
any of the values allowed for the <I>sequence</I> argument to the
<B><A HREF="../TclCmd/bind.htm">bind</A></B> command.
If <I>virtual</I> is already defined, the new physical event sequences
add to the existing sequences for the event.
<P><DT><A NAME="M6"><B>event delete &lt;&lt;</B><I>virtual</I><B>&gt;&gt; </B>?<I>sequence</I> <I>sequence ...</I>?</A><DD>
Deletes each of the <I>sequence</I>s from those associated with
the virtual event given by <I>virtual</I>.
<I>Virtual</I> may be any string value and <I>sequence</I> may have
any of the values allowed for the <I>sequence</I> argument to the
<B><A HREF="../TclCmd/bind.htm">bind</A></B> command.
Any <I>sequence</I>s not currently associated with <I>virtual</I>
are ignored.
If no <I>sequence</I> argument is provided, all physical event sequences
are removed for <I>virtual</I>, so that the virtual event will not
trigger anymore.
<P><DT><A NAME="M7"><B>event generate </B><I>window event </I>?<I>option value option value ...</I>?</A><DD>
Generates a window event and arranges for it to be processed just as if
it had come from the window system.
<I>Window</I> gives the path name of the window for which the event
will be generated; it may also be an identifier (such as returned by
<B><A HREF="../TclCmd/winfo.htm">winfo id</A></B>) as long as it is for a window in the current application.
<I>Event</I> provides a basic description of
the event, such as <B>&lt;Shift-Button-2&gt;</B> or <B>&lt;&lt;Paste&gt;&gt;</B>.
If <I>Window</I> is empty the whole screen is meant, and coordinates
are relative to the screen.
<I>Event</I> may have any of the forms allowed for the <I>sequence</I>
argument of the <B><A HREF="../TclCmd/bind.htm">bind</A></B> command except that it must consist
of a single event pattern, not a sequence.
<I>Option-value</I> pairs may be used to specify additional
attributes of the event, such as the x and y mouse position; see
EVENT FIELDS below. If the <B>-when</B> option is not specified, the
event is processed immediately: all of the handlers for the event
will complete before the <B>event generate</B> command returns.
If the <B>-when</B> option is specified then it determines when the
event is processed. Certain events, such as key events, require
that the window has focus to receive the event properly.
<P><DT><A NAME="M8"><B>event info </B>?&lt;&lt;<I>virtual</I><B>&gt;&gt;</B>?</A><DD>
Returns information about virtual events.
If the <B>&lt;&lt;</B><I>virtual</I><B>&gt;&gt;</B> argument is omitted, the return value
is a list of all the virtual events that are currently defined.
If <B>&lt;&lt;</B><I>virtual</I><B>&gt;&gt;</B> is specified then the return value is
a list whose elements are the physical event sequences currently
defined for the given virtual event; if the virtual event is
not defined then an empty string is returned.
<P></DL>
<H3><A NAME="M9">EVENT FIELDS</A></H3>
The following options are supported for the <B>event generate</B>
command. These correspond to the ``%'' expansions
allowed in binding scripts for the <B><A HREF="../TclCmd/bind.htm">bind</A></B> command.
<P>
<DL>
<P><DT><A NAME="M10"><B>-above</B><I> window</I></A><DD>
<I>Window</I> specifies the <I>above</I> field for the event,
either as a window path name or as an integer window id.
Valid for <B>Configure</B> events.
Corresponds to the <B>%a</B> substitution for binding scripts.
<P><DT><A NAME="M11"><B>-borderwidth</B><I> size</I></A><DD>
<I>Size</I> must be a screen distance; it specifies the
<I>border_width</I> field for the event.
Valid for <B>Configure</B> events.
Corresponds to the <B>%B</B> substitution for binding scripts.
<P><DT><A NAME="M12"><B>-button</B><I> number</I></A><DD>
<I>Number</I> must be an integer; it specifies the <I>detail</I> field
for a <B>ButtonPress</B> or <B>ButtonRelease</B> event, overriding
any button number provided in the base <I>event</I> argument.
Corresponds to the <B>%b</B> substitution for binding scripts.
<P><DT><A NAME="M13"><B>-count</B><I> number</I></A><DD>
<I>Number</I> must be an integer; it specifies the <I>count</I> field
for the event. Valid for <B>Expose</B> events.
Corresponds to the <B>%c</B> substitution for binding scripts.
<P><DT><A NAME="M14"><B>-delta</B><I> number</I></A><DD>
<I>Number</I> must be an integer; it specifies the <I>delta</I> field
for the <B>MouseWheel</B> event. The <I>delta</I> refers to the
direction and magnitude the mouse wheel was rotated. Note the value
is not a screen distance but are units of motion in the mouse wheel.
Typically these values are multiples of 120. For example, 120 should
scroll the text widget up 4 lines and -240 would scroll the text
widget down 8 lines. Of course, other widgets may define different
behaviors for mouse wheel motion. This field corresponds to the
<B>%D</B> substitution for binding scripts.
<P><DT><A NAME="M15"><B>-detail</B><I> detail</I></A><DD>
<I>Detail</I> specifies the <I>detail</I> field for the event
and must be one of the following:
<PRE><B>NotifyAncestor NotifyNonlinearVirtual
NotifyDetailNone NotifyPointer
NotifyInferior NotifyPointerRoot
NotifyNonlinear NotifyVirtual</B></PRE>
Valid for <B>Enter</B>, <B>Leave</B>, <B>FocusIn</B> and
<B>FocusOut</B> events.
Corresponds to the <B>%d</B> substitution for binding scripts.
<P><DT><A NAME="M16"><B>-focus</B><I> boolean</I></A><DD>
<I>Boolean</I> must be a boolean value; it specifies the <I>focus</I>
field for the event.
Valid for <B>Enter</B> and <B>Leave</B> events.
Corresponds to the <B>%f</B> substitution for binding scripts.
<P><DT><A NAME="M17"><B>-height</B><I> size</I></A><DD>
<I>Size</I> must be a screen distance; it specifies the <I>height</I>
field for the event. Valid for <B>Configure</B> events.
Corresponds to the <B>%h</B> substitution for binding scripts.
<P><DT><A NAME="M18"><B>-keycode</B><I> number</I></A><DD>
<I>Number</I> must be an integer; it specifies the <I>keycode</I>
field for the event.
Valid for <B>KeyPress</B> and <B>KeyRelease</B> events.
Corresponds to the <B>%k</B> substitution for binding scripts.
<P><DT><A NAME="M19"><B>-keysym</B><I> name</I></A><DD>
<I>Name</I> must be the name of a valid keysym, such as <B>g</B>,
<B>space</B>, or <B><A HREF="../TkCmd/return.htm">Return</A></B>; its corresponding
keycode value is used as the <I>keycode</I> field for event, overriding
any detail specified in the base <I>event</I> argument.
Valid for <B>KeyPress</B> and <B>KeyRelease</B> events.
Corresponds to the <B>%K</B> substitution for binding scripts.
<P><DT><A NAME="M20"><B>-mode</B><I> notify</I></A><DD>
<I>Notify</I> specifies the <I>mode</I> field for the event and must be
one of <B>NotifyNormal</B>, <B>NotifyGrab</B>, <B>NotifyUngrab</B>, or
<B>NotifyWhileGrabbed</B>.
Valid for <B>Enter</B>, <B>Leave</B>, <B>FocusIn</B>, and
<B>FocusOut</B> events.
Corresponds to the <B>%m</B> substitution for binding scripts.
<P><DT><A NAME="M21"><B>-override</B><I> boolean</I></A><DD>
<I>Boolean</I> must be a boolean value; it specifies the
<I>override_redirect</I> field for the event.
Valid for <B>Map</B>, <B>Reparent</B>, and <B>Configure</B> events.
Corresponds to the <B>%o</B> substitution for binding scripts.
<P><DT><A NAME="M22"><B>-place</B><I> where</I></A><DD>
<I>Where</I> specifies the <I>place</I> field for the event; it must be
either <B>PlaceOnTop</B> or <B>PlaceOnBottom</B>.
Valid for <B>Circulate</B> events.
Corresponds to the <B>%p</B> substitution for binding scripts.
<P><DT><A NAME="M23"><B>-root</B><I> window</I></A><DD>
<I>Window</I> must be either a window path name or an integer window
identifier; it specifies the <I>root</I> field for the event.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>Leave</B>, and <B>Motion</B>
events.
Corresponds to the <B>%R</B> substitution for binding scripts.
<P><DT><A NAME="M24"><B>-rootx</B><I> coord</I></A><DD>
<I>Coord</I> must be a screen distance; it specifies the <I>x_root</I>
field for the event.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>Leave</B>, and <B>Motion</B>
events. Corresponds to the <B>%X</B> substitution for binding scripts.
<P><DT><A NAME="M25"><B>-rooty</B><I> coord</I></A><DD>
<I>Coord</I> must be a screen distance; it specifies th <I>y_root</I>
field for the event.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>Leave</B>, and <B>Motion</B>
events.
Corresponds to the <B>%Y</B> substitution for binding scripts.
<P><DT><A NAME="M26"><B>-sendevent</B><I> boolean</I></A><DD>
<B>Boolean</B> must be a boolean value; it specifies the <I>send_event</I>
field for the event. Valid for all events. Corresponds to the
<B>%E</B> substitution for binding scripts.
<P><DT><A NAME="M27"><B>-serial</B><I> number</I></A><DD>
<I>Number</I> must be an integer; it specifies the <I>serial</I> field
for the event. Valid for all events.
Corresponds to the <B>%#</B> substitution for binding scripts.
<P><DT><A NAME="M28"><B>-state</B><I> state</I></A><DD>
<I>State</I> specifies the <I>state</I> field for the event.
For <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>Leave</B>, and <B>Motion</B> events
it must be an integer value.
For <B>Visibility</B> events it must be one of <B>VisibilityUnobscured</B>,
<B>VisibilityPartiallyObscured</B>, or <B>VisibilityFullyObscured</B>.
This option overrides any modifiers such as <B>Meta</B> or <B>Control</B>
specified in the base <I>event</I>.
Corresponds to the <B>%s</B> substitution for binding scripts.
<P><DT><A NAME="M29"><B>-subwindow</B><I> window</I></A><DD>
<I>Window</I> specifies the <I>subwindow</I> field for the event, either
as a path name for a Tk widget or as an integer window identifier.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>Leave</B>, and <B>Motion</B> events.
Similar to <B>%S</B> substitution for binding scripts.
<P><DT><A NAME="M30"><B>-time</B><I> integer</I></A><DD>
<I>Integer</I> must be an integer value; it specifies the <I>time</I> field
for the event.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Enter</B>, <B>Leave</B>, <B>Motion</B>,
and <B>Property</B> events.
Corresponds to the <B>%t</B> substitution for binding scripts.
<P><DT><A NAME="M31"><B>-warp</B><I> boolean</I></A><DD>
<I>boolean</I> must be a boolean value; it specifies whether
the screen pointer should be warped as well.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, and <B>Motion</B> events. The pointer will
only warp to a window if it is mapped.
<P><DT><A NAME="M32"><B>-width</B><I> size</I></A><DD>
<I>Size</I> must be a screen distance; it specifies the <I>width</I> field
for the event.
Valid for <B>Configure</B> events.
Corresponds to the <B>%w</B> substitution for binding scripts.
<P><DT><A NAME="M33"><B>-when</B><I> when</I></A><DD>
<I>When</I> determines when the event will be processed; it must have one
of the following values:
<P>
<DL>
<P><DT><A NAME="M34"><B>now</B></A><DD>
Process the event immediately, before the command returns.
This also happens if the <B>-when</B> option is omitted.
<P><DT><A NAME="M35"><B>tail</B></A><DD>
Place the event on Tcl's event queue behind any events already
queued for this application.
<P><DT><A NAME="M36"><B>head</B></A><DD>
Place the event at the front of Tcl's event queue, so that it
will be handled before any other events already queued.
<P><DT><A NAME="M37"><B>mark</B></A><DD>
Place the event at the front of Tcl's event queue but behind any
other events already queued with <B>-when mark</B>.
This option is useful when generating a series of events that should
be processed in order but at the front of the queue.
<P></DL>
<P><DT><A NAME="M38"><B>-x</B><I> coord</I></A><DD>
<I>Coord</I> must be a screen distance; it specifies the <I>x</I> field
for the event.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Motion</B>, <B>Enter</B>, <B>Leave</B>,
<B>Expose</B>, <B>Configure</B>, <B>Gravity</B>, and <B>Reparent</B>
events.
Corresponds to the the <B>%x</B> substitution for binding scripts.
If <I>Window</I> is empty the coordinate is relative to the
screen, and this option corresponds to the <B>%X</B> substitution
for binding scripts.
<P><DT><A NAME="M39"><B>-y</B><I> coord</I></A><DD>
<I>Coord</I> must be a screen distance; it specifies the <I>y</I>
field for the event.
Valid for <B>KeyPress</B>, <B>KeyRelease</B>, <B>ButtonPress</B>,
<B>ButtonRelease</B>, <B>Motion</B>, <B>Enter</B>, <B>Leave</B>,
<B>Expose</B>, <B>Configure</B>, <B>Gravity</B>, and <B>Reparent</B>
events.
Corresponds to the the <B>%y</B> substitution for binding scripts.
If <I>Window</I> is empty the coordinate is relative to the
screen, and this option corresponds to the <B>%Y</B> substitution
for binding scripts.
<P></DL>
<P>
Any options that are not specified when generating an event are filled
with the value 0, except for <I>serial</I>, which is filled with the
next X event serial number.
<H3><A NAME="M40">VIRTUAL EVENT EXAMPLES</A></H3>
In order for a virtual event binding to trigger, two things must
happen. First, the virtual event must be defined with the
<B>event add</B> command. Second, a binding must be created for
the virtual event with the <B><A HREF="../TclCmd/bind.htm">bind</A></B> command.
Consider the following virtual event definitions:
<PRE>event add &lt;&lt;Paste&gt;&gt; &lt;Control-y&gt;
event add &lt;&lt;Paste&gt;&gt; &lt;Button-2&gt;
event add &lt;&lt;Save&gt;&gt; &lt;Control-X&gt;&lt;Control-S&gt;
event add &lt;&lt;Save&gt;&gt; &lt;Shift-F12&gt;</PRE>
In the <B><A HREF="../TclCmd/bind.htm">bind</A></B> command, a virtual event can be bound like any other
builtin event type as follows:
<PRE>bind Entry &lt;&lt;Paste&gt;&gt; {%W insert [selection get]}</PRE>
The double angle brackets are used to specify that a virtual event is being
bound. If the user types Control-y or presses button 2, or if
a <B>&lt;&lt;Paste&gt;&gt;</B> virtual event is synthesized with <B>event generate</B>,
then the <B>&lt;&lt;Paste&gt;&gt;</B> binding will be invoked.
<P>
If a virtual binding has the exact same sequence as a separate
physical binding, then the physical binding will take precedence.
Consider the following example:
<PRE>event add &lt;&lt;Paste&gt;&gt; &lt;Control-y&gt; &lt;Meta-Control-y&gt;
bind Entry &lt;Control-y&gt; {puts Control-y}
bind Entry &lt;&lt;Paste&gt;&gt; {puts Paste}</PRE>
When the user types Control-y the <B>&lt;Control-y&gt;</B> binding
will be invoked, because a physical event is considered
more specific than a virtual event, all other things being equal.
However, when the user types Meta-Control-y the
<B>&lt;&lt;Paste&gt;&gt;</B> binding will be invoked, because the
<B>Meta</B> modifier in the physical pattern associated with the
virtual binding is more specific than the <B>&lt;Control-y</B>&gt; sequence for
the physical event.
<P>
Bindings on a virtual event may be created before the virtual event exists.
Indeed, the virtual event never actually needs to be defined, for instance,
on platforms where the specific virtual event would meaningless or
ungeneratable.
<P>
When a definition of a virtual event changes at run time, all windows
will respond immediately to the new definition.
Starting from the preceding example, if the following code is executed:
<PRE>bind &lt;Entry&gt; &lt;Control-y&gt; {}
event add &lt;&lt;Paste&gt;&gt; &lt;Key-F6&gt;</PRE>
the behavior will change such in two ways. First, the shadowed
<B>&lt;&lt;Paste&gt;&gt;</B> binding will emerge.
Typing Control-y will no longer invoke the <B>&lt;Control-y&gt;</B> binding,
but instead invoke the virtual event <B>&lt;&lt;Paste&gt;&gt;</B>. Second,
pressing the F6 key will now also invoke the <B>&lt;&lt;Paste&gt;&gt;</B> binding.
<H3><A NAME="M41">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/bind.htm">bind</A></B>
<H3><A NAME="M42">KEYWORDS</A></H3>
<A href="../Keywords/E.htm#event">event</A>, <A href="../Keywords/B.htm#binding">binding</A>, <A href="../Keywords/D.htm#define">define</A>, <A href="../Keywords/H.htm#handle">handle</A>, <A href="../Keywords/V.htm#virtual event">virtual event</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1998-2000 Ajuba Solutions.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

118
hlp/en/tk/focus.htm Normal file
View File

@@ -0,0 +1,118 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - focus manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="focus.htm#M2" NAME="L468">NAME</A>
<DL><DD>focus - Manage the input focus</DL>
<DD><A HREF="focus.htm#M3" NAME="L469">SYNOPSIS</A>
<DL>
<DD><B>focus</B>
<DD><B>focus </B><I>window</I>
<DD><B>focus </B><I>option</I> ?<I>arg arg ...</I>?
</DL>
<DD><A HREF="focus.htm#M4" NAME="L470">DESCRIPTION</A>
<DL>
<DD><A HREF="focus.htm#M5" NAME="L471"><B>focus</B></A>
<DD><A HREF="focus.htm#M6" NAME="L472"><B>focus </B><I>window</I></A>
<DD><A HREF="focus.htm#M7" NAME="L473"><B>focus -displayof</B> <I>window</I></A>
<DD><A HREF="focus.htm#M8" NAME="L474"><B>focus -force </B><I>window</I></A>
<DD><A HREF="focus.htm#M9" NAME="L475"><B>focus -lastfor</B> <I>window</I></A>
</DL>
<DD><A HREF="focus.htm#M10" NAME="L476">QUIRKS</A>
<DD><A HREF="focus.htm#M11" NAME="L477">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
focus - Manage the input focus
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>focus</B><BR>
<B>focus </B><I>window</I><BR>
<B>focus </B><I>option</I> ?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>focus</B> command is used to manage the Tk input focus.
At any given time, one window on each display is designated as
the <I>focus window</I>; any key press or key release events for the
display are sent to that window.
It is normally up to the window manager to redirect the focus among the
top-level windows of a display. For example, some window managers
automatically set the input focus to a top-level window whenever
the mouse enters it; others redirect the input focus only when
the user clicks on a window.
Usually the window manager will set the focus
only to top-level windows, leaving it up to the application to
redirect the focus among the children of the top-level.
<P>
Tk remembers one focus window for each top-level (the most recent
descendant of that top-level to receive the focus); when the window
manager gives the focus
to a top-level, Tk automatically redirects it to the remembered
window. Within a top-level Tk uses an <I>explicit</I> focus model
by default. Moving the mouse within a top-level does not normally
change the focus; the focus changes only when a widget
decides explicitly to claim the focus (e.g., because of a button
click), or when the user types a key such as Tab that moves the
focus.
<P>
The Tcl procedure <B>tk_focusFollowsMouse</B> may be invoked to
create an <I>implicit</I> focus model: it reconfigures Tk so that
the focus is set to a window whenever the mouse enters it.
The Tcl procedures <B>tk_focusNext</B> and <B>tk_focusPrev</B>
implement a focus order among the windows of a top-level; they
are used in the default bindings for Tab and Shift-Tab, among other
things.
<P>
The <B>focus</B> command can take any of the following forms:
<P>
<DL>
<P><DT><A NAME="M5"><B>focus</B></A><DD>
Returns the path name of the focus window on the display containing
the application's main window, or an empty string if no window in
this application has the focus on that display. Note: it is
better to specify the display explicitly using <B>-displayof</B>
(see below) so that the code will work in applications using multiple
displays.
<P><DT><A NAME="M6"><B>focus </B><I>window</I></A><DD>
If the application currently has the input focus on <I>window</I>'s
display, this command resets the input focus for <I>window</I>'s display
to <I>window</I> and returns an empty string.
If the application doesn't currently have the input focus on
<I>window</I>'s display, <I>window</I> will be remembered as the focus
for its top-level; the next time the focus arrives at the top-level,
Tk will redirect it to <I>window</I>.
If <I>window</I> is an empty string then the command does nothing.
<P><DT><A NAME="M7"><B>focus -displayof</B> <I>window</I></A><DD>
Returns the name of the focus window on the display containing <I>window</I>.
If the focus window for <I>window</I>'s display isn't in this
application, the return value is an empty string.
<P><DT><A NAME="M8"><B>focus -force </B><I>window</I></A><DD>
Sets the focus of <I>window</I>'s display to <I>window</I>, even if
the application doesn't currently have the input focus for the display.
This command should be used sparingly, if at all.
In normal usage, an application should not claim the focus for
itself; instead, it should wait for the window manager to give it
the focus.
If <I>window</I> is an empty string then the command does nothing.
<P><DT><A NAME="M9"><B>focus -lastfor</B> <I>window</I></A><DD>
Returns the name of the most recent window to have the input focus
among all the windows in the same top-level as <I>window</I>.
If no window in that top-level has ever had the input focus, or
if the most recent focus window has been deleted, then the name
of the top-level is returned. The return value is the window that
will receive the input focus the next time the window manager gives
the focus to the top-level.
<P></DL>
<H3><A NAME="M10">QUIRKS</A></H3>
When an internal window receives the input focus, Tk doesn't actually
set the X focus to that window; as far as X is concerned, the focus
will stay on the top-level window containing the window with the focus.
However, Tk generates FocusIn and FocusOut events just as if the X
focus were on the internal window. This approach gets around a
number of problems that would occur if the X focus were actually moved;
the fact that the X focus is on the top-level is invisible unless
you use C code to query the X server directly.
<H3><A NAME="M11">KEYWORDS</A></H3>
<A href="../Keywords/E.htm#events">events</A>, <A href="../Keywords/F.htm#focus">focus</A>, <A href="../Keywords/K.htm#keyboard">keyboard</A>, <A href="../Keywords/T.htm#top-level">top-level</A>, <A href="../Keywords/W.htm#window manager">window manager</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

48
hlp/en/tk/focusNext.htm Normal file
View File

@@ -0,0 +1,48 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_focusNext manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tk_focusNext, tk_focusPrev, tk_focusFollowsMouse - Utility procedures for managing the input focus.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_focusNext </B><I>window</I><BR>
<B>tk_focusPrev </B><I>window</I><BR>
<B>tk_focusFollowsMouse</B><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
<B>tk_focusNext</B> is a utility procedure used for keyboard traversal.
It returns the ``next'' window after <I>window</I> in focus order.
The focus order is determined by
the stacking order of windows and the structure of the window hierarchy.
Among siblings, the focus order is the same as the stacking order, with the
lowest window being first.
If a window has children, the window is visited first, followed by
its children (recursively), followed by its next sibling.
Top-level windows other than <I>window</I> are skipped, so that
<B>tk_focusNext</B> never returns a window in a different top-level
from <I>window</I>.
<P>
After computing the next window, <B>tk_focusNext</B> examines the
window's <B>-takefocus</B> option to see whether it should be skipped.
If so, <B>tk_focusNext</B> continues on to the next window in the focus
order, until it eventually finds a window that will accept the focus
or returns back to <I>window</I>.
<P>
<B>tk_focusPrev</B> is similar to <B>tk_focusNext</B> except that it
returns the window just before <I>window</I> in the focus order.
<P>
<B>tk_focusFollowsMouse</B> changes the focus model for the application
to an implicit one where the window under the mouse gets the focus.
After this procedure is called, whenever the mouse enters a window
Tk will automatically give it the input focus.
The <B><A HREF="../TclCmd/focus.htm">focus</A></B> command may be used to move the focus to a window
other than the one under the mouse, but as soon as the mouse moves
into a new window the focus will jump to that window.
Note: at present there is no built-in support for returning the
application to an explicit focus model; to do this you'll have
to write a script that deletes the bindings created by
<B>tk_focusFollowsMouse</B>.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/F.htm#focus">focus</A>, <A href="../Keywords/K.htm#keyboard traversal">keyboard traversal</A>, <A href="../Keywords/T.htm#top-level">top-level</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

276
hlp/en/tk/font.htm Normal file
View File

@@ -0,0 +1,276 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - font manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="font.htm#M2" NAME="L482">NAME</A>
<DL><DD>font - Create and inspect fonts.</DL>
<DD><A HREF="font.htm#M3" NAME="L483">SYNOPSIS</A>
<DL>
<DD><B>font</B><I> option </I>?<I>arg arg ...</I>?
</DL>
<DD><A HREF="font.htm#M4" NAME="L484">DESCRIPTION</A>
<DL>
<DD><A HREF="font.htm#M5" NAME="L485"><B>font actual </B><I>font</I> ?<B>-displayof </B><I>window</I>? ?<I>option</I>?</A>
<DD><A HREF="font.htm#M6" NAME="L486"><B>font configure </B><I>fontname</I> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="font.htm#M7" NAME="L487"><B>font create</B> ?<I>fontname</I>? ?<I>option value ...</I>?</A>
<DD><A HREF="font.htm#M8" NAME="L488"><B>font delete</B> <I>fontname</I> ?<I>fontname ...</I>?</A>
<DD><A HREF="font.htm#M9" NAME="L489"><B>font families</B> ?<B>-displayof </B><I>window</I>?</A>
<DD><A HREF="font.htm#M10" NAME="L490"><B>font measure </B><I>font</I> ?<B>-displayof </B><I>window</I>? <I>text</I></A>
<DD><A HREF="font.htm#M11" NAME="L491"><B>font metrics </B><I>font</I> ?<B>-displayof </B><I>window</I>? ?<I>option</I>?</A>
<DD><A HREF="font.htm#M12" NAME="L492"><B>font names</B></A>
</DL>
<DD><A HREF="font.htm#M13" NAME="L493">FONT DESCRIPTION</A>
<DL>
<DD><A HREF="font.htm#M14" NAME="L494">[1] <I>fontname</I></A>
<DD><A HREF="font.htm#M15" NAME="L495">[2] <I>systemfont</I></A>
<DD><A HREF="font.htm#M16" NAME="L496">[3] <I>family </I>?<I>size</I>? ?<I>style</I>? ?<I>style ...</I>?</A>
<DD><A HREF="font.htm#M17" NAME="L497">[4] X-font names (XLFD)</A>
<DD><A HREF="font.htm#M18" NAME="L498">[5] <I>option value </I>?<I>option value ...</I>?</A>
</DL>
<DD><A HREF="font.htm#M19" NAME="L499">FONT METRICS</A>
<DL>
<DD><A HREF="font.htm#M20" NAME="L500"><B>-ascent </B></A>
<DD><A HREF="font.htm#M21" NAME="L501"><B>-descent </B></A>
<DD><A HREF="font.htm#M22" NAME="L502"><B>-linespace</B></A>
<DD><A HREF="font.htm#M23" NAME="L503"><B>-fixed </B></A>
</DL>
<DD><A HREF="font.htm#M24" NAME="L504">FONT OPTIONS</A>
<DL>
<DD><A HREF="font.htm#M25" NAME="L505"><B>-family </B><I>name</I></A>
<DD><A HREF="font.htm#M26" NAME="L506"><B>-size </B><I>size</I></A>
<DD><A HREF="font.htm#M27" NAME="L507"><B>-weight </B><I>weight</I></A>
<DD><A HREF="font.htm#M28" NAME="L508"><B>-slant </B><I>slant</I></A>
<DD><A HREF="font.htm#M29" NAME="L509"><B>-underline </B><I>boolean</I></A>
<DD><A HREF="font.htm#M30" NAME="L510"><B>-overstrike </B><I>boolean</I></A>
</DL>
<DD><A HREF="font.htm#M31" NAME="L511">PLATFORM-SPECIFIC ISSUES</A>
<DL>
<DD><A HREF="font.htm#M32" NAME="L512">X Windows:</A>
<DD><A HREF="font.htm#M33" NAME="L513">MS Windows:</A>
<DD><A HREF="font.htm#M34" NAME="L514">Macintosh:</A>
</DL>
<DD><A HREF="font.htm#M35" NAME="L515">SEE ALSO</A>
<DD><A HREF="font.htm#M36" NAME="L516">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
font - Create and inspect fonts.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>font</B><I> option </I>?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>font</B> command provides several facilities for dealing with
fonts, such as defining named fonts and inspecting the actual attributes of
a font. The command has several different forms, determined by the
first argument. The following forms are currently supported:
<P>
<DL>
<P><DT><A NAME="M5"><B>font actual </B><I>font</I> ?<B>-displayof </B><I>window</I>? ?<I>option</I>?</A><DD>
Returns information about the the actual attributes that are obtained when
<I>font</I> is used on <I>window</I>'s display; the actual attributes obtained
may differ from the attributes requested due to platform-dependant
limitations, such as the availability of font families and pointsizes.
<I>font</I> is a font description; see FONT DESCRIPTIONS below. If the
<I>window</I> argument is omitted, it defaults to the main window. If
<I>option</I> is specified, returns the value of that attribute; if it is
omitted, the return value is a list of all the attributes and their values.
See FONT OPTIONS below for a list of the possible attributes.
<P><DT><A NAME="M6"><B>font configure </B><I>fontname</I> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the desired attributes for the named font called
<I>fontname</I>. If no <I>option</I> is specified, returns a list describing
all the options and their values for <I>fontname</I>. If a single <I>option</I>
is specified with no <I>value</I>, then returns the current value of that
attribute. If one or more <I>option</I>-<I>value</I> pairs are specified,
then the command modifies the given named font to have the given values; in
this case, all widgets using that font will redisplay themselves using the
new attributes for the font. See FONT OPTIONS below for a list of the
possible attributes.
<P><DT><A NAME="M7"><B>font create</B> ?<I>fontname</I>? ?<I>option value ...</I>?</A><DD>
Creates a new named font and returns its name. <I>fontname</I> specifies the
name for the font; if it is omitted, then Tk generates a new name of the
form <B>font</B><I>x</I>, where <I>x</I> is an integer. There may be any number
of <I>option</I>-<I>value</I> pairs, which provide the desired attributes for
the new named font. See FONT OPTIONS below for a list of the possible
attributes.
<P><DT><A NAME="M8"><B>font delete</B> <I>fontname</I> ?<I>fontname ...</I>?</A><DD>
Delete the specified named fonts. If there are widgets using the named font,
the named font won't actually be deleted until all the instances are
released. Those widgets will continue to display using the last known values
for the named font. If a deleted named font is subsequently recreated with
another call to <B>font create</B>, the widgets will use the new named font
and redisplay themselves using the new attributes of that font.
<P><DT><A NAME="M9"><B>font families</B> ?<B>-displayof </B><I>window</I>?</A><DD>
The return value is a list of the case-insensitive names of all font families
that exist on <I>window</I>'s display. If the <I>window</I> argument is
omitted, it defaults to the main window.
<P><DT><A NAME="M10"><B>font measure </B><I>font</I> ?<B>-displayof </B><I>window</I>? <I>text</I></A><DD>
Measures the amount of space the string <I>text</I> would use in the given
<I>font</I> when displayed in <I>window</I>. <I>font</I> is a font description;
see FONT DESCRIPTIONS below. If the <I>window</I> argument is omitted, it
defaults to the main window. The return value is the total width in pixels
of <I>text</I>, not including the extra pixels used by highly exagerrated
characters such as cursive ``f''. If the string contains newlines or tabs,
those characters are not expanded or treated specially when measuring the
string.
<P><DT><A NAME="M11"><B>font metrics </B><I>font</I> ?<B>-displayof </B><I>window</I>? ?<I>option</I>?</A><DD>
Returns information about the metrics (the font-specific data), for
<I>font</I> when it is used on <I>window</I>'s display. <I>font</I> is a font
description; see FONT DESCRIPTIONS below. If the <I>window</I> argument is
omitted, it defaults to the main window. If <I>option</I> is specified,
returns the value of that metric; if it is omitted, the return value is a
list of all the metrics and their values. See FONT METRICS below for a list
of the possible metrics.
<P><DT><A NAME="M12"><B>font names</B></A><DD>
The return value is a list of all the named fonts that are currently defined.
<P></DL>
<H3><A NAME="M13">FONT DESCRIPTION</A></H3>
The following formats are accepted as a font description anywhere
<I>font</I> is specified as an argument above; these same forms are also
permitted when specifying the <B>-font</B> option for widgets.
<P>
<DL>
<P><DT><A NAME="M14">[1] <I>fontname</I></A><DD>
The name of a named font, created using the <B>font create</B> command. When
a widget uses a named font, it is guaranteed that this will never cause an
error, as long as the named font exists, no matter what potentially invalid
or meaningless set of attributes the named font has. If the named font
cannot be displayed with exactly the specified attributes, some other close
font will be substituted automatically.
<P><DT><A NAME="M15">[2] <I>systemfont</I></A><DD>
The platform-specific name of a font, interpreted by the graphics server.
This also includes, under X, an XLFD (see [4]) for which a single ``<B>*</B>''
character was used to elide more than one field in the middle of the
name. See PLATFORM-SPECIFIC issues for a list of the system fonts.
<P><DT><A NAME="M16">[3] <I>family </I>?<I>size</I>? ?<I>style</I>? ?<I>style ...</I>?</A><DD>
A properly formed list whose first element is the desired font
<I>family</I> and whose optional second element is the desired <I>size</I>.
The interpretation of the <I>size</I> attribute follows the same rules
described for <B>-size</B> in FONT OPTIONS below. Any additional optional
arguments following the <I>size</I> are font <I>style</I>s. Possible values
for the <I>style</I> arguments are as follows:
<PRE><B>normal bold roman italic
underline overstrike</B></PRE>
<P><DT><A NAME="M17">[4] X-font names (XLFD)</A><DD>
A Unix-centric font name of the form
<I>-foundry-family-weight-slant-setwidth-addstyle-pixel-point-resx-resy-spacing-width-charset-encoding</I>.
The ``<B>*</B>'' character may be used to skip individual fields that the
user does not care about. There must be exactly one ``<B>*</B>'' for each
field skipped, except that a ``<B>*</B>'' at the end of the XLFD skips any
remaining fields; the shortest valid XLFD is simply ``<B>*</B>'', signifying
all fields as defaults. Any fields that were skipped are given default
values. For compatibility, an XLFD always chooses a font of the specified
pixel size (not point size); although this interpretation is not strictly
correct, all existing applications using XLFDs assumed that one ``point''
was in fact one pixel and would display incorrectly (generally larger) if
the correct size font were actually used.
<P><DT><A NAME="M18">[5] <I>option value </I>?<I>option value ...</I>?</A><DD>
A properly formed list of <I>option</I>-<I>value</I> pairs that specify
the desired attributes of the font, in the same format used when defining
a named font; see FONT OPTIONS below.
<P></DL>
<P>
When font description <I>font</I> is used, the system attempts to parse the
description according to each of the above five rules, in the order specified.
Cases [1] and [2] must match the name of an existing named font or of a
system font. Cases [3], [4], and [5] are accepted on all
platforms and the closest available font will be used. In some situations
it may not be possible to find any close font (e.g., the font family was
a garbage value); in that case, some system-dependant default font is
chosen. If the font description does not match any of the above patterns,
an error is generated.
<H3><A NAME="M19">FONT METRICS</A></H3>
The following options are used by the <B>font metrics</B> command to query
font-specific data determined when the font was created. These properties are
for the whole font itself and not for individual characters drawn in that
font. In the following definitions, the ``baseline'' of a font is the
horizontal line where the bottom of most letters line up; certain letters,
such as lower-case ``g'' stick below the baseline.
<P>
<DL>
<P><DT><A NAME="M20"><B>-ascent </B></A><DD>
The amount in pixels that the tallest letter sticks up above the baseline of
the font, plus any extra blank space added by the designer of the font.
<P><DT><A NAME="M21"><B>-descent </B></A><DD>
The largest amount in pixels that any letter sticks down below the baseline
of the font, plus any extra blank space added by the designer of the font.
<P><DT><A NAME="M22"><B>-linespace</B></A><DD>
Returns how far apart vertically in pixels two lines of text using the same
font should be placed so that none of the characters in one line overlap any
of the characters in the other line. This is generally the sum of the ascent
above the baseline line plus the descent below the baseline.
<P><DT><A NAME="M23"><B>-fixed </B></A><DD>
Returns a boolean flag that is ``<B>1</B>'' if this is a fixed-width font,
where each normal character is the the same width as all the other
characters, or is ``<B>0</B>'' if this is a proportionally-spaced font, where
individual characters have different widths. The widths of control
characters, tab characters, and other non-printing characters are not
included when calculating this value.
<P></DL>
<H3><A NAME="M24">FONT OPTIONS</A></H3>
The following options are supported on all platforms, and are used when
constructing a named font or when specifying a font using style [5] as
above:
<P>
<DL>
<P><DT><A NAME="M25"><B>-family </B><I>name</I></A><DD>
The case-insensitive font family name. Tk guarantees to support the font
families named <B>Courier</B> (a monospaced ``typewriter'' font), <B>Times</B>
(a serifed ``newspaper'' font), and <B>Helvetica</B> (a sans-serif
``European'' font). The most closely matching native font family will
automatically be substituted when one of the above font families is used.
The <I>name</I> may also be the name of a native, platform-specific font
family; in that case it will work as desired on one platform but may not
display correctly on other platforms. If the family is unspecified or
unrecognized, a platform-specific default font will be chosen.
<P><DT><A NAME="M26"><B>-size </B><I>size</I></A><DD>
The desired size of the font. If the <I>size</I> argument is a positive
number, it is interpreted as a size in points. If <I>size</I> is a negative
number, its absolute value is interpreted as a size in pixels. If a
font cannot be displayed at the specified size, a nearby size will be
chosen. If <I>size</I> is unspecified or zero, a platform-dependent default
size will be chosen.
<P>
Sizes should normally be specified in points so the application will remain
the same ruler size on the screen, even when changing screen resolutions or
moving scripts across platforms. However, specifying pixels is useful in
certain circumstances such as when a piece of text must line up with respect
to a fixed-size bitmap. The mapping between points and pixels is set when
the application starts, based on properties of the installed monitor, but it
can be overridden by calling the <B><A HREF="../TclCmd/tk.htm">tk scaling</A></B> command.
<P><DT><A NAME="M27"><B>-weight </B><I>weight</I></A><DD>
The nominal thickness of the characters in the font. The value
<B>normal</B> specifies a normal weight font, while <B>bold</B> specifies a
bold font. The closest available weight to the one specified will
be chosen. The default weight is <B>normal</B>.
<P><DT><A NAME="M28"><B>-slant </B><I>slant</I></A><DD>
The amount the characters in the font are slanted away from the
vertical. Valid values for slant are <B>roman</B> and <B>italic</B>.
A roman font is the normal, upright appearance of a font, while
an italic font is one that is tilted some number of degrees from upright.
The closest available slant to the one specified will be chosen.
The default slant is <B>roman</B>.
<P><DT><A NAME="M29"><B>-underline </B><I>boolean</I></A><DD>
The value is a boolean flag that specifies whether characters in this
font should be underlined. The default value for underline is <B>false</B>.
<P><DT><A NAME="M30"><B>-overstrike </B><I>boolean</I></A><DD>
The value is a boolean flag that specifies whether a horizontal line should
be drawn through the middle of characters in this font. The default value
for overstrike is <B>false</B>.
<P></DL>
<H3><A NAME="M31">PLATFORM-SPECIFIC ISSUES</A></H3>
The following named system fonts are supported:
<P>
<DL>
<P><DT><A NAME="M32">X Windows:</A><DD>
All valid X font names, including those listed by xlsfonts(1), are available.
<P><DT><A NAME="M33">MS Windows:</A><DD>
<PRE><B>system ansi device
systemfixed ansifixed oemfixed</B></PRE>
<P><DT><A NAME="M34">Macintosh:</A><DD>
<PRE><B>system application</B></PRE>
<P></DL>
<H3><A NAME="M35">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/options.htm">options</A></B>
<H3><A NAME="M36">KEYWORDS</A></H3>
<A href="../Keywords/F.htm#font">font</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

176
hlp/en/tk/frame.htm Normal file
View File

@@ -0,0 +1,176 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - frame manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="frame.htm#M2" NAME="L517">NAME</A>
<DL><DD>frame - Create and manipulate frame widgets</DL>
<DD><A HREF="frame.htm#M3" NAME="L518">SYNOPSIS</A>
<DL>
<DD><B>frame</B> <I>pathName</I> ?<I>options</I>?
</DL>
<DD><A HREF="frame.htm#M4" NAME="L519">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
</DL>
<DD><A HREF="frame.htm#M5" NAME="L520">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="frame.htm#M6" NAME="L521">-background, background, Background</A>
<DD><A HREF="frame.htm#M7" NAME="L522">-class, class, Class</A>
<DD><A HREF="frame.htm#M8" NAME="L523">-colormap, colormap, Colormap</A>
<DD><A HREF="frame.htm#M9" NAME="L524">-container, container, Container</A>
<DD><A HREF="frame.htm#M10" NAME="L525">-height, height, Height</A>
<DD><A HREF="frame.htm#M11" NAME="L526">-visual, visual, Visual</A>
<DD><A HREF="frame.htm#M12" NAME="L527">-width, width, Width</A>
</DL>
<DD><A HREF="frame.htm#M13" NAME="L528">DESCRIPTION</A>
<DD><A HREF="frame.htm#M14" NAME="L529">WIDGET COMMAND</A>
<DL>
<DD><A HREF="frame.htm#M15" NAME="L530"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="frame.htm#M16" NAME="L531"><I>pathName </I><B>configure</B> ?<I>option</I>? <I>?value option value ...</I>?</A>
</DL>
<DD><A HREF="frame.htm#M17" NAME="L532">BINDINGS</A>
<DD><A HREF="frame.htm#M18" NAME="L533">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
frame - Create and manipulate frame widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>frame</B> <I>pathName</I> ?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-background</A></B>
<DT>Database Name: <B>background</B>
<DT>Database Class: <B>Background</B>
<DD>This option is the same as the standard <B>background</B> option
except that its value may also be specified as an empty string.
In this case, the widget will display no background or border, and
no colors will be consumed from its colormap for its background
and border.
<P><DT>Command-Line Name: <B><A NAME="M7">-class</A></B>
<DT>Database Name: <B>class</B>
<DT>Database Class: <B>Class</B>
<DD>Specifies a class for the window.
This class will be used when querying the option database for
the window's other options, and it will also be used later for
other purposes such as bindings.
The <B>class</B> option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M8">-colormap</A></B>
<DT>Database Name: <B>colormap</B>
<DT>Database Class: <B>Colormap</B>
<DD>Specifies a colormap to use for the window.
The value may be either <B>new</B>, in which case a new colormap is
created for the window and its children, or the name of another
window (which must be on the same screen and have the same visual
as <I>pathName</I>), in which case the new window will use the colormap
from the specified window.
If the <B>colormap</B> option is not specified, the new window
uses the same colormap as its parent.
This option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M9">-container</A></B>
<DT>Database Name: <B>container</B>
<DT>Database Class: <B>Container</B>
<DD>The value must be a boolean. If true, it means that this window will
be used as a container in which some other application will be embedded
(for example, a Tk toplevel can be embedded using the <B>-use</B> option).
The window will support the appropriate window manager protocols for
things like geometry requests. The window should not have any
children of its own in this application.
This option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M10">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies the desired height for the window in any of the forms
acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P><DT>Command-Line Name: <B><A NAME="M11">-visual</A></B>
<DT>Database Name: <B>visual</B>
<DT>Database Class: <B>Visual</B>
<DD>Specifies visual information for the new window in any of the
forms accepted by <B><A HREF="../TclLib/GetVisual.htm">Tk_GetVisual</A></B>.
If this option is not specified, the new window will use the same
visual as its parent.
The <B>visual</B> option may not be modified with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M12">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the desired width for the window in any of the forms
acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option is less than or equal to zero then the window will
not request any size at all.
</DL>
<H3><A NAME="M13">DESCRIPTION</A></H3>
The <B>frame</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a frame widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the frame such as its background color
and relief. The <B>frame</B> command returns the
path name of the new window.
<P>
A frame is a simple widget. Its primary purpose is to act as a
spacer or container for complex window layouts. The only features
of a frame are its background color and an optional 3-D border to make the
frame appear raised or sunken.
<H3><A NAME="M14">WIDGET COMMAND</A></H3>
The <B>frame</B> command creates a new Tcl command whose
name is the same as the path name of the frame's window. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>PathName</I> is the name of the command, which is the same as
the frame widget's path name. <I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for frame widgets:
<P>
<DL>
<P><DT><A NAME="M15"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>frame</B>
command.
<P><DT><A NAME="M16"><I>pathName </I><B>configure</B> ?<I>option</I>? <I>?value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>frame</B>
command.
<P></DL>
<H3><A NAME="M17">BINDINGS</A></H3>
When a new frame is created, it has no default event bindings:
frames are not intended to be interactive.
<H3><A NAME="M18">KEYWORDS</A></H3>
<A href="../Keywords/F.htm#frame">frame</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

158
hlp/en/tk/getOpenFile.htm Normal file
View File

@@ -0,0 +1,158 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_getOpenFile manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="getOpenFile.htm#M2" NAME="L534">NAME</A>
<DL><DD>tk_getOpenFile, tk_getSaveFile - pop up a dialog box for the user to select a file to open or save.</DL>
<DD><A HREF="getOpenFile.htm#M3" NAME="L535">SYNOPSIS</A>
<DL>
<DD><B>tk_getOpenFile </B>?<I>option value ...</I>?
<DD><B>tk_getSaveFile </B>?<I>option value ...</I>?
</DL>
<DD><A HREF="getOpenFile.htm#M4" NAME="L536">DESCRIPTION</A>
<DL>
<DD><A HREF="getOpenFile.htm#M5" NAME="L537"><B>-defaultextension</B> <I>extension</I></A>
<DD><A HREF="getOpenFile.htm#M6" NAME="L538"><B>-filetypes</B> <I>filePatternList</I></A>
<DD><A HREF="getOpenFile.htm#M7" NAME="L539"><B>-initialdir</B> <I>directory</I></A>
<DD><A HREF="getOpenFile.htm#M8" NAME="L540"><B>-initialfile</B> <I>filename</I></A>
<DD><A HREF="getOpenFile.htm#M9" NAME="L541"><B>-parent</B> <I>window</I></A>
<DD><A HREF="getOpenFile.htm#M10" NAME="L542"><B>-title</B> <I>titleString</I></A>
</DL>
<DD><A HREF="getOpenFile.htm#M11" NAME="L543">SPECIFYING FILE PATTERNS</A>
<DD><A HREF="getOpenFile.htm#M12" NAME="L544">SPECIFYING EXTENSIONS</A>
<DD><A HREF="getOpenFile.htm#M13" NAME="L545">EXAMPLE</A>
<DD><A HREF="getOpenFile.htm#M14" NAME="L546">SEE ALSO</A>
<DD><A HREF="getOpenFile.htm#M15" NAME="L547">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
tk_getOpenFile, tk_getSaveFile - pop up a dialog box for the user to select a file to open or save.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_getOpenFile </B>?<I>option value ...</I>?<BR>
<B>tk_getSaveFile </B>?<I>option value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The procedures <B>tk_getOpenFile</B> and <B>tk_getSaveFile</B> pop up a
dialog box for the user to select a file to open or save. The
<B>tk_getOpenFile</B> command is usually associated with the <B><A HREF="../TkCmd/open.htm">Open</A></B>
command in the <B><A HREF="../TkCmd/file.htm">File</A></B> menu. Its purpose is for the user to select an
existing file <I>only</I>. If the user enters an non-existent file, the
dialog box gives the user an error prompt and requires the user to give
an alternative selection. If an application allows the user to create
new files, it should do so by providing a separate <B>New</B> menu command.
<P>
The <B>tk_getSaveFile</B> command is usually associated with the <B>Save
as</B> command in the <B><A HREF="../TkCmd/file.htm">File</A></B> menu. If the user enters a file that
already exists, the dialog box prompts the user for confirmation
whether the existing file should be overwritten or not.
<P>
The following <I>option-value</I> pairs are possible as command line
arguments to these two commands:
<P>
<DL>
<P><DT><A NAME="M5"><B>-defaultextension</B> <I>extension</I></A><DD>
Specifies a string that will be appended to the filename if the user
enters a filename without an extension. The defaut value is the empty
string, which means no extension will be appended to the filename in
any case. This option is ignored on the Macintosh platform, which
does not require extensions to filenames.
<P><DT><A NAME="M6"><B>-filetypes</B> <I>filePatternList</I></A><DD>
If a <B><A HREF="../TkCmd/file.htm">File types</A></B> listbox exists in the file dialog on the particular
platform, this option gives the <I>filetype</I>s in this listbox. When
the user choose a filetype in the listbox, only the files of that type
are listed. If this option is unspecified, or if it is set to the
empty list, or if the <B><A HREF="../TkCmd/file.htm">File types</A></B> listbox is not supported by the
particular platform then all files are listed regardless of their
types. See the section SPECIFYING FILE PATTERNS below for a
discussion on the contents of <I>filePatternList</I>.
<P><DT><A NAME="M7"><B>-initialdir</B> <I>directory</I></A><DD>
Specifies that the files in <I>directory</I> should be displayed
when the dialog pops up. If this parameter is not specified, then
the files in the current working directory are displayed. If the
parameter specifies a relative path, the return value will convert the
relative path to an absolute path. This option may not always work on
the Macintosh. This is not a bug. Rather, the <I>General Controls</I>
control panel on the Mac allows the end user to override the
application default directory.
<P><DT><A NAME="M8"><B>-initialfile</B> <I>filename</I></A><DD>
Specifies a filename to be displayed in the dialog when it pops up. This
option is ignored on the Macintosh platform.
<P><DT><A NAME="M9"><B>-parent</B> <I>window</I></A><DD>
Makes <I>window</I> the logical parent of the file dialog. The file
dialog is displayed on top of its parent window.
<P><DT><A NAME="M10"><B>-title</B> <I>titleString</I></A><DD>
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title is displayed.
<P></DL>
<P>
If the user selects a file, both <B>tk_getOpenFile</B> and
<B>tk_getSaveFile</B> return the full pathname of this file. If the
user cancels the operation, both commands return the empty string.
<H3><A NAME="M11">SPECIFYING FILE PATTERNS</A></H3>
The <I>filePatternList</I> value given by the <B>-filetypes</B> option
is a list of file patterns. Each file pattern is a list of the
form
<PRE><I>typeName</I> {<I>extension</I> ?<I>extension ...</I>?} ?{<I>macType</I> ?<I>macType ...</I>?}?</PRE>
<I>typeName</I> is the name of the file type described by this
file pattern and is the text string that appears in the <B><A HREF="../TkCmd/file.htm">File types</A></B>
listbox. <I>extension</I> is a file extension for this file pattern.
<I>macType</I> is a four-character Macintosh file type. The list of
<I>macType</I>s is optional and may be omitted for applications that do
not need to execute on the Macintosh platform.
<P>
Several file patterns may have the same <I>typeName,</I> in which case
they refer to the same file type and share the same entry in the
listbox. When the user selects an entry in the listbox, all the files
that match at least one of the file patterns corresponding
to that entry are listed. Usually, each file pattern corresponds to a
distinct type of file. The use of more than one file patterns for one
type of file is necessary on the Macintosh platform only.
<P>
On the Macintosh platform, a file matches a file pattern if its
name matches at least one of the <I>extension</I>(s) AND it
belongs to at least one of the <I>macType</I>(s) of the
file pattern. For example, the <B>C Source Files</B> file pattern in the
sample code matches with files that have a <B>.c</B> extension AND
belong to the <I>macType</I> <B><A HREF="../TclCmd/text.htm">TEXT</A></B>. To use the OR rule instead,
you can use two file patterns, one with the <I>extensions</I> only and
the other with the <I>macType</I> only. The <B>GIF Files</B> file type
in the sample code matches files that EITHER have a <B>.gif</B>
extension OR belong to the <I>macType</I> <B>GIFF</B>.
<P>
On the Unix and Windows platforms, a file matches a file pattern
if its name matches at at least one of the <I>extension</I>(s) of
the file pattern. The <I>macType</I>s are ignored.
<H3><A NAME="M12">SPECIFYING EXTENSIONS</A></H3>
On the Unix and Macintosh platforms, extensions are matched using
glob-style pattern matching. On the Windows platforms, extensions are
matched by the underlying operating system. The types of possible
extensions are: (1) the special extension * matches any
file; (2) the special extension &quot;&quot; matches any files that
do not have an extension (i.e., the filename contains no full stop
character); (3) any character string that does not contain any wild
card characters (* and ?).
<P>
Due to the different pattern matching rules on the various platforms,
to ensure portability, wild card characters are not allowed in the
extensions, except as in the special extension *. Extensions
without a full stop character (e.g, ~) are allowed but may not
work on all platforms.
<H3><A NAME="M13">EXAMPLE</A></H3>
<PRE>set types {
{{Text Files} {.txt} }
{{TCL Scripts} {.tcl} }
{{C Source Files} {.c} TEXT}
{{GIF Files} {.gif} }
{{GIF Files} {} GIFF}
{{All Files} * }
}
set filename [tk_getOpenFile -filetypes $types]
if {$filename != &quot;&quot;} {
# Open the file ...
}</PRE>
<H3><A NAME="M14">SEE ALSO</A></H3>
<B>tk_chooseDirectory</B>
<H3><A NAME="M15">KEYWORDS</A></H3>
<A href="../Keywords/F.htm#file selection dialog">file selection dialog</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

127
hlp/en/tk/grab.htm Normal file
View File

@@ -0,0 +1,127 @@
<HTML><HEAD><TITLE>Built-In Commands - grab manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="grab.htm#M2" NAME="L548">NAME</A>
<DL><DD>grab - Confine pointer and keyboard events to a window sub-tree</DL>
<DD><A HREF="grab.htm#M3" NAME="L549">SYNOPSIS</A>
<DL>
<DD><B>grab </B>?<B>-global</B>? <I>window</I>
<DD><B>grab </B><I>option </I>?<I>arg arg </I>...?
</DL>
<DD><A HREF="grab.htm#M4" NAME="L550">DESCRIPTION</A>
<DL>
<DD><A HREF="grab.htm#M5" NAME="L551"><B>grab </B>?<B>-global</B>? <I>window</I></A>
<DD><A HREF="grab.htm#M6" NAME="L552"><B>grab current </B>?<I>window</I>?</A>
<DD><A HREF="grab.htm#M7" NAME="L553"><B>grab release </B><I>window</I></A>
<DD><A HREF="grab.htm#M8" NAME="L554"><B>grab set </B>?<B>-global</B>? <I>window</I></A>
<DD><A HREF="grab.htm#M9" NAME="L555"><B>grab status </B><I>window</I></A>
</DL>
<DD><A HREF="grab.htm#M10" NAME="L556">BUGS</A>
<DD><A HREF="grab.htm#M11" NAME="L557">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
grab - Confine pointer and keyboard events to a window sub-tree
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>grab </B>?<B>-global</B>? <I>window</I><BR>
<B>grab </B><I>option </I>?<I>arg arg </I>...?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command implements simple pointer and keyboard grabs for Tk.
Tk's grabs are different than the grabs
described in the Xlib documentation.
When a grab is set for a particular window, Tk restricts all pointer
events to the grab window and its descendants in Tk's window hierarchy.
Whenever the pointer is within the grab window's subtree, the pointer
will behave exactly the same as if there had been no grab at all
and all events will be reported in the normal fashion.
When the pointer is outside <I>window</I>'s tree, button presses and
releases and
mouse motion events are reported to <I>window</I>, and window entry
and window exit events are ignored.
The grab subtree ``owns'' the pointer:
windows outside the grab subtree will be visible on the screen
but they will be insensitive until the grab is released.
The tree of windows underneath the grab window can include top-level
windows, in which case all of those top-level windows
and their descendants will continue to receive mouse events
during the grab.
<P>
Two forms of grabs are possible: local and global.
A local grab affects only the grabbing application: events will
be reported to other applications as if the grab had never occurred.
Grabs are local by default.
A global grab locks out all applications on the screen,
so that only the given subtree of the grabbing application will be
sensitive to pointer events (mouse button presses, mouse button releases,
pointer motions, window entries, and window exits).
During global grabs the window manager will not receive pointer
events either.
<P>
During local grabs, keyboard events (key presses and key releases)
are delivered as usual: the window
manager controls which application receives keyboard events, and
if they are sent to any window in the grabbing application then they are
redirected to the focus window.
During a global grab Tk grabs the keyboard so that all keyboard events
are always sent to the grabbing application.
The <B><A HREF="../TclCmd/focus.htm">focus</A></B> command is still used to determine which window in the
application receives the keyboard events.
The keyboard grab is released when the grab is released.
<P>
Grabs apply to particular displays. If an application has windows
on multiple displays then it can establish a separate grab on each
display.
The grab on a particular display affects only the windows on
that display.
It is possible for different applications on a single display to have
simultaneous local grabs, but only one application can have a global
grab on a given display at once.
<P>
The <B>grab</B> command can take any of the following forms:
<P>
<DL>
<P><DT><A NAME="M5"><B>grab </B>?<B>-global</B>? <I>window</I></A><DD>
Same as <B>grab set</B>, described below.
<P><DT><A NAME="M6"><B>grab current </B>?<I>window</I>?</A><DD>
If <I>window</I> is specified, returns the name of the current grab
window in this application for <I>window</I>'s display, or an empty
string if there is no such window.
If <I>window</I> is omitted, the command returns a list whose elements
are all of the windows grabbed by this application for all displays,
or an empty string if the application has no grabs.
<P><DT><A NAME="M7"><B>grab release </B><I>window</I></A><DD>
Releases the grab on <I>window</I> if there is one, otherwise does
nothing. Returns an empty string.
<P><DT><A NAME="M8"><B>grab set </B>?<B>-global</B>? <I>window</I></A><DD>
Sets a grab on <I>window</I>. If <B>-global</B> is specified then the
grab is global, otherwise it is local.
If a grab was already in effect for this application on
<I>window</I>'s display then it is automatically released.
If there is already a grab on <I>window</I> and it has the same
global/local form as the requested grab, then the command
does nothing. Returns an empty string.
<P><DT><A NAME="M9"><B>grab status </B><I>window</I></A><DD>
Returns <B>none</B> if no grab is currently set on <I>window</I>,
<B>local</B> if a local grab is set on <I>window</I>, and
<B><A HREF="../TkCmd/global.htm">global</A></B> if a global grab is set.
<P></DL>
<H3><A NAME="M10">BUGS</A></H3>
It took an incredibly complex and gross implementation to produce
the simple grab effect described above.
Given the current implementation, it isn't safe for applications
to use the Xlib grab facilities at all except through the Tk grab
procedures.
If applications try to manipulate X's grab mechanisms directly,
things will probably break.
<P>
If a single process is managing several different Tk applications,
only one of those applications can have a local grab for a given
display at any given time. If the applications are in different
processes, this restriction doesn't exist.
<H3><A NAME="M11">KEYWORDS</A></H3>
<A href="../Keywords/G.htm#grab">grab</A>, <A href="../Keywords/K.htm#keyboard events">keyboard events</A>, <A href="../Keywords/P.htm#pointer events">pointer events</A>, <A href="../Keywords/W.htm#window">window</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1992 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

343
hlp/en/tk/grid.htm Normal file
View File

@@ -0,0 +1,343 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - grid manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="grid.htm#M2" NAME="L558">NAME</A>
<DL><DD>grid - Geometry manager that arranges widgets in a grid</DL>
<DD><A HREF="grid.htm#M3" NAME="L559">SYNOPSIS</A>
<DL>
<DD><B>grid </B><I>option arg </I>?<I>arg ...</I>?
</DL>
<DD><A HREF="grid.htm#M4" NAME="L560">DESCRIPTION</A>
<DL>
<DD><A HREF="grid.htm#M5" NAME="L561"><B>grid </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A>
<DD><A HREF="grid.htm#M6" NAME="L562"><B>grid bbox </B><I>master</I> ?<I>column row</I>? ?<I>column2 row2</I>?</A>
<DD><A HREF="grid.htm#M7" NAME="L563"><B>grid columnconfigure </B><I>master index </I>?<I>-option value...</I>?</A>
<DD><A HREF="grid.htm#M8" NAME="L564"><B>grid configure </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A>
<DL>
<DD><A HREF="grid.htm#M9" NAME="L565"><B>-column </B><I>n</I></A>
<DD><A HREF="grid.htm#M10" NAME="L566"><B>-columnspan </B><I>n</I></A>
<DD><A HREF="grid.htm#M11" NAME="L567"><B>-in </B><I>other</I></A>
<DD><A HREF="grid.htm#M12" NAME="L568"><B>-ipadx </B><I>amount</I></A>
<DD><A HREF="grid.htm#M13" NAME="L569"><B>-ipady </B><I>amount</I></A>
<DD><A HREF="grid.htm#M14" NAME="L570"><B>-padx </B><I>amount</I></A>
<DD><A HREF="grid.htm#M15" NAME="L571"><B>-pady </B><I>amount</I></A>
<DD><A HREF="grid.htm#M16" NAME="L572"><B>-row </B><I>n</I></A>
<DD><A HREF="grid.htm#M17" NAME="L573"><B>-rowspan </B><I>n</I></A>
<DD><A HREF="grid.htm#M18" NAME="L574"><B>-sticky </B><I>style</I></A>
</DL>
<DD><A HREF="grid.htm#M19" NAME="L575"><B>grid forget </B><I>slave </I>?<I>slave ...</I>?</A>
<DD><A HREF="grid.htm#M20" NAME="L576"><B>grid info </B><I>slave</I></A>
<DD><A HREF="grid.htm#M21" NAME="L577"><B>grid location </B><I>master x y</I></A>
<DD><A HREF="grid.htm#M22" NAME="L578"><B>grid propagate </B><I>master</I> ?<I>boolean</I>?</A>
<DD><A HREF="grid.htm#M23" NAME="L579"><B>grid rowconfigure </B><I>master index </I>?<I>-option value...</I>?</A>
<DD><A HREF="grid.htm#M24" NAME="L580"><B>grid remove </B><I>slave </I>?<I>slave ...</I>?</A>
<DD><A HREF="grid.htm#M25" NAME="L581"><B>grid size </B><I>master</I></A>
<DD><A HREF="grid.htm#M26" NAME="L582"><B>grid slaves </B><I>master</I> ?<I>-option value</I>?</A>
</DL>
<DD><A HREF="grid.htm#M27" NAME="L583">RELATIVE PLACEMENT</A>
<DL>
<DD><A HREF="grid.htm#M28" NAME="L584"><B>-</B></A>
<DD><A HREF="grid.htm#M29" NAME="L585"><B>x</B></A>
<DD><A HREF="grid.htm#M30" NAME="L586"><B>^</B></A>
</DL>
<DD><A HREF="grid.htm#M31" NAME="L587">THE GRID ALGORITHM</A>
<DD><A HREF="grid.htm#M32" NAME="L588">GEOMETRY PROPAGATION</A>
<DD><A HREF="grid.htm#M33" NAME="L589">RESTRICTIONS ON MASTER WINDOWS</A>
<DD><A HREF="grid.htm#M34" NAME="L590">STACKING ORDER</A>
<DD><A HREF="grid.htm#M35" NAME="L591">CREDITS</A>
<DD><A HREF="grid.htm#M36" NAME="L592">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
grid - Geometry manager that arranges widgets in a grid
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>grid </B><I>option arg </I>?<I>arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>grid</B> command is used to communicate with the grid
geometry manager that arranges widgets in rows and columns inside
of another window, called the geometry master (or master window).
The <B>grid</B> command can have any of several forms, depending
on the <I>option</I> argument:
<P>
<DL>
<P><DT><A NAME="M5"><B>grid </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A><DD>
If the first argument to <B>grid</B> is a window name (any value
starting with ``.''), then the command is processed in the same
way as <B>grid configure</B>.
<P><DT><A NAME="M6"><B>grid bbox </B><I>master</I> ?<I>column row</I>? ?<I>column2 row2</I>?</A><DD>
With no arguments,
the bounding box (in pixels) of the grid is returned.
The return value consists of 4 integers. The first two are the pixel
offset from the master window (x then y) of the top-left corner of the
grid, and the second two integers are the width and height of the grid,
also in pixels. If a single <I>column</I> and <I>row</I> is specified on
the command line, then the bounding box for that cell is returned, where the
top left cell is numbered from zero. If both <I>column</I> and <I>row</I>
arguments are specified, then the bounding box spanning the rows and columns
indicated is returned.
<P><DT><A NAME="M7"><B>grid columnconfigure </B><I>master index </I>?<I>-option value...</I>?</A><DD>
Query or set the column properties of the <I>index</I> column of the
geometry master, <I>master</I>.
The valid options are <B>-minsize</B>, <B>-weight</B> and <B>-pad</B>.
If one or more options are provided, then <I>index</I> may be given as
a list of column indeces to which the configuration options will operate on.
The <B>-minsize</B> option sets the minimum size, in screen units,
that will be permitted for this column.
The <B>-weight</B> option (an integer value)
sets the relative weight for apportioning
any extra spaces among
columns.
A weight of zero (0) indicates the column will not deviate from its requested
size. A column whose weight is two will grow at twice the rate as a column
of weight one when extra space is allocated to the layout.
The <B>-pad</B> option specifies the number of screen units that will be
added to the largest window contained completely in that column when the
grid geometry manager requests a size from the containing window.
If only an option is specified, with no value,
the current value of that option is returned.
If only the master window and index is specified, all the current settings
are returned in an list of &quot;-option value&quot; pairs.
<P><DT><A NAME="M8"><B>grid configure </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A><DD>
The arguments consist of the names of one or more slave windows
followed by pairs of arguments that specify how
to manage the slaves.
The characters <B>-</B>, <B>x</B> and <B>^</B>,
can be specified instead of a window name to alter the default
location of a <I>slave</I>, as described in the ``RELATIVE PLACEMENT''
section, below.
The following options are supported:
<P>
<DL>
<P><DT><A NAME="M9"><B>-column </B><I>n</I></A><DD>
Insert the slave so that it occupies the <I>n</I>th column in the grid.
Column numbers start with 0. If this option is not supplied, then the
slave is arranged just to the right of previous slave specified on this
call to <I>grid</I>, or column &quot;0&quot; if it is the first slave. For each
<B>x</B> that immediately precedes the <I>slave</I>, the column position
is incremented by one. Thus the <B>x</B> represents a blank column
for this row in the grid.
<P><DT><A NAME="M10"><B>-columnspan </B><I>n</I></A><DD>
Insert the slave so that it occupies <I>n</I> columns in the grid.
The default is one column, unless the window name is followed by a
<B>-</B>, in which case the columnspan is incremented once for each immediately
following <B>-</B>.
<P><DT><A NAME="M11"><B>-in </B><I>other</I></A><DD>
Insert the slave(s) in the master
window given by <I>other</I>. The default is the first slave's
parent window.
<P><DT><A NAME="M12"><B>-ipadx </B><I>amount</I></A><DD>
The <I>amount</I> specifies how much horizontal internal padding to
leave on each side of the slave(s). This is space is added
inside the slave(s) border.
The <I>amount</I> must be a valid screen distance, such as <B>2</B> or <B>.5c</B>.
It defaults to 0.
<P><DT><A NAME="M13"><B>-ipady </B><I>amount</I></A><DD>
The <I>amount</I> specifies how much vertical internal padding to
leave on on the top and bottom of the slave(s).
This space is added inside the slave(s) border.
The <I>amount</I> defaults to 0.
<P><DT><A NAME="M14"><B>-padx </B><I>amount</I></A><DD>
The <I>amount</I> specifies how much horizontal external padding to
leave on each side of the slave(s), in screen units.
The <I>amount</I> defaults to 0.
This space is added outside the slave(s) border.
<P><DT><A NAME="M15"><B>-pady </B><I>amount</I></A><DD>
The <I>amount</I> specifies how much vertical external padding to
leave on the top and bottom of the slave(s), in screen units.
The <I>amount</I> defaults to 0.
This space is added outside the slave(s) border.
<P><DT><A NAME="M16"><B>-row </B><I>n</I></A><DD>
Insert the slave so that it occupies the <I>n</I>th row in the grid.
Row numbers start with 0. If this option is not supplied, then the
slave is arranged on the same row as the previous slave specified on this
call to <B>grid</B>, or the first unoccupied row if this is the first slave.
<P><DT><A NAME="M17"><B>-rowspan </B><I>n</I></A><DD>
Insert the slave so that it occupies <I>n</I> rows in the grid.
The default is one row. If the next <B>grid</B> command contains
<B>^</B> characters instead of <I>slaves</I> that line up with the columns
of this <I>slave</I>, then the <B>rowspan</B> of this <I>slave</I> is
extended by one.
<P><DT><A NAME="M18"><B>-sticky </B><I>style</I></A><DD>
If a slave's cell is larger than its requested dimensions, this
option may be used to position (or stretch) the slave within its cell.
<I>Style</I> is a string that contains zero or more of the characters
<B>n</B>, <B>s</B>, <B>e</B> or <B>w</B>.
The string can optionally contains spaces or
commas, but they are ignored. Each letter refers to a side (north, south,
east, or west) that the slave will &quot;stick&quot; to. If both <B>n</B> and <B>s</B> (or
<B>e</B> and <B>w</B>) are specified, the slave will be stretched to fill the entire
height (or width) of its cavity. The <B>sticky</B> option subsumes the
combination of <B>-anchor</B> and <B>-fill</B> that is used by <B><A HREF="../TclCmd/pack.htm">pack</A></B>.
The default is <B>{}</B>, which causes the slave to be centered in its cavity,
at its requested size.
</DL><P>If any of the slaves are already managed by the geometry manager
then any unspecified options for them retain their previous values rather
than receiving default values.<DL>
<P></DL>
<P><DT><A NAME="M19"><B>grid forget </B><I>slave </I>?<I>slave ...</I>?</A><DD>
Removes each of the <I>slave</I>s from grid for its
master and unmaps their windows.
The slaves will no longer be managed by the grid geometry manager.
The configuration options for that window are forgotten, so that if the
slave is managed once more by the grid geometry manager, the initial
default settings are used.
<P><DT><A NAME="M20"><B>grid info </B><I>slave</I></A><DD>
Returns a list whose elements are the current configuration state of
the slave given by <I>slave</I> in the same option-value form that
might be specified to <B>grid configure</B>.
The first two elements of the list are ``<B>-in </B><I>master</I>'' where
<I>master</I> is the slave's master.
<P><DT><A NAME="M21"><B>grid location </B><I>master x y</I></A><DD>
Given <I>x</I> and <I>y</I> values in screen units relative to the master window,
the column and row number at that <I>x</I> and <I>y</I> location is returned.
For locations that are above or to the left of the grid, <B>-1</B> is returned.
<P><DT><A NAME="M22"><B>grid propagate </B><I>master</I> ?<I>boolean</I>?</A><DD>
If <I>boolean</I> has a true boolean value such as <B>1</B> or <B>on</B>
then propagation is enabled for <I>master</I>, which must be a window
name (see ``GEOMETRY PROPAGATION'' below).
If <I>boolean</I> has a false boolean value then propagation is
disabled for <I>master</I>.
In either of these cases an empty string is returned.
If <I>boolean</I> is omitted then the command returns <B>0</B> or
<B>1</B> to indicate whether propagation is currently enabled
for <I>master</I>.
Propagation is enabled by default.
<P><DT><A NAME="M23"><B>grid rowconfigure </B><I>master index </I>?<I>-option value...</I>?</A><DD>
Query or set the row properties of the <I>index</I> row of the
geometry master, <I>master</I>.
The valid options are <B>-minsize</B>, <B>-weight</B> and <B>-pad</B>.
If one or more options are provided, then <I>index</I> may be given as
a list of row indeces to which the configuration options will operate on.
The <B>-minsize</B> option sets the minimum size, in screen units,
that will be permitted for this row.
The <B>-weight</B> option (an integer value)
sets the relative weight for apportioning
any extra spaces among
rows.
A weight of zero (0) indicates the row will not deviate from its requested
size. A row whose weight is two will grow at twice the rate as a row
of weight one when extra space is allocated to the layout.
The <B>-pad</B> option specifies the number of screen units that will be
added to the largest window contained completely in that row when the
grid geometry manager requests a size from the containing window.
If only an option is specified, with no value,
the current value of that option is returned.
If only the master window and index is specified, all the current settings
are returned in an list of &quot;-option value&quot; pairs.
<P><DT><A NAME="M24"><B>grid remove </B><I>slave </I>?<I>slave ...</I>?</A><DD>
Removes each of the <I>slave</I>s from grid for its
master and unmaps their windows.
The slaves will no longer be managed by the grid geometry manager.
However, the configuration options for that window are remembered,
so that if the
slave is managed once more by the grid geometry manager, the previous
values are retained.
<P><DT><A NAME="M25"><B>grid size </B><I>master</I></A><DD>
Returns the size of the grid (in columns then rows) for <I>master</I>.
The size is determined either by the <I>slave</I> occupying the largest
row or column, or the largest column or row with a <B>minsize</B>,
<B>weight</B>, or <B>pad</B> that is non-zero.
<P><DT><A NAME="M26"><B>grid slaves </B><I>master</I> ?<I>-option value</I>?</A><DD>
If no options are supplied, a list of all of the slaves in <I>master</I>
are returned, most recently manages first.
<I>Option</I> can be either <B>-row</B> or <B>-column</B> which
causes only the slaves in the row (or column) specified by <I>value</I>
to be returned.
<P></DL>
<H3><A NAME="M27">RELATIVE PLACEMENT</A></H3>
The <B>grid</B> command contains a limited set of capabilities that
permit layouts to be created without specifying the row and column
information for each slave. This permits slaves to be rearranged,
added, or removed without the need to explicitly specify row and
column information.
When no column or row information is specified for a <I>slave</I>,
default values are chosen for
<B>column</B>, <B>row</B>, <B>columnspan</B> and <B>rowspan</B>
at the time the <I>slave</I> is managed. The values are chosen
based upon the current layout of the grid, the position of the <I>slave</I>
relative to other <I>slave</I>s in the same grid command, and the presence
of the characters <B>-</B>, <B>^</B>, and <B>^</B> in <B>grid</B>
command where <I>slave</I> names are normally expected.
<P>
<DL>
<P><DT><A NAME="M28"><B>-</B></A><DD>
This increases the columnspan of the <I>slave</I> to the left. Several
<B>-</B>'s in a row will successively increase the columnspan. A <B>-</B>
may not follow a <B>^</B> or a <B>x</B>.
<P><DT><A NAME="M29"><B>x</B></A><DD>
This leaves an empty column between the <I>slave</I> on the left and
the <I>slave</I> on the right.
<P><DT><A NAME="M30"><B>^</B></A><DD>
This extends the <B>rowspan</B> of the <I>slave</I> above the <B>^</B>'s
in the grid. The number of <B>^</B>'s in a row must match the number of
columns spanned by the <I>slave</I> above it.
<P></DL>
<H3><A NAME="M31">THE GRID ALGORITHM</A></H3>
The grid geometry manager lays out its slaves in three steps.
In the first step, the minimum size needed to fit all of the slaves
is computed, then (if propagation is turned on), a request is made
of the master window to become that size.
In the second step, the requested size is compared against the actual size
of the master. If the sizes are different, then spaces is added to or taken
away from the layout as needed.
For the final step, each slave is positioned in its row(s) and column(s)
based on the setting of its <I>sticky</I> flag.
<P>
To compute the minimum size of a layout, the grid geometry manager
first looks at all slaves whose columnspan and rowspan values are one,
and computes the nominal size of each row or column to be either the
<I>minsize</I> for that row or column, or the sum of the <I>pad</I>ding
plus the size of the largest slave, whichever is greater. Then the
slaves whose rowspans or columnspans are greater than one are
examined. If a group of rows or columns need to be increased in size
in order to accommodate these slaves, then extra space is added to each
row or column in the group according to its <I>weight</I>. For each
group whose weights are all zero, the additional space is apportioned
equally.
<P>
For masters whose size is larger than the requested layout, the additional
space is apportioned according to the row and column weights. If all of
the weights are zero, the layout is centered within its master.
For masters whose size is smaller than the requested layout, space is taken
away from columns and rows according to their weights. However, once a
column or row shrinks to its minsize, its weight is taken to be zero.
If more space needs to be removed from a layout than would be permitted, as
when all the rows or columns are at there minimum sizes, the layout is
clipped on the bottom and right.
<H3><A NAME="M32">GEOMETRY PROPAGATION</A></H3>
The grid geometry manager normally computes how large a master must be to
just exactly meet the needs of its slaves, and it sets the
requested width and height of the master to these dimensions.
This causes geometry information to propagate up through a
window hierarchy to a top-level window so that the entire
sub-tree sizes itself to fit the needs of the leaf windows.
However, the <B>grid propagate</B> command may be used to
turn off propagation for one or more masters.
If propagation is disabled then grid will not set
the requested width and height of the master window.
This may be useful if, for example, you wish for a master
window to have a fixed size that you specify.
<H3><A NAME="M33">RESTRICTIONS ON MASTER WINDOWS</A></H3>
The master for each slave must either be the slave's parent
(the default) or a descendant of the slave's parent.
This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is
visible without danger of the slave being clipped by its parent.
In addition, all slaves in one call to <B>grid</B> must have the same master.
<H3><A NAME="M34">STACKING ORDER</A></H3>
If the master for a slave is not its parent then you must make sure
that the slave is higher in the stacking order than the master.
Otherwise the master will obscure the slave and it will appear as
if the slave hasn't been managed correctly.
The easiest way to make sure the slave is higher than the master is
to create the master window first: the most recently created window
will be highest in the stacking order.
<H3><A NAME="M35">CREDITS</A></H3>
The <B>grid</B> command is based on ideas taken from the <I>GridBag</I>
geometry manager written by Doug. Stein, and the <B>blt_table</B> geometry
manager, written by George Howlett.
<H3><A NAME="M36">KEYWORDS</A></H3>
<A href="../Keywords/G.htm#geometry manager">geometry manager</A>, <A href="../Keywords/L.htm#location">location</A>, <A href="../Keywords/G.htm#grid">grid</A>, <A href="../Keywords/C.htm#cell">cell</A>, <A href="../Keywords/P.htm#propagation">propagation</A>, <A href="../Keywords/S.htm#size">size</A>, <A href="../Keywords/P.htm#pack">pack</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

104
hlp/en/tk/image.htm Normal file
View File

@@ -0,0 +1,104 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - image manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="image.htm#M2" NAME="L593">NAME</A>
<DL><DD>image - Create and manipulate images</DL>
<DD><A HREF="image.htm#M3" NAME="L594">SYNOPSIS</A>
<DL>
<DD><B>image</B> <I>option </I>?<I>arg arg ...</I>?
</DL>
<DD><A HREF="image.htm#M4" NAME="L595">DESCRIPTION</A>
<DL>
<DD><A HREF="image.htm#M5" NAME="L596"><B>image create </B><I>type </I>?<I>name</I>? ?<I>option value ...</I>?</A>
<DD><A HREF="image.htm#M6" NAME="L597"><B>image delete </B>?<I>name name</I> ...?</A>
<DD><A HREF="image.htm#M7" NAME="L598"><B>image height </B><I>name</I></A>
<DD><A HREF="image.htm#M8" NAME="L599"><B>image names</B></A>
<DD><A HREF="image.htm#M9" NAME="L600"><B>image type </B><I>name</I></A>
<DD><A HREF="image.htm#M10" NAME="L601"><B>image types</B></A>
<DD><A HREF="image.htm#M11" NAME="L602"><B>image width </B><I>name</I></A>
</DL>
<DD><A HREF="image.htm#M12" NAME="L603">BUILT-IN IMAGE TYPES</A>
<DL>
<DD><A HREF="image.htm#M13" NAME="L604"><B>bitmap</B></A>
<DD><A HREF="image.htm#M14" NAME="L605"><B>photo</B></A>
</DL>
<DD><A HREF="image.htm#M15" NAME="L606">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
image - Create and manipulate images
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>image</B> <I>option </I>?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>image</B> command is used to create, delete, and query images.
It can take several different forms, depending on the
<I>option</I> argument. The legal forms are:
<P>
<DL>
<P><DT><A NAME="M5"><B>image create </B><I>type </I>?<I>name</I>? ?<I>option value ...</I>?</A><DD>
Creates a new image and returns its name.
<I>type</I> specifies the type of the image, which must be one of
the types currently defined (e.g., <B><A HREF="../TclCmd/bitmap.htm">bitmap</A></B>).
<I>name</I> specifies the name for the image; if it is omitted then
Tk picks a name of the form <B>image</B><I>x</I>, where <I>x</I> is
an integer.
There may be any number of <I>option</I>-<I>value</I> pairs,
which provide configuration options for the new image.
The legal set of options is defined separately for each image
type; see below for details on the options for built-in image types.
If an image already exists by the given name then it is replaced
with the new image and any instances of that image will redisplay
with the new contents.
It is important to note that the image command will silently overwrite any
procedure that may currently be defined by the given name, so choose the
name wisely. It is recommended to use a separate namespace for image names
(e.g., <B>::img::logo</B>, <B>::img::large</B>).
<P><DT><A NAME="M6"><B>image delete </B>?<I>name name</I> ...?</A><DD>
Deletes each of the named images and returns an empty string.
If there are instances of the images displayed in widgets,
the images won't actually be deleted until all of the instances
are released.
However, the association between the instances and the image
manager will be dropped.
Existing instances will retain their sizes but redisplay as
empty areas.
If a deleted image is recreated with another call to <B>image create</B>,
the existing instances will use the new image.
<P><DT><A NAME="M7"><B>image height </B><I>name</I></A><DD>
Returns a decimal string giving the height of image <I>name</I>
in pixels.
<P><DT><A NAME="M8"><B>image names</B></A><DD>
Returns a list containing the names of all existing images.
<P><DT><A NAME="M9"><B>image type </B><I>name</I></A><DD>
Returns the type of image <I>name</I> (the value of the <I>type</I>
argument to <B>image create</B> when the image was created).
<P><DT><A NAME="M10"><B>image types</B></A><DD>
Returns a list whose elements are all of the valid image types
(i.e., all of the values that may be supplied for the <I>type</I>
argument to <B>image create</B>).
<P><DT><A NAME="M11"><B>image width </B><I>name</I></A><DD>
Returns a decimal string giving the width of image <I>name</I>
in pixels.
<P></DL>
<H3><A NAME="M12">BUILT-IN IMAGE TYPES</A></H3>
The following image types are defined by Tk so they will be available
in any Tk application.
Individual applications or extensions may define additional types.
<P>
<DL>
<P><DT><A NAME="M13"><B>bitmap</B></A><DD>
Each pixel in the image displays a foreground color, a background
color, or nothing.
See the <B><A HREF="../TclCmd/bitmap.htm">bitmap</A></B> manual entry for more information.
<P><DT><A NAME="M14"><B>photo</B></A><DD>
Displays a variety of full-color images, using dithering to
approximate colors on displays with limited color capabilities.
See the <B><A HREF="../TclCmd/photo.htm">photo</A></B> manual entry for more information.
<P></DL>
<H3><A NAME="M15">KEYWORDS</A></H3>
<A href="../Keywords/H.htm#height">height</A>, <A href="../Keywords/I.htm#image">image</A>, <A href="../Keywords/T.htm#types of images">types of images</A>, <A href="../Keywords/W.htm#width">width</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

909
hlp/en/tk/keysyms.htm Normal file
View File

@@ -0,0 +1,909 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - keysyms manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
keysyms - keysyms recognized by Tk
<H3><A NAME="M3">DESCRIPTION</A></H3>
Tk recognizes many keysyms when specifying key bindings (eg,
<B>bind . &lt;Key-</B><I>keysym</I><B>&gt;</B>). The following list enumerates the
keysyms that will be recognized by Tk. Note that not all keysyms will
be valid on all platforms. For example, on Unix systems, the presence
of a particular keysym is dependant on the configuration of the
keyboard modifier map. This list shows keysyms along with their
decimal and hexidecimal values.
<P>
<PRE>space 32 0x0020
exclam 33 0x0021
quotedbl 34 0x0022
numbersign 35 0x0023
dollar 36 0x0024
percent 37 0x0025
ampersand 38 0x0026
quoteright 39 0x0027
parenleft 40 0x0028
parenright 41 0x0029
asterisk 42 0x002a
plus 43 0x002b
comma 44 0x002c
minus 45 0x002d
period 46 0x002e
slash 47 0x002f
0 48 0x0030
1 49 0x0031
2 50 0x0032
3 51 0x0033
4 52 0x0034
5 53 0x0035
6 54 0x0036
7 55 0x0037
8 56 0x0038
9 57 0x0039
colon 58 0x003a
semicolon 59 0x003b
less 60 0x003c
equal 61 0x003d
greater 62 0x003e
question 63 0x003f
at 64 0x0040
A 65 0x0041
B 66 0x0042
C 67 0x0043
D 68 0x0044
E 69 0x0045
F 70 0x0046
G 71 0x0047
H 72 0x0048
I 73 0x0049
J 74 0x004a
K 75 0x004b
L 76 0x004c
M 77 0x004d
N 78 0x004e
O 79 0x004f
P 80 0x0050
Q 81 0x0051
R 82 0x0052
S 83 0x0053
T 84 0x0054
U 85 0x0055
V 86 0x0056
W 87 0x0057
X 88 0x0058
Y 89 0x0059
Z 90 0x005a
bracketleft 91 0x005b
backslash 92 0x005c
bracketright 93 0x005d
asciicircum 94 0x005e
underscore 95 0x005f
quoteleft 96 0x0060
a 97 0x0061
b 98 0x0062
c 99 0x0063
d 100 0x0064
e 101 0x0065
f 102 0x0066
g 103 0x0067
h 104 0x0068
i 105 0x0069
j 106 0x006a
k 107 0x006b
l 108 0x006c
m 109 0x006d
n 110 0x006e
o 111 0x006f
p 112 0x0070
q 113 0x0071
r 114 0x0072
s 115 0x0073
t 116 0x0074
u 117 0x0075
v 118 0x0076
w 119 0x0077
x 120 0x0078
y 121 0x0079
z 122 0x007a
braceleft 123 0x007b
bar 124 0x007c
braceright 125 0x007d
asciitilde 126 0x007e
nobreakspace 160 0x00a0
exclamdown 161 0x00a1
cent 162 0x00a2
sterling 163 0x00a3
currency 164 0x00a4
yen 165 0x00a5
brokenbar 166 0x00a6
section 167 0x00a7
diaeresis 168 0x00a8
copyright 169 0x00a9
ordfeminine 170 0x00aa
guillemotleft 171 0x00ab
notsign 172 0x00ac
hyphen 173 0x00ad
registered 174 0x00ae
macron 175 0x00af
degree 176 0x00b0
plusminus 177 0x00b1
twosuperior 178 0x00b2
threesuperior 179 0x00b3
acute 180 0x00b4
mu 181 0x00b5
paragraph 182 0x00b6
periodcentered 183 0x00b7
cedilla 184 0x00b8
onesuperior 185 0x00b9
masculine 186 0x00ba
guillemotright 187 0x00bb
onequarter 188 0x00bc
onehalf 189 0x00bd
threequarters 190 0x00be
questiondown 191 0x00bf
Agrave 192 0x00c0
Aacute 193 0x00c1
Acircumflex 194 0x00c2
Atilde 195 0x00c3
Adiaeresis 196 0x00c4
Aring 197 0x00c5
AE 198 0x00c6
Ccedilla 199 0x00c7
Egrave 200 0x00c8
Eacute 201 0x00c9
Ecircumflex 202 0x00ca
Ediaeresis 203 0x00cb
Igrave 204 0x00cc
Iacute 205 0x00cd
Icircumflex 206 0x00ce
Idiaeresis 207 0x00cf
Eth 208 0x00d0
Ntilde 209 0x00d1
Ograve 210 0x00d2
Oacute 211 0x00d3
Ocircumflex 212 0x00d4
Otilde 213 0x00d5
Odiaeresis 214 0x00d6
multiply 215 0x00d7
Ooblique 216 0x00d8
Ugrave 217 0x00d9
Uacute 218 0x00da
Ucircumflex 219 0x00db
Udiaeresis 220 0x00dc
Yacute 221 0x00dd
Thorn 222 0x00de
ssharp 223 0x00df
agrave 224 0x00e0
aacute 225 0x00e1
acircumflex 226 0x00e2
atilde 227 0x00e3
adiaeresis 228 0x00e4
aring 229 0x00e5
ae 230 0x00e6
ccedilla 231 0x00e7
egrave 232 0x00e8
eacute 233 0x00e9
ecircumflex 234 0x00ea
ediaeresis 235 0x00eb
igrave 236 0x00ec
iacute 237 0x00ed
icircumflex 238 0x00ee
idiaeresis 239 0x00ef
eth 240 0x00f0
ntilde 241 0x00f1
ograve 242 0x00f2
oacute 243 0x00f3
ocircumflex 244 0x00f4
otilde 245 0x00f5
odiaeresis 246 0x00f6
division 247 0x00f7
oslash 248 0x00f8
ugrave 249 0x00f9
uacute 250 0x00fa
ucircumflex 251 0x00fb
udiaeresis 252 0x00fc
yacute 253 0x00fd
thorn 254 0x00fe
ydiaeresis 255 0x00ff
Aogonek 417 0x01a1
breve 418 0x01a2
Lstroke 419 0x01a3
Lcaron 421 0x01a5
Sacute 422 0x01a6
Scaron 425 0x01a9
Scedilla 426 0x01aa
Tcaron 427 0x01ab
Zacute 428 0x01ac</PRE>
<PRE>Zcaron 430 0x01ae
Zabovedot 431 0x01af
aogonek 433 0x01b1
ogonek 434 0x01b2
lstroke 435 0x01b3
lcaron 437 0x01b5
sacute 438 0x01b6
caron 439 0x01b7
scaron 441 0x01b9
scedilla 442 0x01ba
tcaron 443 0x01bb
zacute 444 0x01bc
doubleacute 445 0x01bd
zcaron 446 0x01be
zabovedot 447 0x01bf
Racute 448 0x01c0
Abreve 451 0x01c3
Cacute 454 0x01c6
Ccaron 456 0x01c8
Eogonek 458 0x01ca
Ecaron 460 0x01cc
Dcaron 463 0x01cf
Nacute 465 0x01d1
Ncaron 466 0x01d2
Odoubleacute 469 0x01d5
Rcaron 472 0x01d8
Uring 473 0x01d9
Udoubleacute 475 0x01db
Tcedilla 478 0x01de
racute 480 0x01e0
abreve 483 0x01e3
cacute 486 0x01e6
ccaron 488 0x01e8
eogonek 490 0x01ea
ecaron 492 0x01ec
dcaron 495 0x01ef
nacute 497 0x01f1
ncaron 498 0x01f2
odoubleacute 501 0x01f5
rcaron 504 0x01f8
uring 505 0x01f9
udoubleacute 507 0x01fb
tcedilla 510 0x01fe
abovedot 511 0x01ff
Hstroke 673 0x02a1
Hcircumflex 678 0x02a6
Iabovedot 681 0x02a9
Gbreve 683 0x02ab
Jcircumflex 684 0x02ac
hstroke 689 0x02b1
hcircumflex 694 0x02b6
idotless 697 0x02b9
gbreve 699 0x02bb
jcircumflex 700 0x02bc
Cabovedot 709 0x02c5
Ccircumflex 710 0x02c6
Gabovedot 725 0x02d5
Gcircumflex 728 0x02d8
Ubreve 733 0x02dd
Scircumflex 734 0x02de
cabovedot 741 0x02e5
ccircumflex 742 0x02e6
gabovedot 757 0x02f5
gcircumflex 760 0x02f8
ubreve 765 0x02fd
scircumflex 766 0x02fe
kappa 930 0x03a2
Rcedilla 931 0x03a3
Itilde 933 0x03a5
Lcedilla 934 0x03a6
Emacron 938 0x03aa
Gcedilla 939 0x03ab
Tslash 940 0x03ac
rcedilla 947 0x03b3
itilde 949 0x03b5
lcedilla 950 0x03b6
emacron 954 0x03ba
gacute 955 0x03bb
tslash 956 0x03bc
ENG 957 0x03bd
eng 959 0x03bf
Amacron 960 0x03c0
Iogonek 967 0x03c7
Eabovedot 972 0x03cc
Imacron 975 0x03cf
Ncedilla 977 0x03d1
Omacron 978 0x03d2
Kcedilla 979 0x03d3
Uogonek 985 0x03d9
Utilde 989 0x03dd
Umacron 990 0x03de
amacron 992 0x03e0
iogonek 999 0x03e7
eabovedot 1004 0x03ec
imacron 1007 0x03ef
ncedilla 1009 0x03f1
omacron 1010 0x03f2
kcedilla 1011 0x03f3
uogonek 1017 0x03f9
utilde 1021 0x03fd
umacron 1022 0x03fe
overline 1150 0x047e
kana_fullstop 1185 0x04a1
kana_openingbracket 1186 0x04a2
kana_closingbracket 1187 0x04a3
kana_comma 1188 0x04a4
kana_middledot 1189 0x04a5
kana_WO 1190 0x04a6
kana_a 1191 0x04a7
kana_i 1192 0x04a8
kana_u 1193 0x04a9
kana_e 1194 0x04aa
kana_o 1195 0x04ab
kana_ya 1196 0x04ac
kana_yu 1197 0x04ad
kana_yo 1198 0x04ae
kana_tu 1199 0x04af
prolongedsound 1200 0x04b0
kana_A 1201 0x04b1
kana_I 1202 0x04b2
kana_U 1203 0x04b3
kana_E 1204 0x04b4
kana_O 1205 0x04b5
kana_KA 1206 0x04b6
kana_KI 1207 0x04b7
kana_KU 1208 0x04b8
kana_KE 1209 0x04b9
kana_KO 1210 0x04ba
kana_SA 1211 0x04bb
kana_SHI 1212 0x04bc
kana_SU 1213 0x04bd
kana_SE 1214 0x04be
kana_SO 1215 0x04bf
kana_TA 1216 0x04c0
kana_TI 1217 0x04c1
kana_TU 1218 0x04c2
kana_TE 1219 0x04c3
kana_TO 1220 0x04c4
kana_NA 1221 0x04c5
kana_NI 1222 0x04c6
kana_NU 1223 0x04c7
kana_NE 1224 0x04c8
kana_NO 1225 0x04c9
kana_HA 1226 0x04ca
kana_HI 1227 0x04cb
kana_HU 1228 0x04cc
kana_HE 1229 0x04cd
kana_HO 1230 0x04ce
kana_MA 1231 0x04cf
kana_MI 1232 0x04d0
kana_MU 1233 0x04d1
kana_ME 1234 0x04d2
kana_MO 1235 0x04d3
kana_YA 1236 0x04d4
kana_YU 1237 0x04d5
kana_YO 1238 0x04d6
kana_RA 1239 0x04d7
kana_RI 1240 0x04d8
kana_RU 1241 0x04d9
kana_RE 1242 0x04da
kana_RO 1243 0x04db
kana_WA 1244 0x04dc
kana_N 1245 0x04dd
voicedsound 1246 0x04de
semivoicedsound 1247 0x04df
Arabic_comma 1452 0x05ac
Arabic_semicolon 1467 0x05bb
Arabic_question_mark 1471 0x05bf
Arabic_hamza 1473 0x05c1
Arabic_maddaonalef 1474 0x05c2
Arabic_hamzaonalef 1475 0x05c3
Arabic_hamzaonwaw 1476 0x05c4
Arabic_hamzaunderalef 1477 0x05c5
Arabic_hamzaonyeh 1478 0x05c6
Arabic_alef 1479 0x05c7
Arabic_beh 1480 0x05c8
Arabic_tehmarbuta 1481 0x05c9
Arabic_teh 1482 0x05ca
Arabic_theh 1483 0x05cb
Arabic_jeem 1484 0x05cc
Arabic_hah 1485 0x05cd
Arabic_khah 1486 0x05ce
Arabic_dal 1487 0x05cf
Arabic_thal 1488 0x05d0
Arabic_ra 1489 0x05d1
Arabic_zain 1490 0x05d2
Arabic_seen 1491 0x05d3
Arabic_sheen 1492 0x05d4
Arabic_sad 1493 0x05d5
Arabic_dad 1494 0x05d6
Arabic_tah 1495 0x05d7
Arabic_zah 1496 0x05d8
Arabic_ain 1497 0x05d9
Arabic_ghain 1498 0x05da
Arabic_tatweel 1504 0x05e0
Arabic_feh 1505 0x05e1
Arabic_qaf 1506 0x05e2
Arabic_kaf 1507 0x05e3
Arabic_lam 1508 0x05e4
Arabic_meem 1509 0x05e5</PRE>
<PRE>Arabic_noon 1510 0x05e6
Arabic_heh 1511 0x05e7
Arabic_waw 1512 0x05e8
Arabic_alefmaksura 1513 0x05e9
Arabic_yeh 1514 0x05ea
Arabic_fathatan 1515 0x05eb
Arabic_dammatan 1516 0x05ec
Arabic_kasratan 1517 0x05ed
Arabic_fatha 1518 0x05ee
Arabic_damma 1519 0x05ef
Arabic_kasra 1520 0x05f0
Arabic_shadda 1521 0x05f1
Arabic_sukun 1522 0x05f2
Serbian_dje 1697 0x06a1
Macedonia_gje 1698 0x06a2
Cyrillic_io 1699 0x06a3
Ukranian_je 1700 0x06a4
Macedonia_dse 1701 0x06a5
Ukranian_i 1702 0x06a6
Ukranian_yi 1703 0x06a7
Serbian_je 1704 0x06a8
Serbian_lje 1705 0x06a9
Serbian_nje 1706 0x06aa
Serbian_tshe 1707 0x06ab
Macedonia_kje 1708 0x06ac
Byelorussian_shortu 1710 0x06ae
Serbian_dze 1711 0x06af
numerosign 1712 0x06b0
Serbian_DJE 1713 0x06b1
Macedonia_GJE 1714 0x06b2
Cyrillic_IO 1715 0x06b3
Ukranian_JE 1716 0x06b4
Macedonia_DSE 1717 0x06b5
Ukranian_I 1718 0x06b6
Ukranian_YI 1719 0x06b7
Serbian_JE 1720 0x06b8
Serbian_LJE 1721 0x06b9
Serbian_NJE 1722 0x06ba
Serbian_TSHE 1723 0x06bb
Macedonia_KJE 1724 0x06bc
Byelorussian_SHORTU 1726 0x06be
Serbian_DZE 1727 0x06bf
Cyrillic_yu 1728 0x06c0
Cyrillic_a 1729 0x06c1
Cyrillic_be 1730 0x06c2
Cyrillic_tse 1731 0x06c3
Cyrillic_de 1732 0x06c4
Cyrillic_ie 1733 0x06c5
Cyrillic_ef 1734 0x06c6
Cyrillic_ghe 1735 0x06c7
Cyrillic_ha 1736 0x06c8
Cyrillic_i 1737 0x06c9
Cyrillic_shorti 1738 0x06ca
Cyrillic_ka 1739 0x06cb
Cyrillic_el 1740 0x06cc
Cyrillic_em 1741 0x06cd
Cyrillic_en 1742 0x06ce
Cyrillic_o 1743 0x06cf
Cyrillic_pe 1744 0x06d0
Cyrillic_ya 1745 0x06d1
Cyrillic_er 1746 0x06d2
Cyrillic_es 1747 0x06d3
Cyrillic_te 1748 0x06d4
Cyrillic_u 1749 0x06d5
Cyrillic_zhe 1750 0x06d6
Cyrillic_ve 1751 0x06d7
Cyrillic_softsign 1752 0x06d8
Cyrillic_yeru 1753 0x06d9
Cyrillic_ze 1754 0x06da
Cyrillic_sha 1755 0x06db
Cyrillic_e 1756 0x06dc
Cyrillic_shcha 1757 0x06dd
Cyrillic_che 1758 0x06de
Cyrillic_hardsign 1759 0x06df
Cyrillic_YU 1760 0x06e0
Cyrillic_A 1761 0x06e1
Cyrillic_BE 1762 0x06e2
Cyrillic_TSE 1763 0x06e3
Cyrillic_DE 1764 0x06e4
Cyrillic_IE 1765 0x06e5
Cyrillic_EF 1766 0x06e6
Cyrillic_GHE 1767 0x06e7
Cyrillic_HA 1768 0x06e8
Cyrillic_I 1769 0x06e9
Cyrillic_SHORTI 1770 0x06ea
Cyrillic_KA 1771 0x06eb
Cyrillic_EL 1772 0x06ec
Cyrillic_EM 1773 0x06ed
Cyrillic_EN 1774 0x06ee
Cyrillic_O 1775 0x06ef
Cyrillic_PE 1776 0x06f0
Cyrillic_YA 1777 0x06f1
Cyrillic_ER 1778 0x06f2
Cyrillic_ES 1779 0x06f3
Cyrillic_TE 1780 0x06f4
Cyrillic_U 1781 0x06f5
Cyrillic_ZHE 1782 0x06f6
Cyrillic_VE 1783 0x06f7
Cyrillic_SOFTSIGN 1784 0x06f8
Cyrillic_YERU 1785 0x06f9
Cyrillic_ZE 1786 0x06fa
Cyrillic_SHA 1787 0x06fb
Cyrillic_E 1788 0x06fc
Cyrillic_SHCHA 1789 0x06fd
Cyrillic_CHE 1790 0x06fe
Cyrillic_HARDSIGN 1791 0x06ff
Greek_ALPHAaccent 1953 0x07a1
Greek_EPSILONaccent 1954 0x07a2
Greek_ETAaccent 1955 0x07a3
Greek_IOTAaccent 1956 0x07a4
Greek_IOTAdiaeresis 1957 0x07a5
Greek_IOTAaccentdiaeresis 1958 0x07a6
Greek_OMICRONaccent 1959 0x07a7
Greek_UPSILONaccent 1960 0x07a8
Greek_UPSILONdieresis 1961 0x07a9
Greek_UPSILONaccentdieresis 1962 0x07aa
Greek_OMEGAaccent 1963 0x07ab
Greek_alphaaccent 1969 0x07b1
Greek_epsilonaccent 1970 0x07b2
Greek_etaaccent 1971 0x07b3
Greek_iotaaccent 1972 0x07b4
Greek_iotadieresis 1973 0x07b5
Greek_iotaaccentdieresis 1974 0x07b6
Greek_omicronaccent 1975 0x07b7
Greek_upsilonaccent 1976 0x07b8
Greek_upsilondieresis 1977 0x07b9
Greek_upsilonaccentdieresis 1978 0x07ba
Greek_omegaaccent 1979 0x07bb
Greek_ALPHA 1985 0x07c1
Greek_BETA 1986 0x07c2
Greek_GAMMA 1987 0x07c3
Greek_DELTA 1988 0x07c4
Greek_EPSILON 1989 0x07c5
Greek_ZETA 1990 0x07c6
Greek_ETA 1991 0x07c7
Greek_THETA 1992 0x07c8
Greek_IOTA 1993 0x07c9
Greek_KAPPA 1994 0x07ca
Greek_LAMBDA 1995 0x07cb
Greek_MU 1996 0x07cc
Greek_NU 1997 0x07cd
Greek_XI 1998 0x07ce
Greek_OMICRON 1999 0x07cf
Greek_PI 2000 0x07d0
Greek_RHO 2001 0x07d1
Greek_SIGMA 2002 0x07d2
Greek_TAU 2004 0x07d4
Greek_UPSILON 2005 0x07d5
Greek_PHI 2006 0x07d6
Greek_CHI 2007 0x07d7
Greek_PSI 2008 0x07d8
Greek_OMEGA 2009 0x07d9
Greek_alpha 2017 0x07e1
Greek_beta 2018 0x07e2
Greek_gamma 2019 0x07e3
Greek_delta 2020 0x07e4
Greek_epsilon 2021 0x07e5
Greek_zeta 2022 0x07e6
Greek_eta 2023 0x07e7
Greek_theta 2024 0x07e8
Greek_iota 2025 0x07e9
Greek_kappa 2026 0x07ea
Greek_lambda 2027 0x07eb
Greek_mu 2028 0x07ec
Greek_nu 2029 0x07ed
Greek_xi 2030 0x07ee
Greek_omicron 2031 0x07ef
Greek_pi 2032 0x07f0
Greek_rho 2033 0x07f1
Greek_sigma 2034 0x07f2
Greek_finalsmallsigma 2035 0x07f3
Greek_tau 2036 0x07f4
Greek_upsilon 2037 0x07f5
Greek_phi 2038 0x07f6
Greek_chi 2039 0x07f7
Greek_psi 2040 0x07f8
Greek_omega 2041 0x07f9
leftradical 2209 0x08a1
topleftradical 2210 0x08a2
horizconnector 2211 0x08a3
topintegral 2212 0x08a4
botintegral 2213 0x08a5
vertconnector 2214 0x08a6
topleftsqbracket 2215 0x08a7
botleftsqbracket 2216 0x08a8
toprightsqbracket 2217 0x08a9
botrightsqbracket 2218 0x08aa
topleftparens 2219 0x08ab
botleftparens 2220 0x08ac
toprightparens 2221 0x08ad
botrightparens 2222 0x08ae
leftmiddlecurlybrace 2223 0x08af
rightmiddlecurlybrace 2224 0x08b0
topleftsummation 2225 0x08b1
botleftsummation 2226 0x08b2
topvertsummationconnector 2227 0x08b3
botvertsummationconnector 2228 0x08b4
toprightsummation 2229 0x08b5
botrightsummation 2230 0x08b6
rightmiddlesummation 2231 0x08b7</PRE>
<PRE>lessthanequal 2236 0x08bc
notequal 2237 0x08bd
greaterthanequal 2238 0x08be
integral 2239 0x08bf
therefore 2240 0x08c0
variation 2241 0x08c1
infinity 2242 0x08c2
nabla 2245 0x08c5
approximate 2248 0x08c8
similarequal 2249 0x08c9
ifonlyif 2253 0x08cd
implies 2254 0x08ce
identical 2255 0x08cf
radical 2262 0x08d6
includedin 2266 0x08da
includes 2267 0x08db
intersection 2268 0x08dc
union 2269 0x08dd
logicaland 2270 0x08de
logicalor 2271 0x08df
partialderivative 2287 0x08ef
function 2294 0x08f6
leftarrow 2299 0x08fb
uparrow 2300 0x08fc
rightarrow 2301 0x08fd
downarrow 2302 0x08fe
blank 2527 0x09df
soliddiamond 2528 0x09e0
checkerboard 2529 0x09e1
ht 2530 0x09e2
ff 2531 0x09e3
cr 2532 0x09e4
lf 2533 0x09e5
nl 2536 0x09e8
vt 2537 0x09e9
lowrightcorner 2538 0x09ea
uprightcorner 2539 0x09eb
upleftcorner 2540 0x09ec
lowleftcorner 2541 0x09ed
crossinglines 2542 0x09ee
horizlinescan1 2543 0x09ef
horizlinescan3 2544 0x09f0
horizlinescan5 2545 0x09f1
horizlinescan7 2546 0x09f2
horizlinescan9 2547 0x09f3
leftt 2548 0x09f4
rightt 2549 0x09f5
bott 2550 0x09f6
topt 2551 0x09f7
vertbar 2552 0x09f8
emspace 2721 0x0aa1
enspace 2722 0x0aa2
em3space 2723 0x0aa3
em4space 2724 0x0aa4
digitspace 2725 0x0aa5
punctspace 2726 0x0aa6
thinspace 2727 0x0aa7
hairspace 2728 0x0aa8
emdash 2729 0x0aa9
endash 2730 0x0aaa
signifblank 2732 0x0aac
ellipsis 2734 0x0aae
doubbaselinedot 2735 0x0aaf
onethird 2736 0x0ab0
twothirds 2737 0x0ab1
onefifth 2738 0x0ab2
twofifths 2739 0x0ab3
threefifths 2740 0x0ab4
fourfifths 2741 0x0ab5
onesixth 2742 0x0ab6
fivesixths 2743 0x0ab7
careof 2744 0x0ab8
figdash 2747 0x0abb
leftanglebracket 2748 0x0abc
decimalpoint 2749 0x0abd
rightanglebracket 2750 0x0abe
marker 2751 0x0abf
oneeighth 2755 0x0ac3
threeeighths 2756 0x0ac4
fiveeighths 2757 0x0ac5
seveneighths 2758 0x0ac6
trademark 2761 0x0ac9
signaturemark 2762 0x0aca
trademarkincircle 2763 0x0acb
leftopentriangle 2764 0x0acc
rightopentriangle 2765 0x0acd
emopencircle 2766 0x0ace
emopenrectangle 2767 0x0acf
leftsinglequotemark 2768 0x0ad0
rightsinglequotemark 2769 0x0ad1
leftdoublequotemark 2770 0x0ad2
rightdoublequotemark 2771 0x0ad3
prescription 2772 0x0ad4
minutes 2774 0x0ad6
seconds 2775 0x0ad7
latincross 2777 0x0ad9
hexagram 2778 0x0ada
filledrectbullet 2779 0x0adb
filledlefttribullet 2780 0x0adc
filledrighttribullet 2781 0x0add
emfilledcircle 2782 0x0ade
emfilledrect 2783 0x0adf
enopencircbullet 2784 0x0ae0
enopensquarebullet 2785 0x0ae1
openrectbullet 2786 0x0ae2
opentribulletup 2787 0x0ae3
opentribulletdown 2788 0x0ae4
openstar 2789 0x0ae5
enfilledcircbullet 2790 0x0ae6
enfilledsqbullet 2791 0x0ae7
filledtribulletup 2792 0x0ae8
filledtribulletdown 2793 0x0ae9
leftpointer 2794 0x0aea
rightpointer 2795 0x0aeb
club 2796 0x0aec
diamond 2797 0x0aed
heart 2798 0x0aee
maltesecross 2800 0x0af0
dagger 2801 0x0af1
doubledagger 2802 0x0af2
checkmark 2803 0x0af3
ballotcross 2804 0x0af4
musicalsharp 2805 0x0af5
musicalflat 2806 0x0af6
malesymbol 2807 0x0af7
femalesymbol 2808 0x0af8
telephone 2809 0x0af9
telephonerecorder 2810 0x0afa
phonographcopyright 2811 0x0afb
caret 2812 0x0afc
singlelowquotemark 2813 0x0afd
doublelowquotemark 2814 0x0afe
cursor 2815 0x0aff
leftcaret 2979 0x0ba3
rightcaret 2982 0x0ba6
downcaret 2984 0x0ba8
upcaret 2985 0x0ba9
overbar 3008 0x0bc0
downtack 3010 0x0bc2
upshoe 3011 0x0bc3
downstile 3012 0x0bc4
underbar 3014 0x0bc6
jot 3018 0x0bca
quad 3020 0x0bcc
uptack 3022 0x0bce
circle 3023 0x0bcf
upstile 3027 0x0bd3
downshoe 3030 0x0bd6
rightshoe 3032 0x0bd8
leftshoe 3034 0x0bda
lefttack 3036 0x0bdc
righttack 3068 0x0bfc
hebrew_aleph 3296 0x0ce0
hebrew_beth 3297 0x0ce1
hebrew_gimmel 3298 0x0ce2
hebrew_daleth 3299 0x0ce3
hebrew_he 3300 0x0ce4
hebrew_waw 3301 0x0ce5
hebrew_zayin 3302 0x0ce6
hebrew_het 3303 0x0ce7
hebrew_teth 3304 0x0ce8
hebrew_yod 3305 0x0ce9
hebrew_finalkaph 3306 0x0cea
hebrew_kaph 3307 0x0ceb
hebrew_lamed 3308 0x0cec
hebrew_finalmem 3309 0x0ced
hebrew_mem 3310 0x0cee
hebrew_finalnun 3311 0x0cef
hebrew_nun 3312 0x0cf0
hebrew_samekh 3313 0x0cf1
hebrew_ayin 3314 0x0cf2
hebrew_finalpe 3315 0x0cf3
hebrew_pe 3316 0x0cf4
hebrew_finalzadi 3317 0x0cf5
hebrew_zadi 3318 0x0cf6
hebrew_kuf 3319 0x0cf7
hebrew_resh 3320 0x0cf8
hebrew_shin 3321 0x0cf9
hebrew_taf 3322 0x0cfa
BackSpace 65288 0xff08
Tab 65289 0xff09
Linefeed 65290 0xff0a
Clear 65291 0xff0b
Return 65293 0xff0d
Pause 65299 0xff13
Scroll_Lock 65300 0xff14
Sys_Req 65301 0xff15
Escape 65307 0xff1b
Multi_key 65312 0xff20
Kanji 65313 0xff21
Home 65360 0xff50
Left 65361 0xff51
Up 65362 0xff52
Right 65363 0xff53
Down 65364 0xff54
Prior 65365 0xff55
Next 65366 0xff56
End 65367 0xff57
Begin 65368 0xff58
Win_L 65371 0xff5b
Win_R 65372 0xff5c</PRE>
<PRE>App 65373 0xff5d
Select 65376 0xff60
Print 65377 0xff61
Execute 65378 0xff62
Insert 65379 0xff63
Undo 65381 0xff65
Redo 65382 0xff66
Menu 65383 0xff67
Find 65384 0xff68
Cancel 65385 0xff69
Help 65386 0xff6a
Break 65387 0xff6b
Hebrew_switch 65406 0xff7e
Num_Lock 65407 0xff7f
KP_Space 65408 0xff80
KP_Tab 65417 0xff89
KP_Enter 65421 0xff8d
KP_F1 65425 0xff91
KP_F2 65426 0xff92
KP_F3 65427 0xff93
KP_F4 65428 0xff94
KP_Multiply 65450 0xffaa
KP_Add 65451 0xffab
KP_Separator 65452 0xffac
KP_Subtract 65453 0xffad
KP_Decimal 65454 0xffae
KP_Divide 65455 0xffaf
KP_0 65456 0xffb0
KP_1 65457 0xffb1
KP_2 65458 0xffb2
KP_3 65459 0xffb3
KP_4 65460 0xffb4
KP_5 65461 0xffb5
KP_6 65462 0xffb6
KP_7 65463 0xffb7
KP_8 65464 0xffb8
KP_9 65465 0xffb9
KP_Equal 65469 0xffbd
F1 65470 0xffbe
F2 65471 0xffbf
F3 65472 0xffc0
F4 65473 0xffc1
F5 65474 0xffc2
F6 65475 0xffc3
F7 65476 0xffc4
F8 65477 0xffc5
F9 65478 0xffc6
F10 65479 0xffc7
L1 65480 0xffc8
L2 65481 0xffc9
L3 65482 0xffca
L4 65483 0xffcb
L5 65484 0xffcc
L6 65485 0xffcd
L7 65486 0xffce
L8 65487 0xffcf
L9 65488 0xffd0
L10 65489 0xffd1
R1 65490 0xffd2
R2 65491 0xffd3
R3 65492 0xffd4
R4 65493 0xffd5
R5 65494 0xffd6
R6 65495 0xffd7
R7 65496 0xffd8
R8 65497 0xffd9
R9 65498 0xffda
R10 65499 0xffdb
R11 65500 0xffdc
R12 65501 0xffdd
F33 65502 0xffde
R14 65503 0xffdf
R15 65504 0xffe0
Shift_L 65505 0xffe1
Shift_R 65506 0xffe2
Control_L 65507 0xffe3
Control_R 65508 0xffe4
Caps_Lock 65509 0xffe5
Shift_Lock 65510 0xffe6
Meta_L 65511 0xffe7
Meta_R 65512 0xffe8
Alt_L 65513 0xffe9
Alt_R 65514 0xffea
Super_L 65515 0xffeb
Super_R 65516 0xffec
Hyper_L 65517 0xffed
Hyper_R 65518 0xffee
Delete 65535 0xffff</PRE>
<H3><A NAME="M4">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/bind.htm">bind</A></B>
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/K.htm#keysym">keysym</A>, <A href="../Keywords/B.htm#bind">bind</A>, <A href="../Keywords/B.htm#binding">binding</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1998-2000 by Scriptics Corporation.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

143
hlp/en/tk/label.htm Normal file
View File

@@ -0,0 +1,143 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - label manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="label.htm#M2" NAME="L611">NAME</A>
<DL><DD>label - Create and manipulate label widgets</DL>
<DD><A HREF="label.htm#M3" NAME="L612">SYNOPSIS</A>
<DL>
<DD><B>label</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="label.htm#M4" NAME="L613">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground -activeforeground -anchor">-activebackground -activeforeground -anchor</A>
<DD><A HREF="options.htm#M-background -bitmap -borderwidth">-background -bitmap -borderwidth</A>
<DD><A HREF="options.htm#M-cursor -disabledforeground -font">-cursor -disabledforeground -font</A>
<DD><A HREF="options.htm#M-foreground -highlightbackground -highlightcolor">-foreground -highlightbackground -highlightcolor</A>
<DD><A HREF="options.htm#M-highlightthickness -image -justify">-highlightthickness -image -justify</A>
<DD><A HREF="options.htm#M-padx -pady -relief">-padx -pady -relief</A>
<DD><A HREF="options.htm#M-takefocus -text -textvariable">-takefocus -text -textvariable</A>
<DD><A HREF="options.htm#M-underline -wraplength">-underline -wraplength</A>
</DL>
<DD><A HREF="label.htm#M13" NAME="L622">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="label.htm#M14" NAME="L623">-height, height, Height</A>
<DD><A HREF="label.htm#M15" NAME="L624">-state, state, State</A>
<DD><A HREF="label.htm#M16" NAME="L625">-width, width, Width</A>
</DL>
<DD><A HREF="label.htm#M17" NAME="L626">DESCRIPTION</A>
<DD><A HREF="label.htm#M18" NAME="L627">WIDGET COMMAND</A>
<DL>
<DD><A HREF="label.htm#M19" NAME="L628"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="label.htm#M20" NAME="L629"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="label.htm#M21" NAME="L630">BINDINGS</A>
<DD><A HREF="label.htm#M22" NAME="L631">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
label - Create and manipulate label widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>label</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground -activeforeground -anchor">-activebackground -activeforeground -anchor</A></B>
<DT><B><A HREF="options.htm#M-background -bitmap -borderwidth">-background -bitmap -borderwidth</A></B>
<DT><B><A HREF="options.htm#M-cursor -disabledforeground -font">-cursor -disabledforeground -font</A></B>
<DT><B><A HREF="options.htm#M-foreground -highlightbackground -highlightcolor">-foreground -highlightbackground -highlightcolor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness -image -justify">-highlightthickness -image -justify</A></B>
<DT><B><A HREF="options.htm#M-padx -pady -relief">-padx -pady -relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus -text -textvariable">-takefocus -text -textvariable</A></B>
<DT><B><A HREF="options.htm#M-underline -wraplength">-underline -wraplength</A></B>
</DL>
<H3><A NAME="M13">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M14">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies a desired height for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in lines of text.
If this option isn't specified, the label's desired height is computed
from the size of the image or bitmap or text being displayed in it.
<P><DT>Command-Line Name: <B><A NAME="M15">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the label: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the button is displayed using the
<B>foreground</B> and <B>background</B> options. In active state
the label is displayed using the <B>activeForeground</B> and
<B>activeBackground</B> options. In the disabled state the
<B>disabledForeground</B> and <B>background</B> options determine how
the button is displayed.
<P><DT>Command-Line Name: <B><A NAME="M16">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies a desired width for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in characters.
If this option isn't specified, the label's desired width is computed
from the size of the image or bitmap or text being displayed in it.
</DL>
<H3><A NAME="M17">DESCRIPTION</A></H3>
The <B>label</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a label widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the label such as its colors, font,
text, and initial relief. The <B>label</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A label is a widget that displays a textual string, bitmap or image.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the <B>wrapLength</B> option) and
one of the characters may optionally be underlined using the
<B>underline</B> option.
The label can be manipulated in a few simple ways, such as
changing its relief or text, using the commands described below.
<H3><A NAME="M18">WIDGET COMMAND</A></H3>
The <B>label</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for label widgets:
<P>
<DL>
<P><DT><A NAME="M19"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>label</B>
command.
<P><DT><A NAME="M20"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>label</B>
command.
<P></DL>
<H3><A NAME="M21">BINDINGS</A></H3>
When a new label is created, it has no default event bindings:
labels are not intended to be interactive.
<H3><A NAME="M22">KEYWORDS</A></H3>
<A href="../Keywords/L.htm#label">label</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

611
hlp/en/tk/listbox.htm Normal file
View File

@@ -0,0 +1,611 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - listbox manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="listbox.htm#M2" NAME="L632">NAME</A>
<DL><DD>listbox - Create and manipulate listbox widgets</DL>
<DD><A HREF="listbox.htm#M3" NAME="L633">SYNOPSIS</A>
<DL>
<DD><B>listbox</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="listbox.htm#M4" NAME="L634">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-exportselection">-exportselection, exportSelection, ExportSelection</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-height">-height</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-listvar">-listvar</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-selectbackground">-selectbackground, selectBackground, Foreground</A>
<DD><A HREF="options.htm#M-selectborderwidth">-selectborderwidth, selectBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-selectforeground">-selectforeground, selectForeground, Background</A>
<DD><A HREF="options.htm#M-setgrid">-setgrid, setGrid, SetGrid</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-width">-width</A>
<DD><A HREF="options.htm#M-xscrollcommand">-xscrollcommand, xScrollCommand, ScrollCommand</A>
<DD><A HREF="options.htm#M-yscrollcommand">-yscrollcommand, yScrollCommand, ScrollCommand</A>
</DL>
<DD><A HREF="listbox.htm#M8" NAME="L638">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="listbox.htm#M9" NAME="L639">-height, height, Height</A>
<DD><A HREF="listbox.htm#M10" NAME="L640">-listvar, listVariable, Variable</A>
<DD><A HREF="listbox.htm#M11" NAME="L641">-selectmode, selectMode, SelectMode</A>
<DD><A HREF="listbox.htm#M12" NAME="L642">-width, width, Width</A>
</DL>
<DD><A HREF="listbox.htm#M13" NAME="L643">DESCRIPTION</A>
<DD><A HREF="listbox.htm#M14" NAME="L644">INDICES</A>
<DL>
<DD><A HREF="listbox.htm#M15" NAME="L645"><I>number</I></A>
<DD><A HREF="listbox.htm#M16" NAME="L646"><B>active</B></A>
<DD><A HREF="listbox.htm#M17" NAME="L647"><B>anchor</B></A>
<DD><A HREF="listbox.htm#M18" NAME="L648"><B>end</B></A>
<DD><A HREF="listbox.htm#M19" NAME="L649"><B>@</B><I>x</I><B>,</B><I>y</I></A>
</DL>
<DD><A HREF="listbox.htm#M20" NAME="L650">WIDGET COMMAND</A>
<DL>
<DD><A HREF="listbox.htm#M21" NAME="L651"><I>pathName </I><B>activate</B> <I>index</I></A>
<DD><A HREF="listbox.htm#M22" NAME="L652"><I>pathName </I><B>bbox</B> <I>index</I></A>
<DD><A HREF="listbox.htm#M23" NAME="L653"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="listbox.htm#M24" NAME="L654"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="listbox.htm#M25" NAME="L655"><I>pathName </I><B>curselection</B></A>
<DD><A HREF="listbox.htm#M26" NAME="L656"><I>pathName </I><B>delete </B><I>first </I>?<I>last</I>?</A>
<DD><A HREF="listbox.htm#M27" NAME="L657"><I>pathName </I><B>get </B><I>first</I> ?<I>last</I>?</A>
<DD><A HREF="listbox.htm#M28" NAME="L658"><I>pathName </I><B>index </B><I>index</I></A>
<DD><A HREF="listbox.htm#M29" NAME="L659"><I>pathName </I><B>insert </B><I>index </I>?<I>element element ...</I>?</A>
<DD><A HREF="listbox.htm#M30" NAME="L660"><I>pathName </I><B>itemcget </B><I>index option</I></A>
<DD><A HREF="listbox.htm#M31" NAME="L661"><I>pathName </I><B>itemconfigure </B><I>index</I> ?<I>option</I>? ?<I>value</I>? ?<I>option value ...</I>?</A>
<DL>
<DD><A HREF="listbox.htm#M32" NAME="L662"><B>-background </B><I>color</I></A>
<DD><A HREF="listbox.htm#M33" NAME="L663"><B>-foreground </B><I>color</I></A>
<DD><A HREF="listbox.htm#M34" NAME="L664"><B>-selectbackground </B><I>color</I></A>
<DD><A HREF="listbox.htm#M35" NAME="L665"><B>-selectforeground </B><I>color</I></A>
</DL>
<DD><A HREF="listbox.htm#M36" NAME="L666"><I>pathName </I><B>nearest </B><I>y</I></A>
<DD><A HREF="listbox.htm#M37" NAME="L667"><I>pathName </I><B>scan</B> <I>option args</I></A>
<DL>
<DD><A HREF="listbox.htm#M38" NAME="L668"><I>pathName </I><B>scan mark </B><I>x y</I></A>
<DD><A HREF="listbox.htm#M39" NAME="L669"><I>pathName </I><B>scan dragto </B><I>x y</I>.</A>
</DL>
<DD><A HREF="listbox.htm#M40" NAME="L670"><I>pathName </I><B>see </B><I>index</I></A>
<DD><A HREF="listbox.htm#M41" NAME="L671"><I>pathName </I><B>selection </B><I>option arg</I></A>
<DL>
<DD><A HREF="listbox.htm#M42" NAME="L672"><I>pathName </I><B>selection anchor </B><I>index</I></A>
<DD><A HREF="listbox.htm#M43" NAME="L673"><I>pathName </I><B>selection clear </B><I>first </I>?<I>last</I>?</A>
<DD><A HREF="listbox.htm#M44" NAME="L674"><I>pathName </I><B>selection includes </B><I>index</I></A>
<DD><A HREF="listbox.htm#M45" NAME="L675"><I>pathName </I><B>selection set </B><I>first </I>?<I>last</I>?</A>
</DL>
<DD><A HREF="listbox.htm#M46" NAME="L676"><I>pathName </I><B>size</B></A>
<DD><A HREF="listbox.htm#M47" NAME="L677"><I>pathName </I><B>xview </B><I>args</I></A>
<DL>
<DD><A HREF="listbox.htm#M48" NAME="L678"><I>pathName </I><B>xview</B></A>
<DD><A HREF="listbox.htm#M49" NAME="L679"><I>pathName </I><B>xview</B> <I>index</I></A>
<DD><A HREF="listbox.htm#M50" NAME="L680"><I>pathName </I><B>xview moveto</B><I> fraction</I></A>
<DD><A HREF="listbox.htm#M51" NAME="L681"><I>pathName </I><B>xview scroll </B><I>number what</I></A>
</DL>
<DD><A HREF="listbox.htm#M52" NAME="L682"><I>pathName </I><B>yview </B><I>?args</I>?</A>
<DL>
<DD><A HREF="listbox.htm#M53" NAME="L683"><I>pathName </I><B>yview</B></A>
<DD><A HREF="listbox.htm#M54" NAME="L684"><I>pathName </I><B>yview</B> <I>index</I></A>
<DD><A HREF="listbox.htm#M55" NAME="L685"><I>pathName </I><B>yview moveto</B><I> fraction</I></A>
<DD><A HREF="listbox.htm#M56" NAME="L686"><I>pathName </I><B>yview scroll </B><I>number what</I></A>
</DL>
</DL>
<DD><A HREF="listbox.htm#M57" NAME="L687">DEFAULT BINDINGS</A>
<DL>
</DL>
<DD><A HREF="listbox.htm#M58" NAME="L688">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
listbox - Create and manipulate listbox widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>listbox</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-exportselection">-exportselection, exportSelection, ExportSelection</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-height">-height</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-listvar">-listvar</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-selectbackground">-selectbackground, selectBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-selectborderwidth">-selectborderwidth, selectBorderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-selectforeground">-selectforeground, selectForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-setgrid">-setgrid, setGrid, SetGrid</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-width">-width</A></B>
<DT><B><A HREF="options.htm#M-xscrollcommand">-xscrollcommand, xScrollCommand, ScrollCommand</A></B>
<DT><B><A HREF="options.htm#M-yscrollcommand">-yscrollcommand, yScrollCommand, ScrollCommand</A></B>
</DL>
<H3><A NAME="M8">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M9">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies the desired height for the window, in lines.
If zero or less, then the desired height for the window is made just
large enough to hold all the elements in the listbox.
<P><DT>Command-Line Name: <B><A NAME="M10">-listvar</A></B>
<DT>Database Name: <B>listVariable</B>
<DT>Database Class: <B><A HREF="../TkCmd/variable.htm">Variable</A></B>
<DD>Specifies the name of a variable. The value of the variable is a list
to be displayed inside the widget; if the variable value changes
then the widget will automatically update itself to reflect the new value.
Attempts to assign a bad list value to a variable in use as a listvar
will cause an error. Attempts to unset a variable in use as a listvar
will fail but will not generate an error.
<P><DT>Command-Line Name: <B><A NAME="M11">-selectmode</A></B>
<DT>Database Name: <B>selectMode</B>
<DT>Database Class: <B>SelectMode</B>
<DD>Specifies one of several styles for manipulating the selection.
The value of the option may be arbitrary, but the default bindings
expect it to be either <B>single</B>, <B>browse</B>, <B>multiple</B>,
or <B>extended</B>; the default value is <B>browse</B>.
<P><DT>Command-Line Name: <B><A NAME="M12">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the desired width for the window in characters.
If the font doesn't have a uniform width then the width of the
character ``0'' is used in translating from character units to
screen units.
If zero or less, then the desired width for the window is made just
large enough to hold all the elements in the listbox.
</DL>
<H3><A NAME="M13">DESCRIPTION</A></H3>
The <B>listbox</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a listbox widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the listbox such as its colors, font,
text, and relief. The <B>listbox</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A listbox is a widget that displays a list of strings, one per line.
When first created, a new listbox has no elements.
Elements may be added or deleted using widget commands described
below. In addition, one or more elements may be selected as described
below.
If a listbox is exporting its selection (see <B>exportSelection</B>
option), then it will observe the standard X11 protocols
for handling the selection.
Listbox selections are available as type <B><A HREF="../TkCmd/string.htm">STRING</A></B>;
the value of the selection will be the text of the selected elements, with
newlines separating the elements.
<P>
It is not necessary for all the elements to be
displayed in the listbox window at once; commands described below
may be used to change the view in the window. Listboxes allow
scrolling in both directions using the standard <B>xScrollCommand</B>
and <B>yScrollCommand</B> options.
They also support scanning, as described below.
<H3><A NAME="M14">INDICES</A></H3>
Many of the widget commands for listboxes take one or more indices
as arguments.
An index specifies a particular element of the listbox, in any of
the following ways:
<P>
<DL>
<P><DT><A NAME="M15"><I>number</I></A><DD>
Specifies the element as a numerical index, where 0 corresponds
to the first element in the listbox.
<P><DT><A NAME="M16"><B>active</B></A><DD>
Indicates the element that has the location cursor. This element
will be displayed with an underline when the listbox has the
keyboard focus, and it is specified with the <B>activate</B>
widget command.
<P><DT><A NAME="M17"><B>anchor</B></A><DD>
Indicates the anchor point for the selection, which is set with the
<B><A HREF="../TclCmd/selection.htm">selection anchor</A></B> widget command.
<P><DT><A NAME="M18"><B>end</B></A><DD>
Indicates the end of the listbox.
For most commands this refers to the last element in the listbox,
but for a few commands such as <B>index</B> and <B>insert</B>
it refers to the element just after the last one.
<P><DT><A NAME="M19"><B>@</B><I>x</I><B>,</B><I>y</I></A><DD>
Indicates the element that covers the point in the listbox window
specified by <I>x</I> and <I>y</I> (in pixel coordinates). If no
element covers that point, then the closest element to that
point is used.
<P></DL>
<P>
In the widget command descriptions below, arguments named <I>index</I>,
<I>first</I>, and <I>last</I> always contain text indices in one of
the above forms.
<H3><A NAME="M20">WIDGET COMMAND</A></H3>
The <B>listbox</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for listbox widgets:
<P>
<DL>
<P><DT><A NAME="M21"><I>pathName </I><B>activate</B> <I>index</I></A><DD>
Sets the active element to the one indicated by <I>index</I>.
If <I>index</I> is outside the range of elements in the listbox
then the closest element is activated.
The active element is drawn with an underline when the widget
has the input focus, and its index may be retrieved with the
index <B>active</B>.
<P><DT><A NAME="M22"><I>pathName </I><B>bbox</B> <I>index</I></A><DD>
Returns a list of four numbers describing the bounding box of
the text in the element given by <I>index</I>.
The first two elements of the list give the x and y coordinates
of the upper-left corner of the screen area covered by the text
(specified in pixels relative to the widget) and the last two
elements give the width and height of the area, in pixels.
If no part of the element given by <I>index</I> is visible on the
screen,
or if <I>index</I> refers to a non-existent element,
then the result is an empty string; if the element is
partially visible, the result gives the full area of the element,
including any parts that are not visible.
<P><DT><A NAME="M23"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>listbox</B>
command.
<P><DT><A NAME="M24"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>listbox</B>
command.
<P><DT><A NAME="M25"><I>pathName </I><B>curselection</B></A><DD>
Returns a list containing the numerical indices of
all of the elements in the listbox that are currently selected.
If there are no elements selected in the listbox then an empty
string is returned.
<P><DT><A NAME="M26"><I>pathName </I><B>delete </B><I>first </I>?<I>last</I>?</A><DD>
Deletes one or more elements of the listbox. <I>First</I> and <I>last</I>
are indices specifying the first and last elements in the range
to delete. If <I>last</I> isn't specified it defaults to
<I>first</I>, i.e. a single element is deleted.
<P><DT><A NAME="M27"><I>pathName </I><B>get </B><I>first</I> ?<I>last</I>?</A><DD>
If <I>last</I> is omitted, returns the contents of the listbox
element indicated by <I>first</I>,
or an empty string if <I>first</I> refers to a non-existent element.
If <I>last</I> is specified, the command returns a list whose elements
are all of the listbox elements between <I>first</I> and <I>last</I>,
inclusive.
Both <I>first</I> and <I>last</I> may have any of the standard
forms for indices.
<P><DT><A NAME="M28"><I>pathName </I><B>index </B><I>index</I></A><DD>
Returns the integer index value that corresponds to <I>index</I>.
If <I>index</I> is <B>end</B> the return value is a count of the number
of elements in the listbox (not the index of the last element).
<P><DT><A NAME="M29"><I>pathName </I><B>insert </B><I>index </I>?<I>element element ...</I>?</A><DD>
Inserts zero or more new elements in the list just before the
element given by <I>index</I>. If <I>index</I> is specified as
<B>end</B> then the new elements are added to the end of the
list. Returns an empty string.
<P><DT><A NAME="M30"><I>pathName </I><B>itemcget </B><I>index option</I></A><DD>
Returns the current value of the item configuration option given
by <I>option</I>. <I>Option</I> may have any of the values accepted
by the <B>listbox itemconfigure</B> command.
<P><DT><A NAME="M31"><I>pathName </I><B>itemconfigure </B><I>index</I> ?<I>option</I>? ?<I>value</I>? ?<I>option value ...</I>?</A><DD>
Query or modify the configuration options of an item in the listbox.
If no <I>option</I> is specified, returns a list describing all of
the available options for the item (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string. The following options
are currently supported for items:
<P>
<DL>
<P><DT><A NAME="M32"><B>-background </B><I>color</I></A><DD>
<I>Color</I> specifies the background color to use when displaying the
item. It may have any of the forms accepted by <B><A HREF="../TclLib/GetColor.htm">Tk_GetColor</A></B>.
<P><DT><A NAME="M33"><B>-foreground </B><I>color</I></A><DD>
<I>Color</I> specifies the foreground color to use when displaying the
item. It may have any of the forms accepted by <B><A HREF="../TclLib/GetColor.htm">Tk_GetColor</A></B>.
<P><DT><A NAME="M34"><B>-selectbackground </B><I>color</I></A><DD>
<I>color</I> specifies the background color to use when displaying the
item while it is selected. It may have any of the forms accepted by
<B><A HREF="../TclLib/GetColor.htm">Tk_GetColor</A></B>.
<P><DT><A NAME="M35"><B>-selectforeground </B><I>color</I></A><DD>
<I>color</I> specifies the foreground color to use when displaying the
item while it is selected. It may have any of the forms accepted by
<B><A HREF="../TclLib/GetColor.htm">Tk_GetColor</A></B>.
<P></DL>
<P><DT><A NAME="M36"><I>pathName </I><B>nearest </B><I>y</I></A><DD>
Given a y-coordinate within the listbox window, this command returns
the index of the (visible) listbox element nearest to that y-coordinate.
<P><DT><A NAME="M37"><I>pathName </I><B>scan</B> <I>option args</I></A><DD>
This command is used to implement scanning on listboxes. It has
two forms, depending on <I>option</I>:
<P>
<DL>
<P><DT><A NAME="M38"><I>pathName </I><B>scan mark </B><I>x y</I></A><DD>
Records <I>x</I> and <I>y</I> and the current view in the listbox
window; used in conjunction with later <B>scan dragto</B> commands.
Typically this command is associated with a mouse button press in
the widget. It returns an empty string.
<P><DT><A NAME="M39"><I>pathName </I><B>scan dragto </B><I>x y</I>.</A><DD>
This command computes the difference between its <I>x</I> and <I>y</I>
arguments and the <I>x</I> and <I>y</I> arguments to the last
<B>scan mark</B> command for the widget.
It then adjusts the view by 10 times the
difference in coordinates. This command is typically associated
with mouse motion events in the widget, to produce the effect of
dragging the list at high speed through the window. The return
value is an empty string.
<P></DL>
<P><DT><A NAME="M40"><I>pathName </I><B>see </B><I>index</I></A><DD>
Adjust the view in the listbox so that the element given by <I>index</I>
is visible.
If the element is already visible then the command has no effect;
if the element is near one edge of the window then the listbox
scrolls to bring the element into view at the edge; otherwise
the listbox scrolls to center the element.
<P><DT><A NAME="M41"><I>pathName </I><B>selection </B><I>option arg</I></A><DD>
This command is used to adjust the selection within a listbox. It
has several forms, depending on <I>option</I>:
<P>
<DL>
<P><DT><A NAME="M42"><I>pathName </I><B>selection anchor </B><I>index</I></A><DD>
Sets the selection anchor to the element given by <I>index</I>.
If <I>index</I> refers to a non-existent element, then the closest
element is used.
The selection anchor is the end of the selection that is fixed
while dragging out a selection with the mouse.
The index <B>anchor</B> may be used to refer to the anchor
element.
<P><DT><A NAME="M43"><I>pathName </I><B>selection clear </B><I>first </I>?<I>last</I>?</A><DD>
If any of the elements between <I>first</I> and <I>last</I>
(inclusive) are selected, they are deselected.
The selection state is not changed for elements outside
this range.
<P><DT><A NAME="M44"><I>pathName </I><B>selection includes </B><I>index</I></A><DD>
Returns 1 if the element indicated by <I>index</I> is currently
selected, 0 if it isn't.
<P><DT><A NAME="M45"><I>pathName </I><B>selection set </B><I>first </I>?<I>last</I>?</A><DD>
Selects all of the elements in the range between
<I>first</I> and <I>last</I>, inclusive, without affecting
the selection state of elements outside that range.
<P></DL>
<P><DT><A NAME="M46"><I>pathName </I><B>size</B></A><DD>
Returns a decimal string indicating the total number of elements
in the listbox.
<P><DT><A NAME="M47"><I>pathName </I><B>xview </B><I>args</I></A><DD>
This command is used to query and change the horizontal position of the
information in the widget's window. It can take any of the following
forms:
<P>
<DL>
<P><DT><A NAME="M48"><I>pathName </I><B>xview</B></A><DD>
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
For example, if the first element is .2 and the second element is .6,
20% of the listbox's text is off-screen to the left, the middle 40% is visible
in the window, and 40% of the text is off-screen to the right.
These are the same values passed to scrollbars via the <B>-xscrollcommand</B>
option.
<P><DT><A NAME="M49"><I>pathName </I><B>xview</B> <I>index</I></A><DD>
Adjusts the view in the window so that the character position given by
<I>index</I> is displayed at the left edge of the window.
Character positions are defined by the width of the character <B>0</B>.
<P><DT><A NAME="M50"><I>pathName </I><B>xview moveto</B><I> fraction</I></A><DD>
Adjusts the view in the window so that <I>fraction</I> of the
total width of the listbox text is off-screen to the left.
<I>fraction</I> must be a fraction between 0 and 1.
<P><DT><A NAME="M51"><I>pathName </I><B>xview scroll </B><I>number what</I></A><DD>
This command shifts the view in the window left or right according to
<I>number</I> and <I>what</I>.
<I>Number</I> must be an integer.
<I>What</I> must be either <B>units</B> or <B>pages</B> or an abbreviation
of one of these.
If <I>what</I> is <B>units</B>, the view adjusts left or right by
<I>number</I> character units (the width of the <B>0</B> character)
on the display; if it is <B>pages</B> then the view adjusts by
<I>number</I> screenfuls.
If <I>number</I> is negative then characters farther to the left
become visible; if it is positive then characters farther to the right
become visible.
<P></DL>
<P><DT><A NAME="M52"><I>pathName </I><B>yview </B><I>?args</I>?</A><DD>
This command is used to query and change the vertical position of the
text in the widget's window.
It can take any of the following forms:
<P>
<DL>
<P><DT><A NAME="M53"><I>pathName </I><B>yview</B></A><DD>
Returns a list containing two elements, both of which are real fractions
between 0 and 1.
The first element gives the position of the listbox element at the
top of the window, relative to the listbox as a whole (0.5 means
it is halfway through the listbox, for example).
The second element gives the position of the listbox element just after
the last one in the window, relative to the listbox as a whole.
These are the same values passed to scrollbars via the <B>-yscrollcommand</B>
option.
<P><DT><A NAME="M54"><I>pathName </I><B>yview</B> <I>index</I></A><DD>
Adjusts the view in the window so that the element given by
<I>index</I> is displayed at the top of the window.
<P><DT><A NAME="M55"><I>pathName </I><B>yview moveto</B><I> fraction</I></A><DD>
Adjusts the view in the window so that the element given by <I>fraction</I>
appears at the top of the window.
<I>Fraction</I> is a fraction between 0 and 1; 0 indicates the first
element in the listbox, 0.33 indicates the element one-third the
way through the listbox, and so on.
<P><DT><A NAME="M56"><I>pathName </I><B>yview scroll </B><I>number what</I></A><DD>
This command adjusts the view in the window up or down according to
<I>number</I> and <I>what</I>.
<I>Number</I> must be an integer.
<I>What</I> must be either <B>units</B> or <B>pages</B>.
If <I>what</I> is <B>units</B>, the view adjusts up or down by
<I>number</I> lines; if it is <B>pages</B> then
the view adjusts by <I>number</I> screenfuls.
If <I>number</I> is negative then earlier elements
become visible; if it is positive then later elements
become visible.
<P></DL>
<P></DL>
<H3><A NAME="M57">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for listboxes that give them
Motif-like behavior. Much of the behavior of a listbox is determined
by its <B>selectMode</B> option, which selects one of four ways
of dealing with the selection.
<P>
If the selection mode is <B>single</B> or <B>browse</B>, at most one
element can be selected in the listbox at once.
In both modes, clicking button 1 on an element selects
it and deselects any other selected item.
In <B>browse</B> mode it is also possible to drag the selection
with button 1.
<P>
If the selection mode is <B>multiple</B> or <B>extended</B>,
any number of elements may be selected at once, including discontiguous
ranges. In <B>multiple</B> mode, clicking button 1 on an element
toggles its selection state without affecting any other elements.
In <B>extended</B> mode, pressing button 1 on an element selects
it, deselects everything else, and sets the anchor to the element
under the mouse; dragging the mouse with button 1
down extends the selection to include all the elements between
the anchor and the element under the mouse, inclusive.
<P>
Most people will probably want to use <B>browse</B> mode for
single selections and <B>extended</B> mode for multiple selections;
the other modes appear to be useful only in special situations.
<P>
Any time the selection changes in the listbox, the virtual event
<B>&lt;&lt;ListboxSelect&gt;&gt;</B> will be generated. It is easiest to bind
to this event to be made aware of any changes to listbox selection.
<P>
In addition to the above behavior, the following additional behavior
is defined by the default bindings:
<P>
<DL>
<P><DT>[1]<DD>
In <B>extended</B> mode, the selected range can be adjusted by pressing
button 1 with the Shift key down: this modifies the selection to
consist of the elements between the anchor and the element under
the mouse, inclusive.
The un-anchored end of this new selection can also be dragged with
the button down.
<P><DT>[2]<DD>
In <B>extended</B> mode, pressing button 1 with the Control key down
starts a toggle operation: the anchor is set to the element under
the mouse, and its selection state is reversed. The selection state
of other elements isn't changed.
If the mouse is dragged with button 1 down, then the selection state
of all elements between the anchor and the element under the mouse
is set to match that of the anchor element; the selection state of
all other elements remains what it was before the toggle operation
began.
<P><DT>[3]<DD>
If the mouse leaves the listbox window with button 1 down, the window
scrolls away from the mouse, making information visible that used
to be off-screen on the side of the mouse.
The scrolling continues until the mouse re-enters the window, the
button is released, or the end of the listbox is reached.
<P><DT>[4]<DD>
Mouse button 2 may be used for scanning.
If it is pressed and dragged over the listbox, the contents of
the listbox drag at high speed in the direction the mouse moves.
<P><DT>[5]<DD>
If the Up or Down key is pressed, the location cursor (active
element) moves up or down one element.
If the selection mode is <B>browse</B> or <B>extended</B> then the
new active element is also selected and all other elements are
deselected.
In <B>extended</B> mode the new active element becomes the
selection anchor.
<P><DT>[6]<DD>
In <B>extended</B> mode, Shift-Up and Shift-Down move the location
cursor (active element) up or down one element and also extend
the selection to that element in a fashion similar to dragging
with mouse button 1.
<P><DT>[7]<DD>
The Left and Right keys scroll the listbox view left and right
by the width of the character <B>0</B>.
Control-Left and Control-Right scroll the listbox view left and
right by the width of the window.
Control-Prior and Control-Next also scroll left and right by
the width of the window.
<P><DT>[8]<DD>
The Prior and Next keys scroll the listbox view up and down
by one page (the height of the window).
<P><DT>[9]<DD>
The Home and End keys scroll the listbox horizontally to
the left and right edges, respectively.
<P><DT>[10]<DD>
Control-Home sets the location cursor to the the first element in
the listbox, selects that element, and deselects everything else
in the listbox.
<P><DT>[11]<DD>
Control-End sets the location cursor to the the last element in
the listbox, selects that element, and deselects everything else
in the listbox.
<P><DT>[12]<DD>
In <B>extended</B> mode, Control-Shift-Home extends the selection
to the first element in the listbox and Control-Shift-End extends
the selection to the last element.
<P><DT>[13]<DD>
In <B>multiple</B> mode, Control-Shift-Home moves the location cursor
to the first element in the listbox and Control-Shift-End moves
the location cursor to the last element.
<P><DT>[14]<DD>
The space and Select keys make a selection at the location cursor
(active element) just as if mouse button 1 had been pressed over
this element.
<P><DT>[15]<DD>
In <B>extended</B> mode, Control-Shift-space and Shift-Select
extend the selection to the active element just as if button 1
had been pressed with the Shift key down.
<P><DT>[16]<DD>
In <B>extended</B> mode, the Escape key cancels the most recent
selection and restores all the elements in the selected range
to their previous selection state.
<P><DT>[17]<DD>
Control-slash selects everything in the widget, except in
<B>single</B> and <B>browse</B> modes, in which case it selects
the active element and deselects everything else.
<P><DT>[18]<DD>
Control-backslash deselects everything in the widget, except in
<B>browse</B> mode where it has no effect.
<P><DT>[19]<DD>
The F16 key (labelled Copy on many Sun workstations) or Meta-w
copies the selection in the widget to the clipboard, if there is
a selection.
<P></DL>
<P>
The behavior of listboxes can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M58">KEYWORDS</A></H3>
<A href="../Keywords/L.htm#listbox">listbox</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1997 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

65
hlp/en/tk/loadTk.htm Normal file
View File

@@ -0,0 +1,65 @@
<HTML><HEAD><TITLE>Tk Tk Built-In Commands - Safe manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
loadTk - Load Tk into a safe interpreter.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>::safe::loadTk </B><I>slave</I> ?<B>-use</B> <I>windowId</I>? ?<B>-display</B> <I>displayName</I>? <BR>
Safe Tk is based on Safe Tcl, which provides a mechanism
that allows restricted and mediated
access to auto-loading and packages for safe interpreters.
Safe Tk adds the ability to configure the interpreter
for safe Tk operations and load Tk into safe
interpreters.
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>::safe::loadTk</B> command initializes the required data structures
in the named safe interpreter and then loads Tk into it.
The command returns the name of the safe interpreter.
If <B>-use</B> is specified, the window identified by the specified system
dependent identifier <I>windowId</I> is used to contain the ``.''
window of the safe interpreter; it can be any valid id, eventually
referencing a window belonging to another application. As a convenience,
if the window you plan to use is a Tk Window of the application you
can use the window name (eg: <B>.x.y</B>) instead of its window Id
(<B>[winfo id .x.y]</B>).
When <B>-use</B> is not specified,
a new toplevel window is created for the ``.'' window of
the safe interpreter. On X11 if you want the embedded window
to use another display than the default one, specify it with
<B>-display</B>.
See the <B>SECURITY ISSUES</B> section below for implementation details.
<H3><A NAME="M5">SECURITY ISSUES</A></H3>
Please read the <B>safe</B> manual page for Tcl to learn about the basic
security considerations for Safe Tcl.
<P>
<B>::safe::loadTk</B> adds the value of <B>tk_library</B> taken from the master
interpreter to the virtual access path of the safe interpreter so that
auto-loading will work in the safe interpreter.
<P>
<P>
Tk initialization is now safe with respect to not trusting
the slave's state for startup. <B>::safe::loadTk</B>
registers the slave's name so
when the Tk initialization (<B><A HREF="../TclLib/Tk_Init.htm">Tk_SafeInit</A></B>) is called
and in turn calls the master's <B>::safe::InitTk</B> it will
return the desired <B>argv</B> equivalent (<B>-use</B>
<I>windowId</I>, correct <B>-display</B>, etc...).
<P>
When <B>-use</B> is not used, the new toplevel created is specially
decorated so the user is always aware that the user interface presented comes
from a potentially unsafe code and can easily delete the corresponding
interpreter.
<P>
On X11, conflicting <B>-use</B> and <B>-display</B> are likely
to generate a fatal X error.
<H3><A NAME="M6">SEE ALSO</A></H3>
<B>safe</B>, <B><A HREF="../TkCmd/interp.htm">interp</A></B>, <B>library</B>, <B><A HREF="../TkCmd/load.htm">load</A></B>, <B><A HREF="../TkCmd/package.htm">package</A></B>, <B><A HREF="../TkCmd/source.htm">source</A></B>, <B><A HREF="../TkCmd/unknown.htm">unknown</A></B>
<H3><A NAME="M7">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#alias">alias</A>, <A href="../Keywords/A.htm#auto-loading">auto-loading</A>, <A href="../Keywords/A.htm#auto_mkindex">auto_mkindex</A>, <A href="../Keywords/L.htm#load">load</A>, <A href="../Keywords/M.htm#master interpreter">master interpreter</A>, <A href="../Keywords/S.htm#safe
interpreter">safe
interpreter</A>, <A href="../Keywords/S.htm#slave interpreter">slave interpreter</A>, <A href="../Keywords/S.htm#source">source</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

27
hlp/en/tk/lower.htm Normal file
View File

@@ -0,0 +1,27 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - lower manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
lower - Change a window's position in the stacking order
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>lower </B><I>window </I>?<I>belowThis</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
If the <I>belowThis</I> argument is omitted then the command lowers
<I>window</I> so that it is below all of its siblings in the stacking
order (it will be obscured by any siblings that overlap it and
will not obscure any siblings).
If <I>belowThis</I> is specified then it must be the path name of
a window that is either a sibling of <I>window</I> or the descendant
of a sibling of <I>window</I>.
In this case the <B>lower</B> command will insert
<I>window</I> into the stacking order just below <I>belowThis</I>
(or the ancestor of <I>belowThis</I> that is a sibling of <I>window</I>);
this could end up either raising or lowering <I>window</I>.
<H3><A NAME="M5">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/raise.htm">raise</A></B>
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/L.htm#lower">lower</A>, <A href="../Keywords/O.htm#obscure">obscure</A>, <A href="../Keywords/S.htm#stacking order">stacking order</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

798
hlp/en/tk/menu.htm Normal file
View File

@@ -0,0 +1,798 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - menu manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="menu.htm#M2" NAME="L700">NAME</A>
<DL><DD>menu - Create and manipulate menu widgets</DL>
<DD><A HREF="menu.htm#M3" NAME="L701">SYNOPSIS</A>
<DL>
<DD><B>menu</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="menu.htm#M4" NAME="L702">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-activeborderwidth">-activeborderwidth, activeBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
</DL>
<DD><A HREF="menu.htm#M5" NAME="L703">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="menu.htm#M6" NAME="L704">-postcommand, postCommand, Command</A>
<DD><A HREF="menu.htm#M7" NAME="L705">-selectcolor, selectColor, Background</A>
<DD><A HREF="menu.htm#M8" NAME="L706">-tearoff, tearOff, TearOff</A>
<DD><A HREF="menu.htm#M9" NAME="L707">-tearoffcommand, tearOffCommand, TearOffCommand</A>
<DD><A HREF="menu.htm#M10" NAME="L708">-title, title, Title</A>
<DD><A HREF="menu.htm#M11" NAME="L709">-type, type, Type</A>
</DL>
<DD><A HREF="menu.htm#M12" NAME="L710">INTRODUCTION</A>
<DD><A HREF="menu.htm#M13" NAME="L711">COMMAND ENTRIES</A>
<DD><A HREF="menu.htm#M14" NAME="L712">SEPARATOR ENTRIES</A>
<DD><A HREF="menu.htm#M15" NAME="L713">CHECKBUTTON ENTRIES</A>
<DD><A HREF="menu.htm#M16" NAME="L714">RADIOBUTTON ENTRIES</A>
<DD><A HREF="menu.htm#M17" NAME="L715">CASCADE ENTRIES</A>
<DD><A HREF="menu.htm#M18" NAME="L716">TEAR-OFF ENTRIES</A>
<DD><A HREF="menu.htm#M19" NAME="L717">MENUBARS</A>
<DD><A HREF="menu.htm#M20" NAME="L718">SPECIAL MENUS IN MENUBARS</A>
<DD><A HREF="menu.htm#M21" NAME="L719">CLONES</A>
<DD><A HREF="menu.htm#M22" NAME="L720">WIDGET COMMAND</A>
<DL>
<DD><A HREF="menu.htm#M23" NAME="L721"><I>number</I></A>
<DD><A HREF="menu.htm#M24" NAME="L722"><B>active</B></A>
<DD><A HREF="menu.htm#M25" NAME="L723"><B>end</B></A>
<DD><A HREF="menu.htm#M26" NAME="L724"><B>last</B></A>
<DD><A HREF="menu.htm#M27" NAME="L725"><B>none</B></A>
<DD><A HREF="menu.htm#M28" NAME="L726"><B>@</B><I>number</I></A>
<DD><A HREF="menu.htm#M29" NAME="L727"><I>pattern</I></A>
</DL>
<DL>
<DD><A HREF="menu.htm#M30" NAME="L728"><I>pathName </I><B>activate </B><I>index</I></A>
<DD><A HREF="menu.htm#M31" NAME="L729"><I>pathName </I><B>add </B><I>type </I>?<I>option value option value ...</I>?</A>
<DL>
<DD><A HREF="menu.htm#M32" NAME="L730"><B>-activebackground </B><I>value</I></A>
<DD><A HREF="menu.htm#M33" NAME="L731"><B>-activeforeground </B><I>value</I></A>
<DD><A HREF="menu.htm#M34" NAME="L732"><B>-accelerator </B><I>value</I></A>
<DD><A HREF="menu.htm#M35" NAME="L733"><B>-background </B><I>value</I></A>
<DD><A HREF="menu.htm#M36" NAME="L734"><B>-bitmap </B><I>value</I></A>
<DD><A HREF="menu.htm#M37" NAME="L735"><B>-columnbreak </B><I>value</I></A>
<DD><A HREF="menu.htm#M38" NAME="L736"><B>-command </B><I>value</I></A>
<DD><A HREF="menu.htm#M39" NAME="L737"><B>-font </B><I>value</I></A>
<DD><A HREF="menu.htm#M40" NAME="L738"><B>-foreground </B><I>value</I></A>
<DD><A HREF="menu.htm#M41" NAME="L739"><B>-hidemargin </B><I>value</I></A>
<DD><A HREF="menu.htm#M42" NAME="L740"><B>-image </B><I>value</I></A>
<DD><A HREF="menu.htm#M43" NAME="L741"><B>-indicatoron </B><I>value</I></A>
<DD><A HREF="menu.htm#M44" NAME="L742"><B>-label </B><I>value</I></A>
<DD><A HREF="menu.htm#M45" NAME="L743"><B>-menu </B><I>value</I></A>
<DD><A HREF="menu.htm#M46" NAME="L744"><B>-offvalue </B><I>value</I></A>
<DD><A HREF="menu.htm#M47" NAME="L745"><B>-onvalue </B><I>value</I></A>
<DD><A HREF="menu.htm#M48" NAME="L746"><B>-selectcolor </B><I>value</I></A>
<DD><A HREF="menu.htm#M49" NAME="L747"><B>-selectimage </B><I>value</I></A>
<DD><A HREF="menu.htm#M50" NAME="L748"><B>-state </B><I>value</I></A>
<DD><A HREF="menu.htm#M51" NAME="L749"><B>-underline </B><I>value</I></A>
<DD><A HREF="menu.htm#M52" NAME="L750"><B>-value </B><I>value</I></A>
<DD><A HREF="menu.htm#M53" NAME="L751"><B>-variable </B><I>value</I></A>
</DL>
<DD><A HREF="menu.htm#M54" NAME="L752"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="menu.htm#M55" NAME="L753"><I>pathName</I> <B>clone</B> <I>newPathname ?cloneType?</I></A>
<DD><A HREF="menu.htm#M56" NAME="L754"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="menu.htm#M57" NAME="L755"><I>pathName </I><B>delete </B><I>index1</I> ?<I>index2</I>?</A>
<DD><A HREF="menu.htm#M58" NAME="L756"><I>pathName </I><B>entrycget</B> <I>index option</I></A>
<DD><A HREF="menu.htm#M59" NAME="L757"><I>pathName </I><B>entryconfigure </B><I>index </I>?<I>options</I>?</A>
<DD><A HREF="menu.htm#M60" NAME="L758"><I>pathName </I><B>index </B><I>index</I></A>
<DD><A HREF="menu.htm#M61" NAME="L759"><I>pathName </I><B>insert </B><I>index</I> <I>type </I>?<I>option value option value ...</I>?</A>
<DD><A HREF="menu.htm#M62" NAME="L760"><I>pathName </I><B>invoke </B><I>index</I></A>
<DD><A HREF="menu.htm#M63" NAME="L761"><I>pathName </I><B>post </B><I>x y</I></A>
<DD><A HREF="menu.htm#M64" NAME="L762"><I>pathName </I><B>postcascade </B><I>index</I></A>
<DD><A HREF="menu.htm#M65" NAME="L763"><I>pathName </I><B>type </B><I>index</I></A>
<DD><A HREF="menu.htm#M66" NAME="L764">.VS</A>
<DD><A HREF="menu.htm#M67" NAME="L765"><I>pathName </I><B>yposition </B><I>index</I></A>
</DL>
<DD><A HREF="menu.htm#M68" NAME="L766">MENU CONFIGURATIONS</A>
<DL>
<DD><A HREF="menu.htm#M69" NAME="L767"><B>Pulldown Menus in Menubar</B></A>
<DD><A HREF="menu.htm#M70" NAME="L768"><B>Pulldown Menus in Menu Buttons</B></A>
<DD><A HREF="menu.htm#M71" NAME="L769"><B>Popup Menus</B></A>
<DD><A HREF="menu.htm#M72" NAME="L770"><B>Option Menus</B></A>
<DD><A HREF="menu.htm#M73" NAME="L771"><B>Torn-off Menus</B></A>
</DL>
<DD><A HREF="menu.htm#M74" NAME="L772">DEFAULT BINDINGS</A>
<DL>
</DL>
<DD><A HREF="menu.htm#M75" NAME="L773">BUGS</A>
<DD><A HREF="menu.htm#M76" NAME="L774">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
menu - Create and manipulate menu widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>menu</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-activeborderwidth">-activeborderwidth, activeBorderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-postcommand</A></B>
<DT>Database Name: <B>postCommand</B>
<DT>Database Class: <B>Command</B>
<DD>If this option is specified then it provides a Tcl command to execute
each time the menu is posted. The command is invoked by the <B>post</B>
widget command before posting the menu. Note that in 8.0 on Macintosh
and Windows, all commands in a menu systems are executed before any
are posted. This is due to the limitations in the individual platforms'
menu managers.
<P><DT>Command-Line Name: <B><A NAME="M7">-selectcolor</A></B>
<DT>Database Name: <B>selectColor</B>
<DT>Database Class: <B>Background</B>
<DD>For menu entries that are check buttons or radio buttons, this option
specifies the color to display in the indicator when the check button
or radio button is selected.
<P><DT>Command-Line Name: <B><A NAME="M8">-tearoff</A></B>
<DT>Database Name: <B>tearOff</B>
<DT>Database Class: <B>TearOff</B>
<DD>This option must have a proper boolean value, which specifies
whether or not the menu should include a tear-off entry at the
top. If so, it will exist as entry 0 of the menu and the other
entries will number starting at 1. The default
menu bindings arrange for the menu to be torn off when the tear-off
entry is invoked.
<P><DT>Command-Line Name: <B><A NAME="M9">-tearoffcommand</A></B>
<DT>Database Name: <B>tearOffCommand</B>
<DT>Database Class: <B>TearOffCommand</B>
<DD>If this option has a non-empty value, then it specifies a Tcl command
to invoke whenever the menu is torn off. The actual command will
consist of the value of this option, followed by a space, followed
by the name of the menu window, followed by a space, followed by
the name of the name of the torn off menu window. For example, if
the option's is ``<B>a b</B>'' and menu <B>.x.y</B> is torn off to
create a new menu <B>.x.tearoff1</B>, then the command
``<B>a b .x.y .x.tearoff1</B>'' will be invoked.
<P><DT>Command-Line Name: <B><A NAME="M10">-title</A></B>
<DT>Database Name: <B>title</B>
<DT>Database Class: <B>Title</B>
<DD>The string will be used to title the window created when this menu is
torn off. If the title is NULL, then the window will have the title
of the menubutton or the text of the cascade item from which this menu
was invoked.
<P><DT>Command-Line Name: <B><A NAME="M11">-type</A></B>
<DT>Database Name: <B>type</B>
<DT>Database Class: <B>Type</B>
<DD>This option can be one of <B>menubar</B>, <B>tearoff</B>, or
<B>normal</B>, and is set when the menu is created. While the string
returned by the configuration database will change if this option is
changed, this does not affect the menu widget's behavior. This is used
by the cloning mechanism and is not normally set outside of the Tk
library.
</DL>
<H3><A NAME="M12">INTRODUCTION</A></H3>
The <B>menu</B> command creates a new top-level window (given
by the <I>pathName</I> argument) and makes it into a menu widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the menu such as its colors and font.
The <B>menu</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A menu is a widget that displays a collection of one-line entries arranged
in one or more columns. There exist several different types of entries,
each with different properties. Entries of different types may be
combined in a single menu. Menu entries are not the same as
entry widgets. In fact, menu entries are not even distinct widgets;
the entire menu is one widget.
<P>
Menu entries are displayed with up to three separate fields.
The main field is a label in the form of a text string,
a bitmap, or an image, controlled by the <B>-label</B>,
<B>-bitmap</B>, and <B>-image</B> options for the entry.
If the <B>-accelerator</B> option is specified for an entry then a second
textual field is displayed to the right of the label. The accelerator
typically describes a keystroke sequence that may be typed in the
application to cause the same result as invoking the menu entry.
The third field is an <I>indicator</I>. The indicator is present only for
checkbutton or radiobutton entries. It indicates whether the entry
is selected or not, and is displayed to the left of the entry's
string.
<P>
In normal use, an entry becomes active (displays itself differently)
whenever the mouse pointer is over the entry. If a mouse
button is released over the entry then the entry is <I>invoked</I>.
The effect of invocation is different for each type of entry;
these effects are described below in the sections on individual
entries.
<P>
Entries may be <I>disabled</I>, which causes their labels
and accelerators to be displayed
with dimmer colors.
The default menu bindings will not allow
a disabled entry to be activated or invoked.
Disabled entries may be re-enabled, at which point it becomes
possible to activate and invoke them again.
<P>
Whenever a menu's active entry is changed, a &lt;&lt;MenuSelect&gt;&gt; virtual
event is send to the menu. The active item can then be queried from
the menu, and an action can be taken, such as setting
context-sensitive help text for the entry.
<H3><A NAME="M13">COMMAND ENTRIES</A></H3>
The most common kind of menu entry is a command entry, which
behaves much like a button widget. When a command entry is
invoked, a Tcl command is executed. The Tcl
command is specified with the <B>-command</B> option.
<H3><A NAME="M14">SEPARATOR ENTRIES</A></H3>
A separator is an entry that is displayed as a horizontal dividing
line. A separator may not be activated or invoked, and it has
no behavior other than its display appearance.
<H3><A NAME="M15">CHECKBUTTON ENTRIES</A></H3>
A checkbutton menu entry behaves much like a checkbutton widget.
When it is invoked it toggles back and forth between the selected
and deselected states. When the entry is selected, a particular
value is stored in a particular global variable (as determined by
the <B>-onvalue</B> and <B>-variable</B> options for the entry); when
the entry is deselected another value (determined by the
<B>-offvalue</B> option) is stored in the global variable.
An indicator box is displayed to the left of the label in a checkbutton
entry. If the entry is selected then the indicator's center is displayed
in the color given by the <B>-selectcolor</B> option for the entry;
otherwise the indicator's center is displayed in the background color for
the menu. If a <B>-command</B> option is specified for a checkbutton
entry, then its value is evaluated as a Tcl command each time the entry
is invoked; this happens after toggling the entry's
selected state.
<H3><A NAME="M16">RADIOBUTTON ENTRIES</A></H3>
A radiobutton menu entry behaves much like a radiobutton widget.
Radiobutton entries are organized in groups of which only one
entry may be selected at a time. Whenever a particular entry
becomes selected it stores a particular value into a particular
global variable (as determined by the <B>-value</B> and
<B>-variable</B> options for the entry). This action
causes any previously-selected entry in the same group
to deselect itself.
Once an entry has become selected, any change to the entry's
associated variable will cause the entry to deselect itself.
Grouping of radiobutton entries is determined by their
associated variables: if two entries have the same associated
variable then they are in the same group.
An indicator diamond is displayed to the left of the label in each
radiobutton entry. If the entry is selected then the indicator's
center is displayed in the color given by the <B>-selectcolor</B> option
for the entry;
otherwise the indicator's center is displayed in the background color for
the menu. If a <B>-command</B> option is specified for a radiobutton
entry, then its value is evaluated as a Tcl command each time the entry
is invoked; this happens after selecting the entry.
<H3><A NAME="M17">CASCADE ENTRIES</A></H3>
A cascade entry is one with an associated menu (determined
by the <B>-menu</B> option). Cascade entries allow the construction
of cascading menus.
The <B>postcascade</B> widget command can be used to post and unpost
the associated menu just next to of the cascade entry.
The associated menu must be a child of the menu containing
the cascade entry (this is needed in order for menu traversal to
work correctly).
<P>
A cascade entry posts its associated menu by invoking a
Tcl command of the form
<PRE><I>menu</I><B> post </B><I>x y</I></PRE>
where <I>menu</I> is the path name of the associated menu, and <I>x</I>
and <I>y</I> are the root-window coordinates of the upper-right
corner of the cascade entry.
On Unix, the lower-level menu is unposted by executing a Tcl command with
the form
<PRE><I>menu</I><B> unpost</B></PRE>
where <I>menu</I> is the name of the associated menu.
On other platforms, the platform's native code takes care of unposting the
menu.
<P>
If a <B>-command</B> option is specified for a cascade entry then it is
evaluated as a Tcl command whenever the entry is invoked. This is not
supported on Windows.
<H3><A NAME="M18">TEAR-OFF ENTRIES</A></H3>
A tear-off entry appears at the top of the menu if enabled with the
<B>tearOff</B> option. It is not like other menu entries in that
it cannot be created with the <B>add</B> widget command and
cannot be deleted with the <B>delete</B> widget command.
When a tear-off entry is created it appears as a dashed line at
the top of the menu. Under the default bindings, invoking the
tear-off entry causes a torn-off copy to be made of the menu and
all of its submenus.
<H3><A NAME="M19">MENUBARS</A></H3>
Any menu can be set as a menubar for a toplevel window (see
<B><A HREF="../TclCmd/toplevel.htm">toplevel</A></B> command for syntax). On the Macintosh, whenever the
toplevel is in front, this menu's cascade items will appear in the
menubar across the top of the main monitor. On Windows and Unix, this
menu's items will be displayed in a menubar accross the top of the
window. These menus will behave according to the interface guidelines
of their platforms. For every menu set as a menubar, a clone menu is
made. See the <B>CLONES</B> section for more information.
<P>
As noted, menubars may behave differently on different platforms. One
example of this concerns the handling of checkbuttons and radiobuttons
within the menu. While it is permitted to put these menu elements on
menubars, they may not be drawn with indicators on some platforms, due
to system restrictions.
<H3><A NAME="M20">SPECIAL MENUS IN MENUBARS</A></H3>
Certain menus in a menubar will be treated specially. On the Macintosh,
access to the special Apple and Help menus is provided. On Windows,
access to the Windows System menu in each window is provided. On X Windows,
a special right-justified help menu is provided. In all cases, these
menus must be created with the command name of the menubar menu concatenated
with the special name. So for a menubar named .menubar, on the Macintosh,
the special menus would be .menubar.apple and .menubar.help; on Windows,
the special menu would be .menubar.system; on X Windows, the help
menu would be .menubar.help.
<P>
When Tk sees an Apple menu on the Macintosh, that menu's contents make
up the first items of the Apple menu on the screen whenever the window
containing the menubar is in front. The menu is the
first one that the user sees and has a title which is an Apple logo.
After all of the Tk-defined items, the menu will have a separator,
followed by all of the items in the user's Apple Menu Items folder.
Since the System uses a different menu definition procedure for
the Apple menu than Tk uses for its menus, and the system APIs do
not fully support everything Tk tries to do, the menu item will only
have its text displayed. No font attributes, images, bitmaps, or colors
will be displayed. In addition, a menu with a tearoff item will have
the tearoff item displayed as &quot;(TearOff)&quot;.
<P>
When Tk see a Help menu on the Macintosh, the menu's contents are
appended to the standard help menu on the right of the user's menubar
whenever the user's menubar is in front. The first items in the menu
are provided by Apple. Similar to the Apple Menu, cusomization in this
menu is limited to what the system provides.
<P>
When Tk sees a System menu on Windows, its items are appended to the
system menu that the menubar is attached to. This menu has an icon
representing a spacebar, and can be invoked with the mouse or by typing
Alt+Spacebar. Due to limitations in the Windows API, any font changes,
colors, images, bitmaps, or tearoff images will not appear in the
system menu.
<P>
When Tk see a Help menu on X Windows, the menu is moved to be last in
the menubar and is right justified.
<H3><A NAME="M21">CLONES</A></H3>
When a menu is set as a menubar for a toplevel window, or when a menu
is torn off, a clone of the menu is made. This clone is a menu widget
in its own right, but it is a child of the original. Changes in the
configuration of the original are reflected in the
clone. Additionally, any cascades that are pointed to are also cloned
so that menu traversal will work right. Clones are destroyed when
either the tearoff or menubar goes away, or when the original menu is
destroyed.
<H3><A NAME="M22">WIDGET COMMAND</A></H3>
The <B>menu</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command.
<P>
Many of the widget commands for a menu take as one argument an
indicator of which entry of the menu to operate on. These
indicators are called <I>index</I>es and may be specified in
any of the following forms:
<P>
<DL>
<P><DT><A NAME="M23"><I>number</I></A><DD>
Specifies the entry numerically, where 0 corresponds
to the top-most entry of the menu, 1 to the entry below it, and
so on.
<P><DT><A NAME="M24"><B>active</B></A><DD>
Indicates the entry that is currently active. If no entry is
active then this form is equivalent to <B>none</B>. This form may
not be abbreviated.
<P><DT><A NAME="M25"><B>end</B></A><DD>
Indicates the bottommost entry in the menu. If there are no
entries in the menu then this form is equivalent to <B>none</B>.
This form may not be abbreviated.
<P><DT><A NAME="M26"><B>last</B></A><DD>
Same as <B>end</B>.
<P><DT><A NAME="M27"><B>none</B></A><DD>
Indicates ``no entry at all''; this is used most commonly with
the <B>activate</B> option to deactivate all the entries in the
menu. In most cases the specification of <B>none</B> causes
nothing to happen in the widget command.
This form may not be abbreviated.
<P><DT><A NAME="M28"><B>@</B><I>number</I></A><DD>
In this form, <I>number</I> is treated as a y-coordinate in the
menu's window; the entry closest to that y-coordinate is used.
For example, ``<B>@0</B>'' indicates the top-most entry in the
window.
<P><DT><A NAME="M29"><I>pattern</I></A><DD>
If the index doesn't satisfy one of the above forms then this
form is used. <I>Pattern</I> is pattern-matched against the label of
each entry in the menu, in order from the top down, until a
matching entry is found. The rules of <B><A HREF="../TkLib/StrMatch.htm">Tcl_StringMatch</A></B>
are used.
<P></DL>
<P>
The following widget commands are possible for menu widgets:
<P>
<DL>
<P><DT><A NAME="M30"><I>pathName </I><B>activate </B><I>index</I></A><DD>
Change the state of the entry indicated by <I>index</I> to <B>active</B>
and redisplay it using its active colors.
Any previously-active entry is deactivated. If <I>index</I>
is specified as <B>none</B>, or if the specified entry is
disabled, then the menu ends up with no active entry.
Returns an empty string.
<P><DT><A NAME="M31"><I>pathName </I><B>add </B><I>type </I>?<I>option value option value ...</I>?</A><DD>
Add a new entry to the bottom of the menu. The new entry's type
is given by <I>type</I> and must be one of <B>cascade</B>,
<B>checkbutton</B>, <B>command</B>, <B>radiobutton</B>, or <B>separator</B>,
or a unique abbreviation of one of the above. If additional arguments
are present, they specify any of the following options:
<P>
<DL>
<P><DT><A NAME="M32"><B>-activebackground </B><I>value</I></A><DD>
Specifies a background color to use for displaying this entry when it
is active.
If this option is specified as an empty string (the default), then the
<B>activeBackground</B> option for the overall menu is used.
If the <B>tk_strictMotif</B> variable has been set to request strict
Motif compliance, then this option is ignored and the <B>-background</B>
option is used in its place.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M33"><B>-activeforeground </B><I>value</I></A><DD>
Specifies a foreground color to use for displaying this entry when it
is active.
If this option is specified as an empty string (the default), then the
<B>activeForeground</B> option for the overall menu is used.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M34"><B>-accelerator </B><I>value</I></A><DD>
Specifies a string to display at the right side of the menu entry.
Normally describes an accelerator keystroke sequence that may be
typed to invoke the same function as the menu entry. This option
is not available for separator or tear-off entries.
<P><DT><A NAME="M35"><B>-background </B><I>value</I></A><DD>
Specifies a background color to use for displaying this entry when it
is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the
<B>background</B> option for the overall menu is used.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M36"><B>-bitmap </B><I>value</I></A><DD>
Specifies a bitmap to display in the menu instead of a textual
label, in any of the forms accepted by <B><A HREF="../TclLib/GetBitmap.htm">Tk_GetBitmap</A></B>.
This option overrides the <B>-label</B> option but may be reset
to an empty string to enable a textual label to be displayed.
If a <B>-image</B> option has been specified, it overrides
<B>-bitmap</B>.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M37"><B>-columnbreak </B><I>value</I></A><DD>
When this option is zero, the appears below the previous entry. When
this option is one, the menu appears at the top of a new column in the
menu.
<P><DT><A NAME="M38"><B>-command </B><I>value</I></A><DD>
Specifies a Tcl command to execute when the menu entry is invoked.
Not available for separator or tear-off entries.
<P><DT><A NAME="M39"><B>-font </B><I>value</I></A><DD>
Specifies the font to use when drawing the label or accelerator
string in this entry.
If this option is specified as an empty string (the default) then
the <B><A HREF="../TclCmd/font.htm">font</A></B> option for the overall menu is used.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M40"><B>-foreground </B><I>value</I></A><DD>
Specifies a foreground color to use for displaying this entry when it
is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the
<B>foreground</B> option for the overall menu is used.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M41"><B>-hidemargin </B><I>value</I></A><DD>
Specifies whether the standard margins should be drawn for this menu
entry. This is useful when creating palette with images in them, i.e.,
color palettes, pattern palettes, etc. 1 indicates that the margin for
the entry is hidden; 0 means that the margin is used.
<P><DT><A NAME="M42"><B>-image </B><I>value</I></A><DD>
Specifies an image to display in the menu instead of a text string
or bitmap
The image must have been created by some previous invocation of
<B><A HREF="../TclCmd/image.htm">image create</A></B>.
This option overrides the <B>-label</B> and <B>-bitmap</B> options
but may be reset to an empty string to enable a textual or
bitmap label to be displayed.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M43"><B>-indicatoron </B><I>value</I></A><DD>
Available only for checkbutton and radiobutton entries.
<I>Value</I> is a boolean that determines whether or not the
indicator should be displayed.
<P><DT><A NAME="M44"><B>-label </B><I>value</I></A><DD>
Specifies a string to display as an identifying label in the menu
entry. Not available for separator or tear-off entries.
<P><DT><A NAME="M45"><B>-menu </B><I>value</I></A><DD>
Available only for cascade entries. Specifies the path name of
the submenu associated with this entry.
The submenu must be a child of the menu.
<P><DT><A NAME="M46"><B>-offvalue </B><I>value</I></A><DD>
Available only for checkbutton entries. Specifies the value to
store in the entry's associated variable when the entry is
deselected.
<P><DT><A NAME="M47"><B>-onvalue </B><I>value</I></A><DD>
Available only for checkbutton entries. Specifies the value to
store in the entry's associated variable when the entry is selected.
<P><DT><A NAME="M48"><B>-selectcolor </B><I>value</I></A><DD>
Available only for checkbutton and radiobutton entries.
Specifies the color to display in the indicator when the entry is
selected.
If the value is an empty string (the default) then the <B>selectColor</B>
option for the menu determines the indicator color.
<P><DT><A NAME="M49"><B>-selectimage </B><I>value</I></A><DD>
Available only for checkbutton and radiobutton entries.
Specifies an image to display in the entry (in place of
the <B>-image</B> option) when it is selected.
<I>Value</I> is the name of an image, which must have been created
by some previous invocation of <B><A HREF="../TclCmd/image.htm">image create</A></B>.
This option is ignored unless the <B>-image</B> option has
been specified.
<P><DT><A NAME="M50"><B>-state </B><I>value</I></A><DD>
Specifies one of three states for the entry: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the entry is displayed using the
<B>foreground</B> option for the menu and the <B>background</B>
option from the entry or the menu.
The active state is typically used when the pointer is over the entry.
In active state the entry is displayed using the <B>activeForeground</B>
option for the menu along with the <B>activebackground</B> option from
the entry. Disabled state means that the entry
should be insensitive: the default bindings will refuse to activate
or invoke the entry.
In this state the entry is displayed according to the
<B>disabledForeground</B> option for the menu and the
<B>background</B> option from the entry.
This option is not available for separator entries.
<P><DT><A NAME="M51"><B>-underline </B><I>value</I></A><DD>
Specifies the integer index of a character to underline in the entry.
This option is also queried by the default bindings and used to
implement keyboard traversal.
0 corresponds to the first character of the text displayed in the entry,
1 to the next character, and so on.
If a bitmap or image is displayed in the entry then this option is ignored.
This option is not available for separator or tear-off entries.
<P><DT><A NAME="M52"><B>-value </B><I>value</I></A><DD>
Available only for radiobutton entries. Specifies the value to
store in the entry's associated variable when the entry is selected.
If an empty string is specified, then the <B>-label</B> option
for the entry as the value to store in the variable.
<P><DT><A NAME="M53"><B>-variable </B><I>value</I></A><DD>
Available only for checkbutton and radiobutton entries. Specifies
the name of a global value to set when the entry is selected.
For checkbutton entries the variable is also set when the entry
is deselected. For radiobutton entries, changing the variable
causes the currently-selected entry to deselect itself.
</DL><P>The <B>add</B> widget command returns an empty string.<DL>
<P></DL>
<P><DT><A NAME="M54"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>menu</B>
command.
<P><DT><A NAME="M55"><I>pathName</I> <B>clone</B> <I>newPathname ?cloneType?</I></A><DD>
Makes a clone of the current menu named <I>newPathName</I>. This clone
is a menu in its own right, but any changes to the clone are
propogated to the original menu and vice versa. <I>cloneType</I> can be
<B>normal</B>, <B>menubar</B>, or <B>tearoff</B>. Should not normally be
called outside of the Tk library. See the <B>CLONES</B> section for
more information.
<P><DT><A NAME="M56"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>menu</B>
command.
<P><DT><A NAME="M57"><I>pathName </I><B>delete </B><I>index1</I> ?<I>index2</I>?</A><DD>
Delete all of the menu entries between <I>index1</I> and
<I>index2</I> inclusive.
If <I>index2</I> is omitted then it defaults to <I>index1</I>.
Attempts to delete a tear-off menu entry are ignored (instead, you
should change the <B>tearOff</B> option to remove the tear-off entry).
<P><DT><A NAME="M58"><I>pathName </I><B>entrycget</B> <I>index option</I></A><DD>
Returns the current value of a configuration option for
the entry given by <I>index</I>.
<I>Option</I> may have any of the values accepted by the <B>add</B>
widget command.
<P><DT><A NAME="M59"><I>pathName </I><B>entryconfigure </B><I>index </I>?<I>options</I>?</A><DD>
This command is similar to the <B>configure</B> command, except that
it applies to the options for an individual entry, whereas <B>configure</B>
applies to the options for the menu as a whole.
<I>Options</I> may have any of the values accepted by the <B>add</B>
widget command. If <I>options</I> are specified, options are modified
as indicated
in the command and the command returns an empty string.
If no <I>options</I> are specified, returns a list describing
the current options for entry <I>index</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list).
<P><DT><A NAME="M60"><I>pathName </I><B>index </B><I>index</I></A><DD>
Returns the numerical index corresponding to <I>index</I>, or
<B>none</B> if <I>index</I> was specified as <B>none</B>.
<P><DT><A NAME="M61"><I>pathName </I><B>insert </B><I>index</I> <I>type </I>?<I>option value option value ...</I>?</A><DD>
Same as the <B>add</B> widget command except that it inserts the new
entry just before the entry given by <I>index</I>, instead of appending
to the end of the menu. The <I>type</I>, <I>option</I>, and <I>value</I>
arguments have the same interpretation as for the <B>add</B> widget
command. It is not possible to insert new menu entries before the
tear-off entry, if the menu has one.
<P><DT><A NAME="M62"><I>pathName </I><B>invoke </B><I>index</I></A><DD>
Invoke the action of the menu entry. See the sections on the
individual entries above for details on what happens. If the
menu entry is disabled then nothing happens. If the
entry has a command associated with it then the result of that
command is returned as the result of the <B>invoke</B> widget
command. Otherwise the result is an empty string. Note: invoking
a menu entry does not automatically unpost the menu; the default
bindings normally take care of this before invoking the <B>invoke</B>
widget command.
<P><DT><A NAME="M63"><I>pathName </I><B>post </B><I>x y</I></A><DD>
Arrange for the menu to be displayed on the screen at the root-window
coordinates given by <I>x</I> and <I>y</I>. These coordinates are
adjusted if necessary to guarantee that the entire menu is visible on
the screen. This command normally returns an empty string.
If the <B>postCommand</B> option has been specified, then its value is
executed as a Tcl script before posting the menu and the result of
that script is returned as the result of the <B>post</B> widget
command.
If an error returns while executing the command, then the error is
returned without posting the menu.
<P><DT><A NAME="M64"><I>pathName </I><B>postcascade </B><I>index</I></A><DD>
Posts the submenu associated with the cascade entry given by
<I>index</I>, and unposts any previously posted submenu.
If <I>index</I> doesn't correspond to a cascade entry,
or if <I>pathName</I> isn't posted,
the command has no effect except to unpost any currently posted
submenu.
<P><DT><A NAME="M65"><I>pathName </I><B>type </B><I>index</I></A><DD>
Returns the type of the menu entry given by <I>index</I>.
This is the <I>type</I> argument passed to the <B>add</B> widget
command when the entry was created, such as <B>command</B>
or <B>separator</B>, or <B>tearoff</B> for a tear-off entry.
<P><DT><A NAME="M66">.VS</A><DD>
<I>pathName </I><B>unpost</B>
Unmap the window so that it is no longer displayed. If a
lower-level cascaded menu is posted, unpost that menu. Returns an
empty string. This subcommand does not work on Windows and the
Macintosh, as those platforms have their own way of unposting menus.
<P><DT><A NAME="M67"><I>pathName </I><B>yposition </B><I>index</I></A><DD>
Returns a decimal string giving the y-coordinate within the menu
window of the topmost pixel in the entry specified by <I>index</I>.
<P></DL>
<H3><A NAME="M68">MENU CONFIGURATIONS</A></H3>
The default bindings support four different ways of using menus:
<P>
<DL>
<P><DT><A NAME="M69"><B>Pulldown Menus in Menubar</B></A><DD>
This is the most command case. You create a menu widget that will become the
menu bar. You then add cascade entries to this menu, specifying the
pull down menus you wish to use in your menu bar. You then create all
of the pulldowns. Once you have done this, specify the menu using the
<B>-menu</B> option of the toplevel's widget command. See the
<B><A HREF="../TclCmd/toplevel.htm">toplevel</A></B> manual entry for details.
<P><DT><A NAME="M70"><B>Pulldown Menus in Menu Buttons</B></A><DD>
This is the compatable way to do menu bars. You create one menubutton
widget for each top-level menu, and typically you arrange a series of
menubuttons in a row in a menubar window. You also create the top-level menus
and any cascaded submenus, and tie them together with <B>-menu</B>
options in menubuttons and cascade menu entries. The top-level menu must
be a child of the menubutton, and each submenu must be a child of the
menu that refers to it. Once you have done this, the default bindings
will allow users to traverse and invoke the tree of menus via its
menubutton; see the <B><A HREF="../TclCmd/menubutton.htm">menubutton</A></B> manual entry for details.
<P><DT><A NAME="M71"><B>Popup Menus</B></A><DD>
Popup menus typically post in response to a mouse button press or
keystroke. You create the popup menus and any cascaded submenus,
then you call the <B><A HREF="../TclCmd/popup.htm">tk_popup</A></B> procedure at the appropriate time
to post the top-level menu.
<P><DT><A NAME="M72"><B>Option Menus</B></A><DD>
An option menu consists of a menubutton with an associated menu
that allows you to select one of several values. The current value
is displayed in the menubutton and is also stored in a global
variable. Use the <B>tk_optionMenu</B> procedure to create option
menubuttons and their menus.
<P><DT><A NAME="M73"><B>Torn-off Menus</B></A><DD>
You create a torn-off menu by invoking the tear-off entry at
the top of an existing menu. The default bindings will create a new menu
that is a copy of the original menu and leave it permanently
posted as a top-level window. The torn-off menu behaves just
the same as the original menu.
<P></DL>
<H3><A NAME="M74">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for menus that give them
the following default behavior:
<P>
<DL>
<P><DT>[1]<DD>
When the mouse enters a menu, the entry underneath the mouse
cursor activates; as the mouse moves around the menu, the active
entry changes to track the mouse.
<P><DT>[2]<DD>
When the mouse leaves a menu all of the entries in the menu
deactivate, except in the special case where the mouse moves from
a menu to a cascaded submenu.
<P><DT>[3]<DD>
When a button is released over a menu, the active entry (if any) is invoked.
The menu also unposts unless it is a torn-off menu.
<P><DT>[4]<DD>
The Space and Return keys invoke the active entry and
unpost the menu.
<P><DT>[5]<DD>
If any of the entries in a menu have letters underlined with
with <B>-underline</B> option, then pressing one of the underlined
letters (or its upper-case or lower-case equivalent) invokes that
entry and unposts the menu.
<P><DT>[6]<DD>
The Escape key aborts a menu selection in progress without invoking any
entry. It also unposts the menu unless it is a torn-off menu.
<P><DT>[7]<DD>
The Up and Down keys activate the next higher or lower entry
in the menu. When one end of the menu is reached, the active
entry wraps around to the other end.
<P><DT>[8]<DD>
The Left key moves to the next menu to the left.
If the current menu is a cascaded submenu, then the submenu is
unposted and the current menu entry becomes the cascade entry
in the parent.
If the current menu is a top-level menu posted from a
menubutton, then the current menubutton is unposted and the
next menubutton to the left is posted.
Otherwise the key has no effect.
The left-right order of menubuttons is determined by their stacking
order: Tk assumes that the lowest menubutton (which by default
is the first one created) is on the left.
<P><DT>[9]<DD>
The Right key moves to the next menu to the right.
If the current entry is a cascade entry, then the submenu is
posted and the current menu entry becomes the first entry
in the submenu.
Otherwise, if the current menu was posted from a
menubutton, then the current menubutton is unposted and the
next menubutton to the right is posted.
<P></DL>
<P>
Disabled menu entries are non-responsive: they don't activate and
they ignore mouse button presses and releases.
<P>
The behavior of menus can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M75">BUGS</A></H3>
At present it isn't possible to use the
option database to specify values for the options to individual
entries.
<H3><A NAME="M76">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#menu">menu</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1997 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

266
hlp/en/tk/menubutton.htm Normal file
View File

@@ -0,0 +1,266 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - menubutton manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="menubutton.htm#M2" NAME="L775">NAME</A>
<DL><DD>menubutton - Create and manipulate menubutton widgets</DL>
<DD><A HREF="menubutton.htm#M3" NAME="L776">SYNOPSIS</A>
<DL>
<DD><B>menubutton</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="menubutton.htm#M4" NAME="L777">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A>
<DD><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-image">-image, image, Image</A>
<DD><A HREF="options.htm#M-justify">-justify, justify, Justify</A>
<DD><A HREF="options.htm#M-padx">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text">-text, text, Text</A>
<DD><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-underline">-underline, underline, Underline</A>
<DD><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A>
</DL>
<DD><A HREF="menubutton.htm#M5" NAME="L778">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="menubutton.htm#M6" NAME="L779">-direction, direction, Height</A>
<DD><A HREF="menubutton.htm#M7" NAME="L780">-height, height, Height</A>
<DD><A HREF="menubutton.htm#M8" NAME="L781">-indicatoron, indicatorOn, IndicatorOn</A>
<DD><A HREF="menubutton.htm#M9" NAME="L782">-menu, menu, MenuName</A>
<DD><A HREF="menubutton.htm#M10" NAME="L783">-state, state, State</A>
<DD><A HREF="menubutton.htm#M11" NAME="L784">-width, width, Width</A>
</DL>
<DD><A HREF="menubutton.htm#M12" NAME="L785">INTRODUCTION</A>
<DD><A HREF="menubutton.htm#M13" NAME="L786">WIDGET COMMAND</A>
<DL>
<DD><A HREF="menubutton.htm#M14" NAME="L787"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="menubutton.htm#M15" NAME="L788"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="menubutton.htm#M16" NAME="L789">DEFAULT BINDINGS</A>
<DL>
</DL>
<DD><A HREF="menubutton.htm#M17" NAME="L790">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
menubutton - Create and manipulate menubutton widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>menubutton</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-image">-image, image, Image</A></B>
<DT><B><A HREF="options.htm#M-justify">-justify, justify, Justify</A></B>
<DT><B><A HREF="options.htm#M-padx">-padx, padX, Pad</A></B>
<DT><B><A HREF="options.htm#M-pady">-pady, padY, Pad</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-text">-text, text, Text</A></B>
<DT><B><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A></B>
<DT><B><A HREF="options.htm#M-underline">-underline, underline, Underline</A></B>
<DT><B><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-direction</A></B>
<DT>Database Name: <B>direction</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies where the menu is going to be popup up. <B>above</B> tries to
pop the menu above the menubutton. <B>below</B> tries to pop the menu
below the menubutton. <B>left</B> tries to pop the menu to the left of
the menubutton. <B>right</B> tries to pop the menu to the right of the
menu button. <B><A HREF="../TkCmd/flush.htm">flush</A></B> pops the menu directly over the menubutton.
<P><DT>Command-Line Name: <B><A NAME="M7">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies a desired height for the menubutton.
If an image or bitmap is being displayed in the menubutton then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in lines of text.
If this option isn't specified, the menubutton's desired height is computed
from the size of the image or bitmap or text being displayed in it.
<P><DT>Command-Line Name: <B><A NAME="M8">-indicatoron</A></B>
<DT>Database Name: <B>indicatorOn</B>
<DT>Database Class: <B>IndicatorOn</B>
<DD>The value must be a proper boolean value. If it is true then
a small indicator rectangle will be displayed on the right side
of the menubutton and the default menu bindings will treat this
as an option menubutton. If false then no indicator will be
displayed.
<P><DT>Command-Line Name: <B><A NAME="M9">-menu</A></B>
<DT>Database Name: <B><A HREF="../TclCmd/menu.htm">menu</A></B>
<DT>Database Class: <B>MenuName</B>
<DD>Specifies the path name of the menu associated with this menubutton.
The menu must be a child of the menubutton.
<P><DT>Command-Line Name: <B><A NAME="M10">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the menubutton: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the menubutton is displayed using the
<B>foreground</B> and <B>background</B> options. The active state is
typically used when the pointer is over the menubutton. In active state
the menubutton is displayed using the <B>activeForeground</B> and
<B>activeBackground</B> options. Disabled state means that the menubutton
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the <B>disabledForeground</B> and
<B>background</B> options determine how the button is displayed.
<P><DT>Command-Line Name: <B><A NAME="M11">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies a desired width for the menubutton.
If an image or bitmap is being displayed in the menubutton then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in characters.
If this option isn't specified, the menubutton's desired width is computed
from the size of the image or bitmap or text being displayed in it.
</DL>
<H3><A NAME="M12">INTRODUCTION</A></H3>
The <B>menubutton</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a menubutton widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the menubutton such as its colors, font,
text, and initial relief. The <B>menubutton</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A menubutton is a widget that displays a textual string, bitmap, or image
and is associated with a menu widget.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the <B>wrapLength</B> option) and
one of the characters may optionally be underlined using the
<B>underline</B> option. In normal usage, pressing
mouse button 1 over the menubutton causes the associated menu to
be posted just underneath the menubutton. If the mouse is moved over
the menu before releasing the mouse button, the button release
causes the underlying menu entry to be invoked. When the button
is released, the menu is unposted.
<P>
Menubuttons are typically organized into groups called menu bars
that allow scanning:
if the mouse button is pressed over one menubutton (causing it
to post its menu) and the mouse is moved over another menubutton
in the same menu bar without releasing the mouse button, then the
menu of the first menubutton is unposted and the menu of the
new menubutton is posted instead.
<P>
There are several interactions between menubuttons and menus; see
the <B><A HREF="../TclCmd/menu.htm">menu</A></B> manual entry for information on various menu configurations,
such as pulldown menus and option menus.
<H3><A NAME="M13">WIDGET COMMAND</A></H3>
The <B>menubutton</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for menubutton widgets:
<P>
<DL>
<P><DT><A NAME="M14"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>menubutton</B>
command.
<P><DT><A NAME="M15"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>menubutton</B>
command.
<P></DL>
<H3><A NAME="M16">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for menubuttons that give them
the following default behavior:
<P>
<DL>
<P><DT>[1]<DD>
A menubutton activates whenever the mouse passes over it and deactivates
whenever the mouse leaves it.
<P><DT>[2]<DD>
Pressing mouse button 1 over a menubutton posts the menubutton:
its relief changes to raised and its associated menu is posted
under the menubutton. If the mouse is dragged down into the menu
with the button still down, and if the mouse button is then
released over an entry in the menu, the menubutton is unposted
and the menu entry is invoked.
<P><DT>[3]<DD>
If button 1 is pressed over a menubutton and then released over that
menubutton, the menubutton stays posted: you can still move the mouse
over the menu and click button 1 on an entry to invoke it.
Once a menu entry has been invoked, the menubutton unposts itself.
<P><DT>[4]<DD>
If button 1 is pressed over a menubutton and then dragged over some
other menubutton, the original menubutton unposts itself and the
new menubutton posts.
<P><DT>[5]<DD>
If button 1 is pressed over a menubutton and released outside
any menubutton or menu, the menubutton unposts without invoking
any menu entry.
<P><DT>[6]<DD>
When a menubutton is posted, its associated menu claims the input
focus to allow keyboard traversal of the menu and its submenus.
See the <B><A HREF="../TclCmd/menu.htm">menu</A></B> manual entry for details on these bindings.
<P><DT>[7]<DD>
If the <B>underline</B> option has been specified for a menubutton
then keyboard traversal may be used to post the menubutton:
Alt+<I>x</I>, where <I>x</I> is the underlined character (or its
lower-case or upper-case equivalent), may be typed in any window
under the menubutton's toplevel to post the menubutton.
<P><DT>[8]<DD>
The F10 key may be typed in any window to post the first menubutton
under its toplevel window that isn't disabled.
<P><DT>[9]<DD>
If a menubutton has the input focus, the space and return keys
post the menubutton.
<P></DL>
<P>
If the menubutton's state is <B>disabled</B> then none of the above
actions occur: the menubutton is completely non-responsive.
<P>
The behavior of menubuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M17">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#menubutton">menubutton</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1997 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

196
hlp/en/tk/message.htm Normal file
View File

@@ -0,0 +1,196 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - message manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="message.htm#M2" NAME="L791">NAME</A>
<DL><DD>message - Create and manipulate message widgets</DL>
<DD><A HREF="message.htm#M3" NAME="L792">SYNOPSIS</A>
<DL>
<DD><B>message</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="message.htm#M4" NAME="L793">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-padx">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text">-text, text, Text</A>
<DD><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-width">-width</A>
</DL>
<DD><A HREF="message.htm#M6" NAME="L795">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="message.htm#M7" NAME="L796">-aspect, aspect, Aspect</A>
<DD><A HREF="message.htm#M8" NAME="L797">-justify, justify, Justify</A>
<DD><A HREF="message.htm#M9" NAME="L798">-width, width, Width</A>
</DL>
<DD><A HREF="message.htm#M10" NAME="L799">DESCRIPTION</A>
<DD><A HREF="message.htm#M11" NAME="L800">WIDGET COMMAND</A>
<DL>
<DD><A HREF="message.htm#M12" NAME="L801"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="message.htm#M13" NAME="L802"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="message.htm#M14" NAME="L803">DEFAULT BINDINGS</A>
<DD><A HREF="message.htm#M15" NAME="L804">BUGS</A>
<DD><A HREF="message.htm#M16" NAME="L805">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
message - Create and manipulate message widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>message</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-padx">-padx, padX, Pad</A></B>
<DT><B><A HREF="options.htm#M-pady">-pady, padY, Pad</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-text">-text, text, Text</A></B>
<DT><B><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A></B>
<DT><B><A HREF="options.htm#M-width">-width</A></B>
</DL>
<H3><A NAME="M6">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M7">-aspect</A></B>
<DT>Database Name: <B>aspect</B>
<DT>Database Class: <B>Aspect</B>
<DD>Specifies a non-negative integer value indicating desired
aspect ratio for the text. The aspect ratio is specified as
100*width/height. 100 means the text should
be as wide as it is tall, 200 means the text should
be twice as wide as it is tall, 50 means the text should
be twice as tall as it is wide, and so on.
Used to choose line length for text if <B>width</B> option
isn't specified.
Defaults to 150.
<P><DT>Command-Line Name: <B><A NAME="M8">-justify</A></B>
<DT>Database Name: <B>justify</B>
<DT>Database Class: <B>Justify</B>
<DD>Specifies how to justify lines of text.
Must be one of <B>left</B>, <B>center</B>, or <B>right</B>. Defaults
to <B>left</B>.
This option works together with the <B>anchor</B>, <B>aspect</B>,
<B>padX</B>, <B>padY</B>, and <B>width</B> options to provide a variety
of arrangements of the text within the window.
The <B>aspect</B> and <B>width</B> options determine the amount of
screen space needed to display the text.
The <B>anchor</B>, <B>padX</B>, and <B>padY</B> options determine where this
rectangular area is displayed within the widget's window, and the
<B>justify</B> option determines how each line is displayed within that
rectangular region.
For example, suppose <B>anchor</B> is <B>e</B> and <B>justify</B> is
<B>left</B>, and that the message window is much larger than needed
for the text.
The the text will displayed so that the left edges of all the lines
line up and the right edge of the longest line is <B>padX</B> from
the right side of the window; the entire text block will be centered
in the vertical span of the window.
<P><DT>Command-Line Name: <B><A NAME="M9">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the length of lines in the window.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option has a value greater than zero then the <B>aspect</B>
option is ignored and the <B>width</B> option determines the line
length.
If this option has a value less than or equal to zero, then
the <B>aspect</B> option determines the line length.
</DL>
<H3><A NAME="M10">DESCRIPTION</A></H3>
The <B>message</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a message widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the message such as its colors, font,
text, and initial relief. The <B>message</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A message is a widget that displays a textual string. A message
widget has three special features. First, it breaks up
its string into lines in order to produce a given aspect ratio
for the window. The line breaks are chosen at word boundaries
wherever possible (if not even a single word would fit on a
line, then the word will be split across lines). Newline characters
in the string will force line breaks; they can be used, for example,
to leave blank lines in the display.
<P>
The second feature of a message widget is justification. The text
may be displayed left-justified (each line starts at the left side of
the window), centered on a line-by-line basis, or right-justified
(each line ends at the right side of the window).
<P>
The third feature of a message widget is that it handles control
characters and non-printing characters specially. Tab characters
are replaced with enough blank space to line up on the next
8-character boundary. Newlines cause line breaks. Other control
characters (ASCII code less than 0x20) and characters not defined
in the font are displayed as a four-character sequence <B>&#92;x</B><I>hh</I> where
<I>hh</I> is the two-digit hexadecimal number corresponding to
the character. In the unusual case where the font doesn't contain
all of the characters in ``0123456789abcdef&#92;x'' then control
characters and undefined characters are not displayed at all.
<H3><A NAME="M11">WIDGET COMMAND</A></H3>
The <B>message</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for message widgets:
<P>
<DL>
<P><DT><A NAME="M12"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>message</B>
command.
<P><DT><A NAME="M13"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>message</B>
command.
<P></DL>
<H3><A NAME="M14">DEFAULT BINDINGS</A></H3>
When a new message is created, it has no default event bindings:
messages are intended for output purposes only.
<H3><A NAME="M15">BUGS</A></H3>
Tabs don't work very well with text that is centered or right-justified.
The most common result is that the line is justified wrong.
<H3><A NAME="M16">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#message">message</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

95
hlp/en/tk/messageBox.htm Normal file
View File

@@ -0,0 +1,95 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_messageBox manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="messageBox.htm#M2" NAME="L806">NAME</A>
<DL><DD>tk_messageBox - pops up a message window and waits for user response.</DL>
<DD><A HREF="messageBox.htm#M3" NAME="L807">SYNOPSIS</A>
<DL>
<DD><B>tk_messageBox </B>?<I>option value ...</I>?
</DL>
<DD><A HREF="messageBox.htm#M4" NAME="L808">DESCRIPTION</A>
<DL>
<DD><A HREF="messageBox.htm#M5" NAME="L809"><B>-default</B> <I>name</I></A>
<DD><A HREF="messageBox.htm#M6" NAME="L810"><B>-icon</B> <I>iconImage</I></A>
<DD><A HREF="messageBox.htm#M7" NAME="L811"><B>-message</B> <I>string</I></A>
<DD><A HREF="messageBox.htm#M8" NAME="L812"><B>-parent</B> <I>window</I></A>
<DD><A HREF="messageBox.htm#M9" NAME="L813"><B>-title</B> <I>titleString</I></A>
<DD><A HREF="messageBox.htm#M10" NAME="L814"><B>-type</B> <I>predefinedType</I></A>
<DL>
<DD><A HREF="messageBox.htm#M11" NAME="L815"><B>abortretryignore</B></A>
<DD><A HREF="messageBox.htm#M12" NAME="L816"><B>ok</B></A>
<DD><A HREF="messageBox.htm#M13" NAME="L817"><B>okcancel</B></A>
<DD><A HREF="messageBox.htm#M14" NAME="L818"><B>retrycancel</B></A>
<DD><A HREF="messageBox.htm#M15" NAME="L819"><B>yesno</B></A>
<DD><A HREF="messageBox.htm#M16" NAME="L820"><B>yesnocancel</B></A>
</DL>
</DL>
<DD><A HREF="messageBox.htm#M17" NAME="L821">EXAMPLE</A>
<DD><A HREF="messageBox.htm#M18" NAME="L822">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
tk_messageBox - pops up a message window and waits for user response.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_messageBox </B>?<I>option value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This procedure creates and displays a message window with an
application-specified message, an icon and a set of buttons. Each of
the buttons in the message window is identified by a unique symbolic
name (see the <B>-type</B> options). After the message window is
popped up, <B>tk_messageBox</B> waits for the user to select one of the
buttons. Then it returns the symbolic name of the selected button.
The following option-value pairs are supported:
<P>
<DL>
<P><DT><A NAME="M5"><B>-default</B> <I>name</I></A><DD>
<I>Name</I> gives the symbolic name of the default button for
this message window ('ok', 'cancel', and so on). See <B>-type</B>
for a list of the symbolic names. If this option is not specified,
the first button in the dialog will be made the default.
<P><DT><A NAME="M6"><B>-icon</B> <I>iconImage</I></A><DD>
Specifies an icon to display. <I>IconImage</I> must be one of the
following: <B><A HREF="../TkCmd/error.htm">error</A></B>, <B><A HREF="../TkCmd/info.htm">info</A></B>, <B>question</B> or
<B>warning</B>. If this option is not specified, then the info icon will be
displayed.
<P><DT><A NAME="M7"><B>-message</B> <I>string</I></A><DD>
Specifies the message to display in this message box.
<P><DT><A NAME="M8"><B>-parent</B> <I>window</I></A><DD>
Makes <I>window</I> the logical parent of the message box. The message
box is displayed on top of its parent window.
<P><DT><A NAME="M9"><B>-title</B> <I>titleString</I></A><DD>
Specifies a string to display as the title of the message box. The
default value is an empty string.
<P><DT><A NAME="M10"><B>-type</B> <I>predefinedType</I></A><DD>
Arranges for a predefined set of buttons to be displayed. The
following values are possible for <I>predefinedType</I>:
<P>
<DL>
<P><DT><A NAME="M11"><B>abortretryignore</B></A><DD>
Displays three buttons whose symbolic names are <B>abort</B>,
<B>retry</B> and <B>ignore</B>.
<P><DT><A NAME="M12"><B>ok</B></A><DD>
Displays one button whose symbolic name is <B>ok</B>.
<P><DT><A NAME="M13"><B>okcancel</B></A><DD>
Displays two buttons whose symbolic names are <B>ok</B> and <B>cancel</B>.
<P><DT><A NAME="M14"><B>retrycancel</B></A><DD>
Displays two buttons whose symbolic names are <B>retry</B> and <B>cancel</B>.
<P><DT><A NAME="M15"><B>yesno</B></A><DD>
Displays two buttons whose symbolic names are <B>yes</B> and <B>no</B>.
<P><DT><A NAME="M16"><B>yesnocancel</B></A><DD>
Displays three buttons whose symbolic names are <B>yes</B>, <B>no</B>
and <B>cancel</B>.
<P></DL>
<P></DL>
<P>
<H3><A NAME="M17">EXAMPLE</A></H3>
<PRE>set answer [tk_messageBox -message &quot;Really quit?&quot; -type yesno -icon question]
switch -- $answer {
yes exit
no {tk_messageBox -message &quot;I know you like this application!&quot; -type ok}
}</PRE>
<H3><A NAME="M18">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#message box">message box</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

96
hlp/en/tk/option.htm Normal file
View File

@@ -0,0 +1,96 @@
<HTML><HEAD><TITLE>Built-In Commands - option manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="option.htm#M2" NAME="L823">NAME</A>
<DL><DD>option - Add/retrieve window options to/from the option database</DL>
<DD><A HREF="option.htm#M3" NAME="L824">SYNOPSIS</A>
<DL>
<DD><B>option add </B><I>pattern value </I>?<I>priority</I>?
<DD><B>option clear</B>
<DD><B>option get </B><I>window name class</I>
<DD><B>option readfile </B><I>fileName </I>?<I>priority</I>?
</DL>
<DD><A HREF="option.htm#M4" NAME="L825">DESCRIPTION</A>
<DL>
<DD><A HREF="option.htm#M5" NAME="L826"><B>widgetDefault</B></A>
<DD><A HREF="option.htm#M6" NAME="L827"><B>startupFile</B></A>
<DD><A HREF="option.htm#M7" NAME="L828"><B>userDefault</B></A>
<DD><A HREF="option.htm#M8" NAME="L829"><B>interactive</B></A>
</DL>
<DD><A HREF="option.htm#M9" NAME="L830">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
option - Add/retrieve window options to/from the option database
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>option add </B><I>pattern value </I>?<I>priority</I>?<BR>
<B>option clear</B><BR>
<B>option get </B><I>window name class</I><BR>
<B>option readfile </B><I>fileName </I>?<I>priority</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>option</B> command allows you to add entries to the Tk option
database or to retrieve options from the database. The <B>add</B>
form of the command adds a new option to the database.
<I>Pattern</I> contains
the option being specified, and consists of names and/or classes
separated by asterisks or dots, in the usual X format. <I>Value</I>
contains a text string to associate with <I>pattern</I>; this is the
value that will be returned in calls to <B><A HREF="../TclLib/GetOption.htm">Tk_GetOption</A></B> or by
invocations of the <B>option get</B> command. If <I>priority</I>
is specified, it indicates the priority level for this option (see
below for legal values); it defaults to <B>interactive</B>.
This command always returns an empty string.
<P>
The <B>option clear</B> command clears the option database. Default
options (from the
<B>RESOURCE_MANAGER</B> property or the <B>.Xdefaults</B>
file) will be reloaded automatically the next time an
option is added to the database or removed from it. This command
always returns an empty string.
<P>
The <B>option get</B> command returns the value of the option
specified for <I>window</I>
under <I>name</I> and <I>class</I>. If several entries in the option
database match <I>window</I>, <I>name</I>, and <I>class</I>, then
the command returns whichever was created with highest
<I>priority</I> level. If there are several matching
entries at the same priority level, then it returns whichever entry
was most recently entered into the option database. If there are
no matching entries, then the empty string is returned.
<P>
The <B>readfile</B> form of the command reads <I>fileName</I>,
which should have the standard format for an
X resource database such as <B>.Xdefaults</B>, and adds all the
options specified in that file to the option database. If <I>priority</I>
is specified, it indicates the priority level at which to enter the
options; <I>priority</I> defaults to <B>interactive</B>.
<P>
The <I>priority</I> arguments to the <B>option</B> command are
normally specified symbolically using one of the following values:
<P>
<DL>
<P><DT><A NAME="M5"><B>widgetDefault</B></A><DD>
Level 20. Used for default values hard-coded into widgets.
<P><DT><A NAME="M6"><B>startupFile</B></A><DD>
Level 40. Used for options specified in application-specific
startup files.
<P><DT><A NAME="M7"><B>userDefault</B></A><DD>
Level 60. Used for options specified in user-specific defaults
files, such as <B>.Xdefaults</B>, resource databases loaded into
the X server, or user-specific startup files.
<P><DT><A NAME="M8"><B>interactive</B></A><DD>
Level 80. Used for options specified interactively after the application
starts running. If <I>priority</I> isn't specified, it defaults to
this level.
<P></DL>
<P>
Any of the above keywords may be abbreviated. In addition, priorities
may be specified numerically using integers between 0 and 100,
inclusive. The numeric form is probably a bad idea except for new priority
levels other than the ones given above.
<H3><A NAME="M9">KEYWORDS</A></H3>
<A href="../Keywords/D.htm#database">database</A>, <A href="../Keywords/O.htm#option">option</A>, <A href="../Keywords/P.htm#priority">priority</A>, <A href="../Keywords/R.htm#retrieve">retrieve</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

30
hlp/en/tk/optionMenu.htm Normal file
View File

@@ -0,0 +1,30 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_optionMenu manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tk_optionMenu - Create an option menubutton and its menu
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_optionMenu </B><I>w varName value </I>?<I>value value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This procedure creates an option menubutton whose name is <I>w</I>,
plus an associated menu.
Together they allow the user to select one of the values
given by the <I>value</I> arguments.
The current value will be stored in the global variable whose
name is given by <I>varName</I> and it will also be displayed as the label
in the option menubutton.
The user can click on the menubutton to display a menu containing
all of the <I>value</I>s and thereby select a new value.
Once a new value is selected, it will be stored in the variable
and appear in the option menubutton.
The current value can also be changed by setting the variable.
<P>
The return value from <B>tk_optionMenu</B> is the name of the menu
associated with <I>w</I>, so that the caller can change its configuration
options or manipulate it in other ways.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/O.htm#option menu">option menu</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

453
hlp/en/tk/options.htm Normal file
View File

@@ -0,0 +1,453 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - options manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="options.htm#M2" NAME="L2">NAME</A>
<DL><DD>options - Standard options supported by widgets</DL>
<DD><A HREF="options.htm#M3" NAME="L3">DESCRIPTION</A>
<DL>
<DD><A HREF="options.htm#M-activebackground" NAME="L4">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-activeborderwidth" NAME="L5">-activeborderwidth, activeBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-activeforeground" NAME="L6">-activeforeground, activeForeground, Background</A>
<DD><A HREF="options.htm#M-anchor" NAME="L7">-anchor, anchor, Anchor</A>
<DD><A HREF="options.htm#M-background" NAME="L8">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-bitmap" NAME="L9">-bitmap, bitmap, Bitmap</A>
<DD><A HREF="options.htm#M-borderwidth" NAME="L10">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor" NAME="L11">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-disabledforeground" NAME="L12">-disabledforeground, disabledForeground, DisabledForeground</A>
<DD><A HREF="options.htm#M-exportselection" NAME="L13">-exportselection, exportSelection, ExportSelection</A>
<DD><A HREF="options.htm#M-font" NAME="L14">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground" NAME="L15">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground" NAME="L16">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor" NAME="L17">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness" NAME="L18">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-image" NAME="L19">-image, image, Image</A>
<DD><A HREF="options.htm#M-insertbackground" NAME="L20">-insertbackground, insertBackground, Foreground</A>
<DD><A HREF="options.htm#M-insertborderwidth" NAME="L21">-insertborderwidth, insertBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-insertofftime" NAME="L22">-insertofftime, insertOffTime, OffTime</A>
<DD><A HREF="options.htm#M-insertontime" NAME="L23">-insertontime, insertOnTime, OnTime</A>
<DD><A HREF="options.htm#M-insertwidth" NAME="L24">-insertwidth, insertWidth, InsertWidth</A>
<DD><A HREF="options.htm#M-jump" NAME="L25">-jump, jump, Jump</A>
<DD><A HREF="options.htm#M-justify" NAME="L26">-justify, justify, Justify</A>
<DD><A HREF="options.htm#M-orient" NAME="L27">-orient, orient, Orient</A>
<DD><A HREF="options.htm#M-padx" NAME="L28">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady" NAME="L29">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief" NAME="L30">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-repeatdelay" NAME="L31">-repeatdelay, repeatDelay, RepeatDelay</A>
<DD><A HREF="options.htm#M-repeatinterval" NAME="L32">-repeatinterval, repeatInterval, RepeatInterval</A>
<DD><A HREF="options.htm#M-selectbackground" NAME="L33">-selectbackground, selectBackground, Foreground</A>
<DD><A HREF="options.htm#M-selectborderwidth" NAME="L34">-selectborderwidth, selectBorderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-selectforeground" NAME="L35">-selectforeground, selectForeground, Background</A>
<DD><A HREF="options.htm#M-setgrid" NAME="L36">-setgrid, setGrid, SetGrid</A>
<DD><A HREF="options.htm#M-takefocus" NAME="L37">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text" NAME="L38">-text, text, Text</A>
<DD><A HREF="options.htm#M-textvariable" NAME="L39">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-troughcolor" NAME="L40">-troughcolor, troughColor, Background</A>
<DD><A HREF="options.htm#M-underline" NAME="L41">-underline, underline, Underline</A>
<DD><A HREF="options.htm#M-wraplength" NAME="L42">-wraplength, wrapLength, WrapLength</A>
<DD><A HREF="options.htm#M-xscrollcommand" NAME="L43">-xscrollcommand, xScrollCommand, ScrollCommand</A>
<DD><A HREF="options.htm#M-yscrollcommand" NAME="L44">-yscrollcommand, yScrollCommand, ScrollCommand</A>
</DL>
<DD><A HREF="options.htm#M4" NAME="L45">SEE ALSO</A>
<DD><A HREF="options.htm#M5" NAME="L46">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
options - Standard options supported by widgets
<H3><A NAME="M3">DESCRIPTION</A></H3>
This manual entry describes the common configuration options supported
by widgets in the Tk toolkit. Every widget does not necessarily support
every option (see the manual entries for individual widgets for a list
of the standard options supported by that widget), but if a widget does
support an option with one of the names listed below, then the option
has exactly the effect described below.
<P>
In the descriptions below, ``Command-Line Name'' refers to the
switch used in class commands and <B>configure</B> widget commands to
set this value. For example, if an option's command-line switch is
<B>-foreground</B> and there exists a widget <B>.a.b.c</B>, then the
command
<PRE><B>.a.b.c configure -foreground black</B></PRE>
may be used to specify the value <B>black</B> for the option in the
the widget <B>.a.b.c</B>. Command-line switches may be abbreviated,
as long as the abbreviation is unambiguous.
``Database Name'' refers to the option's name in the option database (e.g.
in .Xdefaults files). ``Database Class'' refers to the option's class value
in the option database.
<DL>
<DT>Command-Line Name: <B><A NAME="M-activebackground">-activebackground</A></B>
<DT>Database Name: <B>activeBackground</B>
<DT>Database Class: <B>Foreground</B>
<DD>Specifies background color to use when drawing active elements.
An element (a widget or portion of a widget) is active if the
mouse cursor is positioned over the element and pressing a mouse button
will cause some action to occur.
If strict Motif compliance has been requested by setting the
<B>tk_strictMotif</B> variable, this option will normally be
ignored; the normal background color will be used instead.
For some elements on Windows and Macintosh systems, the active color
will only be used while mouse button 1 is pressed over the element.
<P><DT>Command-Line Name: <B><A NAME="M-activeborderwidth">-activeborderwidth</A></B>
<DT>Database Name: <B>activeBorderWidth</B>
<DT>Database Class: <B>BorderWidth</B>
<DD>Specifies a non-negative value indicating
the width of the 3-D border drawn around active elements. See above for
definition of active elements.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
This option is typically only available in widgets displaying more
than one element at a time (e.g. menus but not buttons).
<P><DT>Command-Line Name: <B><A NAME="M-activeforeground">-activeforeground</A></B>
<DT>Database Name: <B>activeForeground</B>
<DT>Database Class: <B>Background</B>
<DD>Specifies foreground color to use when drawing active elements.
See above for definition of active elements.
<P><DT>Command-Line Name: <B><A NAME="M-anchor">-anchor</A></B>
<DT>Database Name: <B>anchor</B>
<DT>Database Class: <B>Anchor</B>
<DD>Specifies how the information in a widget (e.g. text or a bitmap)
is to be displayed in the widget.
Must be one of the values <B>n</B>, <B>ne</B>, <B>e</B>, <B>se</B>,
<B>s</B>, <B>sw</B>, <B>w</B>, <B>nw</B>, or <B>center</B>.
For example, <B>nw</B> means display the information such that its
top-left corner is at the top-left corner of the widget.
<P><DT>Command-Line Name: <B><A NAME="M-background">-background or -bg</A></B>
<DT>Database Name: <B>background</B>
<DT>Database Class: <B>Background</B>
<DD>Specifies the normal background color to use when displaying the
widget.
<P><DT>Command-Line Name: <B><A NAME="M-bitmap">-bitmap</A></B>
<DT>Database Name: <B>bitmap</B>
<DT>Database Class: <B>Bitmap</B>
<DD>Specifies a bitmap to display in the widget, in any of the forms
acceptable to <B><A HREF="../TclLib/GetBitmap.htm">Tk_GetBitmap</A></B>.
The exact way in which the bitmap is displayed may be affected by
other options such as <B>anchor</B> or <B>justify</B>.
Typically, if this option is specified then it overrides other
options that specify a textual value to display in the widget;
the <B>bitmap</B> option may be reset to an empty string to re-enable
a text display.
In widgets that support both <B>bitmap</B> and <B>image</B> options,
<B>image</B> will usually override <B>bitmap</B>.
<P><DT>Command-Line Name: <B><A NAME="M-borderwidth">-borderwidth or -bd</A></B>
<DT>Database Name: <B>borderWidth</B>
<DT>Database Class: <B>BorderWidth</B>
<DD>Specifies a non-negative value indicating the width
of the 3-D border to draw around the outside of the widget (if such a
border is being drawn; the <B>relief</B> option typically determines
this). The value may also be used when drawing 3-D effects in the
interior of the widget.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
<P><DT>Command-Line Name: <B><A NAME="M-cursor">-cursor</A></B>
<DT>Database Name: <B>cursor</B>
<DT>Database Class: <B>Cursor</B>
<DD>Specifies the mouse cursor to be used for the widget.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetCursor.htm">Tk_GetCursor</A></B>.
<P><DT>Command-Line Name: <B><A NAME="M-disabledforeground">-disabledforeground</A></B>
<DT>Database Name: <B>disabledForeground</B>
<DT>Database Class: <B>DisabledForeground</B>
<DD>Specifies foreground color to use when drawing a disabled element.
If the option is specified as an empty string (which is typically the
case on monochrome displays), disabled elements are drawn with the
normal foreground color but they are dimmed by drawing them
with a stippled fill pattern.
<P><DT>Command-Line Name: <B><A NAME="M-exportselection">-exportselection</A></B>
<DT>Database Name: <B>exportSelection</B>
<DT>Database Class: <B>ExportSelection</B>
<DD>Specifies whether or not a selection in the widget should also be
the X selection.
The value may have any of the forms accepted by <B><A HREF="../TkLib/GetInt.htm">Tcl_GetBoolean</A></B>,
such as <B>true</B>, <B>false</B>, <B>0</B>, <B>1</B>, <B>yes</B>, or <B>no</B>.
If the selection is exported, then selecting in the widget deselects
the current X selection, selecting outside the widget deselects any
widget selection, and the widget will respond to selection retrieval
requests when it has a selection. The default is usually for widgets
to export selections.
<P><DT>Command-Line Name: <B><A NAME="M-font">-font</A></B>
<DT>Database Name: <B><A HREF="../TclCmd/font.htm">font</A></B>
<DT>Database Class: <B><A HREF="../TclCmd/font.htm">Font</A></B>
<DD>Specifies the font to use when drawing text inside the widget.
The value may have any of the forms accepted by <B><A HREF="../TclLib/GetFont.htm">Tk_GetFont</A></B>.
<P><DT>Command-Line Name: <B><A NAME="M-foreground">-foreground or -fg</A></B>
<DT>Database Name: <B>foreground</B>
<DT>Database Class: <B>Foreground</B>
<DD>Specifies the normal foreground color to use when displaying the widget.
<P><DT>Command-Line Name: <B><A NAME="M-highlightbackground">-highlightbackground</A></B>
<DT>Database Name: <B>highlightBackground</B>
<DT>Database Class: <B>HighlightBackground</B>
<DD>Specifies the color to display in the traversal highlight region when
the widget does not have the input focus.
<P><DT>Command-Line Name: <B><A NAME="M-highlightcolor">-highlightcolor</A></B>
<DT>Database Name: <B>highlightColor</B>
<DT>Database Class: <B>HighlightColor</B>
<DD>Specifies the color to use for the traversal highlight rectangle that is
drawn around the widget when it has the input focus.
<P><DT>Command-Line Name: <B><A NAME="M-highlightthickness">-highlightthickness</A></B>
<DT>Database Name: <B>highlightThickness</B>
<DT>Database Class: <B>HighlightThickness</B>
<DD>Specifies a non-negative value indicating the width of the highlight
rectangle to draw around the outside of the widget when it has the
input focus.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If the value is zero, no focus highlight is drawn around the widget.
<P><DT>Command-Line Name: <B><A NAME="M-image">-image</A></B>
<DT>Database Name: <B>image</B>
<DT>Database Class: <B>Image</B>
<DD>Specifies an image to display in the widget, which must have been
created with the <B><A HREF="../TclCmd/image.htm">image create</A></B> command.
Typically, if the <B>image</B> option is specified then it overrides other
options that specify a bitmap or textual value to display in the widget;
the <B>image</B> option may be reset to an empty string to re-enable
a bitmap or text display.
<P><DT>Command-Line Name: <B><A NAME="M-insertbackground">-insertbackground</A></B>
<DT>Database Name: <B>insertBackground</B>
<DT>Database Class: <B>Foreground</B>
<DD>Specifies the color to use as background in the area covered by the
insertion cursor. This color will normally override either the normal
background for the widget (or the selection background if the insertion
cursor happens to fall in the selection).
<P><DT>Command-Line Name: <B><A NAME="M-insertborderwidth">-insertborderwidth</A></B>
<DT>Database Name: <B>insertBorderWidth</B>
<DT>Database Class: <B>BorderWidth</B>
<DD>Specifies a non-negative value indicating the width
of the 3-D border to draw around the insertion cursor.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
<P><DT>Command-Line Name: <B><A NAME="M-insertofftime">-insertofftime</A></B>
<DT>Database Name: <B>insertOffTime</B>
<DT>Database Class: <B>OffTime</B>
<DD>Specifies a non-negative integer value indicating the number of
milliseconds the insertion cursor should remain ``off'' in each blink cycle.
If this option is zero then the cursor doesn't blink: it is on
all the time.
<P><DT>Command-Line Name: <B><A NAME="M-insertontime">-insertontime</A></B>
<DT>Database Name: <B>insertOnTime</B>
<DT>Database Class: <B>OnTime</B>
<DD>Specifies a non-negative integer value indicating the number of
milliseconds the insertion cursor should remain ``on'' in each blink cycle.
<P><DT>Command-Line Name: <B><A NAME="M-insertwidth">-insertwidth</A></B>
<DT>Database Name: <B>insertWidth</B>
<DT>Database Class: <B>InsertWidth</B>
<DD>Specifies a value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If a border has been specified for the insertion
cursor (using the <B>insertBorderWidth</B> option), the border
will be drawn inside the width specified by the <B>insertWidth</B>
option.
<P><DT>Command-Line Name: <B><A NAME="M-jump">-jump</A></B>
<DT>Database Name: <B>jump</B>
<DT>Database Class: <B>Jump</B>
<DD>For widgets with a slider that can be dragged to adjust a value,
such as scrollbars, this option determines when
notifications are made about changes in the value.
The option's value must be a boolean of the form accepted by
<B><A HREF="../TkLib/GetInt.htm">Tcl_GetBoolean</A></B>.
If the value is false, updates are made continuously as the
slider is dragged.
If the value is true, updates are delayed until the mouse button
is released to end the drag; at that point a single notification
is made (the value ``jumps'' rather than changing smoothly).
<P><DT>Command-Line Name: <B><A NAME="M-justify">-justify</A></B>
<DT>Database Name: <B>justify</B>
<DT>Database Class: <B>Justify</B>
<DD>When there are multiple lines of text displayed in a widget, this
option determines how the lines line up with each other.
Must be one of <B>left</B>, <B>center</B>, or <B>right</B>.
<B>Left</B> means that the lines' left edges all line up, <B>center</B>
means that the lines' centers are aligned, and <B>right</B> means
that the lines' right edges line up.
<P><DT>Command-Line Name: <B><A NAME="M-orient">-orient</A></B>
<DT>Database Name: <B>orient</B>
<DT>Database Class: <B>Orient</B>
<DD>For widgets that can lay themselves out with either a horizontal
or vertical orientation, such as scrollbars, this option specifies
which orientation should be used. Must be either <B>horizontal</B>
or <B>vertical</B> or an abbreviation of one of these.
<P><DT>Command-Line Name: <B><A NAME="M-padx">-padx</A></B>
<DT>Database Name: <B>padX</B>
<DT>Database Class: <B>Pad</B>
<DD>Specifies a non-negative value indicating how much extra space
to request for the widget in the X-direction.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
When computing how large a window it needs, the widget will
add this amount to the width it would normally need (as determined
by the width of the things displayed in the widget); if the geometry
manager can satisfy this request, the widget will end up with extra
internal space to the left and/or right of what it displays inside.
Most widgets only use this option for padding text: if they are
displaying a bitmap or image, then they usually ignore padding
options.
<P><DT>Command-Line Name: <B><A NAME="M-pady">-pady</A></B>
<DT>Database Name: <B>padY</B>
<DT>Database Class: <B>Pad</B>
<DD>Specifies a non-negative value indicating how much extra space
to request for the widget in the Y-direction.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
When computing how large a window it needs, the widget will add
this amount to the height it would normally need (as determined by
the height of the things displayed in the widget); if the geometry
manager can satisfy this request, the widget will end up with extra
internal space above and/or below what it displays inside.
Most widgets only use this option for padding text: if they are
displaying a bitmap or image, then they usually ignore padding
options.
<P><DT>Command-Line Name: <B><A NAME="M-relief">-relief</A></B>
<DT>Database Name: <B>relief</B>
<DT>Database Class: <B>Relief</B>
<DD>Specifies the 3-D effect desired for the widget. Acceptable
values are <B>raised</B>, <B>sunken</B>, <B>flat</B>, <B>ridge</B>,
<B>solid</B>, and <B>groove</B>.
The value
indicates how the interior of the widget should appear relative
to its exterior; for example, <B>raised</B> means the interior of
the widget should appear to protrude from the screen, relative to
the exterior of the widget.
<P><DT>Command-Line Name: <B><A NAME="M-repeatdelay">-repeatdelay</A></B>
<DT>Database Name: <B>repeatDelay</B>
<DT>Database Class: <B>RepeatDelay</B>
<DD>Specifies the number of milliseconds a button or key must be held
down before it begins to auto-repeat. Used, for example, on the
up- and down-arrows in scrollbars.
<P><DT>Command-Line Name: <B><A NAME="M-repeatinterval">-repeatinterval</A></B>
<DT>Database Name: <B>repeatInterval</B>
<DT>Database Class: <B>RepeatInterval</B>
<DD>Used in conjunction with <B>repeatDelay</B>: once auto-repeat
begins, this option determines the number of milliseconds between
auto-repeats.
<P><DT>Command-Line Name: <B><A NAME="M-selectbackground">-selectbackground</A></B>
<DT>Database Name: <B>selectBackground</B>
<DT>Database Class: <B>Foreground</B>
<DD>Specifies the background color to use when displaying selected
items.
<P><DT>Command-Line Name: <B><A NAME="M-selectborderwidth">-selectborderwidth</A></B>
<DT>Database Name: <B>selectBorderWidth</B>
<DT>Database Class: <B>BorderWidth</B>
<DD>Specifies a non-negative value indicating the width
of the 3-D border to draw around selected items.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
<P><DT>Command-Line Name: <B><A NAME="M-selectforeground">-selectforeground</A></B>
<DT>Database Name: <B>selectForeground</B>
<DT>Database Class: <B>Background</B>
<DD>Specifies the foreground color to use when displaying selected
items.
<P><DT>Command-Line Name: <B><A NAME="M-setgrid">-setgrid</A></B>
<DT>Database Name: <B>setGrid</B>
<DT>Database Class: <B>SetGrid</B>
<DD>Specifies a boolean value that determines whether this widget controls the
resizing grid for its top-level window.
This option is typically used in text widgets, where the information
in the widget has a natural size (the size of a character) and it makes
sense for the window's dimensions to be integral numbers of these units.
These natural window sizes form a grid.
If the <B>setGrid</B> option is set to true then the widget will
communicate with the window manager so that when the user interactively
resizes the top-level window that contains the widget, the dimensions of
the window will be displayed to the user in grid units and the window
size will be constrained to integral numbers of grid units.
See the section GRIDDED GEOMETRY MANAGEMENT in the <B><A HREF="../TclCmd/wm.htm">wm</A></B> manual
entry for more details.
<P><DT>Command-Line Name: <B><A NAME="M-takefocus">-takefocus</A></B>
<DT>Database Name: <B>takeFocus</B>
<DT>Database Class: <B>TakeFocus</B>
<DD>Determines whether the window accepts the focus during keyboard
traversal (e.g., Tab and Shift-Tab).
Before setting the focus to a window, the traversal scripts
consult the value of the <B>takeFocus</B> option.
A value of <B>0</B> means that the window should be skipped entirely
during keyboard traversal.
<B>1</B> means that the window should receive the input
focus as long as it is viewable (it and all of its ancestors are mapped).
An empty value for the option means that the traversal scripts make
the decision about whether or not to focus on the window: the current
algorithm is to skip the window if it is
disabled, if it has no key bindings, or if it is not viewable.
If the value has any other form, then the traversal scripts take
the value, append the name of the window to it (with a separator space),
and evaluate the resulting string as a Tcl script.
The script must return <B>0</B>, <B>1</B>, or an empty string: a
<B>0</B> or <B>1</B> value specifies whether the window will receive
the input focus, and an empty string results in the default decision
described above.
Note: this interpretation of the option is defined entirely by
the Tcl scripts that implement traversal: the widget implementations
ignore the option entirely, so you can change its meaning if you
redefine the keyboard traversal scripts.
<P><DT>Command-Line Name: <B><A NAME="M-text">-text</A></B>
<DT>Database Name: <B><A HREF="../TclCmd/text.htm">text</A></B>
<DT>Database Class: <B><A HREF="../TclCmd/text.htm">Text</A></B>
<DD>Specifies a string to be displayed inside the widget. The way in which
the string is displayed depends on the particular widget and may be
determined by other options, such as <B>anchor</B> or <B>justify</B>.
<P><DT>Command-Line Name: <B><A NAME="M-textvariable">-textvariable</A></B>
<DT>Database Name: <B>textVariable</B>
<DT>Database Class: <B><A HREF="../TkCmd/variable.htm">Variable</A></B>
<DD>Specifies the name of a variable. The value of the variable is a text
string to be displayed inside the widget; if the variable value changes
then the widget will automatically update itself to reflect the new value.
The way in which the string is displayed in the widget depends on the
particular widget and may be determined by other options, such as
<B>anchor</B> or <B>justify</B>.
<P><DT>Command-Line Name: <B><A NAME="M-troughcolor">-troughcolor</A></B>
<DT>Database Name: <B>troughColor</B>
<DT>Database Class: <B>Background</B>
<DD>Specifies the color to use for the rectangular trough areas
in widgets such as scrollbars and scales. This option is ignored for
scrollbars on Windows (native widget doesn't recognize this option).
<P><DT>Command-Line Name: <B><A NAME="M-underline">-underline</A></B>
<DT>Database Name: <B>underline</B>
<DT>Database Class: <B>Underline</B>
<DD>Specifies the integer index of a character to underline in the widget.
This option is used by the default bindings to implement keyboard
traversal for menu buttons and menu entries.
0 corresponds to the first character of the text displayed in the
widget, 1 to the next character, and so on.
<P><DT>Command-Line Name: <B><A NAME="M-wraplength">-wraplength</A></B>
<DT>Database Name: <B>wrapLength</B>
<DT>Database Class: <B>WrapLength</B>
<DD>For widgets that can perform word-wrapping, this option specifies
the maximum line length.
Lines that would exceed this length are wrapped onto the next line,
so that no line is longer than the specified length.
The value may be specified in any of the standard forms for
screen distances.
If this value is less than or equal to 0 then no wrapping is done: lines
will break only at newline characters in the text.
<P><DT>Command-Line Name: <B><A NAME="M-xscrollcommand">-xscrollcommand</A></B>
<DT>Database Name: <B>xScrollCommand</B>
<DT>Database Class: <B>ScrollCommand</B>
<DD>Specifies the prefix for a command used to communicate with horizontal
scrollbars.
When the view in the widget's window changes (or
whenever anything else occurs that could change the display in a
scrollbar, such as a change in the total size of the widget's
contents), the widget will
generate a Tcl command by concatenating the scroll command and
two numbers.
Each of the numbers is a fraction between 0 and 1, which indicates
a position in the document. 0 indicates the beginning of the document,
1 indicates the end, .333 indicates a position one third the way through
the document, and so on.
The first fraction indicates the first information in the document
that is visible in the window, and the second fraction indicates
the information just after the last portion that is visible.
The command is
then passed to the Tcl interpreter for execution. Typically the
<B>xScrollCommand</B> option consists of the path name of a scrollbar
widget followed by ``set'', e.g. ``.x.scrollbar set'': this will cause
the scrollbar to be updated whenever the view in the window changes.
If this option is not specified, then no command will be executed.
<P><DT>Command-Line Name: <B><A NAME="M-yscrollcommand">-yscrollcommand</A></B>
<DT>Database Name: <B>yScrollCommand</B>
<DT>Database Class: <B>ScrollCommand</B>
<DD>Specifies the prefix for a command used to communicate with vertical
scrollbars. This option is treated in the same way as the
<B>xScrollCommand</B> option, except that it is used for vertical
scrollbars and is provided by widgets that support vertical scrolling.
See the description of <B>xScrollCommand</B> for details
on how this option is used.
</DL>
<H3><A NAME="M4">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/colors.htm">colors</A></B>, <B><A HREF="../TclCmd/cursors.htm">cursors</A></B>, <B><A HREF="../TclCmd/font.htm">font</A></B>
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#class">class</A>, <A href="../Keywords/N.htm#name">name</A>, <A href="../Keywords/S.htm#standard option">standard option</A>, <A href="../Keywords/S.htm#switch">switch</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

281
hlp/en/tk/pack.htm Normal file
View File

@@ -0,0 +1,281 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - pack manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="pack.htm#M2" NAME="L835">NAME</A>
<DL><DD>pack - Geometry manager that packs around edges of cavity</DL>
<DD><A HREF="pack.htm#M3" NAME="L836">SYNOPSIS</A>
<DL>
<DD><B>pack </B><I>option arg </I>?<I>arg ...</I>?
</DL>
<DD><A HREF="pack.htm#M4" NAME="L837">DESCRIPTION</A>
<DL>
<DD><A HREF="pack.htm#M5" NAME="L838"><B>pack </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A>
<DD><A HREF="pack.htm#M6" NAME="L839"><B>pack configure </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A>
<DL>
<DD><A HREF="pack.htm#M7" NAME="L840"><B>-after </B><I>other</I></A>
<DD><A HREF="pack.htm#M8" NAME="L841"><B>-anchor </B><I>anchor</I></A>
<DD><A HREF="pack.htm#M9" NAME="L842"><B>-before </B><I>other</I></A>
<DD><A HREF="pack.htm#M10" NAME="L843"><B>-expand </B><I>boolean</I></A>
<DD><A HREF="pack.htm#M11" NAME="L844"><B>-fill </B><I>style</I></A>
<DL>
<DD><A HREF="pack.htm#M12" NAME="L845"><B>none</B></A>
<DD><A HREF="pack.htm#M13" NAME="L846"><B>x</B></A>
<DD><A HREF="pack.htm#M14" NAME="L847"><B>y</B></A>
<DD><A HREF="pack.htm#M15" NAME="L848"><B>both</B></A>
</DL>
<DD><A HREF="pack.htm#M16" NAME="L849"><B>-in </B><I>other</I></A>
<DD><A HREF="pack.htm#M17" NAME="L850"><B>-ipadx </B><I>amount</I></A>
<DD><A HREF="pack.htm#M18" NAME="L851"><B>-ipady </B><I>amount</I></A>
<DD><A HREF="pack.htm#M19" NAME="L852"><B>-padx </B><I>amount</I></A>
<DD><A HREF="pack.htm#M20" NAME="L853"><B>-pady </B><I>amount</I></A>
<DD><A HREF="pack.htm#M21" NAME="L854"><B>-side </B><I>side</I></A>
</DL>
<DD><A HREF="pack.htm#M22" NAME="L855"><B>pack forget </B><I>slave </I>?<I>slave ...</I>?</A>
<DD><A HREF="pack.htm#M23" NAME="L856"><B>pack info </B><I>slave</I></A>
<DD><A HREF="pack.htm#M24" NAME="L857"><B>pack propagate </B><I>master</I> ?<I>boolean</I>?</A>
<DD><A HREF="pack.htm#M25" NAME="L858"><B>pack slaves </B><I>master</I></A>
</DL>
<DD><A HREF="pack.htm#M26" NAME="L859">THE PACKER ALGORITHM</A>
<DL>
</DL>
<DD><A HREF="pack.htm#M27" NAME="L860">EXPANSION</A>
<DD><A HREF="pack.htm#M28" NAME="L861">GEOMETRY PROPAGATION</A>
<DD><A HREF="pack.htm#M29" NAME="L862">RESTRICTIONS ON MASTER WINDOWS</A>
<DD><A HREF="pack.htm#M30" NAME="L863">PACKING ORDER</A>
<DD><A HREF="pack.htm#M31" NAME="L864">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
pack - Geometry manager that packs around edges of cavity
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>pack </B><I>option arg </I>?<I>arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>pack</B> command is used to communicate with the packer,
a geometry manager that arranges the children of a parent by
packing them in order around the edges of the parent.
The <B>pack</B> command can have any of several forms, depending
on the <I>option</I> argument:
<P>
<DL>
<P><DT><A NAME="M5"><B>pack </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A><DD>
If the first argument to <B>pack</B> is a window name (any value
starting with ``.''), then the command is processed in the same
way as <B>pack configure</B>.
<P><DT><A NAME="M6"><B>pack configure </B><I>slave </I>?<I>slave ...</I>? ?<I>options</I>?</A><DD>
The arguments consist of the names of one or more slave windows
followed by pairs of arguments that specify how
to manage the slaves.
See ``THE PACKER ALGORITHM'' below for details on how the options
are used by the packer.
The following options are supported:
<P>
<DL>
<P><DT><A NAME="M7"><B>-after </B><I>other</I></A><DD>
<I>Other</I> must the name of another window.
Use its master as the master for the slaves, and insert
the slaves just after <I>other</I> in the packing order.
<P><DT><A NAME="M8"><B>-anchor </B><I>anchor</I></A><DD>
<I>Anchor</I> must be a valid anchor position such as <B>n</B>
or <B>sw</B>; it specifies where to position each slave in its
parcel.
Defaults to <B>center</B>.
<P><DT><A NAME="M9"><B>-before </B><I>other</I></A><DD>
<I>Other</I> must the name of another window.
Use its master as the master for the slaves, and insert
the slaves just before <I>other</I> in the packing order.
<P><DT><A NAME="M10"><B>-expand </B><I>boolean</I></A><DD>
Specifies whether the slaves should be expanded to consume
extra space in their master.
<I>Boolean</I> may have any proper boolean value, such as <B>1</B>
or <B>no</B>.
Defaults to 0.
<P><DT><A NAME="M11"><B>-fill </B><I>style</I></A><DD>
If a slave's parcel is larger than its requested dimensions, this
option may be used to stretch the slave.
<I>Style</I> must have one of the following values:
<P>
<DL>
<P><DT><A NAME="M12"><B>none</B></A><DD>
Give the slave its requested dimensions plus any internal padding
requested with <B>-ipadx</B> or <B>-ipady</B>. This is the default.
<P><DT><A NAME="M13"><B>x</B></A><DD>
Stretch the slave horizontally to fill the entire width of its
parcel (except leave external padding as specified by <B>-padx</B>).
<P><DT><A NAME="M14"><B>y</B></A><DD>
Stretch the slave vertically to fill the entire height of its
parcel (except leave external padding as specified by <B>-pady</B>).
<P><DT><A NAME="M15"><B>both</B></A><DD>
Stretch the slave both horizontally and vertically.
<P></DL>
<P><DT><A NAME="M16"><B>-in </B><I>other</I></A><DD>
Insert the slave(s) at the end of the packing order for the master
window given by <I>other</I>.
<P><DT><A NAME="M17"><B>-ipadx </B><I>amount</I></A><DD>
<I>Amount</I> specifies how much horizontal internal padding to
leave on each side of the slave(s).
<I>Amount</I> must be a valid screen distance, such as <B>2</B> or <B>.5c</B>.
It defaults to 0.
<P><DT><A NAME="M18"><B>-ipady </B><I>amount</I></A><DD>
<I>Amount</I> specifies how much vertical internal padding to
leave on each side of the slave(s).
<I>Amount</I> defaults to 0.
<P><DT><A NAME="M19"><B>-padx </B><I>amount</I></A><DD>
<I>Amount</I> specifies how much horizontal external padding to
leave on each side of the slave(s).
<I>Amount</I> defaults to 0.
<P><DT><A NAME="M20"><B>-pady </B><I>amount</I></A><DD>
<I>Amount</I> specifies how much vertical external padding to
leave on each side of the slave(s).
<I>Amount</I> defaults to 0.
<P><DT><A NAME="M21"><B>-side </B><I>side</I></A><DD>
Specifies which side of the master the slave(s) will be packed against.
Must be <B>left</B>, <B>right</B>, <B>top</B>, or <B>bottom</B>.
Defaults to <B>top</B>.
</DL><P>If no <B>-in</B>, <B>-after</B> or <B>-before</B> option is specified
then each of the slaves will be inserted at the end of the packing list
for its parent unless it is already managed by the packer (in which
case it will be left where it is).
If one of these options is specified then all the slaves will be
inserted at the specified point.
If any of the slaves are already managed by the geometry manager
then any unspecified options for them retain their previous values rather
than receiving default values.<DL>
<P></DL>
<P><DT><A NAME="M22"><B>pack forget </B><I>slave </I>?<I>slave ...</I>?</A><DD>
Removes each of the <I>slave</I>s from the packing order for its
master and unmaps their windows.
The slaves will no longer be managed by the packer.
<P><DT><A NAME="M23"><B>pack info </B><I>slave</I></A><DD>
Returns a list whose elements are the current configuration state of
the slave given by <I>slave</I> in the same option-value form that
might be specified to <B>pack configure</B>.
The first two elements of the list are ``<B>-in </B><I>master</I>'' where
<I>master</I> is the slave's master.
<P><DT><A NAME="M24"><B>pack propagate </B><I>master</I> ?<I>boolean</I>?</A><DD>
If <I>boolean</I> has a true boolean value such as <B>1</B> or <B>on</B>
then propagation is enabled for <I>master</I>, which must be a window
name (see ``GEOMETRY PROPAGATION'' below).
If <I>boolean</I> has a false boolean value then propagation is
disabled for <I>master</I>.
In either of these cases an empty string is returned.
If <I>boolean</I> is omitted then the command returns <B>0</B> or
<B>1</B> to indicate whether propagation is currently enabled
for <I>master</I>.
Propagation is enabled by default.
<P><DT><A NAME="M25"><B>pack slaves </B><I>master</I></A><DD>
Returns a list of all of the slaves in the packing order for <I>master</I>.
The order of the slaves in the list is the same as their order in
the packing order.
If <I>master</I> has no slaves then an empty string is returned.
<P></DL>
<H3><A NAME="M26">THE PACKER ALGORITHM</A></H3>
For each master the packer maintains an ordered list of slaves
called the <I>packing list</I>.
The <B>-in</B>, <B>-after</B>, and <B>-before</B> configuration
options are used to specify the master for each slave and the slave's
position in the packing list.
If none of these options is given for a slave then the slave
is added to the end of the packing list for its parent.
<P>
The packer arranges the slaves for a master by scanning the
packing list in order.
At the time it processes each slave, a rectangular area within
the master is still unallocated.
This area is called the <I>cavity</I>; for the first slave it
is the entire area of the master.
<P>
For each slave the packer carries out the following steps:
<P>
<DL>
<P><DT>[1]<DD>
The packer allocates a rectangular <I>parcel</I> for the slave
along the side of the cavity given by the slave's <B>-side</B> option.
If the side is top or bottom then the width of the parcel is
the width of the cavity and its height is the requested height
of the slave plus the <B>-ipady</B> and <B>-pady</B> options.
For the left or right side the height of the parcel is
the height of the cavity and the width is the requested width
of the slave plus the <B>-ipadx</B> and <B>-padx</B> options.
The parcel may be enlarged further because of the <B>-expand</B>
option (see ``EXPANSION'' below)
<P><DT>[2]<DD>
The packer chooses the dimensions of the slave.
The width will normally be the slave's requested width plus
twice its <B>-ipadx</B> option and the height will normally be
the slave's requested height plus twice its <B>-ipady</B>
option.
However, if the <B>-fill</B> option is <B>x</B> or <B>both</B>
then the width of the slave is expanded to fill the width of the parcel,
minus twice the <B>-padx</B> option.
If the <B>-fill</B> option is <B>y</B> or <B>both</B>
then the height of the slave is expanded to fill the width of the parcel,
minus twice the <B>-pady</B> option.
<P><DT>[3]<DD>
The packer positions the slave over its parcel.
If the slave is smaller than the parcel then the <B>-anchor</B>
option determines where in the parcel the slave will be placed.
If <B>-padx</B> or <B>-pady</B> is non-zero, then the given
amount of external padding will always be left between the
slave and the edges of the parcel.
<P></DL>
<P>
Once a given slave has been packed, the area of its parcel
is subtracted from the cavity, leaving a smaller rectangular
cavity for the next slave.
If a slave doesn't use all of its parcel, the unused space
in the parcel will not be used by subsequent slaves.
If the cavity should become too small to meet the needs of
a slave then the slave will be given whatever space is
left in the cavity.
If the cavity shrinks to zero size, then all remaining slaves
on the packing list will be unmapped from the screen until
the master window becomes large enough to hold them again.
<H3><A NAME="M27">EXPANSION</A></H3>
If a master window is so large that there will be extra space
left over after all of its slaves have been packed, then the
extra space is distributed uniformly among all of the slaves
for which the <B>-expand</B> option is set.
Extra horizontal space is distributed among the expandable
slaves whose <B>-side</B> is <B>left</B> or <B>right</B>,
and extra vertical space is distributed among the expandable
slaves whose <B>-side</B> is <B>top</B> or <B>bottom</B>.
<H3><A NAME="M28">GEOMETRY PROPAGATION</A></H3>
The packer normally computes how large a master must be to
just exactly meet the needs of its slaves, and it sets the
requested width and height of the master to these dimensions.
This causes geometry information to propagate up through a
window hierarchy to a top-level window so that the entire
sub-tree sizes itself to fit the needs of the leaf windows.
However, the <B>pack propagate</B> command may be used to
turn off propagation for one or more masters.
If propagation is disabled then the packer will not set
the requested width and height of the packer.
This may be useful if, for example, you wish for a master
window to have a fixed size that you specify.
<H3><A NAME="M29">RESTRICTIONS ON MASTER WINDOWS</A></H3>
The master for each slave must either be the slave's parent
(the default) or a descendant of the slave's parent.
This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is
visible without danger of the slave being clipped by its parent.
<H3><A NAME="M30">PACKING ORDER</A></H3>
If the master for a slave is not its parent then you must make sure
that the slave is higher in the stacking order than the master.
Otherwise the master will obscure the slave and it will appear as
if the slave hasn't been packed correctly.
The easiest way to make sure the slave is higher than the master is
to create the master window first: the most recently created window
will be highest in the stacking order.
Or, you can use the <B><A HREF="../TclCmd/raise.htm">raise</A></B> and <B><A HREF="../TclCmd/lower.htm">lower</A></B> commands to change
the stacking order of either the master or the slave.
<H3><A NAME="M31">KEYWORDS</A></H3>
<A href="../Keywords/G.htm#geometry manager">geometry manager</A>, <A href="../Keywords/L.htm#location">location</A>, <A href="../Keywords/P.htm#packer">packer</A>, <A href="../Keywords/P.htm#parcel">parcel</A>, <A href="../Keywords/P.htm#propagation">propagation</A>, <A href="../Keywords/S.htm#size">size</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

58
hlp/en/tk/palette.htm Normal file
View File

@@ -0,0 +1,58 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_setPalette manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tk_setPalette, tk_bisque - Modify the Tk color palette
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_setPalette </B><I>background</I><BR>
<B>tk_setPalette </B><I>name value </I>?<I>name value ...</I>?<BR>
<B>tk_bisque</B><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>tk_setPalette</B> procedure changes the color scheme for Tk.
It does this by modifying the colors of existing widgets and by changing
the option database so that future widgets will use the new color scheme.
If <B>tk_setPalette</B> is invoked with a single argument, the
argument is the name of a color to use as the normal background
color; <B>tk_setPalette</B> will compute a complete color palette
from this background color.
Alternatively, the arguments to <B>tk_setPalette</B> may consist of any number
of <I>name</I>-<I>value</I> pairs, where the first argument of the pair
is the name of an option in the Tk option database and the second
argument is the new value to use for that option. The following
database names are currently supported:
<PRE><B>activeBackground foreground selectColor
activeForeground highlightBackground selectBackground
background highlightColor selectForeground
disabledForeground insertBackground troughColor</B></PRE>
<B>tk_setPalette</B> tries to compute reasonable defaults for any
options that you don't specify. You can specify options other
than the above ones and Tk will change those options on widgets as
well. This feature may be useful if you are using custom widgets with
additional color options.
<P>
Once it has computed the new value to use for each of the color options,
<B>tk_setPalette</B> scans the widget hierarchy to modify the options
of all existing widgets. For each widget, it checks to see if any
of the above options is defined for the widget. If so, and if the
option's current value is the default, then the value is changed; if
the option has a value other than the default, <B>tk_setPalette</B>
will not change it. The default for an option is the one provided by
the widget (<B>[lindex [$w configure $option] 3]</B>) unless
<B>tk_setPalette</B> has been run previously, in which case it is the
value specified in the previous invocation of <B>tk_setPalette</B>.
<P>
After modifying all the widgets in the application, <B>tk_setPalette</B>
adds options to the option database to change the defaults for
widgets created in the future. The new options are added at
priority <B>widgetDefault</B>, so they will be overridden by options
from the .Xdefaults file or options specified on the command-line
that creates a widget.
<P>
The procedure <B>tk_bisque</B> is provided for backward compatibility:
it restores the application's colors to the light brown (``bisque'')
color scheme used in Tk 3.6 and earlier versions.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#bisque">bisque</A>, <A href="../Keywords/C.htm#color">color</A>, <A href="../Keywords/P.htm#palette">palette</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

427
hlp/en/tk/photo.htm Normal file
View File

@@ -0,0 +1,427 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - photo manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="photo.htm#M2" NAME="L869">NAME</A>
<DL><DD>photo - Full-color images</DL>
<DD><A HREF="photo.htm#M3" NAME="L870">SYNOPSIS</A>
<DL>
<DD><B>image create photo </B>?<I>name</I>? ?<I>options</I>?
</DL>
<DD><A HREF="photo.htm#M4" NAME="L871">DESCRIPTION</A>
<DD><A HREF="photo.htm#M5" NAME="L872">CREATING PHOTOS</A>
<DL>
<DD><A HREF="photo.htm#M6" NAME="L873"><B>-data </B><I>string</I></A>
<DD><A HREF="photo.htm#M7" NAME="L874"><B>-format </B><I>format-name</I></A>
<DD><A HREF="photo.htm#M8" NAME="L875"><B>-file </B><I>name</I></A>
<DD><A HREF="photo.htm#M9" NAME="L876"><B>-gamma </B><I>value</I></A>
<DD><A HREF="photo.htm#M10" NAME="L877"><B>-height </B><I>number</I></A>
<DD><A HREF="photo.htm#M11" NAME="L878"><B>-palette </B><I>palette-spec</I></A>
<DD><A HREF="photo.htm#M12" NAME="L879"><B>-width </B><I>number</I></A>
</DL>
<DD><A HREF="photo.htm#M13" NAME="L880">IMAGE COMMAND</A>
<DL>
<DD><A HREF="photo.htm#M14" NAME="L881"><I>imageName </I><B>blank</B></A>
<DD><A HREF="photo.htm#M15" NAME="L882"><I>imageName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="photo.htm#M16" NAME="L883"><I>imageName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="photo.htm#M17" NAME="L884"><I>imageName </I><B>copy</B> <I>sourceImage</I> ?<I>option value(s) ...</I>?</A>
<DL>
<DD><A HREF="photo.htm#M18" NAME="L885"><B>-from </B><I>x1 y1 x2 y2</I></A>
<DD><A HREF="photo.htm#M19" NAME="L886"><B>-to </B><I>x1 y1 x2 y2</I></A>
<DD><A HREF="photo.htm#M20" NAME="L887"><B>-shrink</B></A>
<DD><A HREF="photo.htm#M21" NAME="L888"><B>-zoom </B><I>x y</I></A>
<DD><A HREF="photo.htm#M22" NAME="L889"><B>-subsample </B><I>x y</I></A>
</DL>
<DD><A HREF="photo.htm#M23" NAME="L890"><I>imageName </I><B>data ?</B><I>option value(s) ...</I>?</A>
<DL>
<DD><A HREF="photo.htm#M24" NAME="L891"><B>-background</B><I> color</I></A>
<DD><A HREF="photo.htm#M25" NAME="L892"><B>-format</B><I> format-name</I></A>
<DD><A HREF="photo.htm#M26" NAME="L893"><B>-from </B><I>x1 y1 x2 y2</I></A>
<DD><A HREF="photo.htm#M27" NAME="L894"><B>-grayscale</B></A>
</DL>
<DD><A HREF="photo.htm#M28" NAME="L895"><I>imageName </I><B>get</B> <I>x y</I></A>
<DD><A HREF="photo.htm#M29" NAME="L896"><I>imageName </I><B>put</B> <I>data</I> ?<I>option value(s) ...</I>?</A>
<DL>
<DD><A HREF="photo.htm#M30" NAME="L897"><B>-format </B><I>format-name</I></A>
<DD><A HREF="photo.htm#M31" NAME="L898"><B>-from </B><I>x1 y1 x2 y2</I></A>
<DD><A HREF="photo.htm#M32" NAME="L899"><B>-shrink</B></A>
<DD><A HREF="photo.htm#M33" NAME="L900"><B>-to </B><I>x y</I></A>
</DL>
<DD><A HREF="photo.htm#M34" NAME="L901"><I>imageName </I><B>read</B> <I>filename</I> ?<I>option value(s) ...</I>?</A>
<DL>
<DD><A HREF="photo.htm#M35" NAME="L902"><B>-format </B><I>format-name</I></A>
<DD><A HREF="photo.htm#M36" NAME="L903"><B>-from </B><I>x1 y1 x2 y2</I></A>
<DD><A HREF="photo.htm#M37" NAME="L904"><B>-shrink</B></A>
<DD><A HREF="photo.htm#M38" NAME="L905"><B>-to </B><I>x y</I></A>
</DL>
<DD><A HREF="photo.htm#M39" NAME="L906"><I>imageName </I><B>redither</B></A>
<DD><A HREF="photo.htm#M40" NAME="L907"><I>imageName </I><B>write </B><I>filename</I> ?<I>option value(s) ...</I>?</A>
<DL>
<DD><A HREF="photo.htm#M41" NAME="L908"><B>-background</B><I> color</I></A>
<DD><A HREF="photo.htm#M42" NAME="L909"><B>-format</B><I> format-name</I></A>
<DD><A HREF="photo.htm#M43" NAME="L910"><B>-from </B><I>x1 y1 x2 y2</I></A>
<DD><A HREF="photo.htm#M44" NAME="L911"><B>-grayscale</B></A>
</DL>
</DL>
<DD><A HREF="photo.htm#M45" NAME="L912">IMAGE FORMATS</A>
<DD><A HREF="photo.htm#M46" NAME="L913">COLOR ALLOCATION</A>
<DD><A HREF="photo.htm#M47" NAME="L914">CREDITS</A>
<DD><A HREF="photo.htm#M48" NAME="L915">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
photo - Full-color images
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>image create photo </B>?<I>name</I>? ?<I>options</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
A photo is an image whose pixels can display any color or be
transparent. A photo image is stored internally in full color (32
bits per pixel), and is displayed using dithering if necessary. Image
data for a photo image can be obtained from a file or a string, or it
can be supplied from
C code through a procedural interface. At present, only GIF and PPM/PGM
formats are supported, but an interface exists to allow additional
image file formats to be added easily. A photo image is transparent
in regions where no image data has been supplied.
<H3><A NAME="M5">CREATING PHOTOS</A></H3>
Like all images, photos are created using the <B><A HREF="../TclCmd/image.htm">image create</A></B>
command.
Photos support the following <I>options</I>:
<P>
<DL>
<P><DT><A NAME="M6"><B>-data </B><I>string</I></A><DD>
Specifies the contents of the image as a string. The string can
contain base64 encoded data or binary data. The format of the
string must be one of those for which there is an image file format
handler that will accept string data. If both the <B>-data</B>
and <B>-file</B> options are specified, the <B>-file</B> option takes
precedence.
<P><DT><A NAME="M7"><B>-format </B><I>format-name</I></A><DD>
Specifies the name of the file format for the data specified with the
<B>-data</B> or <B>-file</B> option.
<P><DT><A NAME="M8"><B>-file </B><I>name</I></A><DD>
<I>name</I> gives the name of a file that is to be read to supply data
for the photo image. The file format must be one of those for which
there is an image file format handler that can read data.
<P><DT><A NAME="M9"><B>-gamma </B><I>value</I></A><DD>
Specifies that the colors allocated for displaying this image in a
window should be corrected for a non-linear display with the specified
gamma exponent value. (The intensity produced by most
CRT displays is a power function of the input value, to a good
approximation; gamma is the exponent and is typically around 2).
The value specified must be greater than zero. The default
value is one (no correction). In general, values greater than one
will make the image lighter, and values less than one will make it
darker.
<P><DT><A NAME="M10"><B>-height </B><I>number</I></A><DD>
Specifies the height of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
image to expand or shrink vertically to fit the data stored in it.
<P><DT><A NAME="M11"><B>-palette </B><I>palette-spec</I></A><DD>
Specifies the resolution of the color cube to be allocated for
displaying this image, and thus the number of colors used from the
colormaps of the windows where it is displayed. The
<I>palette-spec</I> string may be either a single decimal number,
specifying the number of shades of gray to use, or three decimal
numbers separated by slashes (/), specifying the number of shades of
red, green and blue to use, respectively. If the first form (a single
number) is used, the image will be displayed in monochrome (i.e.,
grayscale).
<P><DT><A NAME="M12"><B>-width </B><I>number</I></A><DD>
Specifies the width of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
image to expand or shrink horizontally to fit the data stored in it.
<P></DL>
<H3><A NAME="M13">IMAGE COMMAND</A></H3>
When a photo image is created, Tk also creates a new command
whose name is the same as the image.
This command may be used to invoke various operations
on the image.
It has the following general form:
<PRE><I>imageName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command.
<P>
Those options that write data to the image generally expand the size
of the image, if necessary, to accommodate the data written to the
image, unless the user has specified non-zero values for the
<B>-width</B> and/or <B>-height</B> configuration options, in which
case the width and/or height, respectively, of the image will not be
changed.
<P>
The following commands are possible for photo images:
<P>
<DL>
<P><DT><A NAME="M14"><I>imageName </I><B>blank</B></A><DD>
Blank the image; that is, set the entire image to have no data, so it
will be displayed as transparent, and the background of whatever
window it is displayed in will show through.
<P><DT><A NAME="M15"><I>imageName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the
<B>image create photo</B> command.
<P><DT><A NAME="M16"><I>imageName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options for the image.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>imageName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the
<B>image create photo</B> command.
<P><DT><A NAME="M17"><I>imageName </I><B>copy</B> <I>sourceImage</I> ?<I>option value(s) ...</I>?</A><DD>
Copies a region from the image called <I>sourceImage</I> (which must
be a photo image) to the image called <I>imageName</I>, possibly with
pixel zooming and/or subsampling. If no options are specified, this
command copies the whole of <I>sourceImage</I> into <I>imageName</I>,
starting at coordinates (0,0) in <I>imageName</I>. The following
options may be specified:
<P>
<DL>
<P><DT><A NAME="M18"><B>-from </B><I>x1 y1 x2 y2</I></A><DD>
Specifies a rectangular sub-region of the source image to be copied.
(<I>x1,y1</I>) and (<I>x2,y2</I>) specify diagonally opposite corners of
the rectangle. If <I>x2</I> and <I>y2</I> are not specified, the
default value is the bottom-right corner of the source image. The
pixels copied will include the left and top edges of the specified
rectangle but not the bottom or right edges. If the <B>-from</B>
option is not given, the default is the whole source image.
<P><DT><A NAME="M19"><B>-to </B><I>x1 y1 x2 y2</I></A><DD>
Specifies a rectangular sub-region of the destination image to be
affected. (<I>x1,y1</I>) and (<I>x2,y2</I>) specify diagonally opposite
corners of the rectangle. If <I>x2</I> and <I>y2</I> are not specified,
the default value is (<I>x1,y1</I>) plus the size of the source
region (after subsampling and zooming, if specified). If <I>x2</I> and
<I>y2</I> are specified, the source region will be replicated if
necessary to fill the destination region in a tiled fashion.
<P><DT><A NAME="M20"><B>-shrink</B></A><DD>
Specifies that the size of the destination image should be reduced, if
necessary, so that the region being copied into is at the bottom-right
corner of the image. This option will not affect the width or height
of the image if the user has specified a non-zero value for the
<B>-width</B> or <B>-height</B> configuration option, respectively.
<P><DT><A NAME="M21"><B>-zoom </B><I>x y</I></A><DD>
Specifies that the source region should be magnified by a factor of
<I>x</I> in the X direction and <I>y</I> in the Y direction. If <I>y</I>
is not given, the default value is the same as <I>x</I>. With this
option, each pixel in the source image will be expanded into a block
of <I>x</I> x <I>y</I> pixels in the destination image, all the same
color. <I>x</I> and <I>y</I> must be greater than 0.
<P><DT><A NAME="M22"><B>-subsample </B><I>x y</I></A><DD>
Specifies that the source image should be reduced in size by using
only every <I>x</I>th pixel in the X direction and <I>y</I>th pixel in
the Y direction. Negative values will cause the image to be flipped
about the Y or X axes, respectively. If <I>y</I> is not given, the
default value is the same as <I>x</I>.
<P></DL>
<P><DT><A NAME="M23"><I>imageName </I><B>data ?</B><I>option value(s) ...</I>?</A><DD>
Returns image data in the form of a string. The following options
may be specified:
<P>
<DL>
<P><DT><A NAME="M24"><B>-background</B><I> color</I></A><DD>
If the color is specified, the data will not contain any transparency
information. In all transparent pixels the color will be replaced by
the specified color.
<P><DT><A NAME="M25"><B>-format</B><I> format-name</I></A><DD>
Specifies the name of the image file format handler to be used.
Specifically, this subcommand searches
for the first handler whose name matches a initial substring of
<I>format-name</I> and which has the capability to read this image data.
If this option is not given, this subcommand uses the first
handler that has the capability to read the image data.
<P><DT><A NAME="M26"><B>-from </B><I>x1 y1 x2 y2</I></A><DD>
Specifies a rectangular region of <I>imageName</I> to be returned.
If only <I>x1</I> and <I>y1</I> are specified, the region
extends from <I>(x1,y1)</I> to the bottom-right corner of
<I>imageName</I>. If all four coordinates are given, they specify
diagonally opposite corners of the rectangular region, including x1,y1
and excluding x2,y2. The default, if this option is not given, is the
whole image.
<P><DT><A NAME="M27"><B>-grayscale</B></A><DD>
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
<P></DL>
<P><DT><A NAME="M28"><I>imageName </I><B>get</B> <I>x y</I></A><DD>
Returns the color of the pixel at coordinates (<I>x</I>,<I>y</I>) in the
image as a list of three integers between 0 and 255, representing the
red, green and blue components respectively.
<P><DT><A NAME="M29"><I>imageName </I><B>put</B> <I>data</I> ?<I>option value(s) ...</I>?</A><DD>
Sets pixels in <I> imageName</I> to the data specified in
<I>data</I>. This command first searches the list of image file
format handlers for a handler that can interpret the data
in <I>data</I>, and then reads the image in <I>filename</I> into
<I>imageName</I> (the destination image). The following options
may be specified:
<P>
<DL>
<P><DT><A NAME="M30"><B>-format </B><I>format-name</I></A><DD>
Specifies the format of the image data in <I>data</I>.
Specifically, only image file format handlers whose names begin with
<I>format-name</I> will be used while searching for an image data
format handler to read the data.
<P><DT><A NAME="M31"><B>-from </B><I>x1 y1 x2 y2</I></A><DD>
Specifies a rectangular sub-region of the image file data to be
returned. If only <I>x1</I> and <I>y1</I> are specified, the region
extends from (<I>x1,y1</I>) to the bottom-right corner of the image
in the image file. If all four coordinates are specified, they
specify diagonally opposite corners or the region. The default,
if this option is not specified, is the whole of the image.
<P><DT><A NAME="M32"><B>-shrink</B></A><DD>
If this option, the size of <I>imageName</I> will be reduced, if
necessary, so that the region into which the image file data are read
is at the bottom-right corner of the <I>imageName</I>. This option
will not affect the width or height of the image if the user has
specified a non-zero value for the <B>-width</B> or <B>-height</B>
configuration option, respectively.
<P><DT><A NAME="M33"><B>-to </B><I>x y</I></A><DD>
Specifies the coordinates of the top-left corner of the region of
<I>imageName</I> into which data from <I>filename</I> are to be read.
The default is (0,0).
<P></DL>
<P><DT><A NAME="M34"><I>imageName </I><B>read</B> <I>filename</I> ?<I>option value(s) ...</I>?</A><DD>
Reads image data from the file named <I>filename</I> into the image.
This command first searches the list of
image file format handlers for a handler that can interpret the data
in <I>filename</I>, and then reads the image in <I>filename</I> into
<I>imageName</I> (the destination image). The following options may be
specified:
<P>
<DL>
<P><DT><A NAME="M35"><B>-format </B><I>format-name</I></A><DD>
Specifies the format of the image data in <I>filename</I>.
Specifically, only image file format handlers whose names begin with
<I>format-name</I> will be used while searching for an image data
format handler to read the data.
<P><DT><A NAME="M36"><B>-from </B><I>x1 y1 x2 y2</I></A><DD>
Specifies a rectangular sub-region of the image file data to be copied
to the destination image. If only <I>x1</I> and <I>y1</I> are
specified, the region extends from (<I>x1,y1</I>) to the bottom-right
corner of the image in the image file. If all four coordinates are
specified, they specify diagonally opposite corners or the region.
The default, if this option is not specified, is the whole of the
image in the image file.
<P><DT><A NAME="M37"><B>-shrink</B></A><DD>
If this option, the size of <I>imageName</I> will be reduced, if
necessary, so that the region into which the image file data are read
is at the bottom-right corner of the <I>imageName</I>. This option
will not affect the width or height of the image if the user has
specified a non-zero value for the <B>-width</B> or <B>-height</B>
configuration option, respectively.
<P><DT><A NAME="M38"><B>-to </B><I>x y</I></A><DD>
Specifies the coordinates of the top-left corner of the region of
<I>imageName</I> into which data from <I>filename</I> are to be read.
The default is (0,0).
<P></DL>
<P><DT><A NAME="M39"><I>imageName </I><B>redither</B></A><DD>
The dithering algorithm used in displaying photo images propagates
quantization errors from one pixel to its neighbors.
If the image data for <I>imageName</I> is supplied in pieces, the
dithered image may not be exactly correct. Normally the difference is
not noticeable, but if it is a problem, this command can be used to
recalculate the dithered image in each window where the image is
displayed.
<P><DT><A NAME="M40"><I>imageName </I><B>write </B><I>filename</I> ?<I>option value(s) ...</I>?</A><DD>
Writes image data from <I>imageName</I> to a file named <I>filename</I>.
The following options may be specified:
<P>
<DL>
<P><DT><A NAME="M41"><B>-background</B><I> color</I></A><DD>
If the color is specified, the data will not contain any transparency
information. In all transparent pixels the color will be replaced by
the specified color.
<P><DT><A NAME="M42"><B>-format</B><I> format-name</I></A><DD>
Specifies the name of the image file format handler to be used to
write the data to the file. Specifically, this subcommand searches
for the first handler whose name matches a initial substring of
<I>format-name</I> and which has the capability to write an image
file. If this option is not given, this subcommand uses the first
handler that has the capability to write an image file.
<P><DT><A NAME="M43"><B>-from </B><I>x1 y1 x2 y2</I></A><DD>
Specifies a rectangular region of <I>imageName</I> to be written to the
image file. If only <I>x1</I> and <I>y1</I> are specified, the region
extends from <I>(x1,y1)</I> to the bottom-right corner of
<I>imageName</I>. If all four coordinates are given, they specify
diagonally opposite corners of the rectangular region. The default,
if this option is not given, is the whole image.
<P><DT><A NAME="M44"><B>-grayscale</B></A><DD>
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
<P></DL>
<P></DL>
<H3><A NAME="M45">IMAGE FORMATS</A></H3>
The photo image code is structured to allow handlers for additional
image file formats to be added easily. The photo image code maintains
a list of these handlers. Handlers are added to the list by
registering them with a call to <B><A HREF="../TclLib/CrtPhImgFmt.htm">Tk_CreatePhotoImageFormat</A></B>. The
standard Tk distribution comes with handlers for PPM/PGM and GIF formats,
which are automatically registered on initialization.
<P>
When reading an image file or processing
string data specified with the <B>-data</B> configuration option, the
photo image code invokes each handler in turn until one is
found that claims to be able to read the data in the file or string.
Usually this will find the correct handler, but if it doesn't, the
user may give a format name with the <B>-format</B> option to specify
which handler to use. In fact the photo image code will try those
handlers whose names begin with the string specified for the
<B>-format</B> option (the comparison is case-insensitive). For
example, if the user specifies <B>-format gif</B>, then a handler
named GIF87 or GIF89 may be invoked, but a handler
named JPEG may not (assuming that such handlers had been
registered).
<P>
When writing image data to a file, the processing of the
<B>-format</B> option is slightly different: the string value given
for the <B>-format</B> option must begin with the complete name of the
requested handler, and may contain additional information following
that, which the handler can use, for example, to specify which variant
to use of the formats supported by the handler.
<H3><A NAME="M46">COLOR ALLOCATION</A></H3>
When a photo image is displayed in a window, the photo image code
allocates colors to use to display the image and dithers the image, if
necessary, to display a reasonable approximation to the image using
the colors that are available. The colors are allocated as a color
cube, that is, the number of colors allocated is the product of the
number of shades of red, green and blue.
<P>
Normally, the number of
colors allocated is chosen based on the depth of the window. For
example, in an 8-bit PseudoColor window, the photo image code will
attempt to allocate seven shades of red, seven shades of green and
four shades of blue, for a total of 198 colors. In a 1-bit StaticGray
(monochrome) window, it will allocate two colors, black and white. In
a 24-bit DirectColor or TrueColor window, it will allocate 256 shades
each of red, green and blue. Fortunately, because of the way that
pixel values can be combined in DirectColor and TrueColor windows,
this only requires 256 colors to be allocated. If not all of the
colors can be allocated, the photo image code reduces the number of
shades of each primary color and tries again.
<P>
The user can exercise some control over the number of colors that a
photo image uses with the <B>-palette</B> configuration option. If
this option is used, it specifies the maximum number of shades of
each primary color to try to allocate. It can also be used to force
the image to be displayed in shades of gray, even on a color display,
by giving a single number rather than three numbers separated by
slashes.
<H3><A NAME="M47">CREDITS</A></H3>
The photo image type was designed and implemented by Paul Mackerras,
based on his earlier photo widget and some suggestions from
John Ousterhout.
<H3><A NAME="M48">KEYWORDS</A></H3>
<A href="../Keywords/P.htm#photo">photo</A>, <A href="../Keywords/I.htm#image">image</A>, <A href="../Keywords/C.htm#color">color</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994 The Australian National University
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1997 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

240
hlp/en/tk/place.htm Normal file
View File

@@ -0,0 +1,240 @@
<HTML><HEAD><TITLE>Built-In Commands - place manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="place.htm#M2" NAME="L916">NAME</A>
<DL><DD>place - Geometry manager for fixed or rubber-sheet placement</DL>
<DD><A HREF="place.htm#M3" NAME="L917">SYNOPSIS</A>
<DL>
<DD><B>place </B><I>window option value </I>?<I>option value ...</I>?
<DD><B>place configure </B><I>window option value </I>?<I>option value ...</I>?
<DD><B>place forget </B><I>window</I>
<DD><B>place info </B><I>window</I>
<DD><B>place slaves </B><I>window</I>
</DL>
<DD><A HREF="place.htm#M4" NAME="L918">DESCRIPTION</A>
<DL>
<DD><A HREF="place.htm#M5" NAME="L919"><B>-in </B><I>master</I></A>
<DD><A HREF="place.htm#M6" NAME="L920"><B>-x </B><I>location</I></A>
<DD><A HREF="place.htm#M7" NAME="L921"><B>-relx </B><I>location</I></A>
<DD><A HREF="place.htm#M8" NAME="L922"><B>-y </B><I>location</I></A>
<DD><A HREF="place.htm#M9" NAME="L923"><B>-rely </B><I>location</I></A>
<DD><A HREF="place.htm#M10" NAME="L924"><B>-anchor </B><I>where</I></A>
<DD><A HREF="place.htm#M11" NAME="L925"><B>-width </B><I>size</I></A>
<DD><A HREF="place.htm#M12" NAME="L926"><B>-relwidth </B><I>size</I></A>
<DD><A HREF="place.htm#M13" NAME="L927"><B>-height </B><I>size</I></A>
<DD><A HREF="place.htm#M14" NAME="L928"><B>-relheight </B><I>size</I></A>
<DD><A HREF="place.htm#M15" NAME="L929"><B>-bordermode </B><I>mode</I></A>
</DL>
<DD><A HREF="place.htm#M16" NAME="L930">FINE POINTS</A>
<DD><A HREF="place.htm#M17" NAME="L931">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
place - Geometry manager for fixed or rubber-sheet placement
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>place </B><I>window option value </I>?<I>option value ...</I>?<BR>
<B>place configure </B><I>window option value </I>?<I>option value ...</I>?<BR>
<B>place forget </B><I>window</I><BR>
<B>place info </B><I>window</I><BR>
<B>place slaves </B><I>window</I><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The placer is a geometry manager for Tk.
It provides simple fixed placement of windows, where you specify
the exact size and location of one window, called the <I>slave</I>,
within another window, called the <I>master</I>.
The placer also provides rubber-sheet placement, where you specify the
size and location of the slave in terms of the dimensions of
the master, so that the slave changes size and location
in response to changes in the size of the master.
Lastly, the placer allows you to mix these styles of placement so
that, for example, the slave has a fixed width and height but is
centered inside the master.
<P>
If the first argument to the <B>place</B> command is a window path
name or <B>configure</B> then the command arranges for the placer
to manage the geometry of a slave whose path name is <I>window</I>.
The remaining arguments consist of one or more <I>option-value</I>
pairs that specify the way in which <I>window</I>'s
geometry is managed.
If the placer is already managing <I>window</I>, then the
<I>option-value</I> pairs modify the configuration for <I>window</I>.
In this form the <B>place</B> command returns an empty string as result.
The following <I>option-value</I> pairs are supported:
<P>
<DL>
<P><DT><A NAME="M5"><B>-in </B><I>master</I></A><DD>
<I>Master</I> specifes the path name of the window relative
to which <I>window</I> is to be placed.
<I>Master</I> must either be <I>window</I>'s parent or a descendant
of <I>window</I>'s parent.
In addition, <I>master</I> and <I>window</I> must both be descendants
of the same top-level window.
These restrictions are necessary to guarantee
that <I>window</I> is visible whenever <I>master</I> is visible.
If this option isn't specified then the master defaults to
<I>window</I>'s parent.
<P><DT><A NAME="M6"><B>-x </B><I>location</I></A><DD>
<I>Location</I> specifies the x-coordinate within the master window
of the anchor point for <I>window</I>.
The location is specified in screen units (i.e. any of the forms
accepted by <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>) and need not lie within the bounds
of the master window.
<P><DT><A NAME="M7"><B>-relx </B><I>location</I></A><DD>
<I>Location</I> specifies the x-coordinate within the master window
of the anchor point for <I>window</I>.
In this case the location is specified in a relative fashion
as a floating-point number: 0.0 corresponds to the left edge
of the master and 1.0 corresponds to the right edge of the master.
<I>Location</I> need not be in the range 0.0-1.0.
If both <B>-x</B> and <B>-relx</B> are specified for a slave
then their values are summed. For example, <B>-relx 0.5 -x -2</B>
positions the left edge of the slave 2 pixels to the left of the
center of its master.
<P><DT><A NAME="M8"><B>-y </B><I>location</I></A><DD>
<I>Location</I> specifies the y-coordinate within the master window
of the anchor point for <I>window</I>.
The location is specified in screen units (i.e. any of the forms
accepted by <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>) and need not lie within the bounds
of the master window.
<P><DT><A NAME="M9"><B>-rely </B><I>location</I></A><DD>
<I>Location</I> specifies the y-coordinate within the master window
of the anchor point for <I>window</I>.
In this case the value is specified in a relative fashion
as a floating-point number: 0.0 corresponds to the top edge
of the master and 1.0 corresponds to the bottom edge of the master.
<I>Location</I> need not be in the range 0.0-1.0.
If both <B>-y</B> and <B>-rely</B> are specified for a slave
then their values are summed. For example, <B>-rely 0.5 -x 3</B>
positions the top edge of the slave 3 pixels below the
center of its master.
<P><DT><A NAME="M10"><B>-anchor </B><I>where</I></A><DD>
<I>Where</I> specifies which point of <I>window</I> is to be positioned
at the (x,y) location selected by the <B>-x</B>, <B>-y</B>,
<B>-relx</B>, and <B>-rely</B> options.
The anchor point is in terms of the outer area of <I>window</I>
including its border, if any.
Thus if <I>where</I> is <B>se</B> then the lower-right corner of
<I>window</I>'s border will appear at the given (x,y) location
in the master.
The anchor position defaults to <B>nw</B>.
<P><DT><A NAME="M11"><B>-width </B><I>size</I></A><DD>
<I>Size</I> specifies the width for <I>window</I> in screen units
(i.e. any of the forms accepted by <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>).
The width will be the outer width of <I>window</I> including its
border, if any.
If <I>size</I> is an empty string, or if no <B>-width</B>
or <B>-relwidth</B> option is specified, then the width requested
internally by the window will be used.
<P><DT><A NAME="M12"><B>-relwidth </B><I>size</I></A><DD>
<I>Size</I> specifies the width for <I>window</I>.
In this case the width is specified as a floating-point number
relative to the width of the master: 0.5 means <I>window</I> will
be half as wide as the master, 1.0 means <I>window</I> will have
the same width as the master, and so on.
If both <B>-width</B> and <B>-relwidth</B> are specified for a slave,
their values are summed. For example, <B>-relwidth 1.0 -width 5</B>
makes the slave 5 pixels wider than the master.
<P><DT><A NAME="M13"><B>-height </B><I>size</I></A><DD>
<I>Size</I> specifies the height for <I>window</I> in screen units
(i.e. any of the forms accepted by <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>).
The height will be the outer dimension of <I>window</I> including its
border, if any.
If <I>size</I> is an empty string, or if no <B>-height</B> or
<B>-relheight</B> option is specified, then the height requested
internally by the window will be used.
<P><DT><A NAME="M14"><B>-relheight </B><I>size</I></A><DD>
<I>Size</I> specifies the height for <I>window</I>.
In this case the height is specified as a floating-point number
relative to the height of the master: 0.5 means <I>window</I> will
be half as high as the master, 1.0 means <I>window</I> will have
the same height as the master, and so on.
If both <B>-height</B> and <B>-relheight</B> are specified for a slave,
their values are summed. For example, <B>-relheight 1.0 -height -2</B>
makes the slave 2 pixels shorter than the master.
<P><DT><A NAME="M15"><B>-bordermode </B><I>mode</I></A><DD>
<I>Mode</I> determines the degree to which borders within the
master are used in determining the placement of the slave.
The default and most common value is <B>inside</B>.
In this case the placer considers the area of the master to
be the innermost area of the master, inside any border:
an option of <B>-x 0</B> corresponds to an x-coordinate just
inside the border and an option of <B>-relwidth 1.0</B>
means <I>window</I> will fill the area inside the master's
border.
If <I>mode</I> is <B>outside</B> then the placer considers
the area of the master to include its border;
this mode is typically used when placing <I>window</I>
outside its master, as with the options <B>-x 0 -y 0 -anchor ne</B>.
Lastly, <I>mode</I> may be specified as <B>ignore</B>, in which
case borders are ignored: the area of the master is considered
to be its official X area, which includes any internal border but
no external border. A bordermode of <B>ignore</B> is probably
not very useful.
<P></DL>
<P>
If the same value is specified separately with
two different options, such as <B>-x</B> and <B>-relx</B>, then
the most recent option is used and the older one is ignored.
<P>
The <B>place slaves</B> command returns a list of all the slave
windows for which <I>window</I> is the master.
If there are no slaves for <I>window</I> then an empty string is
returned.
<P>
The <B>place forget</B> command causes the placer to stop managing
the geometry of <I>window</I>. As a side effect of this command
<I>window</I> will be unmapped so that it doesn't appear on the
screen.
If <I>window</I> isn't currently managed by the placer then the
command has no effect.
<B>Place forget</B> returns an empty string as result.
<P>
The <B>place info</B> command returns a list giving the current
configuration of <I>window</I>.
The list consists of <I>option-value</I> pairs in exactly the
same form as might be specified to the <B>place configure</B>
command.
If the configuration of a window has been retrieved with
<B>place info</B>, that configuration can be restored later by
first using <B>place forget</B> to erase any existing information
for the window and then invoking <B>place configure</B> with
the saved information.
<H3><A NAME="M16">FINE POINTS</A></H3>
It is not necessary for the master window to be the parent
of the slave window.
This feature is useful in at least two situations.
First, for complex window layouts it means you can create a
hierarchy of subwindows whose only purpose
is to assist in the layout of the parent.
The ``real children'' of the parent (i.e. the windows that
are significant for the application's user interface) can be
children of the parent yet be placed inside the windows
of the geometry-management hierarchy.
This means that the path names of the ``real children''
don't reflect the geometry-management hierarchy and users
can specify options for the real children
without being aware of the structure of the geometry-management
hierarchy.
<P>
A second reason for having a master different than the slave's
parent is to tie two siblings together.
For example, the placer can be used to force a window always to
be positioned centered just below one of its
siblings by specifying the configuration
<PRE><B>-in </B><I>sibling</I><B> -relx 0.5 -rely 1.0 -anchor n -bordermode outside</B></PRE>
Whenever the sibling is repositioned in the future, the slave
will be repositioned as well.
<P>
Unlike many other geometry managers (such as the packer)
the placer does not make any attempt to manipulate the geometry of
the master windows or the parents of slave windows (i.e. it doesn't
set their requested sizes).
To control the sizes of these windows, make them windows like
frames and canvases that provide configuration options for this purpose.
<H3><A NAME="M17">KEYWORDS</A></H3>
<A href="../Keywords/G.htm#geometry manager">geometry manager</A>, <A href="../Keywords/H.htm#height">height</A>, <A href="../Keywords/L.htm#location">location</A>, <A href="../Keywords/M.htm#master">master</A>, <A href="../Keywords/P.htm#place">place</A>, <A href="../Keywords/R.htm#rubber sheet">rubber sheet</A>, <A href="../Keywords/S.htm#slave">slave</A>, <A href="../Keywords/W.htm#width">width</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1992 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

23
hlp/en/tk/popup.htm Normal file
View File

@@ -0,0 +1,23 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk_popup manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tk_popup - Post a popup menu
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_popup </B><I>menu x y </I>?<I>entry</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This procedure posts a menu at a given position on the screen and
configures Tk so that the menu and its cascaded children can be
traversed with the mouse or the keyboard.
<I>Menu</I> is the name of a menu widget and <I>x</I> and <I>y</I>
are the root coordinates at which to display the menu.
If <I>entry</I> is omitted or an empty string, the
menu's upper left corner is positioned at the given point.
Otherwise <I>entry</I> gives the index of an entry in <I>menu</I> and
the menu will be positioned so that the entry is positioned over
the given point.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#menu">menu</A>, <A href="../Keywords/P.htm#popup">popup</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

311
hlp/en/tk/radiobutton.htm Normal file
View File

@@ -0,0 +1,311 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - radiobutton manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="radiobutton.htm#M2" NAME="L936">NAME</A>
<DL><DD>radiobutton - Create and manipulate radiobutton widgets</DL>
<DD><A HREF="radiobutton.htm#M3" NAME="L937">SYNOPSIS</A>
<DL>
<DD><B>radiobutton</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="radiobutton.htm#M4" NAME="L938">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A>
<DD><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-image">-image, image, Image</A>
<DD><A HREF="options.htm#M-justify">-justify, justify, Justify</A>
<DD><A HREF="options.htm#M-padx">-padx, padX, Pad</A>
<DD><A HREF="options.htm#M-pady">-pady, padY, Pad</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-text">-text, text, Text</A>
<DD><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A>
<DD><A HREF="options.htm#M-underline">-underline, underline, Underline</A>
<DD><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A>
</DL>
<DD><A HREF="radiobutton.htm#M5" NAME="L939">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="radiobutton.htm#M6" NAME="L940">-command, command, Command</A>
<DD><A HREF="radiobutton.htm#M7" NAME="L941">-height, height, Height</A>
<DD><A HREF="radiobutton.htm#M8" NAME="L942">-indicatoron, indicatorOn, IndicatorOn</A>
<DD><A HREF="radiobutton.htm#M9" NAME="L943">-selectcolor, selectColor, Background</A>
<DD><A HREF="radiobutton.htm#M10" NAME="L944">-selectimage, selectImage, SelectImage</A>
<DD><A HREF="radiobutton.htm#M11" NAME="L945">-state, state, State</A>
<DD><A HREF="radiobutton.htm#M12" NAME="L946">-value, value, Value</A>
<DD><A HREF="radiobutton.htm#M13" NAME="L947">-variable, variable, Variable</A>
<DD><A HREF="radiobutton.htm#M14" NAME="L948">-width, width, Width</A>
</DL>
<DD><A HREF="radiobutton.htm#M15" NAME="L949">DESCRIPTION</A>
<DD><A HREF="radiobutton.htm#M16" NAME="L950">WIDGET COMMAND</A>
<DL>
<DD><A HREF="radiobutton.htm#M17" NAME="L951"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="radiobutton.htm#M18" NAME="L952"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="radiobutton.htm#M19" NAME="L953"><I>pathName </I><B>deselect</B></A>
<DD><A HREF="radiobutton.htm#M20" NAME="L954"><I>pathName </I><B>flash</B></A>
<DD><A HREF="radiobutton.htm#M21" NAME="L955"><I>pathName </I><B>invoke</B></A>
<DD><A HREF="radiobutton.htm#M22" NAME="L956"><I>pathName </I><B>select</B></A>
</DL>
<DD><A HREF="radiobutton.htm#M23" NAME="L957">BINDINGS</A>
<DL>
</DL>
<DD><A HREF="radiobutton.htm#M24" NAME="L958">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
radiobutton - Create and manipulate radiobutton widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>radiobutton</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-activeforeground">-activeforeground, activeForeground, Background</A></B>
<DT><B><A HREF="options.htm#M-anchor">-anchor, anchor, Anchor</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-bitmap">-bitmap, bitmap, Bitmap</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-disabledforeground">-disabledforeground, disabledForeground, DisabledForeground</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-image">-image, image, Image</A></B>
<DT><B><A HREF="options.htm#M-justify">-justify, justify, Justify</A></B>
<DT><B><A HREF="options.htm#M-padx">-padx, padX, Pad</A></B>
<DT><B><A HREF="options.htm#M-pady">-pady, padY, Pad</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-text">-text, text, Text</A></B>
<DT><B><A HREF="options.htm#M-textvariable">-textvariable, textVariable, Variable</A></B>
<DT><B><A HREF="options.htm#M-underline">-underline, underline, Underline</A></B>
<DT><B><A HREF="options.htm#M-wraplength">-wraplength, wrapLength, WrapLength</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-command</A></B>
<DT>Database Name: <B>command</B>
<DT>Database Class: <B>Command</B>
<DD>Specifies a Tcl command to associate with the button. This command
is typically invoked when mouse button 1 is released over the button
window. The button's global variable (<B>-variable</B> option) will
be updated before the command is invoked.
<P><DT>Command-Line Name: <B><A NAME="M7">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies a desired height for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in lines of text.
If this option isn't specified, the button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
<P><DT>Command-Line Name: <B><A NAME="M8">-indicatoron</A></B>
<DT>Database Name: <B>indicatorOn</B>
<DT>Database Class: <B>IndicatorOn</B>
<DD>Specifies whether or not the indicator should be drawn. Must be a
proper boolean value. If false, the <B>relief</B> option is
ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise.
<P><DT>Command-Line Name: <B><A NAME="M9">-selectcolor</A></B>
<DT>Database Name: <B>selectColor</B>
<DT>Database Class: <B>Background</B>
<DD>Specifies a background color to use when the button is selected.
If <B>indicatorOn</B> is true then the color applies to the indicator.
Under Windows, this color is used as the background for the indicator
regardless of the select state.
If <B>indicatorOn</B> is false, this color is used as the background
for the entire widget, in place of <B>background</B> or <B>activeBackground</B>,
whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
<P><DT>Command-Line Name: <B><A NAME="M10">-selectimage</A></B>
<DT>Database Name: <B>selectImage</B>
<DT>Database Class: <B>SelectImage</B>
<DD>Specifies an image to display (in place of the <B>image</B> option)
when the radiobutton is selected.
This option is ignored unless the <B>image</B> option has been
specified.
<P><DT>Command-Line Name: <B><A NAME="M11">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the radiobutton: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the radiobutton is displayed using the
<B>foreground</B> and <B>background</B> options. The active state is
typically used when the pointer is over the radiobutton. In active state
the radiobutton is displayed using the <B>activeForeground</B> and
<B>activeBackground</B> options. Disabled state means that the radiobutton
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the <B>disabledForeground</B> and
<B>background</B> options determine how the radiobutton is displayed.
<P><DT>Command-Line Name: <B><A NAME="M12">-value</A></B>
<DT>Database Name: <B>value</B>
<DT>Database Class: <B>Value</B>
<DD>Specifies value to store in the button's associated variable whenever
this button is selected.
<P><DT>Command-Line Name: <B><A NAME="M13">-variable</A></B>
<DT>Database Name: <B><A HREF="../TkCmd/variable.htm">variable</A></B>
<DT>Database Class: <B><A HREF="../TkCmd/variable.htm">Variable</A></B>
<DD>Specifies name of global variable to set whenever this button is
selected. Changes in this variable also cause the button to select
or deselect itself.
Defaults to the value <B>selectedButton</B>.
<P><DT>Command-Line Name: <B><A NAME="M14">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies a desired width for the button.
If an image or bitmap is being displayed in the button, the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in characters.
If this option isn't specified, the button's desired width is computed
from the size of the image or bitmap or text being displayed in it.
</DL>
<H3><A NAME="M15">DESCRIPTION</A></H3>
The <B>radiobutton</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a radiobutton widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the radiobutton such as its colors, font,
text, and initial relief. The <B>radiobutton</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A radiobutton is a widget that displays a textual string, bitmap or image
and a diamond or circle called an <I>indicator</I>.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the <B>wrapLength</B> option) and
one of the characters may optionally be underlined using the
<B>underline</B> option. A radiobutton has
all of the behavior of a simple button: it can display itself in either
of three different ways, according to the <B>state</B> option;
it can be made to appear
raised, sunken, or flat; it can be made to flash; and it invokes
a Tcl command whenever mouse button 1 is clicked over the
check button.
<P>
In addition, radiobuttons can be <I>selected</I>.
If a radiobutton is selected, the indicator is normally
drawn with a selected appearance, and
a Tcl variable associated with the radiobutton is set to a particular
value (normally 1).
Under Unix, the indicator is drawn with a sunken relief and a special
color. Under Windows, the indicator is drawn with a round mark inside.
If the radiobutton is not selected, then the indicator is drawn with a
deselected appearance, and the associated variable is
set to a different value (typically 0).
Under Unix, the indicator is drawn with a raised relief and no special
color. Under Windows, the indicator is drawn without a round mark inside.
Typically, several radiobuttons share a single variable and the
value of the variable indicates which radiobutton is to be selected.
When a radiobutton is selected it sets the value of the variable to
indicate that fact; each radiobutton also monitors the value of
the variable and automatically selects and deselects itself when the
variable's value changes.
By default the variable <B>selectedButton</B>
is used; its contents give the name of the button that is
selected, or the empty string if no button associated with that
variable is selected.
The name of the variable for a radiobutton,
plus the variable to be stored into it, may be modified with options
on the command line or in the option database.
Configuration options may also be used to modify the way the
indicator is displayed (or whether it is displayed at all).
By default a radiobutton is configured to select itself on button clicks.
<H3><A NAME="M16">WIDGET COMMAND</A></H3>
The <B>radiobutton</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for radiobutton widgets:
<P>
<DL>
<P><DT><A NAME="M17"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>radiobutton</B>
command.
<P><DT><A NAME="M18"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>radiobutton</B>
command.
<P><DT><A NAME="M19"><I>pathName </I><B>deselect</B></A><DD>
Deselects the radiobutton and sets the associated variable to an
empty string.
If this radiobutton was not currently selected, the command has
no effect.
<P><DT><A NAME="M20"><I>pathName </I><B>flash</B></A><DD>
Flashes the radiobutton. This is accomplished by redisplaying the radiobutton
several times, alternating between active and normal colors. At
the end of the flash the radiobutton is left in the same normal/active
state as when the command was invoked.
This command is ignored if the radiobutton's state is <B>disabled</B>.
<P><DT><A NAME="M21"><I>pathName </I><B>invoke</B></A><DD>
Does just what would have happened if the user invoked the radiobutton
with the mouse: selects the button and invokes
its associated Tcl command, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the radiobutton.
This command is ignored if the radiobutton's state is <B>disabled</B>.
<P><DT><A NAME="M22"><I>pathName </I><B>select</B></A><DD>
Selects the radiobutton and sets the associated variable to the
value corresponding to this widget.
<P></DL>
<H3><A NAME="M23">BINDINGS</A></H3>
Tk automatically creates class bindings for radiobuttons that give them
the following default behavior:
<P>
<DL>
<P><DT>[1]<DD>
On Unix systems, a radiobutton activates whenever the mouse passes
over it and deactivates whenever the mouse leaves the radiobutton. On
Mac and Windows systems, when mouse button 1 is pressed over a
radiobutton, the button activates whenever the mouse pointer is inside
the button, and deactivates whenever the mouse pointer leaves the
button.
<P><DT>[2]<DD>
When mouse button 1 is pressed over a radiobutton it is invoked (it
becomes selected and the command associated with the button is
invoked, if there is one).
<P><DT>[3]<DD>
When a radiobutton has the input focus, the space key causes the radiobutton
to be invoked.
<P></DL>
<P>
If the radiobutton's state is <B>disabled</B> then none of the above
actions occur: the radiobutton is completely non-responsive.
<P>
The behavior of radiobuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M24">KEYWORDS</A></H3>
<A href="../Keywords/R.htm#radiobutton">radiobutton</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

27
hlp/en/tk/raise.htm Normal file
View File

@@ -0,0 +1,27 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - raise manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
raise - Change a window's position in the stacking order
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>raise </B><I>window </I>?<I>aboveThis</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
If the <I>aboveThis</I> argument is omitted then the command raises
<I>window</I> so that it is above all of its siblings in the stacking
order (it will not be obscured by any siblings and will obscure
any siblings that overlap it).
If <I>aboveThis</I> is specified then it must be the path name of
a window that is either a sibling of <I>window</I> or the descendant
of a sibling of <I>window</I>.
In this case the <B>raise</B> command will insert
<I>window</I> into the stacking order just above <I>aboveThis</I>
(or the ancestor of <I>aboveThis</I> that is a sibling of <I>window</I>);
this could end up either raising or lowering <I>window</I>.
<H3><A NAME="M5">SEE ALSO</A></H3>
<B><A HREF="../TclCmd/lower.htm">lower</A></B>
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/O.htm#obscure">obscure</A>, <A href="../Keywords/R.htm#raise">raise</A>, <A href="../Keywords/S.htm#stacking order">stacking order</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

334
hlp/en/tk/scale.htm Normal file
View File

@@ -0,0 +1,334 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - scale manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="scale.htm#M2" NAME="L964">NAME</A>
<DL><DD>scale - Create and manipulate scale widgets</DL>
<DD><A HREF="scale.htm#M3" NAME="L965">SYNOPSIS</A>
<DL>
<DD><B>scale</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="scale.htm#M4" NAME="L966">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-font">-font, font, Font</A>
<DD><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-orient">-orient, orient, Orient</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-repeatdelay">-repeatdelay, repeatDelay, RepeatDelay</A>
<DD><A HREF="options.htm#M-repeatinterval">-repeatinterval, repeatInterval, RepeatInterval</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-troughcolor">-troughcolor, troughColor, Background</A>
</DL>
<DD><A HREF="scale.htm#M5" NAME="L967">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="scale.htm#M6" NAME="L968">-bigincrement, bigIncrement, BigIncrement</A>
<DD><A HREF="scale.htm#M7" NAME="L969">-command, command, Command</A>
<DD><A HREF="scale.htm#M8" NAME="L970">-digits, digits, Digits</A>
<DD><A HREF="scale.htm#M9" NAME="L971">-from, from, From</A>
<DD><A HREF="scale.htm#M10" NAME="L972">-label, label, Label</A>
<DD><A HREF="scale.htm#M11" NAME="L973">-length, length, Length</A>
<DD><A HREF="scale.htm#M12" NAME="L974">-resolution, resolution, Resolution</A>
<DD><A HREF="scale.htm#M13" NAME="L975">-showvalue, showValue, ShowValue</A>
<DD><A HREF="scale.htm#M14" NAME="L976">-sliderlength, sliderLength, SliderLength</A>
<DD><A HREF="scale.htm#M15" NAME="L977">-sliderrelief, sliderRelief, SliderRelief</A>
<DD><A HREF="scale.htm#M16" NAME="L978">-state, state, State</A>
<DD><A HREF="scale.htm#M17" NAME="L979">-tickinterval, tickInterval, TickInterval</A>
<DD><A HREF="scale.htm#M18" NAME="L980">-to, to, To</A>
<DD><A HREF="scale.htm#M19" NAME="L981">-variable, variable, Variable</A>
<DD><A HREF="scale.htm#M20" NAME="L982">-width, width, Width</A>
</DL>
<DD><A HREF="scale.htm#M21" NAME="L983">DESCRIPTION</A>
<DD><A HREF="scale.htm#M22" NAME="L984">WIDGET COMMAND</A>
<DL>
<DD><A HREF="scale.htm#M23" NAME="L985"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="scale.htm#M24" NAME="L986"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="scale.htm#M25" NAME="L987"><I>pathName </I><B>coords </B>?<I>value</I>?</A>
<DD><A HREF="scale.htm#M26" NAME="L988"><I>pathName </I><B>get</B> ?<I>x y</I>?</A>
<DD><A HREF="scale.htm#M27" NAME="L989"><I>pathName </I><B>identify</B> <I>x y</I></A>
<DD><A HREF="scale.htm#M28" NAME="L990"><I>pathName </I><B>set</B> <I>value</I></A>
</DL>
<DD><A HREF="scale.htm#M29" NAME="L991">BINDINGS</A>
<DL>
</DL>
<DD><A HREF="scale.htm#M30" NAME="L992">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
scale - Create and manipulate scale widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>scale</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-font">-font, font, Font</A></B>
<DT><B><A HREF="options.htm#M-foreground">-foreground or -fg, foreground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-orient">-orient, orient, Orient</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-repeatdelay">-repeatdelay, repeatDelay, RepeatDelay</A></B>
<DT><B><A HREF="options.htm#M-repeatinterval">-repeatinterval, repeatInterval, RepeatInterval</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-troughcolor">-troughcolor, troughColor, Background</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-bigincrement</A></B>
<DT>Database Name: <B>bigIncrement</B>
<DT>Database Class: <B>BigIncrement</B>
<DD>Some interactions with the scale cause its value to change by
``large'' increments; this option specifies the size of the
large increments. If specified as 0, the large increments default
to 1/10 the range of the scale.
<P><DT>Command-Line Name: <B><A NAME="M7">-command</A></B>
<DT>Database Name: <B>command</B>
<DT>Database Class: <B>Command</B>
<DD>Specifies the prefix of a Tcl command to invoke whenever the scale's
value is changed via a widget command.
The actual command consists
of this option followed by a space and a real number indicating the
new value of the scale.
<P><DT>Command-Line Name: <B><A NAME="M8">-digits</A></B>
<DT>Database Name: <B>digits</B>
<DT>Database Class: <B>Digits</B>
<DD>An integer specifying how many significant digits should be retained
when converting the value of the scale to a string.
If the number is less than or equal to zero, then the scale picks
the smallest value that guarantees that every possible slider
position prints as a different string.
<P><DT>Command-Line Name: <B><A NAME="M9">-from</A></B>
<DT>Database Name: <B>from</B>
<DT>Database Class: <B>From</B>
<DD>A real value corresponding to the left or top end of the scale.
<P><DT>Command-Line Name: <B><A NAME="M10">-label</A></B>
<DT>Database Name: <B><A HREF="../TclCmd/label.htm">label</A></B>
<DT>Database Class: <B><A HREF="../TclCmd/label.htm">Label</A></B>
<DD>A string to display as a label for the scale. For
vertical scales the label is displayed just to the right of the
top end of the scale. For horizontal scales the label is displayed
just above the left end of the scale. If the option is specified
as an empty string, no label is displayed.
<P><DT>Command-Line Name: <B><A NAME="M11">-length</A></B>
<DT>Database Name: <B>length</B>
<DT>Database Class: <B>Length</B>
<DD>Specifies the desired long dimension of the scale in screen units
(i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>).
For vertical scales this is the scale's height; for horizontal scales
it is the scale's width.
<P><DT>Command-Line Name: <B><A NAME="M12">-resolution</A></B>
<DT>Database Name: <B>resolution</B>
<DT>Database Class: <B>Resolution</B>
<DD>A real value specifying the resolution for the scale.
If this value is greater than zero then the scale's value will always be
rounded to an even multiple of this value, as will tick marks and
the endpoints of the scale. If the value is less than zero then no
rounding occurs. Defaults to 1 (i.e., the value will be integral).
<P><DT>Command-Line Name: <B><A NAME="M13">-showvalue</A></B>
<DT>Database Name: <B>showValue</B>
<DT>Database Class: <B>ShowValue</B>
<DD>Specifies a boolean value indicating whether or not the current
value of the scale is to be displayed.
<P><DT>Command-Line Name: <B><A NAME="M14">-sliderlength</A></B>
<DT>Database Name: <B>sliderLength</B>
<DT>Database Class: <B>SliderLength</B>
<DD>Specfies the size of the slider, measured in screen units along the slider's
long dimension. The value may be specified in any of the forms acceptable
to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
<P><DT>Command-Line Name: <B><A NAME="M15">-sliderrelief</A></B>
<DT>Database Name: <B>sliderRelief</B>
<DT>Database Class: <B>SliderRelief</B>
<DD>Specifies the relief to use when drawing the slider, such as <B>raised</B>
or <B>sunken</B>.
<P><DT>Command-Line Name: <B><A NAME="M16">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the scale: <B>normal</B>,
<B>active</B>, or <B>disabled</B>.
If the scale is disabled then the value may not be changed and the scale
won't activate.
If the scale is active, the slider is displayed using the color
specified by the <B>activeBackground</B> option.
<P><DT>Command-Line Name: <B><A NAME="M17">-tickinterval</A></B>
<DT>Database Name: <B>tickInterval</B>
<DT>Database Class: <B>TickInterval</B>
<DD>Must be a real value.
Determines the spacing between numerical
tick marks displayed below or to the left of the slider.
If 0, no tick marks will be displayed.
<P><DT>Command-Line Name: <B><A NAME="M18">-to</A></B>
<DT>Database Name: <B>to</B>
<DT>Database Class: <B>To</B>
<DD>Specifies a real value corresponding
to the right or bottom end of the scale.
This value may be either less than or greater than the <B>from</B> option.
<P><DT>Command-Line Name: <B><A NAME="M19">-variable</A></B>
<DT>Database Name: <B><A HREF="../TkCmd/variable.htm">variable</A></B>
<DT>Database Class: <B><A HREF="../TkCmd/variable.htm">Variable</A></B>
<DD>Specifies the name of a global variable to link to the scale. Whenever the
value of the variable changes, the scale will update to reflect this
value.
Whenever the scale is manipulated interactively, the variable
will be modified to reflect the scale's new value.
<P><DT>Command-Line Name: <B><A NAME="M20">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the desired narrow dimension of the trough in screen units
(i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>).
For vertical scales this is the trough's width; for horizontal scales
this is the trough's height.
</DL>
<H3><A NAME="M21">DESCRIPTION</A></H3>
The <B>scale</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a scale widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the scale such as its colors, orientation,
and relief. The <B>scale</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A scale is a widget that displays a rectangular <I>trough</I> and a
small <I>slider</I>. The trough corresponds to a range
of real values (determined by the <B>from</B>, <B>to</B>, and
<B>resolution</B> options),
and the position of the slider selects a particular real value.
The slider's position (and hence the scale's value) may be adjusted
with the mouse or keyboard as described in the BINDINGS
section below. Whenever the scale's value is changed, a Tcl
command is invoked (using the <B>command</B> option) to notify
other interested widgets of the change.
In addition, the value
of the scale can be linked to a Tcl variable (using the <B><A HREF="../TkCmd/variable.htm">variable</A></B>
option), so that changes in either are reflected in the other.
<P>
Three annotations may be displayed in a scale widget: a label
appearing at the top right of the widget (top left for horizontal
scales), a number displayed just to the left of the slider
(just above the slider for horizontal scales), and a collection
of numerical tick marks just to the left of the current value
(just below the trough for horizontal scales). Each of these three
annotations may be enabled or disabled using the
configuration options.
<H3><A NAME="M22">WIDGET COMMAND</A></H3>
The <B>scale</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for scale widgets:
<P>
<DL>
<P><DT><A NAME="M23"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>scale</B>
command.
<P><DT><A NAME="M24"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>scale</B>
command.
<P><DT><A NAME="M25"><I>pathName </I><B>coords </B>?<I>value</I>?</A><DD>
Returns a list whose elements are the x and y coordinates of
the point along the centerline of the trough that corresponds
to <I>value</I>.
If <I>value</I> is omitted then the scale's current value is used.
<P><DT><A NAME="M26"><I>pathName </I><B>get</B> ?<I>x y</I>?</A><DD>
If <I>x</I> and <I>y</I> are omitted, returns the current value
of the scale. If <I>x</I> and <I>y</I> are specified, they give
pixel coordinates within the widget; the command returns
the scale value corresponding to the given pixel.
Only one of <I>x</I> or <I>y</I> is used: for horizontal scales
<I>y</I> is ignored, and for vertical scales <I>x</I> is ignored.
<P><DT><A NAME="M27"><I>pathName </I><B>identify</B> <I>x y</I></A><DD>
Returns a string indicating what part of the scale lies under
the coordinates given by <I>x</I> and <I>y</I>.
A return value of <B>slider</B> means that the point is over
the slider; <B>trough1</B> means that the point is over the
portion of the slider above or to the left of the slider;
and <B>trough2</B> means that the point is over the portion
of the slider below or to the right of the slider.
If the point isn't over one of these elements, an empty string
is returned.
<P><DT><A NAME="M28"><I>pathName </I><B>set</B> <I>value</I></A><DD>
This command is invoked to change the current value of the scale,
and hence the position at which the slider is displayed. <I>Value</I>
gives the new value for the scale.
The command has no effect if the scale is disabled.
<P></DL>
<H3><A NAME="M29">BINDINGS</A></H3>
Tk automatically creates class bindings for scales that give them
the following default behavior.
Where the behavior is different for vertical and horizontal scales,
the horizontal behavior is described in parentheses.
<P>
<DL>
<P><DT>[1]<DD>
If button 1 is pressed in the trough, the scale's value will
be incremented or decremented by the value of the <B>resolution</B>
option so that the slider moves in the direction of the cursor.
If the button is held down, the action auto-repeats.
<P><DT>[2]<DD>
If button 1 is pressed over the slider, the slider can be dragged
with the mouse.
<P><DT>[3]<DD>
If button 1 is pressed in the trough with the Control key down,
the slider moves all the way to the end of its range, in the
direction towards the mouse cursor.
<P><DT>[4]<DD>
If button 2 is pressed, the scale's value is set to the mouse
position. If the mouse is dragged with button 2 down, the scale's
value changes with the drag.
<P><DT>[5]<DD>
The Up and Left keys move the slider up (left) by the value
of the <B>resolution</B> option.
<P><DT>[6]<DD>
The Down and Right keys move the slider down (right) by the value
of the <B>resolution</B> option.
<P><DT>[7]<DD>
Control-Up and Control-Left move the slider up (left) by the
value of the <B>bigIncrement</B> option.
<P><DT>[8]<DD>
Control-Down and Control-Right move the slider down (right) by the
value of the <B>bigIncrement</B> option.
<P><DT>[9]<DD>
Home moves the slider to the top (left) end of its range.
<P><DT>[10]<DD>
End moves the slider to the bottom (right) end of its range.
<P></DL>
<P>
If the scale is disabled using the <B>state</B> option then
none of the above bindings have any effect.
<P>
The behavior of scales can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M30">KEYWORDS</A></H3>
<A href="../Keywords/S.htm#scale">scale</A>, <A href="../Keywords/S.htm#slider">slider</A>, <A href="../Keywords/T.htm#trough">trough</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

414
hlp/en/tk/scrollbar.htm Normal file
View File

@@ -0,0 +1,414 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - scrollbar manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="scrollbar.htm#M2" NAME="L993">NAME</A>
<DL><DD>scrollbar - Create and manipulate scrollbar widgets</DL>
<DD><A HREF="scrollbar.htm#M3" NAME="L994">SYNOPSIS</A>
<DL>
<DD><B>scrollbar</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="scrollbar.htm#M4" NAME="L995">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A>
<DD><A HREF="options.htm#M-background">-background or -bg, background, Background</A>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-jump">-jump, jump, Jump</A>
<DD><A HREF="options.htm#M-orient">-orient, orient, Orient</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-repeatdelay">-repeatdelay, repeatDelay, RepeatDelay</A>
<DD><A HREF="options.htm#M-repeatinterval">-repeatinterval, repeatInterval, RepeatInterval</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
<DD><A HREF="options.htm#M-troughcolor">-troughcolor, troughColor, Background</A>
</DL>
<DD><A HREF="scrollbar.htm#M5" NAME="L996">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="scrollbar.htm#M6" NAME="L997">-activerelief, activeRelief, ActiveRelief</A>
<DD><A HREF="scrollbar.htm#M7" NAME="L998">-command, command, Command</A>
<DD><A HREF="scrollbar.htm#M8" NAME="L999">-elementborderwidth, elementBorderWidth, BorderWidth</A>
<DD><A HREF="scrollbar.htm#M9" NAME="L1000">-width, width, Width</A>
</DL>
<DD><A HREF="scrollbar.htm#M10" NAME="L1001">DESCRIPTION</A>
<DD><A HREF="scrollbar.htm#M11" NAME="L1002">ELEMENTS</A>
<DL>
<DD><A HREF="scrollbar.htm#M12" NAME="L1003"><B>arrow1</B></A>
<DD><A HREF="scrollbar.htm#M13" NAME="L1004"><B>trough1</B></A>
<DD><A HREF="scrollbar.htm#M14" NAME="L1005"><B>slider</B></A>
<DD><A HREF="scrollbar.htm#M15" NAME="L1006"><B>trough2</B></A>
<DD><A HREF="scrollbar.htm#M16" NAME="L1007"><B>arrow2</B></A>
</DL>
<DD><A HREF="scrollbar.htm#M17" NAME="L1008">WIDGET COMMAND</A>
<DL>
<DD><A HREF="scrollbar.htm#M18" NAME="L1009"><I>pathName </I><B>activate </B>?<I>element</I>?</A>
<DD><A HREF="scrollbar.htm#M19" NAME="L1010"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="scrollbar.htm#M20" NAME="L1011"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
<DD><A HREF="scrollbar.htm#M21" NAME="L1012"><I>pathName </I><B>delta </B><I>deltaX deltaY</I></A>
<DD><A HREF="scrollbar.htm#M22" NAME="L1013"><I>pathName </I><B>fraction </B><I>x y</I></A>
<DD><A HREF="scrollbar.htm#M23" NAME="L1014"><I>pathName </I><B>get</B></A>
<DD><A HREF="scrollbar.htm#M24" NAME="L1015"><I>pathName </I><B>identify</B> <I>x y</I></A>
<DD><A HREF="scrollbar.htm#M25" NAME="L1016"><I>pathName </I><B>set</B> <I>first last</I></A>
</DL>
<DD><A HREF="scrollbar.htm#M26" NAME="L1017">SCROLLING COMMANDS</A>
<DL>
<DD><A HREF="scrollbar.htm#M27" NAME="L1018"><I>prefix </I><B>moveto </B><I>fraction</I></A>
<DD><A HREF="scrollbar.htm#M28" NAME="L1019"><I>prefix </I><B>scroll </B><I>number </I><B>units</B></A>
<DD><A HREF="scrollbar.htm#M29" NAME="L1020"><I>prefix </I><B>scroll </B><I>number </I><B>pages</B></A>
</DL>
<DD><A HREF="scrollbar.htm#M30" NAME="L1021">OLD COMMAND SYNTAX</A>
<DL>
<DD><A HREF="scrollbar.htm#M31" NAME="L1022"><I>pathName </I><B>set</B> <I>totalUnits windowUnits firstUnit lastUnit</I></A>
</DL>
<DL>
<DD><A HREF="scrollbar.htm#M32" NAME="L1023"><I>prefix</I> <I>unit</I></A>
</DL>
<DD><A HREF="scrollbar.htm#M33" NAME="L1024">BINDINGS</A>
<DL>
</DL>
<DD><A HREF="scrollbar.htm#M34" NAME="L1025">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
scrollbar - Create and manipulate scrollbar widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>scrollbar</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground">-activebackground, activeBackground, Foreground</A></B>
<DT><B><A HREF="options.htm#M-background">-background or -bg, background, Background</A></B>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-jump">-jump, jump, Jump</A></B>
<DT><B><A HREF="options.htm#M-orient">-orient, orient, Orient</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-repeatdelay">-repeatdelay, repeatDelay, RepeatDelay</A></B>
<DT><B><A HREF="options.htm#M-repeatinterval">-repeatinterval, repeatInterval, RepeatInterval</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
<DT><B><A HREF="options.htm#M-troughcolor">-troughcolor, troughColor, Background</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-activerelief</A></B>
<DT>Database Name: <B>activeRelief</B>
<DT>Database Class: <B>ActiveRelief</B>
<DD>Specifies the relief to use when displaying the element that is
active, if any.
Elements other than the active element are always displayed with
a raised relief.
<P><DT>Command-Line Name: <B><A NAME="M7">-command</A></B>
<DT>Database Name: <B>command</B>
<DT>Database Class: <B>Command</B>
<DD>Specifies the prefix of a Tcl command to invoke to change the view
in the widget associated with the scrollbar. When a user requests
a view change by manipulating the scrollbar, a Tcl command is
invoked. The actual command consists of this option followed by
additional information as described later. This option almost always has
a value such as <B>.t xview</B> or <B>.t yview</B>, consisting of the
name of a widget and either <B>xview</B> (if the scrollbar is for
horizontal scrolling) or <B>yview</B> (for vertical scrolling).
All scrollable widgets have <B>xview</B> and <B>yview</B> commands
that take exactly the additional arguments appended by the scrollbar
as described in SCROLLING COMMANDS below.
<P><DT>Command-Line Name: <B><A NAME="M8">-elementborderwidth</A></B>
<DT>Database Name: <B>elementBorderWidth</B>
<DT>Database Class: <B>BorderWidth</B>
<DD>Specifies the width of borders drawn around the internal elements
of the scrollbar (the two arrows and the slider). The value may
have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this value is less than zero, the value of the <B>borderWidth</B>
option is used in its place.
<P><DT>Command-Line Name: <B><A NAME="M9">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the desired narrow dimension of the scrollbar window,
not including 3-D border, if any. For vertical
scrollbars this will be the width and for horizontal scrollbars
this will be the height.
The value may have any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
</DL>
<H3><A NAME="M10">DESCRIPTION</A></H3>
The <B>scrollbar</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a scrollbar widget.
Additional options, described above, may be specified on the command
line or in the option database to configure aspects of the scrollbar
such as its colors, orientation, and relief.
The <B>scrollbar</B> command returns its <I>pathName</I> argument.
At the time this command is invoked, there must not exist a window
named <I>pathName</I>, but <I>pathName</I>'s parent must exist.
<P>
A scrollbar is a widget that displays two arrows, one at each end of
the scrollbar, and a <I>slider</I> in the middle portion of the
scrollbar.
It provides information about what is visible in an <I>associated window</I>
that displays an document of some sort (such as a file being edited or
a drawing).
The position and size of the slider indicate which portion of the
document is visible in the associated window. For example, if the
slider in a vertical scrollbar covers the top third of the area
between the two arrows, it means that the associated window displays
the top third of its document.
<P>
Scrollbars can be used to adjust the view in the associated window
by clicking or dragging with the mouse. See the BINDINGS section
below for details.
<H3><A NAME="M11">ELEMENTS</A></H3>
A scrollbar displays five elements, which are referred to in the
widget commands for the scrollbar:
<P>
<DL>
<P><DT><A NAME="M12"><B>arrow1</B></A><DD>
The top or left arrow in the scrollbar.
<P><DT><A NAME="M13"><B>trough1</B></A><DD>
The region between the slider and <B>arrow1</B>.
<P><DT><A NAME="M14"><B>slider</B></A><DD>
The rectangle that indicates what is visible in the associated widget.
<P><DT><A NAME="M15"><B>trough2</B></A><DD>
The region between the slider and <B>arrow2</B>.
<P><DT><A NAME="M16"><B>arrow2</B></A><DD>
The bottom or right arrow in the scrollbar.
<P></DL>
<H3><A NAME="M17">WIDGET COMMAND</A></H3>
The <B>scrollbar</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for scrollbar widgets:
<P>
<DL>
<P><DT><A NAME="M18"><I>pathName </I><B>activate </B>?<I>element</I>?</A><DD>
Marks the element indicated by <I>element</I> as active, which
causes it to be displayed as specified by the <B>activeBackground</B>
and <B>activeRelief</B> options.
The only element values understood by this command are <B>arrow1</B>,
<B>slider</B>, or <B>arrow2</B>.
If any other value is specified then no element of the scrollbar
will be active.
If <I>element</I> is not specified, the command returns
the name of the element that is currently active, or an empty string
if no element is active.
<P><DT><A NAME="M19"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>scrollbar</B>
command.
<P><DT><A NAME="M20"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>scrollbar</B>
command.
<P><DT><A NAME="M21"><I>pathName </I><B>delta </B><I>deltaX deltaY</I></A><DD>
Returns a real number indicating the fractional change in
the scrollbar setting that corresponds to a given change
in slider position. For example, if the scrollbar is horizontal,
the result indicates how much the scrollbar setting must change
to move the slider <I>deltaX</I> pixels to the right (<I>deltaY</I> is
ignored in this case).
If the scrollbar is vertical, the result indicates how much the
scrollbar setting must change to move the slider <I>deltaY</I> pixels
down. The arguments and the result may be zero or negative.
<P><DT><A NAME="M22"><I>pathName </I><B>fraction </B><I>x y</I></A><DD>
Returns a real number between 0 and 1 indicating where the point
given by <I>x</I> and <I>y</I> lies in the trough area of the scrollbar.
The value 0 corresponds to the top or left of the trough, the
value 1 corresponds to the bottom or right, 0.5 corresponds to
the middle, and so on.
<I>X</I> and <I>y</I> must be pixel coordinates relative to the scrollbar
widget.
If <I>x</I> and <I>y</I> refer to a point outside the trough, the closest
point in the trough is used.
<P><DT><A NAME="M23"><I>pathName </I><B>get</B></A><DD>
Returns the scrollbar settings in the form of a list whose
elements are the arguments to the most recent <B>set</B> widget command.
<P><DT><A NAME="M24"><I>pathName </I><B>identify</B> <I>x y</I></A><DD>
Returns the name of the element under the point given by <I>x</I> and
<I>y</I> (such as <B>arrow1</B>), or an empty string if the point does
not lie in any element of the scrollbar.
<I>X</I> and <I>y</I> must be pixel coordinates relative to the scrollbar
widget.
<P><DT><A NAME="M25"><I>pathName </I><B>set</B> <I>first last</I></A><DD>
This command is invoked by the scrollbar's associated widget to
tell the scrollbar about the current view in the widget.
The command takes two arguments, each of which is a real fraction
between 0 and 1.
The fractions describe the range of the document that is visible in
the associated widget.
For example, if <I>first</I> is 0.2 and <I>last</I> is 0.4, it means
that the first part of the document visible in the window is 20%
of the way through the document, and the last visible part is 40%
of the way through.
<P></DL>
<H3><A NAME="M26">SCROLLING COMMANDS</A></H3>
When the user interacts with the scrollbar, for example by dragging
the slider, the scrollbar notifies the associated widget that it
must change its view.
The scrollbar makes the notification by evaluating a Tcl command
generated from the scrollbar's <B>-command</B> option.
The command may take any of the following forms.
In each case, <I>prefix</I> is the contents of the
<B>-command</B> option, which usually has a form like <B>.t yview</B>
<P>
<DL>
<P><DT><A NAME="M27"><I>prefix </I><B>moveto </B><I>fraction</I></A><DD>
<I>Fraction</I> is a real number between 0 and 1.
The widget should adjust its view so that the point given
by <I>fraction</I> appears at the beginning of the widget.
If <I>fraction</I> is 0 it refers to the beginning of the
document. 1.0 refers to the end of the document, 0.333
refers to a point one-third of the way through the document,
and so on.
<P><DT><A NAME="M28"><I>prefix </I><B>scroll </B><I>number </I><B>units</B></A><DD>
The widget should adjust its view by <I>number</I> units.
The units are defined in whatever way makes sense for the widget,
such as characters or lines in a text widget.
<I>Number</I> is either 1, which means one unit should scroll off
the top or left of the window, or -1, which means that one unit
should scroll off the bottom or right of the window.
<P><DT><A NAME="M29"><I>prefix </I><B>scroll </B><I>number </I><B>pages</B></A><DD>
The widget should adjust its view by <I>number</I> pages.
It is up to the widget to define the meaning of a page; typically
it is slightly less than what fits in the window, so that there
is a slight overlap between the old and new views.
<I>Number</I> is either 1, which means the next page should
become visible, or -1, which means that the previous page should
become visible.
<P></DL>
<H3><A NAME="M30">OLD COMMAND SYNTAX</A></H3>
In versions of Tk before 4.0, the <B>set</B> and <B>get</B> widget
commands used a different form.
This form is still supported for backward compatibility, but it
is deprecated.
In the old command syntax, the <B>set</B> widget command has the
following form:
<P>
<DL>
<P><DT><A NAME="M31"><I>pathName </I><B>set</B> <I>totalUnits windowUnits firstUnit lastUnit</I></A><DD>
In this form the arguments are all integers.
<I>TotalUnits</I> gives the total size of the object being displayed in the
associated widget. The meaning of one unit depends on the associated
widget; for example, in a text editor widget units might
correspond to lines of
text. <I>WindowUnits</I> indicates the total number of units that
can fit in the associated window at one time. <I>FirstUnit</I>
and <I>lastUnit</I> give the indices of the first and last units
currently visible in the associated window (zero corresponds to the
first unit of the object).
<P></DL>
<P>
Under the old syntax the <B>get</B> widget command returns a list
of four integers, consisting of the <I>totalUnits</I>, <I>windowUnits</I>,
<I>firstUnit</I>, and <I>lastUnit</I> values from the last <B>set</B>
widget command.
<P>
The commands generated by scrollbars also have a different form
when the old syntax is being used:
<P>
<DL>
<P><DT><A NAME="M32"><I>prefix</I> <I>unit</I></A><DD>
<I>Unit</I> is an integer that indicates what should appear at
the top or left of the associated widget's window.
It has the same meaning as the <I>firstUnit</I> and <I>lastUnit</I>
arguments to the <B>set</B> widget command.
<P></DL>
<P>
The most recent <B>set</B> widget command determines whether or not
to use the old syntax.
If it is given two real arguments then the new syntax will be
used in the future, and if it is given four integer arguments then
the old syntax will be used.
<H3><A NAME="M33">BINDINGS</A></H3>
Tk automatically creates class bindings for scrollbars that give them
the following default behavior.
If the behavior is different for vertical and horizontal scrollbars,
the horizontal behavior is described in parentheses.
<P>
<DL>
<P><DT>[1]<DD>
Pressing button 1 over <B>arrow1</B> causes the view in the
associated widget to shift up (left) by one unit so that the
document appears to move down (right) one unit.
If the button is held down, the action auto-repeats.
<P><DT>[2]<DD>
Pressing button 1 over <B>trough1</B> causes the view in the
associated widget to shift up (left) by one screenful so that the
document appears to move down (right) one screenful.
If the button is held down, the action auto-repeats.
<P><DT>[3]<DD>
Pressing button 1 over the slider and dragging causes the view
to drag with the slider.
If the <B>jump</B> option is true, then the view doesn't drag along
with the slider; it changes only when the mouse button is released.
<P><DT>[4]<DD>
Pressing button 1 over <B>trough2</B> causes the view in the
associated widget to shift down (right) by one screenful so that the
document appears to move up (left) one screenful.
If the button is held down, the action auto-repeats.
<P><DT>[5]<DD>
Pressing button 1 over <B>arrow2</B> causes the view in the
associated widget to shift down (right) by one unit so that the
document appears to move up (left) one unit.
If the button is held down, the action auto-repeats.
<P><DT>[6]<DD>
If button 2 is pressed over the trough or the slider, it sets
the view to correspond to the mouse position; dragging the
mouse with button 2 down causes the view to drag with the mouse.
If button 2 is pressed over one of the arrows, it causes the
same behavior as pressing button 1.
<P><DT>[7]<DD>
If button 1 is pressed with the Control key down, then if the
mouse is over <B>arrow1</B> or <B>trough1</B> the view changes
to the very top (left) of the document; if the mouse is over
<B>arrow2</B> or <B>trough2</B> the view changes
to the very bottom (right) of the document; if the mouse is
anywhere else then the button press has no effect.
<P><DT>[8]<DD>
In vertical scrollbars the Up and Down keys have the same behavior
as mouse clicks over <B>arrow1</B> and <B>arrow2</B>, respectively.
In horizontal scrollbars these keys have no effect.
<P><DT>[9]<DD>
In vertical scrollbars Control-Up and Control-Down have the same
behavior as mouse clicks over <B>trough1</B> and <B>trough2</B>, respectively.
In horizontal scrollbars these keys have no effect.
<P><DT>[10]<DD>
In horizontal scrollbars the Up and Down keys have the same behavior
as mouse clicks over <B>arrow1</B> and <B>arrow2</B>, respectively.
In vertical scrollbars these keys have no effect.
<P><DT>[11]<DD>
In horizontal scrollbars Control-Up and Control-Down have the same
behavior as mouse clicks over <B>trough1</B> and <B>trough2</B>, respectively.
In vertical scrollbars these keys have no effect.
<P><DT>[12]<DD>
The Prior and Next keys have the same behavior
as mouse clicks over <B>trough1</B> and <B>trough2</B>, respectively.
<P><DT>[13]<DD>
The Home key adjusts the view to the top (left edge) of the document.
<P><DT>[14]<DD>
The End key adjusts the view to the bottom (right edge) of the document.
<P></DL>
<H3><A NAME="M34">KEYWORDS</A></H3>
<A href="../Keywords/S.htm#scrollbar">scrollbar</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

130
hlp/en/tk/selection.htm Normal file
View File

@@ -0,0 +1,130 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - selection manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="selection.htm#M2" NAME="L1026">NAME</A>
<DL><DD>selection - Manipulate the X selection</DL>
<DD><A HREF="selection.htm#M3" NAME="L1027">SYNOPSIS</A>
<DL>
<DD><B>selection </B><I>option</I> ?<I>arg arg ...</I>?
</DL>
<DD><A HREF="selection.htm#M4" NAME="L1028">DESCRIPTION</A>
<DL>
<DD><A HREF="selection.htm#M5" NAME="L1029"><B>selection clear</B> ?<B>-displayof</B> <I>window</I>? ?<B>-selection</B> <I>selection</I>?</A>
<DD><A HREF="selection.htm#M6" NAME="L1030"><B>selection get</B> ?<B>-displayof</B> <I>window</I>? ?<B>-selection</B> <I>selection</I>? ?<B>-type</B> <I>type</I>?</A>
<DD><A HREF="selection.htm#M7" NAME="L1031"><B>selection handle</B> ?<B>-selection</B> <I>selection</I>? ?<B>-type</B> <I>type</I>? ?<B>-format</B> <I>format</I>? <I>window command</I></A>
<DD><A HREF="selection.htm#M8" NAME="L1032"><B>selection own</B> ?<B>-displayof</B> <I>window</I>? ?<B>-selection</B> <I>selection</I>?</A>
<DD><A HREF="selection.htm#M9" NAME="L1033"><B>selection own</B> ?<B>-command</B> <I>command</I>? ?<B>-selection</B> <I>selection</I>? <I>window</I></A>
</DL>
<DD><A HREF="selection.htm#M10" NAME="L1034">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
selection - Manipulate the X selection
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>selection </B><I>option</I> ?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command provides a Tcl interface to the X selection mechanism and
implements the full selection functionality described in the
X Inter-Client Communication Conventions Manual (ICCCM).
<P>
The first argument to <B>selection</B> determines the format of the
rest of the arguments and the behavior of the command. The following
forms are currently supported:
<P>
<P>
<DL>
<P><DT><A NAME="M5"><B>selection clear</B> ?<B>-displayof</B> <I>window</I>? ?<B>-selection</B> <I>selection</I>?</A><DD>
If <I>selection</I> exists anywhere on <I>window</I>'s display, clear it
so that no window owns the selection anymore. <I>Selection</I>
specifies the X selection that should be cleared, and should be an
atom name such as PRIMARY or CLIPBOARD; see the Inter-Client
Communication Conventions Manual for complete details.
<I>Selection</I> defaults to PRIMARY and <I>window</I> defaults to ``.''.
Returns an empty string.
<P><DT><A NAME="M6"><B>selection get</B> ?<B>-displayof</B> <I>window</I>? ?<B>-selection</B> <I>selection</I>? ?<B>-type</B> <I>type</I>?</A><DD>
Retrieves the value of <I>selection</I> from <I>window</I>'s display and
returns it as a result. <I>Selection</I> defaults to PRIMARY and
<I>window</I> defaults to ``.''.
<I>Type</I> specifies the form in which the selection is to be returned
(the desired ``target'' for conversion, in ICCCM terminology), and
should be an atom name such as STRING or FILE_NAME; see the
Inter-Client Communication Conventions Manual for complete details.
<I>Type</I> defaults to STRING. The selection owner may choose to
return the selection in any of several different representation
formats, such as STRING, ATOM, INTEGER, etc. (this format is different
than the selection type; see the ICCCM for all the confusing details).
If the selection is returned in a non-string format, such as INTEGER
or ATOM, the <B>selection</B> command converts it to string format as a
collection of fields separated by spaces: atoms are converted to their
textual names, and anything else is converted to hexadecimal integers.
<P><DT><A NAME="M7"><B>selection handle</B> ?<B>-selection</B> <I>selection</I>? ?<B>-type</B> <I>type</I>? ?<B>-format</B> <I>format</I>? <I>window command</I></A><DD>
Creates a handler for selection requests, such that <I>command</I> will
be executed whenever <I>selection</I> is owned by <I>window</I> and
someone attempts to retrieve it in the form given by <I>type</I>
(e.g. <I>type</I> is specified in the <B>selection get</B> command).
<I>Selection</I> defaults to PRIMARY, <I>type</I> defaults to STRING, and
<I>format</I> defaults to STRING. If <I>command</I> is an empty string
then any existing handler for <I>window</I>, <I>type</I>, and
<I>selection</I> is removed.
<P>
When <I>selection</I> is requested, <I>window</I> is the selection owner,
and <I>type</I> is the requested type, <I>command</I> will be executed
as a Tcl command with two additional numbers appended to it
(with space separators).
The two additional numbers
are <I>offset</I> and <I>maxChars</I>: <I>offset</I> specifies a starting
character position in the selection and <I>maxChars</I> gives the maximum
number of characters to retrieve. The command should return a value consisting
of at most <I>maxChars</I> of the selection, starting at position
<I>offset</I>. For very large selections (larger than <I>maxChars</I>)
the selection will be retrieved using several invocations of <I>command</I>
with increasing <I>offset</I> values. If <I>command</I> returns a string
whose length is less than <I>maxChars</I>, the return value is assumed to
include all of the remainder of the selection; if the length of
<I>command</I>'s result is equal to <I>maxChars</I> then
<I>command</I> will be invoked again, until it eventually
returns a result shorter than <I>maxChars</I>. The value of <I>maxChars</I>
will always be relatively large (thousands of characters).
<P>
If <I>command</I> returns an error then the selection retrieval is rejected
just as if the selection didn't exist at all.
<P>
The <I>format</I> argument specifies the representation that should be
used to transmit the selection to the requester (the second column of
Table 2 of the ICCCM), and defaults to STRING. If <I>format</I> is
STRING, the selection is transmitted as 8-bit ASCII characters (i.e.
just in the form returned by <I>command</I>). If <I>format</I> is
ATOM, then the return value from <I>command</I> is divided into fields
separated by white space; each field is converted to its atom value,
and the 32-bit atom value is transmitted instead of the atom name.
For any other <I>format</I>, the return value from <I>command</I> is
divided into fields separated by white space and each field is
converted to a 32-bit integer; an array of integers is transmitted
to the selection requester.
<P>The <I>format</I> argument is needed only for compatibility with
selection requesters that don't use Tk. If Tk is being
used to retrieve the selection then the value is converted back to
a string at the requesting end, so <I>format</I> is
irrelevant.
<P><DT><A NAME="M8"><B>selection own</B> ?<B>-displayof</B> <I>window</I>? ?<B>-selection</B> <I>selection</I>?</A><DD>
<P><DT><A NAME="M9"><B>selection own</B> ?<B>-command</B> <I>command</I>? ?<B>-selection</B> <I>selection</I>? <I>window</I></A><DD>
The first form of <B>selection own</B> returns the path name of the
window in this application that owns <I>selection</I> on the display
containing <I>window</I>, or an empty string if no window in this
application owns the selection. <I>Selection</I> defaults to PRIMARY and
<I>window</I> defaults to ``.''.
<P></DL>
<P>
The second form of <B>selection own</B> causes <I>window</I> to become
the new owner of <I>selection</I> on <I>window</I>'s display, returning
an empty string as result. The existing owner, if any, is notified
that it has lost the selection.
If <I>command</I> is specified, it is a Tcl script to execute when
some other window claims ownership of the selection away from
<I>window</I>. <I>Selection</I> defaults to PRIMARY.
<H3><A NAME="M10">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#clear">clear</A>, <A href="../Keywords/F.htm#format">format</A>, <A href="../Keywords/H.htm#handler">handler</A>, <A href="../Keywords/I.htm#ICCCM">ICCCM</A>, <A href="../Keywords/O.htm#own">own</A>, <A href="../Keywords/S.htm#selection">selection</A>, <A href="../Keywords/T.htm#target">target</A>, <A href="../Keywords/T.htm#type">type</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

98
hlp/en/tk/send.htm Normal file
View File

@@ -0,0 +1,98 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - send manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="send.htm#M2" NAME="L1035">NAME</A>
<DL><DD>send - Execute a command in a different application</DL>
<DD><A HREF="send.htm#M3" NAME="L1036">SYNOPSIS</A>
<DL>
<DD><B>send ?</B><I>options</I>? <I>app cmd </I>?<I>arg arg ...</I>?
</DL>
<DD><A HREF="send.htm#M4" NAME="L1037">DESCRIPTION</A>
<DL>
<DD><A HREF="send.htm#M5" NAME="L1038"><B>-async</B></A>
<DD><A HREF="send.htm#M6" NAME="L1039"><B>-displayof</B> <I>pathName</I></A>
<DD><A HREF="send.htm#M7" NAME="L1040"><B>-&nbsp;-</B></A>
</DL>
<DD><A HREF="send.htm#M8" NAME="L1041">APPLICATION NAMES</A>
<DD><A HREF="send.htm#M9" NAME="L1042">DISABLING SENDS</A>
<DD><A HREF="send.htm#M10" NAME="L1043">SECURITY</A>
<DD><A HREF="send.htm#M11" NAME="L1044">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
send - Execute a command in a different application
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>send ?</B><I>options</I>? <I>app cmd </I>?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command arranges for <I>cmd</I> (and <I>arg</I>s) to be executed in the
application named by <I>app</I>. It returns the result or
error from that command execution.
<I>App</I> may be the name of any application whose main window is
on the display containing the sender's main window; it need not
be within the same process.
If no <I>arg</I> arguments are present, then the command to be executed is
contained entirely within the <I>cmd</I> argument. If one or
more <I>arg</I>s are present, they are concatenated to form the
command to be executed, just as for the <B><A HREF="../TkCmd/eval.htm">eval</A></B> command.
<P>
If the initial arguments of the command begin with ``-''
they are treated as options. The following options are
currently defined:
<P>
<DL>
<P><DT><A NAME="M5"><B>-async</B></A><DD>
Requests asynchronous invocation. In this case the <B>send</B>
command will complete immediately without waiting for <I>cmd</I>
to complete in the target application; no result will be available
and errors in the sent command will be ignored.
If the target application is in the same process as the sending
application then the <B>-async</B> option is ignored.
<P><DT><A NAME="M6"><B>-displayof</B> <I>pathName</I></A><DD>
Specifies that the target application's main window is on the display
of the window given by <I>pathName</I>, instead of the display containing
the application's main window.
<P><DT><A NAME="M7"><B>-&nbsp;-</B></A><DD>
Serves no purpose except to terminate the list of options. This
option is needed only if <I>app</I> could contain a leading ``-''
character.
<P></DL>
<H3><A NAME="M8">APPLICATION NAMES</A></H3>
The name of an application is set initially from the name of the
program or script that created the application.
You can query and change the name of an application with the
<B><A HREF="../TclCmd/tk.htm">tk appname</A></B> command.
<H3><A NAME="M9">DISABLING SENDS</A></H3>
If the <B>send</B> command is removed from an application (e.g.
with the command <B>rename send {}</B>) then the application
will not respond to incoming send requests anymore, nor will it
be able to issue outgoing requests.
Communication can be reenabled by invoking the <B><A HREF="../TclCmd/tk.htm">tk appname</A></B>
command.
<H3><A NAME="M10">SECURITY</A></H3>
The <B>send</B> command is potentially a serious security loophole. On Unix,
any application that can connect to your X server can send
scripts to your applications.
These incoming scripts can use Tcl to read and
write your files and invoke subprocesses under your name.
Host-based access control such as that provided by <B>xhost</B>
is particularly insecure, since it allows anyone with an account
on particular hosts to connect to your server, and if disabled it
allows anyone anywhere to connect to your server.
In order to provide at least a small amount of
security, Tk checks the access control being used by the server
and rejects incoming sends unless (a) <B>xhost</B>-style access control
is enabled (i.e. only certain hosts can establish connections) and (b) the
list of enabled hosts is empty.
This means that applications cannot connect to your server unless
they use some other form of authorization
such as that provide by <B>xauth</B>.
Under Windows, <B>send</B> is currently disabled. Most of the
functionality is provided by the <B><A HREF="../TkCmd/dde.htm">dde</A></B> command instead.
<H3><A NAME="M11">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#application">application</A>, <A href="../Keywords/D.htm#dde">dde</A>, <A href="../Keywords/N.htm#name">name</A>, <A href="../Keywords/R.htm#remote execution">remote execution</A>, <A href="../Keywords/S.htm#security">security</A>, <A href="../Keywords/S.htm#send">send</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

1768
hlp/en/tk/text.htm Normal file

File diff suppressed because it is too large Load Diff

66
hlp/en/tk/tk.htm Normal file
View File

@@ -0,0 +1,66 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tk - Manipulate Tk internal state
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk</B> <I>option </I>?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>tk</B> command provides access to miscellaneous
elements of Tk's internal state.
Most of the information manipulated by this command pertains to the
application as a whole, or to a screen or display, rather than to a
particular window.
The command can take any of a number of different forms
depending on the <I>option</I> argument. The legal forms are:
<P>
<DL>
<P><DT><A NAME="M5"><B>tk appname </B>?<I>newName</I>?</A><DD>
If <I>newName</I> isn't specified, this command returns the name
of the application (the name that may be used in <B><A HREF="../TclCmd/send.htm">send</A></B>
commands to communicate with the application).
If <I>newName</I> is specified, then the name of the application
is changed to <I>newName</I>.
If the given name is already in use, then a suffix of the form
``<B> #2</B>'' or ``<B> #3</B>'' is appended in order to make the name unique.
The command's result is the name actually chosen.
<I>newName</I> should not start with a capital letter.
This will interfere with option processing, since names starting with
capitals are assumed to be classes; as a result, Tk may not
be able to find some options for the application.
If sends have been disabled by deleting the <B><A HREF="../TclCmd/send.htm">send</A></B> command,
this command will reenable them and recreate the <B><A HREF="../TclCmd/send.htm">send</A></B>
command.
<P><DT><A NAME="M6"><B>tk scaling </B>?<B>-displayof </B><I>window</I>? ?<I>number</I>?</A><DD>
Sets and queries the current scaling factor used by Tk to convert between
physical units (for example, points, inches, or millimeters) and pixels. The
<I>number</I> argument is a floating point number that specifies the number of
pixels per point on <I>window</I>'s display. If the <I>window</I> argument is
omitted, it defaults to the main window. If the <I>number</I> argument is
omitted, the current value of the scaling factor is returned.
<P>
A ``point'' is a unit of measurement equal to 1/72 inch. A scaling factor
of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard
72 dpi monitor. A scaling factor of 1.25 would mean 1.25 pixels per point,
which is the setting for a 90 dpi monitor; setting the scaling factor to
1.25 on a 72 dpi monitor would cause everything in the application to be
displayed 1.25 times as large as normal. The initial value for the scaling
factor is set when the application starts, based on properties of the
installed monitor, but it can be changed at any time. Measurements made
after the scaling factor is changed will use the new scaling factor, but it
is undefined whether existing widgets will resize themselves dynamically to
accomodate the new scaling factor.
<P><DT><A NAME="M7"><B>tk useinputmethods </B>?<B>-displayof </B><I>window</I>? ?<I>boolean</I>?</A><DD>
Sets and queries the state of whether Tk should use XIM (X Input Methods)
for filtering events. The resulting state is returned. XIM is used in
some locales (ie: Japanese, Korean), to handle special input devices. This
feature is only significant on X. If XIM support is not available, this
will always return 0. If the <I>window</I> argument is omitted, it defaults
to the main window. If the <I>boolean</I> argument is omitted, the current
state is returned. This is turned on by default for the main display.
<P></DL>
<H3><A NAME="M8">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#application name">application name</A>, <A href="../Keywords/S.htm#send">send</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1992 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

61
hlp/en/tk/tk.toc.html Normal file
View File

@@ -0,0 +1,61 @@
<TITLE>Tcl Commands</TITLE>
<a href="bell.htm">bell</a><br>
<a href="destroy.htm">destroy</a><br>
<a href="label.htm">label</a><br>
<a href="photo.htm">photo</a><br>
<a href="bind.htm">bind</a><br>
<a href="entry.htm">entry</a><br>
<a href="listbox.htm">listbox</a><br>
<a href="place.htm">place</a><br>
<a href="popup.htm">tk_popup</a><br>
<a href="bindtags.htm">bindtags</a><br>
<a href="event.htm">event</a><br>
<a href="loadTk.htm">loadTk</a><br>
<a href="radiobutton.htm">radiobutton</a><br>
<a href="bitmap.htm">bitmap</a><br>
<a href="focus.htm">focus</a><br>
<a href="lower.htm">lower</a><br>
<a href="raise.htm">raise</a><br>
<a href="dialog.htm">tk_dialog</a><br>
<a href="tkerror.htm">tkerror</a><br>
<a href="button.htm">button</a><br>
<a href="font.htm">font</a><br>
<a href="menu.htm">menu</a><br>
<a href="scale.htm">scale</a><br>
<a href="tkvars.htm">tkvars</a><br>
<a href="canvas.htm">canvas</a><br>
<a href="frame.htm">frame</a><br>
<a href="menubutton.htm">menubutton</a><br>
<a href="scrollbar.htm">scrollbar</a><br>
<a href="tkwait.htm">tkwait</a><br>
<a href="checkbutton.htm">checkbutton</a><br>
<a href="grab.htm">grab</a><br>
<a href="message.htm">message</a><br>
<a href="selection.htm">selection</a><br>
<a href="toplevel.htm">toplevel</a><br>
<a href="clipboard.htm">clipboard</a><br>
<a href="grid.htm">grid</a><br>
<a href="option.htm">option</a><br>
<a href="send.htm">send</a><br>
<a href="winfo.htm">winfo</a><br>
<a href="colors.htm">colors</a><br>
<a href="image.htm">image</a><br>
<a href="options.htm">options</a><br>
<a href="text.htm">text</a><br>
<a href="palette.htm">tk_bisque</a><br>
<a href="chooseColor.htm">tk_chooseColor</a><br>
<a href="chooseDirectory.htm">tk_chooseDirectory</a><br>
<a href="focusNext.htm">tk_focusPrev</a><br>
<a href="focusNext.htm">tk_focusFollowsMouse</a><br>
<a href="focusNext.htm">tk_focusNext</a><br>
<a href="getOpenFile.htm">tk_getOpenFile</a><br>
<a href="getOpenFile.htm">tk_getSaveFile</a><br>
<a href="optionMenu.htm">tk_optionMenu</a><br>
<a href="palette.htm">tk_setPalette</a><br>
<a href="wm.htm">wm</a><br>
<a href="cursors.htm">cursors</a><br>
<a href="keysyms.htm">keysyms</a><br>
<a href="pack.htm">pack</a><br>
<a href="tk.htm">tk</a><br>
<a href="messageBox.htm">tk_messageBox</a><br>

28
hlp/en/tk/tkerror.htm Normal file
View File

@@ -0,0 +1,28 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tkerror manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tkerror - Command invoked to process background errors
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tkerror </B><I>message</I><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
Note: as of Tk 4.1 the <B>tkerror</B> command has been renamed to
<B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> because the event loop (which is what usually invokes
it) is now part of Tcl. For backward compatibility
the <B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> provided by the current Tk version still
tries to call <B>tkerror</B> if there is one (or an auto loadable one),
so old script defining that error handler should still work, but you
should anyhow modify your scripts to use <B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> instead
of <B>tkerror</B> because that support for the old name might vanish
in the near future. If that call fails, <B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B>
posts a dialog showing the error and offering to see the stack trace
to the user. If you want your own error management you should
directly override <B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> instead of <B>tkerror</B>.
Documentation for <B><A HREF="../TkCmd/bgerror.htm">bgerror</A></B> is available as part of Tcl's
documentation.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#background error">background error</A>, <A href="../Keywords/R.htm#reporting">reporting</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

60
hlp/en/tk/tkvars.htm Normal file
View File

@@ -0,0 +1,60 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tkvars manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tkvars - Variables used or set by Tk
<H3><A NAME="M3">DESCRIPTION</A></H3>
The following Tcl variables are either set or used by Tk at various times
in its execution:
<P>
<DL>
<P><DT><A NAME="M4"><B>tk_library</B></A><DD>
This variable holds the file name for a directory containing a library
of Tcl scripts related to Tk. These scripts include an initialization
file that is normally processed whenever a Tk application starts up,
plus other files containing procedures that implement default behaviors
for widgets.
The initial value of <B>tcl_library</B> is set when Tk is added to
an interpreter; this is done by searching several different directories
until one is found that contains an appropriate Tk startup script.
If the <B>TK_LIBRARY</B> environment variable exists, then
the directory it names is checked first.
If <B>TK_LIBRARY</B> isn't set or doesn't refer to an appropriate
directory, then Tk checks several other directories based on a
compiled-in default location, the location of the Tcl library directory,
the location of the binary containing the application, and the current
working directory.
The variable can be modified by an application to switch to a different
library.
<P><DT><A NAME="M5"><B>tk_patchLevel</B></A><DD>
Contains a decimal integer giving the current patch level for Tk.
The patch level is incremented for each new release or patch, and
it uniquely identifies an official version of Tk.
<P><DT><A NAME="M6"><B>tkPriv</B></A><DD>
This variable is an array containing several pieces of information
that are private to Tk. The elements of <B>tkPriv</B> are used by
Tk library procedures and default bindings.
They should not be accessed by any code outside Tk.
<P><DT><A NAME="M7"><B>tk_strictMotif</B></A><DD>
This variable is set to zero by default.
If an application sets it to one, then Tk attempts to adhere as
closely as possible to Motif look-and-feel standards.
For example, active elements such as buttons and scrollbar
sliders will not change color when the pointer passes over them.
<P><DT><A NAME="M8"><B>tk_version</B></A><DD>
Tk sets this variable in the interpreter for each application.
The variable holds the current version number of the Tk
library in the form <I>major</I>.<I>minor</I>. <I>Major</I> and
<I>minor</I> are integers. The major version number increases in
any Tk release that includes changes that are not backward compatible
(i.e. whenever existing Tk applications and scripts may have to change to
work with the new release). The minor version number increases with
each new release of Tk, except that it resets to zero whenever the
major version number changes.
<P></DL>
<H3><A NAME="M9">KEYWORDS</A></H3>
<A href="../Keywords/V.htm#variables">variables</A>, <A href="../Keywords/V.htm#version">version</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

39
hlp/en/tk/tkwait.htm Normal file
View File

@@ -0,0 +1,39 @@
<HTML><HEAD><TITLE>Built-In Commands - tkwait manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
tkwait - Wait for variable to change or window to be destroyed
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tkwait variable </B><I>name</I><BR>
<B>tkwait visibility </B><I>name</I><BR>
<B>tkwait window </B><I>name</I><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>tkwait</B> command waits for one of several things to happen,
then it returns without taking any other actions.
The return value is always an empty string.
If the first argument is <B><A HREF="../TkCmd/variable.htm">variable</A></B> (or any abbreviation of
it) then the second argument is the name of a global variable and the
command waits for that variable to be modified.
If the first argument is <B>visibility</B> (or any abbreviation
of it) then the second argument is the name of a window and the
<B>tkwait</B> command waits for a change in its
visibility state (as indicated by the arrival of a VisibilityNotify
event). This form is typically used to wait for a newly-created
window to appear on the screen before taking some action.
If the first argument is <B>window</B> (or any abbreviation
of it) then the second argument is the name of a window and the
<B>tkwait</B> command waits for that window to be destroyed.
This form is typically used to wait for a user to finish interacting
with a dialog box before using the result of that interaction.
<P>
While the <B>tkwait</B> command is waiting it processes events in
the normal fashion, so the application will continue to respond
to user interactions.
If an event handler invokes <B>tkwait</B> again, the nested call
to <B>tkwait</B> must complete before the outer call can complete.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/V.htm#variable">variable</A>, <A href="../Keywords/V.htm#visibility">visibility</A>, <A href="../Keywords/W.htm#wait">wait</A>, <A href="../Keywords/W.htm#window">window</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1992 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

211
hlp/en/tk/toplevel.htm Normal file
View File

@@ -0,0 +1,211 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - toplevel manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="toplevel.htm#M2" NAME="L1210">NAME</A>
<DL><DD>toplevel - Create and manipulate toplevel widgets</DL>
<DD><A HREF="toplevel.htm#M3" NAME="L1211">SYNOPSIS</A>
<DL>
<DD><B>toplevel</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="toplevel.htm#M4" NAME="L1212">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
</DL>
<DD><A HREF="toplevel.htm#M5" NAME="L1213">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="toplevel.htm#M6" NAME="L1214">-background, background, Background</A>
<DD><A HREF="toplevel.htm#M7" NAME="L1215">-class, class, Class</A>
<DD><A HREF="toplevel.htm#M8" NAME="L1216">-colormap, colormap, Colormap</A>
<DD><A HREF="toplevel.htm#M9" NAME="L1217">-container, container, Container</A>
<DD><A HREF="toplevel.htm#M10" NAME="L1218">-height, height, Height</A>
<DD><A HREF="toplevel.htm#M11" NAME="L1219">-menu, menu, Menu</A>
<DD><A HREF="toplevel.htm#M12" NAME="L1220">-screen, , </A>
<DD><A HREF="toplevel.htm#M13" NAME="L1221">-use, use, Use</A>
<DD><A HREF="toplevel.htm#M14" NAME="L1222">-visual, visual, Visual</A>
<DD><A HREF="toplevel.htm#M15" NAME="L1223">-width, width, Width</A>
</DL>
<DD><A HREF="toplevel.htm#M16" NAME="L1224">DESCRIPTION</A>
<DD><A HREF="toplevel.htm#M17" NAME="L1225">WIDGET COMMAND</A>
<DL>
<DD><A HREF="toplevel.htm#M18" NAME="L1226"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="toplevel.htm#M19" NAME="L1227"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="toplevel.htm#M20" NAME="L1228">BINDINGS</A>
<DD><A HREF="toplevel.htm#M21" NAME="L1229">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
toplevel - Create and manipulate toplevel widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>toplevel</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
</DL>
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M6">-background</A></B>
<DT>Database Name: <B>background</B>
<DT>Database Class: <B>Background</B>
<DD>This option is the same as the standard <B>background</B> option
except that its value may also be specified as an empty string.
In this case, the widget will display no background or border, and
no colors will be consumed from its colormap for its background
and border.
<P><DT>Command-Line Name: <B><A NAME="M7">-class</A></B>
<DT>Database Name: <B>class</B>
<DT>Database Class: <B>Class</B>
<DD>Specifies a class for the window.
This class will be used when querying the option database for
the window's other options, and it will also be used later for
other purposes such as bindings.
The <B>class</B> option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M8">-colormap</A></B>
<DT>Database Name: <B>colormap</B>
<DT>Database Class: <B>Colormap</B>
<DD>Specifies a colormap to use for the window.
The value may be either <B>new</B>, in which case a new colormap is
created for the window and its children, or the name of another
window (which must be on the same screen and have the same visual
as <I>pathName</I>), in which case the new window will use the colormap
from the specified window.
If the <B>colormap</B> option is not specified, the new window
uses the default colormap of its screen.
This option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M9">-container</A></B>
<DT>Database Name: <B>container</B>
<DT>Database Class: <B>Container</B>
<DD>The value must be a boolean. If true, it means that this window will
be used as a container in which some other application will be embedded
(for example, a Tk toplevel can be embedded using the <B>-use</B> option).
The window will support the appropriate window manager protocols for
things like geometry requests. The window should not have any
children of its own in this application.
This option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M10">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies the desired height for the window in any of the forms
acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P><DT>Command-Line Name: <B><A NAME="M11">-menu</A></B>
<DT>Database Name: <B><A HREF="../TclCmd/menu.htm">menu</A></B>
<DT>Database Class: <B><A HREF="../TclCmd/menu.htm">Menu</A></B>
<DD>Specifies a menu widget to be used as a menubar. On the Macintosh, the
menubar will be displayed accross the top of the main monitor. On
Microsoft Windows and all UNIX platforms, the menu will appear accross
the toplevel window as part of the window dressing maintained by the
window manager.
<P><DT>Command-Line Name: <B><A NAME="M12">-screen</A></B>
<DT>Database Name: <B><A HREF="../TkLib/CrtChannel.htm"></A></B>
<DT>Database Class: <B><A HREF="../TkLib/CrtChannel.htm"></A></B>
<DD>Specifies the screen on which to place the new window.
Any valid screen name may be used, even one associated with a
different display.
Defaults to the same screen as its parent.
This option is special in that it may not be specified via the option
database, and it may not be modified with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M13">-use</A></B>
<DT>Database Name: <B>use</B>
<DT>Database Class: <B>Use</B>
<DD>This option is used for embedding. If the value isn't an empty string,
it must be the the window identifier of a container window, specified as
a hexadecimal string like the ones returned by the <B><A HREF="../TclCmd/winfo.htm">winfo id</A></B>
command. The toplevel widget will be created as a child of the given
container instead of the root window for the screen. If the container
window is in a Tk application, it must be a frame or toplevel widget for
which the <B>-container</B> option was specified.
This option may not be changed with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M14">-visual</A></B>
<DT>Database Name: <B>visual</B>
<DT>Database Class: <B>Visual</B>
<DD>Specifies visual information for the new window in any of the
forms accepted by <B><A HREF="../TclLib/GetVisual.htm">Tk_GetVisual</A></B>.
If this option is not specified, the new window will use the default
visual for its screen.
The <B>visual</B> option may not be modified with the <B>configure</B>
widget command.
<P><DT>Command-Line Name: <B><A NAME="M15">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies the desired width for the window in any of the forms
acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
If this option is less than or equal to zero then the window will
not request any size at all.
</DL>
<H3><A NAME="M16">DESCRIPTION</A></H3>
The <B>toplevel</B> command creates a new toplevel widget (given
by the <I>pathName</I> argument). Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the toplevel such as its background color
and relief. The <B>toplevel</B> command returns the
path name of the new window.
<P>
A toplevel is similar to a frame except that it is created as a
top-level window: its X parent is the root window of a screen
rather than the logical parent from its path name. The primary
purpose of a toplevel is to serve as a container for dialog boxes
and other collections of widgets. The only visible features
of a toplevel are its background color and an optional 3-D border
to make the toplevel appear raised or sunken.
<H3><A NAME="M17">WIDGET COMMAND</A></H3>
The <B>toplevel</B> command creates a new Tcl command whose
name is the same as the path name of the toplevel's window. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>PathName</I> is the name of the command, which is the same as
the toplevel widget's path name. <I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for toplevel widgets:
<P>
<DL>
<P><DT><A NAME="M18"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>toplevel</B>
command.
<P><DT><A NAME="M19"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>toplevel</B>
command.
<P></DL>
<H3><A NAME="M20">BINDINGS</A></H3>
When a new toplevel is created, it has no default event bindings:
toplevels are not intended to be interactive.
<H3><A NAME="M21">KEYWORDS</A></H3>
<A href="../Keywords/T.htm#toplevel">toplevel</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

332
hlp/en/tk/winfo.htm Normal file
View File

@@ -0,0 +1,332 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - winfo manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="winfo.htm#M2" NAME="L1230">NAME</A>
<DL><DD>winfo - Return window-related information</DL>
<DD><A HREF="winfo.htm#M3" NAME="L1231">SYNOPSIS</A>
<DL>
<DD><B>winfo</B> <I>option </I>?<I>arg arg ...</I>?
</DL>
<DD><A HREF="winfo.htm#M4" NAME="L1232">DESCRIPTION</A>
<DL>
<DD><A HREF="winfo.htm#M5" NAME="L1233"><B>winfo atom </B>?<B>-displayof </B><I>window</I>? <I>name</I></A>
<DD><A HREF="winfo.htm#M6" NAME="L1234"><B>winfo atomname </B>?<B>-displayof </B><I>window</I>? <I>id</I></A>
<DD><A HREF="winfo.htm#M7" NAME="L1235"><B>winfo cells </B><I>window</I></A>
<DD><A HREF="winfo.htm#M8" NAME="L1236"><B>winfo children </B><I>window</I></A>
<DD><A HREF="winfo.htm#M9" NAME="L1237"><B>winfo class </B><I>window</I></A>
<DD><A HREF="winfo.htm#M10" NAME="L1238"><B>winfo colormapfull </B><I>window</I></A>
<DD><A HREF="winfo.htm#M11" NAME="L1239"><B>winfo containing </B>?<B>-displayof </B><I>window</I>? <I>rootX rootY</I></A>
<DD><A HREF="winfo.htm#M12" NAME="L1240"><B>winfo depth </B><I>window</I></A>
<DD><A HREF="winfo.htm#M13" NAME="L1241"><B>winfo exists </B><I>window</I></A>
<DD><A HREF="winfo.htm#M14" NAME="L1242"><B>winfo fpixels </B><I>window</I> <I>number</I></A>
<DD><A HREF="winfo.htm#M15" NAME="L1243"><B>winfo geometry </B><I>window</I></A>
<DD><A HREF="winfo.htm#M16" NAME="L1244"><B>winfo height </B><I>window</I></A>
<DD><A HREF="winfo.htm#M17" NAME="L1245"><B>winfo id </B><I>window</I></A>
<DD><A HREF="winfo.htm#M18" NAME="L1246"><B>winfo interps </B>?<B>-displayof </B><I>window</I>?</A>
<DD><A HREF="winfo.htm#M19" NAME="L1247"><B>winfo ismapped </B><I>window</I></A>
<DD><A HREF="winfo.htm#M20" NAME="L1248"><B>winfo manager </B><I>window</I></A>
<DD><A HREF="winfo.htm#M21" NAME="L1249"><B>winfo name </B><I>window</I></A>
<DD><A HREF="winfo.htm#M22" NAME="L1250"><B>winfo parent </B><I>window</I></A>
<DD><A HREF="winfo.htm#M23" NAME="L1251"><B>winfo pathname </B>?<B>-displayof </B><I>window</I>? <I>id</I></A>
<DD><A HREF="winfo.htm#M24" NAME="L1252"><B>winfo pixels </B><I>window</I> <I>number</I></A>
<DD><A HREF="winfo.htm#M25" NAME="L1253"><B>winfo pointerx </B><I>window</I></A>
<DD><A HREF="winfo.htm#M26" NAME="L1254"><B>winfo pointerxy </B><I>window</I></A>
<DD><A HREF="winfo.htm#M27" NAME="L1255"><B>winfo pointery </B><I>window</I></A>
<DD><A HREF="winfo.htm#M28" NAME="L1256"><B>winfo reqheight </B><I>window</I></A>
<DD><A HREF="winfo.htm#M29" NAME="L1257"><B>winfo reqwidth </B><I>window</I></A>
<DD><A HREF="winfo.htm#M30" NAME="L1258"><B>winfo rgb </B><I>window color</I></A>
<DD><A HREF="winfo.htm#M31" NAME="L1259"><B>winfo rootx </B><I>window</I></A>
<DD><A HREF="winfo.htm#M32" NAME="L1260"><B>winfo rooty </B><I>window</I></A>
<DD><A HREF="winfo.htm#M33" NAME="L1261"><B>winfo screen </B><I>window</I></A>
<DD><A HREF="winfo.htm#M34" NAME="L1262"><B>winfo screencells </B><I>window</I></A>
<DD><A HREF="winfo.htm#M35" NAME="L1263"><B>winfo screendepth </B><I>window</I></A>
<DD><A HREF="winfo.htm#M36" NAME="L1264"><B>winfo screenheight </B><I>window</I></A>
<DD><A HREF="winfo.htm#M37" NAME="L1265"><B>winfo screenmmheight </B><I>window</I></A>
<DD><A HREF="winfo.htm#M38" NAME="L1266"><B>winfo screenmmwidth </B><I>window</I></A>
<DD><A HREF="winfo.htm#M39" NAME="L1267"><B>winfo screenvisual </B><I>window</I></A>
<DD><A HREF="winfo.htm#M40" NAME="L1268"><B>winfo screenwidth </B><I>window</I></A>
<DD><A HREF="winfo.htm#M41" NAME="L1269"><B>winfo server </B><I>window</I></A>
<DD><A HREF="winfo.htm#M42" NAME="L1270"><B>winfo toplevel </B><I>window</I></A>
<DD><A HREF="winfo.htm#M43" NAME="L1271"><B>winfo viewable </B><I>window</I></A>
<DD><A HREF="winfo.htm#M44" NAME="L1272"><B>winfo visual </B><I>window</I></A>
<DD><A HREF="winfo.htm#M45" NAME="L1273"><B>winfo visualid </B><I>window</I></A>
<DD><A HREF="winfo.htm#M46" NAME="L1274"><B>winfo visualsavailable </B><I>window</I> ?<B>includeids</B>?</A>
<DD><A HREF="winfo.htm#M47" NAME="L1275"><B>winfo vrootheight </B><I>window</I></A>
<DD><A HREF="winfo.htm#M48" NAME="L1276"><B>winfo vrootwidth </B><I>window</I></A>
<DD><A HREF="winfo.htm#M49" NAME="L1277"><B>winfo vrootx </B><I>window</I></A>
<DD><A HREF="winfo.htm#M50" NAME="L1278"><B>winfo vrooty </B><I>window</I></A>
<DD><A HREF="winfo.htm#M51" NAME="L1279"><B>winfo width </B><I>window</I></A>
<DD><A HREF="winfo.htm#M52" NAME="L1280"><B>winfo x </B><I>window</I></A>
<DD><A HREF="winfo.htm#M53" NAME="L1281"><B>winfo y </B><I>window</I></A>
</DL>
<DD><A HREF="winfo.htm#M54" NAME="L1282">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
winfo - Return window-related information
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>winfo</B> <I>option </I>?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>winfo</B> command is used to retrieve information about windows
managed by Tk. It can take any of a number of different forms,
depending on the <I>option</I> argument. The legal forms are:
<P>
<DL>
<P><DT><A NAME="M5"><B>winfo atom </B>?<B>-displayof </B><I>window</I>? <I>name</I></A><DD>
Returns a decimal string giving the integer identifier for the
atom whose name is <I>name</I>. If no atom exists with the name
<I>name</I> then a new one is created.
If the <B>-displayof</B> option is given then the atom is looked
up on the display of <I>window</I>; otherwise it is looked up on
the display of the application's main window.
<P><DT><A NAME="M6"><B>winfo atomname </B>?<B>-displayof </B><I>window</I>? <I>id</I></A><DD>
Returns the textual name for the atom whose integer identifier is
<I>id</I>.
If the <B>-displayof</B> option is given then the identifier is looked
up on the display of <I>window</I>; otherwise it is looked up on
the display of the application's main window.
This command is the inverse of the <B>winfo atom</B> command.
It generates an error if no such atom exists.
<P><DT><A NAME="M7"><B>winfo cells </B><I>window</I></A><DD>
Returns a decimal string giving the number of cells in the
color map for <I>window</I>.
<P><DT><A NAME="M8"><B>winfo children </B><I>window</I></A><DD>
Returns a list containing the path names of all the children
of <I>window</I>. The list is in stacking order, with the lowest
window first. Top-level windows are returned as children
of their logical parents.
<P><DT><A NAME="M9"><B>winfo class </B><I>window</I></A><DD>
Returns the class name for <I>window</I>.
<P><DT><A NAME="M10"><B>winfo colormapfull </B><I>window</I></A><DD>
Returns 1 if the colormap for <I>window</I> is known to be full, 0
otherwise. The colormap for a window is ``known'' to be full if the last
attempt to allocate a new color on that window failed and this
application hasn't freed any colors in the colormap since the
failed allocation.
<P><DT><A NAME="M11"><B>winfo containing </B>?<B>-displayof </B><I>window</I>? <I>rootX rootY</I></A><DD>
Returns the path name for the window containing the point given
by <I>rootX</I> and <I>rootY</I>.
<I>RootX</I> and <I>rootY</I> are specified in screen units (i.e.
any form acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>) in the coordinate
system of the root window (if a virtual-root window manager is in
use then the coordinate system of the virtual root window is used).
If the <B>-displayof</B> option is given then the coordinates refer
to the screen containing <I>window</I>; otherwise they refer to the
screen of the application's main window.
If no window in this application contains the point then an empty
string is returned.
In selecting the containing window, children are given higher priority
than parents and among siblings the highest one in the stacking order is
chosen.
<P><DT><A NAME="M12"><B>winfo depth </B><I>window</I></A><DD>
Returns a decimal string giving the depth of <I>window</I> (number
of bits per pixel).
<P><DT><A NAME="M13"><B>winfo exists </B><I>window</I></A><DD>
Returns 1 if there exists a window named <I>window</I>, 0 if no such
window exists.
<P><DT><A NAME="M14"><B>winfo fpixels </B><I>window</I> <I>number</I></A><DD>
Returns a floating-point value giving the number of pixels
in <I>window</I> corresponding to the distance given by <I>number</I>.
<I>Number</I> may be specified in any of the forms acceptable
to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetScreenMM</A></B>, such as ``2.0c'' or ``1i''.
The return value may be fractional; for an integer value, use
<B>winfo pixels</B>.
<P><DT><A NAME="M15"><B>winfo geometry </B><I>window</I></A><DD>
Returns the geometry for <I>window</I>, in the form
<I>width</I><B>x</B><I>height</I><B>+</B><I>x</I><B>+</B><I>y</I>. All dimensions are
in pixels.
<P><DT><A NAME="M16"><B>winfo height </B><I>window</I></A><DD>
Returns a decimal string giving <I>window</I>'s height in pixels.
When a window is first created its height will be 1 pixel; the
height will eventually be changed by a geometry manager to fulfill
the window's needs.
If you need the true height immediately after creating a widget,
invoke <B><A HREF="../TkCmd/update.htm">update</A></B> to force the geometry manager to arrange it,
or use <B>winfo reqheight</B> to get the window's requested height
instead of its actual height.
<P><DT><A NAME="M17"><B>winfo id </B><I>window</I></A><DD>
Returns a hexadecimal string giving a low-level platform-specific
identifier for <I>window</I>. On Unix platforms, this is the X
window identifier. Under Windows, this is the Windows
HWND. On the Macintosh the value has no meaning outside Tk.
<P><DT><A NAME="M18"><B>winfo interps </B>?<B>-displayof </B><I>window</I>?</A><DD>
Returns a list whose members are the names of all Tcl interpreters
(e.g. all Tk-based applications) currently registered for a particular display.
If the <B>-displayof</B> option is given then the return value refers
to the display of <I>window</I>; otherwise it refers to
the display of the application's main window.
<P><DT><A NAME="M19"><B>winfo ismapped </B><I>window</I></A><DD>
Returns <B>1</B> if <I>window</I> is currently mapped, <B>0</B> otherwise.
<P><DT><A NAME="M20"><B>winfo manager </B><I>window</I></A><DD>
Returns the name of the geometry manager currently
responsible for <I>window</I>, or an empty string if <I>window</I>
isn't managed by any geometry manager.
The name is usually the name of the Tcl command for the geometry
manager, such as <B><A HREF="../TclCmd/pack.htm">pack</A></B> or <B><A HREF="../TclCmd/place.htm">place</A></B>.
If the geometry manager is a widget, such as canvases or text, the
name is the widget's class command, such as <B><A HREF="../TclCmd/canvas.htm">canvas</A></B>.
<P><DT><A NAME="M21"><B>winfo name </B><I>window</I></A><DD>
Returns <I>window</I>'s name (i.e. its name within its parent, as opposed
to its full path name).
The command <B>winfo name .</B> will return the name of the application.
<P><DT><A NAME="M22"><B>winfo parent </B><I>window</I></A><DD>
Returns the path name of <I>window</I>'s parent, or an empty string
if <I>window</I> is the main window of the application.
<P><DT><A NAME="M23"><B>winfo pathname </B>?<B>-displayof </B><I>window</I>? <I>id</I></A><DD>
Returns the path name of the window whose X identifier is <I>id</I>.
<I>Id</I> must be a decimal, hexadecimal, or octal integer and must
correspond to a window in the invoking application.
If the <B>-displayof</B> option is given then the identifier is looked
up on the display of <I>window</I>; otherwise it is looked up on
the display of the application's main window.
<P><DT><A NAME="M24"><B>winfo pixels </B><I>window</I> <I>number</I></A><DD>
Returns the number of pixels in <I>window</I> corresponding
to the distance given by <I>number</I>.
<I>Number</I> may be specified in any of the forms acceptable
to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>, such as ``2.0c'' or ``1i''.
The result is rounded to the nearest integer value; for a
fractional result, use <B>winfo fpixels</B>.
<P><DT><A NAME="M25"><B>winfo pointerx </B><I>window</I></A><DD>
If the mouse pointer is on the same screen as <I>window</I>, returns the
pointer's x coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position is
measured in the virtual root.
If the mouse pointer isn't on the same screen as <I>window</I> then
-1 is returned.
<P><DT><A NAME="M26"><B>winfo pointerxy </B><I>window</I></A><DD>
If the mouse pointer is on the same screen as <I>window</I>, returns a list
with two elements, which are the pointer's x and y coordinates measured
in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
If the mouse pointer isn't on the same screen as <I>window</I> then
both of the returned coordinates are -1.
<P><DT><A NAME="M27"><B>winfo pointery </B><I>window</I></A><DD>
If the mouse pointer is on the same screen as <I>window</I>, returns the
pointer's y coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
If the mouse pointer isn't on the same screen as <I>window</I> then
-1 is returned.
<P><DT><A NAME="M28"><B>winfo reqheight </B><I>window</I></A><DD>
Returns a decimal string giving <I>window</I>'s requested height,
in pixels. This is the value used by <I>window</I>'s geometry
manager to compute its geometry.
<P><DT><A NAME="M29"><B>winfo reqwidth </B><I>window</I></A><DD>
Returns a decimal string giving <I>window</I>'s requested width,
in pixels. This is the value used by <I>window</I>'s geometry
manager to compute its geometry.
<P><DT><A NAME="M30"><B>winfo rgb </B><I>window color</I></A><DD>
Returns a list containing three decimal values, which are the
red, green, and blue intensities that correspond to <I>color</I> in
the window given by <I>window</I>. <I>Color</I>
may be specified in any of the forms acceptable for a color
option.
<P><DT><A NAME="M31"><B>winfo rootx </B><I>window</I></A><DD>
Returns a decimal string giving the x-coordinate, in the root
window of the screen, of the
upper-left corner of <I>window</I>'s border (or <I>window</I> if it
has no border).
<P><DT><A NAME="M32"><B>winfo rooty </B><I>window</I></A><DD>
Returns a decimal string giving the y-coordinate, in the root
window of the screen, of the
upper-left corner of <I>window</I>'s border (or <I>window</I> if it
has no border).
<P><DT><A NAME="M33"><B>winfo screen </B><I>window</I></A><DD>
Returns the name of the screen associated with <I>window</I>, in
the form <I>displayName</I>.<I>screenIndex</I>.
<P><DT><A NAME="M34"><B>winfo screencells </B><I>window</I></A><DD>
Returns a decimal string giving the number of cells in the default
color map for <I>window</I>'s screen.
<P><DT><A NAME="M35"><B>winfo screendepth </B><I>window</I></A><DD>
Returns a decimal string giving the depth of the root window
of <I>window</I>'s screen (number of bits per pixel).
<P><DT><A NAME="M36"><B>winfo screenheight </B><I>window</I></A><DD>
Returns a decimal string giving the height of <I>window</I>'s screen,
in pixels.
<P><DT><A NAME="M37"><B>winfo screenmmheight </B><I>window</I></A><DD>
Returns a decimal string giving the height of <I>window</I>'s screen,
in millimeters.
<P><DT><A NAME="M38"><B>winfo screenmmwidth </B><I>window</I></A><DD>
Returns a decimal string giving the width of <I>window</I>'s screen,
in millimeters.
<P><DT><A NAME="M39"><B>winfo screenvisual </B><I>window</I></A><DD>
Returns one of the following strings to indicate the default visual
class for <I>window</I>'s screen: <B>directcolor</B>, <B>grayscale</B>,
<B>pseudocolor</B>, <B>staticcolor</B>, <B>staticgray</B>, or
<B>truecolor</B>.
<P><DT><A NAME="M40"><B>winfo screenwidth </B><I>window</I></A><DD>
Returns a decimal string giving the width of <I>window</I>'s screen,
in pixels.
<P><DT><A NAME="M41"><B>winfo server </B><I>window</I></A><DD>
Returns a string containing information about the server for
<I>window</I>'s display. The exact format of this string may vary
from platform to platform. For X servers the string
has the form ``<B>X</B><I>major</I><B>R</B><I>minor vendor vendorVersion</I>''
where <I>major</I> and <I>minor</I> are the version and revision
numbers provided by the server (e.g., <B>X11R5</B>), <I>vendor</I>
is the name of the vendor for the server, and <I>vendorRelease</I>
is an integer release number provided by the server.
<P><DT><A NAME="M42"><B>winfo toplevel </B><I>window</I></A><DD>
Returns the path name of the top-level window containing <I>window</I>.
<P><DT><A NAME="M43"><B>winfo viewable </B><I>window</I></A><DD>
Returns 1 if <I>window</I> and all of its ancestors up through the
nearest toplevel window are mapped. Returns 0 if any of these
windows are not mapped.
<P><DT><A NAME="M44"><B>winfo visual </B><I>window</I></A><DD>
Returns one of the following strings to indicate the visual
class for <I>window</I>: <B>directcolor</B>, <B>grayscale</B>,
<B>pseudocolor</B>, <B>staticcolor</B>, <B>staticgray</B>, or
<B>truecolor</B>.
<P><DT><A NAME="M45"><B>winfo visualid </B><I>window</I></A><DD>
Returns the X identifier for the visual for <I>window</I>.
<P><DT><A NAME="M46"><B>winfo visualsavailable </B><I>window</I> ?<B>includeids</B>?</A><DD>
Returns a list whose elements describe the visuals available for
<I>window</I>'s screen.
Each element consists of a visual class followed by an integer depth.
The class has the same form as returned by <B>winfo visual</B>.
The depth gives the number of bits per pixel in the visual.
In addition, if the <B>includeids</B> argument is provided, then the
depth is followed by the X identifier for the visual.
<P><DT><A NAME="M47"><B>winfo vrootheight </B><I>window</I></A><DD>
Returns the height of the virtual root window associated with <I>window</I>
if there is one; otherwise returns the height of <I>window</I>'s screen.
<P><DT><A NAME="M48"><B>winfo vrootwidth </B><I>window</I></A><DD>
Returns the width of the virtual root window associated with <I>window</I>
if there is one; otherwise returns the width of <I>window</I>'s screen.
<P><DT><A NAME="M49"><B>winfo vrootx </B><I>window</I></A><DD>
Returns the x-offset of the virtual root window associated with <I>window</I>,
relative to the root window of its screen.
This is normally either zero or negative.
Returns 0 if there is no virtual root window for <I>window</I>.
<P><DT><A NAME="M50"><B>winfo vrooty </B><I>window</I></A><DD>
Returns the y-offset of the virtual root window associated with <I>window</I>,
relative to the root window of its screen.
This is normally either zero or negative.
Returns 0 if there is no virtual root window for <I>window</I>.
<P><DT><A NAME="M51"><B>winfo width </B><I>window</I></A><DD>
Returns a decimal string giving <I>window</I>'s width in pixels.
When a window is first created its width will be 1 pixel; the
width will eventually be changed by a geometry manager to fulfill
the window's needs.
If you need the true width immediately after creating a widget,
invoke <B><A HREF="../TkCmd/update.htm">update</A></B> to force the geometry manager to arrange it,
or use <B>winfo reqwidth</B> to get the window's requested width
instead of its actual width.
<P><DT><A NAME="M52"><B>winfo x </B><I>window</I></A><DD>
Returns a decimal string giving the x-coordinate, in <I>window</I>'s
parent, of the
upper-left corner of <I>window</I>'s border (or <I>window</I> if it
has no border).
<P><DT><A NAME="M53"><B>winfo y </B><I>window</I></A><DD>
Returns a decimal string giving the y-coordinate, in <I>window</I>'s
parent, of the
upper-left corner of <I>window</I>'s border (or <I>window</I> if it
has no border).
<P></DL>
<H3><A NAME="M54">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#atom">atom</A>, <A href="../Keywords/C.htm#children">children</A>, <A href="../Keywords/C.htm#class">class</A>, <A href="../Keywords/G.htm#geometry">geometry</A>, <A href="../Keywords/H.htm#height">height</A>, <A href="../Keywords/I.htm#identifier">identifier</A>, <A href="../Keywords/I.htm#information">information</A>, <A href="../Keywords/I.htm#interpreters">interpreters</A>, <A href="../Keywords/M.htm#mapped">mapped</A>, <A href="../Keywords/P.htm#parent">parent</A>, <A href="../Keywords/P.htm#path name">path name</A>, <A href="../Keywords/S.htm#screen">screen</A>, <A href="../Keywords/V.htm#virtual root">virtual root</A>, <A href="../Keywords/W.htm#width">width</A>, <A href="../Keywords/W.htm#window">window</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1997 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

198
hlp/en/tk/wish.htm Normal file
View File

@@ -0,0 +1,198 @@
<HTML><HEAD><TITLE>Tk Applications - wish manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="wish.htm#M2" NAME="L13">NAME</A>
<DL><DD>wish - Simple windowing shell</DL>
<DD><A HREF="wish.htm#M3" NAME="L14">SYNOPSIS</A>
<DL>
<DD><B>wish</B> ?<I>fileName arg arg ...</I>?
</DL>
<DD><A HREF="wish.htm#M4" NAME="L15">OPTIONS</A>
<DL>
<DD><A HREF="wish.htm#M5" NAME="L16"><B>-colormap </B><I>new</I></A>
<DD><A HREF="wish.htm#M6" NAME="L17"><B>-display </B><I>display</I></A>
<DD><A HREF="wish.htm#M7" NAME="L18"><B>-geometry </B><I>geometry</I></A>
<DD><A HREF="wish.htm#M8" NAME="L19"><B>-name </B><I>name</I></A>
<DD><A HREF="wish.htm#M9" NAME="L20"><B>-sync</B></A>
<DD><A HREF="wish.htm#M10" NAME="L21"><B>-use</B> <I>id</I></A>
<DD><A HREF="wish.htm#M11" NAME="L22"><B>-visual </B><I>visual</I></A>
<DD><A HREF="wish.htm#M12" NAME="L23"><B>-&nbsp;-</B></A>
</DL>
<DD><A HREF="wish.htm#M13" NAME="L24">DESCRIPTION</A>
<DD><A HREF="wish.htm#M14" NAME="L25">OPTIONS</A>
<DD><A HREF="wish.htm#M15" NAME="L26">APPLICATION NAME AND CLASS</A>
<DD><A HREF="wish.htm#M16" NAME="L27">VARIABLES</A>
<DL>
<DD><A HREF="wish.htm#M17" NAME="L28"><B>argc</B></A>
<DD><A HREF="wish.htm#M18" NAME="L29"><B>argv</B></A>
<DD><A HREF="wish.htm#M19" NAME="L30"><B>argv0</B></A>
<DD><A HREF="wish.htm#M20" NAME="L31"><B>geometry</B></A>
<DD><A HREF="wish.htm#M21" NAME="L32"><B>tcl_interactive</B></A>
</DL>
<DD><A HREF="wish.htm#M22" NAME="L33">SCRIPT FILES</A>
<DD><A HREF="wish.htm#M23" NAME="L34">PROMPTS</A>
<DD><A HREF="wish.htm#M24" NAME="L35">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
wish - Simple windowing shell
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>wish</B> ?<I>fileName arg arg ...</I>?<BR>
<H3><A NAME="M4">OPTIONS</A></H3>
<DL>
<P><DT><A NAME="M5"><B>-colormap </B><I>new</I></A><DD>
Specifies that the window should have a new private colormap instead of
using the default colormap for the screen.
<P><DT><A NAME="M6"><B>-display </B><I>display</I></A><DD>
Display (and screen) on which to display window.
<P><DT><A NAME="M7"><B>-geometry </B><I>geometry</I></A><DD>
Initial geometry to use for window. If this option is specified, its
value is stored in the <B>geometry</B> global variable of the application's
Tcl interpreter.
<P><DT><A NAME="M8"><B>-name </B><I>name</I></A><DD>
Use <I>name</I> as the title to be displayed in the window, and
as the name of the interpreter for <B><A HREF="../TclCmd/send.htm">send</A></B> commands.
<P><DT><A NAME="M9"><B>-sync</B></A><DD>
Execute all X server commands synchronously, so that errors
are reported immediately. This will result in much slower
execution, but it is useful for debugging.
<P><DT><A NAME="M10"><B>-use</B> <I>id</I></A><DD>
Specifies that the main window for the application is to be embedded in
the window whose identifier is <I>id</I>, instead of being created as an
independent toplevel window. <I>Id</I> must be specified in the same
way as the value for the <B>-use</B> option for toplevel widgets (i.e.
it has a form like that returned by the <B><A HREF="../TclCmd/winfo.htm">winfo id</A></B> command).
<P><DT><A NAME="M11"><B>-visual </B><I>visual</I></A><DD>
Specifies the visual to use for the window.
<I>Visual</I> may have any of the forms supported by the <B><A HREF="../TclLib/GetVisual.htm">Tk_GetVisual</A></B>
procedure.
<P><DT><A NAME="M12"><B>-&nbsp;-</B></A><DD>
Pass all remaining arguments through to the script's <B>argv</B>
variable without interpreting them.
This provides a mechanism for passing arguments such as <B>-name</B>
to a script instead of having <B>wish</B> interpret them.
<P></DL>
<H3><A NAME="M13">DESCRIPTION</A></H3>
<B>Wish</B> is a simple program consisting of the Tcl command
language, the Tk toolkit, and a main program that reads commands
from standard input or from a file.
It creates a main window and then processes Tcl commands.
If <B>wish</B> is invoked with no arguments, or with a first argument
that starts with ``-'', then it reads Tcl commands interactively from
standard input.
It will continue processing commands until all windows have been
deleted or until end-of-file is reached on standard input.
If there exists a file <B>.wishrc</B> in the home directory of
the user, <B>wish</B> evaluates the file as a Tcl script
just before reading the first command from standard input.
<P>
If <B>wish</B> is invoked with an initial <I>fileName</I> argument, then
<I>fileName</I> is treated as the name of a script file.
<B>Wish</B> will evaluate the script in <I>fileName</I> (which
presumably creates a user interface), then it will respond to events
until all windows have been deleted.
Commands will not be read from standard input.
There is no automatic evaluation of <B>.wishrc</B> in this
case, but the script file can always <B><A HREF="../TkCmd/source.htm">source</A></B> it if desired.
<H3><A NAME="M14">OPTIONS</A></H3>
<B>Wish</B> automatically processes all of the command-line options
described in the <B><A HREF="../TclCmd/options.htm">OPTIONS</A></B> summary above.
Any other command-line arguments besides these are passed through
to the application using the <B>argc</B> and <B>argv</B> variables
described later.
<H3><A NAME="M15">APPLICATION NAME AND CLASS</A></H3>
The name of the application, which is used for purposes such as
<B><A HREF="../TclCmd/send.htm">send</A></B> commands, is taken from the <B>-name</B> option,
if it is specified; otherwise it is taken from <I>fileName</I>,
if it is specified, or from the command name by which
<B>wish</B> was invoked. In the last two cases, if the name contains a ``/''
character, then only the characters after the last slash are used
as the application name.
<P>
The class of the application, which is used for purposes such as
specifying options with a <B>RESOURCE_MANAGER</B> property or .Xdefaults
file, is the same as its name except that the first letter is
capitalized.
<H3><A NAME="M16">VARIABLES</A></H3>
<B>Wish</B> sets the following Tcl variables:
<P>
<DL>
<P><DT><A NAME="M17"><B>argc</B></A><DD>
Contains a count of the number of <I>arg</I> arguments (0 if none),
not including the options described above.
<P><DT><A NAME="M18"><B>argv</B></A><DD>
Contains a Tcl list whose elements are the <I>arg</I> arguments
that follow a <B>-&nbsp;-</B> option or don't match any of the
options described in OPTIONS above, in order, or an empty string
if there are no such arguments.
<P><DT><A NAME="M19"><B>argv0</B></A><DD>
Contains <I>fileName</I> if it was specified.
Otherwise, contains the name by which <B>wish</B> was invoked.
<P><DT><A NAME="M20"><B>geometry</B></A><DD>
If the <B>-geometry</B> option is specified, <B>wish</B> copies its
value into this variable. If the variable still exists after
<I>fileName</I> has been evaluated, <B>wish</B> uses the value of
the variable in a <B><A HREF="../TclCmd/wm.htm">wm geometry</A></B> command to set the main
window's geometry.
<P><DT><A NAME="M21"><B>tcl_interactive</B></A><DD>
Contains 1 if <B>wish</B> is reading commands interactively (<I>fileName</I>
was not specified and standard input is a terminal-like
device), 0 otherwise.
<P></DL>
<H3><A NAME="M22">SCRIPT FILES</A></H3>
If you create a Tcl script in a file whose first line is
<PRE><B>#!/usr/local/bin/wish</B></PRE>
then you can invoke the script file directly from your shell if
you mark it as executable.
This assumes that <B>wish</B> has been installed in the default
location in /usr/local/bin; if it's installed somewhere else
then you'll have to modify the above line to match.
Many UNIX systems do not allow the <B>#!</B> line to exceed about
30 characters in length, so be sure that the <B>wish</B> executable
can be accessed with a short file name.
<P>
An even better approach is to start your script files with the
following three lines:
<PRE><B>#!/bin/sh
# the next line restarts using wish &#92;
exec wish &quot;$0&quot; &quot;$@&quot;</B></PRE>
This approach has three advantages over the approach in the previous
paragraph. First, the location of the <B>wish</B> binary doesn't have
to be hard-wired into the script: it can be anywhere in your shell
search path. Second, it gets around the 30-character file name limit
in the previous approach.
Third, this approach will work even if <B>wish</B> is
itself a shell script (this is done on some systems in order to
handle multiple architectures or operating systems: the <B>wish</B>
script selects one of several binaries to run). The three lines
cause both <B>sh</B> and <B>wish</B> to process the script, but the
<B><A HREF="../TkCmd/exec.htm">exec</A></B> is only executed by <B>sh</B>.
<B>sh</B> processes the script first; it treats the second
line as a comment and executes the third line.
The <B><A HREF="../TkCmd/exec.htm">exec</A></B> statement cause the shell to stop processing and
instead to start up <B>wish</B> to reprocess the entire script.
When <B>wish</B> starts up, it treats all three lines as comments,
since the backslash at the end of the second line causes the third
line to be treated as part of the comment on the second line.
<H3><A NAME="M23">PROMPTS</A></H3>
When <B>wish</B> is invoked interactively it normally prompts for each
command with ``<B>% </B>''. You can change the prompt by setting the
variables <B>tcl_prompt1</B> and <B>tcl_prompt2</B>. If variable
<B>tcl_prompt1</B> exists then it must consist of a Tcl script
to output a prompt; instead of outputting a prompt <B>wish</B>
will evaluate the script in <B>tcl_prompt1</B>.
The variable <B>tcl_prompt2</B> is used in a similar way when
a newline is typed but the current command isn't yet complete;
if <B>tcl_prompt2</B> isn't set then no prompt is output for
incomplete commands.
<H3><A NAME="M24">KEYWORDS</A></H3>
<A href="../Keywords/S.htm#shell">shell</A>, <A href="../Keywords/T.htm#toolkit">toolkit</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1991-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>

519
hlp/en/tk/wm.htm Normal file
View File

@@ -0,0 +1,519 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - wm manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="wm.htm#M2" NAME="L1283">NAME</A>
<DL><DD>wm - Communicate with window manager</DL>
<DD><A HREF="wm.htm#M3" NAME="L1284">SYNOPSIS</A>
<DL>
<DD><B>wm</B> <I>option window </I>?<I>args</I>?
</DL>
<DD><A HREF="wm.htm#M4" NAME="L1285">DESCRIPTION</A>
<DL>
<DD><A HREF="wm.htm#M5" NAME="L1286"><B>wm aspect </B><I>window</I> ?<I>minNumer minDenom maxNumer maxDenom</I>?</A>
<DD><A HREF="wm.htm#M6" NAME="L1287"><B>wm client </B><I>window</I> ?<I>name</I>?</A>
<DD><A HREF="wm.htm#M7" NAME="L1288"><B>wm colormapwindows </B><I>window</I> ?<I>windowList</I>?</A>
<DD><A HREF="wm.htm#M8" NAME="L1289"><B>wm command </B><I>window</I> ?<I>value</I>?</A>
<DD><A HREF="wm.htm#M9" NAME="L1290"><B>wm deiconify </B><I>window</I></A>
<DD><A HREF="wm.htm#M10" NAME="L1291"><B>wm focusmodel </B><I>window</I> ?<B>active</B>|<B>passive</B>?</A>
<DD><A HREF="wm.htm#M11" NAME="L1292"><B>wm frame </B><I>window</I></A>
<DD><A HREF="wm.htm#M12" NAME="L1293"><B>wm geometry </B><I>window</I> ?<I>newGeometry</I>?</A>
<DD><A HREF="wm.htm#M13" NAME="L1294"><B>wm grid </B><I>window</I> ?<I>baseWidth baseHeight widthInc heightInc</I>?</A>
<DD><A HREF="wm.htm#M14" NAME="L1295"><B>wm group </B><I>window</I> ?<I>pathName</I>?</A>
<DD><A HREF="wm.htm#M15" NAME="L1296"><B>wm iconbitmap </B><I>window</I> ?<I>bitmap</I>?</A>
<DD><A HREF="wm.htm#M16" NAME="L1297"><B>wm iconify </B><I>window</I></A>
<DD><A HREF="wm.htm#M17" NAME="L1298"><B>wm iconmask </B><I>window</I> ?<I>bitmap</I>?</A>
<DD><A HREF="wm.htm#M18" NAME="L1299"><B>wm iconname </B><I>window</I> ?<I>newName</I>?</A>
<DD><A HREF="wm.htm#M19" NAME="L1300"><B>wm iconposition </B><I>window</I> ?<I>x y</I>?</A>
<DD><A HREF="wm.htm#M20" NAME="L1301"><B>wm iconwindow </B><I>window</I> ?<I>pathName</I>?</A>
<DD><A HREF="wm.htm#M21" NAME="L1302"><B>wm maxsize </B><I>window</I> ?<I>width height</I>?</A>
<DD><A HREF="wm.htm#M22" NAME="L1303"><B>wm minsize </B><I>window</I> ?<I>width height</I>?</A>
<DD><A HREF="wm.htm#M23" NAME="L1304"><B>wm overrideredirect </B><I>window</I> ?<I>boolean</I>?</A>
<DD><A HREF="wm.htm#M24" NAME="L1305"><B>wm positionfrom </B><I>window</I> ?<I>who</I>?</A>
<DD><A HREF="wm.htm#M25" NAME="L1306"><B>wm protocol </B><I>window</I> ?<I>name</I>? ?<I>command</I>?</A>
<DD><A HREF="wm.htm#M26" NAME="L1307"><B>wm resizable </B><I>window</I> ?<I>width height</I>?</A>
<DD><A HREF="wm.htm#M27" NAME="L1308"><B>wm sizefrom </B><I>window</I> ?<I>who</I>?</A>
<DD><A HREF="wm.htm#M28" NAME="L1309"><B>wm state </B><I>window</I> ?newstate?</A>
<DD><A HREF="wm.htm#M29" NAME="L1310"><B>wm title </B><I>window</I> ?<I>string</I>?</A>
<DD><A HREF="wm.htm#M30" NAME="L1311"><B>wm transient </B><I>window</I> ?<I>master</I>?</A>
<DD><A HREF="wm.htm#M31" NAME="L1312"><B>wm withdraw </B><I>window</I></A>
</DL>
<DD><A HREF="wm.htm#M32" NAME="L1313">GEOMETRY MANAGEMENT</A>
<DD><A HREF="wm.htm#M33" NAME="L1314">GRIDDED GEOMETRY MANAGEMENT</A>
<DD><A HREF="wm.htm#M34" NAME="L1315">BUGS</A>
<DD><A HREF="wm.htm#M35" NAME="L1316">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
wm - Communicate with window manager
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>wm</B> <I>option window </I>?<I>args</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>wm</B> command is used to interact with window managers in
order to control such things as the title for a window, its geometry,
or the increments in terms of which it may be resized. The <B>wm</B>
command can take any of a number of different forms, depending on
the <I>option</I> argument. All of the forms expect at least one
additional argument, <I>window</I>, which must be the path name of a
top-level window.
<P>
The legal forms for the <B>wm</B> command are:
<P>
<DL>
<P><DT><A NAME="M5"><B>wm aspect </B><I>window</I> ?<I>minNumer minDenom maxNumer maxDenom</I>?</A><DD>
If <I>minNumer</I>, <I>minDenom</I>, <I>maxNumer</I>, and <I>maxDenom</I>
are all specified, then they will be passed to the window manager
and the window manager should use them to enforce a range of
acceptable aspect ratios for <I>window</I>. The aspect ratio of
<I>window</I> (width/length) will be constrained to lie
between <I>minNumer</I>/<I>minDenom</I> and <I>maxNumer</I>/<I>maxDenom</I>.
If <I>minNumer</I> etc. are all specified as empty strings, then
any existing aspect ratio restrictions are removed.
If <I>minNumer</I> etc. are specified, then the command returns an
empty string. Otherwise, it returns
a Tcl list containing four elements, which are the current values
of <I>minNumer</I>, <I>minDenom</I>, <I>maxNumer</I>, and <I>maxDenom</I>
(if no aspect restrictions are in effect, then an empty string is
returned).
<P><DT><A NAME="M6"><B>wm client </B><I>window</I> ?<I>name</I>?</A><DD>
If <I>name</I> is specified, this command stores <I>name</I> (which
should be the name of
the host on which the application is executing) in <I>window</I>'s
<B>WM_CLIENT_MACHINE</B> property for use by the window manager or
session manager.
The command returns an empty string in this case.
If <I>name</I> isn't specified, the command returns the last name
set in a <B>wm client</B> command for <I>window</I>.
If <I>name</I> is specified as an empty string, the command deletes the
<B>WM_CLIENT_MACHINE</B> property from <I>window</I>.
<P><DT><A NAME="M7"><B>wm colormapwindows </B><I>window</I> ?<I>windowList</I>?</A><DD>
This command is used to manipulate the <B>WM_COLORMAP_WINDOWS</B>
property, which provides information to the window managers about
windows that have private colormaps.
If <I>windowList</I> isn't specified, the command returns a list
whose elements are the names of the windows in the <B>WM_COLORMAP_WINDOWS</B>
property.
If <I>windowList</I> is specified, it consists of a list of window
path names; the command overwrites the <B>WM_COLORMAP_WINDOWS</B>
property with the given windows and returns an empty string.
The <B>WM_COLORMAP_WINDOWS</B> property should normally contain a
list of the internal windows within <I>window</I> whose colormaps differ
from their parents.
The order of the windows in the property indicates a priority order:
the window manager will attempt to install as many colormaps as possible
from the head of this list when <I>window</I> gets the colormap focus.
If <I>window</I> is not included among the windows in <I>windowList</I>,
Tk implicitly adds it at the end of the <B>WM_COLORMAP_WINDOWS</B>
property, so that its colormap is lowest in priority.
If <B>wm colormapwindows</B> is not invoked, Tk will automatically set
the property for each top-level window to all the internal windows
whose colormaps differ from their parents, followed by the top-level
itself; the order of the internal windows is undefined.
See the ICCCM documentation for more information on the
<B>WM_COLORMAP_WINDOWS</B> property.
<P><DT><A NAME="M8"><B>wm command </B><I>window</I> ?<I>value</I>?</A><DD>
If <I>value</I> is specified, this command stores <I>value</I> in <I>window</I>'s
<B>WM_COMMAND</B> property for use by the window manager or
session manager and returns an empty string.
<I>Value</I> must have proper list structure; the elements should
contain the words of the command used to invoke the application.
If <I>value</I> isn't specified then the command returns the last value
set in a <B>wm command</B> command for <I>window</I>.
If <I>value</I> is specified as an empty string, the command
deletes the <B>WM_COMMAND</B> property from <I>window</I>.
<P><DT><A NAME="M9"><B>wm deiconify </B><I>window</I></A><DD>
Arrange for <I>window</I> to be displayed in normal (non-iconified) form.
This is done by mapping the window. If the window has never been
mapped then this command will not map the window, but it will ensure
that when the window is first mapped it will be displayed
in de-iconified form. On Windows, a deiconified window will also be
raised and be given the focus (made the active window).
Returns an empty string.
<P><DT><A NAME="M10"><B>wm focusmodel </B><I>window</I> ?<B>active</B>|<B>passive</B>?</A><DD>
If <B>active</B> or <B>passive</B> is supplied as an optional argument
to the command, then it specifies the focus model for <I>window</I>.
In this case the command returns an empty string. If no additional
argument is supplied, then the command returns the current focus
model for <I>window</I>.
An <B>active</B> focus model means that <I>window</I> will claim the
input focus for itself or its descendants, even at times when
the focus is currently in some other application. <B>Passive</B> means that
<I>window</I> will never claim the focus for itself: the window manager
should give the focus to <I>window</I> at appropriate times. However,
once the focus has been given to <I>window</I> or one of its descendants,
the application may re-assign the focus among <I>window</I>'s descendants.
The focus model defaults to <B>passive</B>, and Tk's <B><A HREF="../TclCmd/focus.htm">focus</A></B> command
assumes a passive model of focusing.
<P><DT><A NAME="M11"><B>wm frame </B><I>window</I></A><DD>
If <I>window</I> has been reparented by the window manager into a
decorative frame, the command returns the platform specific window
identifier for the outermost frame that contains <I>window</I> (the
window whose parent is the root or virtual root). If <I>window</I>
hasn't been reparented by the window manager then the command returns
the platform specific window identifier for <I>window</I>.
<P><DT><A NAME="M12"><B>wm geometry </B><I>window</I> ?<I>newGeometry</I>?</A><DD>
If <I>newGeometry</I> is specified, then the geometry of <I>window</I>
is changed and an empty string is returned. Otherwise the current
geometry for <I>window</I> is returned (this is the most recent
geometry specified either by manual resizing or
in a <B>wm geometry</B> command). <I>NewGeometry</I> has
the form <B>=</B><I>width</I><B>x</B><I>height</I><B>&#177;</B><I>x</I><B>&#177;</B><I>y</I>, where
any of <B>=</B>, <I>width</I><B>x</B><I>height</I>, or <B>&#177;</B><I>x</I><B>&#177;</B><I>y</I>
may be omitted. <I>Width</I> and <I>height</I> are positive integers
specifying the desired dimensions of <I>window</I>. If <I>window</I>
is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions
are specified in grid units; otherwise they are specified in pixel
units. <I>X</I> and <I>y</I> specify the desired location of
<I>window</I> on the screen, in pixels.
If <I>x</I> is preceded by <B>+</B>, it specifies
the number of pixels between the left edge of the screen and the left
edge of <I>window</I>'s border; if preceded by <B>-</B> then
<I>x</I> specifies the number of pixels
between the right edge of the screen and the right edge of <I>window</I>'s
border. If <I>y</I> is preceded by <B>+</B> then it specifies the
number of pixels between the top of the screen and the top
of <I>window</I>'s border; if <I>y</I> is preceded by <B>-</B> then
it specifies the number of pixels between the bottom of <I>window</I>'s
border and the bottom of the screen.
If <I>newGeometry</I> is specified as an empty string then any
existing user-specified geometry for <I>window</I> is cancelled, and
the window will revert to the size requested internally by its
widgets.
<P><DT><A NAME="M13"><B>wm grid </B><I>window</I> ?<I>baseWidth baseHeight widthInc heightInc</I>?</A><DD>
This command indicates that <I>window</I> is to be managed as a
gridded window.
It also specifies the relationship between grid units and pixel units.
<I>BaseWidth</I> and <I>baseHeight</I> specify the number of grid
units corresponding to the pixel dimensions requested internally
by <I>window</I> using <B><A HREF="../TclLib/GeomReq.htm">Tk_GeometryRequest</A></B>. <I>WidthInc</I>
and <I>heightInc</I> specify the number of pixels in each horizontal
and vertical grid unit.
These four values determine a range of acceptable sizes for
<I>window</I>, corresponding to grid-based widths and heights
that are non-negative integers.
Tk will pass this information to the window manager; during
manual resizing, the window manager will restrict the window's size
to one of these acceptable sizes.
Furthermore, during manual resizing the window manager will display
the window's current size in terms of grid units rather than pixels.
If <I>baseWidth</I> etc. are all specified as empty strings, then
<I>window</I> will no longer be managed as a gridded window. If
<I>baseWidth</I> etc. are specified then the return value is an
empty string.
Otherwise the return value is a Tcl list containing
four elements corresponding to the current <I>baseWidth</I>,
<I>baseHeight</I>, <I>widthInc</I>, and <I>heightInc</I>; if
<I>window</I> is not currently gridded, then an empty string
is returned.
Note: this command should not be needed very often, since the
<B><A HREF="../TclLib/SetGrid.htm">Tk_SetGrid</A></B> library procedure and the <B>setGrid</B> option
provide easier access to the same functionality.
<P><DT><A NAME="M14"><B>wm group </B><I>window</I> ?<I>pathName</I>?</A><DD>
If <I>pathName</I> is specified, it gives the path name for the leader of
a group of related windows. The window manager may use this information,
for example, to unmap all of the windows in a group when the group's
leader is iconified. <I>PathName</I> may be specified as an empty string to
remove <I>window</I> from any group association. If <I>pathName</I> is
specified then the command returns an empty string; otherwise it
returns the path name of <I>window</I>'s current group leader, or an empty
string if <I>window</I> isn't part of any group.
<P><DT><A NAME="M15"><B>wm iconbitmap </B><I>window</I> ?<I>bitmap</I>?</A><DD>
If <I>bitmap</I> is specified, then it names a bitmap in the standard
forms accepted by Tk (see the <B><A HREF="../TclLib/GetBitmap.htm">Tk_GetBitmap</A></B> manual entry for details).
This bitmap is passed to the window manager to be displayed in
<I>window</I>'s icon, and the command returns an empty string. If
an empty string is specified for <I>bitmap</I>, then any current icon
bitmap is cancelled for <I>window</I>.
If <I>bitmap</I> is specified then the command returns an empty string.
Otherwise it returns the name of
the current icon bitmap associated with <I>window</I>, or an empty
string if <I>window</I> has no icon bitmap. On the Windows operating
system, an additional flag is supported:
<B>wm iconbitmap </B><I>window</I> ?<I>-default</I>? ?<I>image</I>?.
If the <I>-default</I>
flag is given, the icon is applied to all toplevel windows (existing
and future) to which no other specific icon has yet been applied.
In addition to bitmap image types, any file which contains a valid
Windows icon is also accepted (usually .ico or .icr files). Tcl will
first test if the files contains an icon, and if that fails, test for
a bitmap.
<P><DT><A NAME="M16"><B>wm iconify </B><I>window</I></A><DD>
Arrange for <I>window</I> to be iconified. It <I>window</I> hasn't
yet been mapped for the first time, this command will arrange for
it to appear in the iconified state when it is eventually mapped.
<P><DT><A NAME="M17"><B>wm iconmask </B><I>window</I> ?<I>bitmap</I>?</A><DD>
If <I>bitmap</I> is specified, then it names a bitmap in the standard
forms accepted by Tk (see the <B><A HREF="../TclLib/GetBitmap.htm">Tk_GetBitmap</A></B> manual entry for details).
This bitmap is passed to the window manager to be used as a mask
in conjunction with the <B>iconbitmap</B> option: where the mask
has zeroes no icon will be displayed; where it has ones, the bits
from the icon bitmap will be displayed. If
an empty string is specified for <I>bitmap</I> then any current icon
mask is cancelled for <I>window</I> (this is equivalent to specifying
a bitmap of all ones). If <I>bitmap</I> is specified
then the command returns an empty string. Otherwise it
returns the name of the current icon mask associated with
<I>window</I>, or an empty string if no mask is in effect.
<P><DT><A NAME="M18"><B>wm iconname </B><I>window</I> ?<I>newName</I>?</A><DD>
If <I>newName</I> is specified, then it is passed to the window
manager; the window manager should display <I>newName</I> inside
the icon associated with <I>window</I>. In this case an empty
string is returned as result. If <I>newName</I> isn't specified
then the command returns the current icon name for <I>window</I>,
or an empty string if no icon name has been specified (in this
case the window manager will normally display the window's title,
as specified with the <B>wm title</B> command).
<P><DT><A NAME="M19"><B>wm iconposition </B><I>window</I> ?<I>x y</I>?</A><DD>
If <I>x</I> and <I>y</I> are specified, they are passed to the window
manager as a hint about where to position the icon for <I>window</I>.
In this case an empty string is returned. If <I>x</I> and <I>y</I> are
specified as empty strings then any existing icon position hint is cancelled.
If neither <I>x</I> nor <I>y</I> is specified, then the command returns
a Tcl list containing two values, which are the current icon position
hints (if no hints are in effect then an empty string is returned).
<P><DT><A NAME="M20"><B>wm iconwindow </B><I>window</I> ?<I>pathName</I>?</A><DD>
If <I>pathName</I> is specified, it is the path name for a window to
use as icon for <I>window</I>: when <I>window</I> is iconified then
<I>pathName</I> will be mapped to serve as icon, and when <I>window</I>
is de-iconified then <I>pathName</I> will be unmapped again. If
<I>pathName</I> is specified as an empty string then any existing
icon window association for <I>window</I> will be cancelled. If
the <I>pathName</I> argument is specified then an empty string is
returned. Otherwise the command returns the path name of the
current icon window for <I>window</I>, or an empty string if there
is no icon window currently specified for <I>window</I>.
Button press events are disabled for <I>window</I> as long as it is
an icon window; this is needed in order to allow window managers
to ``own'' those events.
Note: not all window managers support the notion of an icon window.
<P><DT><A NAME="M21"><B>wm maxsize </B><I>window</I> ?<I>width height</I>?</A><DD>
If <I>width</I> and <I>height</I> are specified, they give
the maximum permissible dimensions for <I>window</I>.
For gridded windows the dimensions are specified in
grid units; otherwise they are specified in pixel units.
The window manager will restrict the window's dimensions to be
less than or equal to <I>width</I> and <I>height</I>.
If <I>width</I> and <I>height</I> are
specified, then the command returns an empty string. Otherwise
it returns a Tcl list with two elements, which are the
maximum width and height currently in effect.
The maximum size defaults to the size of the screen.
If resizing has been disabled with the <B>wm resizable</B> command,
then this command has no effect.
See the sections on geometry management below for more information.
<P><DT><A NAME="M22"><B>wm minsize </B><I>window</I> ?<I>width height</I>?</A><DD>
If <I>width</I> and <I>height</I> are specified, they give the
minimum permissible dimensions for <I>window</I>.
For gridded windows the dimensions are specified in
grid units; otherwise they are specified in pixel units.
The window manager will restrict the window's dimensions to be
greater than or equal to <I>width</I> and <I>height</I>.
If <I>width</I> and <I>height</I> are
specified, then the command returns an empty string. Otherwise
it returns a Tcl list with two elements, which are the
minimum width and height currently in effect.
The minimum size defaults to one pixel in each dimension.
If resizing has been disabled with the <B>wm resizable</B> command,
then this command has no effect.
See the sections on geometry management below for more information.
<P><DT><A NAME="M23"><B>wm overrideredirect </B><I>window</I> ?<I>boolean</I>?</A><DD>
If <I>boolean</I> is specified, it must have a proper boolean form and
the override-redirect flag for <I>window</I> is set to that value.
If <I>boolean</I> is not specified then <B>1</B> or <B>0</B> is
returned to indicate whether or not the override-redirect flag
is currently set for <I>window</I>.
Setting the override-redirect flag for a window causes
it to be ignored by the window manager; among other things, this means
that the window will not be reparented from the root window into a
decorative frame and the user will not be able to manipulate the
window using the normal window manager mechanisms.
<P><DT><A NAME="M24"><B>wm positionfrom </B><I>window</I> ?<I>who</I>?</A><DD>
If <I>who</I> is specified, it must be either <B>program</B> or
<B>user</B>, or an abbreviation of one of these two. It indicates
whether <I>window</I>'s current position was requested by the
program or by the user. Many window managers ignore program-requested
initial positions and ask the user to manually position the window; if
<B>user</B> is specified then the window manager should position the
window at the given place without asking the user for assistance.
If <I>who</I> is specified as an empty string, then the current position
source is cancelled.
If <I>who</I> is specified, then the command returns an empty string.
Otherwise it returns <B>user</B> or <B>program</B> to indicate the
source of the window's current position, or an empty string if
no source has been specified yet. Most window managers interpret
``no source'' as equivalent to <B>program</B>.
Tk will automatically set the position source to <B>user</B>
when a <B>wm geometry</B> command is invoked, unless the source has
been set explicitly to <B>program</B>.
<P><DT><A NAME="M25"><B>wm protocol </B><I>window</I> ?<I>name</I>? ?<I>command</I>?</A><DD>
This command is used to manage window manager protocols such as
<B>WM_DELETE_WINDOW</B>.
<I>Name</I> is the name of an atom corresponding to a window manager
protocol, such as <B>WM_DELETE_WINDOW</B> or <B>WM_SAVE_YOURSELF</B>
or <B>WM_TAKE_FOCUS</B>.
If both <I>name</I> and <I>command</I> are specified, then <I>command</I>
is associated with the protocol specified by <I>name</I>.
<I>Name</I> will be added to <I>window</I>'s <B>WM_PROTOCOLS</B>
property to tell the window manager that the application has a
protocol handler for <I>name</I>, and <I>command</I> will
be invoked in the future whenever the window manager sends a
message to the client for that protocol.
In this case the command returns an empty string.
If <I>name</I> is specified but <I>command</I> isn't, then the current
command for <I>name</I> is returned, or an empty string if there
is no handler defined for <I>name</I>.
If <I>command</I> is specified as an empty string then the current
handler for <I>name</I> is deleted and it is removed from the
<B>WM_PROTOCOLS</B> property on <I>window</I>; an empty string is
returned.
Lastly, if neither <I>name</I> nor <I>command</I> is specified, the
command returns a list of all the protocols for which handlers
are currently defined for <I>window</I>.
<P>
Tk always defines a protocol handler for <B>WM_DELETE_WINDOW</B>, even if
you haven't asked for one with <B>wm protocol</B>.
If a <B>WM_DELETE_WINDOW</B> message arrives when you haven't defined
a handler, then Tk handles the message by destroying the window for
which it was received.
<P><DT><A NAME="M26"><B>wm resizable </B><I>window</I> ?<I>width height</I>?</A><DD>
This command controls whether or not the user may interactively
resize a top-level window. If <I>width</I> and <I>height</I> are
specified, they are boolean values that determine whether the
width and height of <I>window</I> may be modified by the user.
In this case the command returns an empty string.
If <I>width</I> and <I>height</I> are omitted then the command
returns a list with two 0/1 elements that indicate whether the
width and height of <I>window</I> are currently resizable.
By default, windows are resizable in both dimensions.
If resizing is disabled, then the window's size will be the size
from the most recent interactive resize or <B>wm geometry</B>
command. If there has been no such operation then
the window's natural size will be used.
<P><DT><A NAME="M27"><B>wm sizefrom </B><I>window</I> ?<I>who</I>?</A><DD>
If <I>who</I> is specified, it must be either <B>program</B> or
<B>user</B>, or an abbreviation of one of these two. It indicates
whether <I>window</I>'s current size was requested by the
program or by the user. Some window managers ignore program-requested
sizes and ask the user to manually size the window; if
<B>user</B> is specified then the window manager should give the
window its specified size without asking the user for assistance.
If <I>who</I> is specified as an empty string, then the current size
source is cancelled.
If <I>who</I> is specified, then the command returns an empty string.
Otherwise it returns <B>user</B> or <B>window</B> to indicate the
source of the window's current size, or an empty string if
no source has been specified yet. Most window managers interpret
``no source'' as equivalent to <B>program</B>.
<P><DT><A NAME="M28"><B>wm state </B><I>window</I> ?newstate?</A><DD>
If <I>newstate</I> is specified, the window will be set to the new state,
otherwise it returns the current state of <I>window</I>: either
<B>normal</B>, <B>iconic</B>, <B>withdrawn</B>, <B>icon</B>, or (Windows only)
<B>zoomed</B>. The difference between <B>iconic</B> and <B>icon</B> is that
<B>iconic</B> refers to a window that has been iconified (e.g., with the
<B>wm iconify</B> command) while <B>icon</B> refers to a window whose only
purpose is to serve as the icon for some other window (via the <B>wm
iconwindow</B> command). The <B>icon</B> state cannot be set.
<P><DT><A NAME="M29"><B>wm title </B><I>window</I> ?<I>string</I>?</A><DD>
If <I>string</I> is specified, then it will be passed to the window
manager for use as the title for <I>window</I> (the window manager
should display this string in <I>window</I>'s title bar). In this
case the command returns an empty string. If <I>string</I> isn't
specified then the command returns the current title for the
<I>window</I>. The title for a window defaults to its name.
<P><DT><A NAME="M30"><B>wm transient </B><I>window</I> ?<I>master</I>?</A><DD>
If <I>master</I> is specified, then the window manager is informed
that <I>window</I> is a transient window (e.g. pull-down menu) working
on behalf of <I>master</I> (where <I>master</I> is the
path name for a top-level window). Some window managers will use
this information to manage <I>window</I> specially. If <I>master</I>
is specified as an empty string then <I>window</I> is marked as not
being a transient window any more. If <I>master</I> is specified,
then the command returns an empty string. Otherwise the command
returns the path name of <I>window</I>'s current master, or an
empty string if <I>window</I> isn't currently a transient window.
<P><DT><A NAME="M31"><B>wm withdraw </B><I>window</I></A><DD>
Arranges for <I>window</I> to be withdrawn from the screen. This
causes the window to be unmapped and forgotten about by the window
manager. If the window
has never been mapped, then this command
causes the window to be mapped in the withdrawn state. Not all
window managers appear to know how to handle windows that are
mapped in the withdrawn state.
Note: it sometimes seems to be necessary to withdraw a
window and then re-map it (e.g. with <B>wm deiconify</B>) to get some
window managers to pay attention to changes in window attributes
such as group.
<P></DL>
<H3><A NAME="M32">GEOMETRY MANAGEMENT</A></H3>
By default a top-level window appears on the screen in its
<I>natural size</I>, which is the one determined internally by its
widgets and geometry managers.
If the natural size of a top-level window changes, then the window's size
changes to match.
A top-level window can be given a size other than its natural size in two ways.
First, the user can resize the window manually using the facilities
of the window manager, such as resize handles.
Second, the application can request a particular size for a
top-level window using the <B>wm geometry</B> command.
These two cases are handled identically by Tk; in either case,
the requested size overrides the natural size.
You can return the window to its natural by invoking <B>wm geometry</B>
with an empty <I>geometry</I> string.
<P>
Normally a top-level window can have any size from one pixel in each
dimension up to the size of its screen.
However, you can use the <B>wm minsize</B> and <B>wm maxsize</B> commands
to limit the range of allowable sizes.
The range set by <B>wm minsize</B> and <B>wm maxsize</B> applies to
all forms of resizing, including the window's natural size as
well as manual resizes and the <B>wm geometry</B> command.
You can also use the command <B>wm resizable</B> to completely
disable interactive resizing in one or both dimensions.
<H3><A NAME="M33">GRIDDED GEOMETRY MANAGEMENT</A></H3>
Gridded geometry management occurs when one of the widgets of an
application supports a range of useful sizes.
This occurs, for example, in a text editor where the scrollbars,
menus, and other adornments are fixed in size but the edit widget
can support any number of lines of text or characters per line.
In this case, it is usually desirable to let the user specify the
number of lines or characters-per-line, either with the
<B>wm geometry</B> command or by interactively resizing the window.
In the case of text, and in other interesting cases also, only
discrete sizes of the window make sense, such as integral numbers
of lines and characters-per-line; arbitrary pixel sizes are not useful.
<P>
Gridded geometry management provides support for this kind of
application.
Tk (and the window manager) assume that there is a grid of some
sort within the application and that the application should be
resized in terms of <I>grid units</I> rather than pixels.
Gridded geometry management is typically invoked by turning on
the <B>setGrid</B> option for a widget; it can also be invoked
with the <B>wm grid</B> command or by calling <B><A HREF="../TclLib/SetGrid.htm">Tk_SetGrid</A></B>.
In each of these approaches the particular widget (or sometimes
code in the application as a whole) specifies the relationship between
integral grid sizes for the window and pixel sizes.
To return to non-gridded geometry management, invoke
<B>wm grid</B> with empty argument strings.
<P>
When gridded geometry management is enabled then all the dimensions specified
in <B>wm minsize</B>, <B>wm maxsize</B>, and <B>wm geometry</B> commands
are treated as grid units rather than pixel units.
Interactive resizing is also carried out in even numbers of grid units
rather than pixels.
<H3><A NAME="M34">BUGS</A></H3>
Most existing window managers appear to have bugs that affect the
operation of the <B>wm</B> command. For example, some changes won't
take effect if the window is already active: the window will have
to be withdrawn and de-iconified in order to make the change happen.
<P>
On the Windows operating system <I>wm iconbitmap</I> has no effect when
passed a bitmap: only icon files currently work properly.
<H3><A NAME="M35">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#aspect ratio">aspect ratio</A>, <A href="../Keywords/D.htm#deiconify">deiconify</A>, <A href="../Keywords/F.htm#focus model">focus model</A>, <A href="../Keywords/G.htm#geometry">geometry</A>, <A href="../Keywords/G.htm#grid">grid</A>, <A href="../Keywords/G.htm#group">group</A>, <A href="../Keywords/I.htm#icon">icon</A>, <A href="../Keywords/I.htm#iconify">iconify</A>, <A href="../Keywords/I.htm#increments">increments</A>, <A href="../Keywords/P.htm#position">position</A>, <A href="../Keywords/S.htm#size">size</A>, <A href="../Keywords/T.htm#title">title</A>, <A href="../Keywords/T.htm#top-level window">top-level window</A>, <A href="../Keywords/U.htm#units">units</A>, <A href="../Keywords/W.htm#window manager">window manager</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1991-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>