Commit of 3.1.1 version

This commit is contained in:
Erick Gallesio
2019-10-31 11:29:02 +01:00
commit 831a9f5c47
1036 changed files with 313127 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
<H2><IMG ALIGN=BOTTOM SRC=Img/RefBookBlue.gif>The <I>STk</I> blue pages</H2><HR><PRE>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=after.n.html>after</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bell.n.html>bell</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bind.n.html>bind</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bindtags.n.html>bindtags</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bitmap.n.html>bitmap</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=button.n.html>button</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=canvas.n.html>canvas</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=checkbutton.n.html>checkbutton</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=clipboard.n.html>clipboard</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=destroy.n.html>destroy</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=entry.n.html>entry</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=focus.n.html>focus</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=frame.n.html>frame</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=grab.n.html>grab</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=grid.n.html>grid</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=image.n.html>image</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=label.n.html>label</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=listbox.n.html>listbox</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=lower.n.html>lower</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=menu.n.html>menu</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=menubutton.n.html>menubutton</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=message.n.html>message</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=option.n.html>option</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=options.n.html>options</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=pack.n.html>pack</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=photo.n.html>photo</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=place.n.html>place</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=radiobutton.n.html>radiobutton</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=raise.n.html>raise</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=scale.n.html>scale</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=scrollbar.n.html>scrollbar</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=selection.n.html>selection</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=send.n.html>send</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=text.n.html>text</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=tk.n.html>tk</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=tkvars.n.html>tkvars</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=tkwait.n.html>tkwait</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=toplevel.n.html>toplevel</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=update.n.html>update</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=winfo.n.html>winfo</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=wm.n.html>wm</A>
</PRE>
</UL>
</UL>
+7
View File
@@ -0,0 +1,7 @@
<H2><IMG ALIGN=BOTTOM SRC=Img/RefBookGreen.gif>The <I>STk</I> green pages</H2><HR><PRE>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=focus-next.n.html>focus-next</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=listener.n.html>listener</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=make-dialog.n.html>make-dialog</A>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=option-menu.n.html>option-menu</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=palette.n.html>palette</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=popup.n.html>popup</A>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=report-error.n.html>report-error</A>
</PRE>
</UL>
</UL>
Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

+32
View File
@@ -0,0 +1,32 @@
#
# STk/Lib Makefile
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 2-Oct-1995 21:17
# Last file update: 24-Jul-1996 17:55
include ../config.make
HLP_DIR=$(libdir)/Help
lib:
install:
-if [ ! -d $(HLP_DIR) ] ; then mkdir -p $(HLP_DIR); fi
chmod 0555 $(HLP_DIR)
$(CP) *.html $(HLP_DIR)
chmod 0644 $(HLP_DIR)/*.html
-if [ ! -d $(HLP_DIR)/Img ] ; then mkdir -p $(HLP_DIR)/Img; fi
chmod 0555 $(HLP_DIR)/Img
$(CP) Img/*.gif $(HLP_DIR)/Img
chmod 0644 $(HLP_DIR)/Img/*.gif
install.libs:
clean:
rm -f index.html
very-clean: clean
+69
View File
@@ -0,0 +1,69 @@
<HTML>
<TITLE>STk Help main page</TITLE>
<BODY BACKGROUND="Img/classeur.gif">
<UL>
<UL>
<H1> STk help</H1>
<BR>
STk help is organized in several <I>``volumes''</I>:
<P>
<UL>
<IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif">
<B><A HREF=./BlueIndex.html> The blue pages</A></B>
describe the Tk commands and Tk widgets. Tk commands and Tk widgets
are implemented in the (STk modified) Tk toolkit.
</UL>
<UL>
<IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> <B>
<A HREF=./GreenIndex.html>The green pages</B></A> describe Tk related
procedures which are implemented in Scheme. These procedures are
located in the STk library directory and are defined as autoload
procedures. This directory must appear in your <TT>*load-path*</TT>
variable if you want to use these procedures.
</UL>
<UL>
<IMG ALIGN=BOTTOM SRC="./Img/RefBookYellow.gif">
<B><A HREF=./YellowIndex.html>The yellow pages</B></A>
describe <B>STk</B> run-time procedures which are not described in the Reference
Manual (<B>STk</B> extensions or libraries). The way to load these procedure is
describe in each specific page.
<B>This is just a start and further pages will be described her in the future</B>
<P>
</UL>
<BR>
Hereafter is the complete list of STk help pages currently available:
<PRE>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=after.n.html>after</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bell.n.html>bell</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bind.n.html>bind</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bindtags.n.html>bindtags</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=bitmap.n.html>bitmap</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=button.n.html>button</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=canvas.n.html>canvas</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=checkbutton.n.html>checkbutton</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=clipboard.n.html>clipboard</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=destroy.n.html>destroy</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=entry.n.html>entry</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=focus.n.html>focus</A>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=focus-next.n.html>focus-next</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=frame.n.html>frame</A> <IMG ALIGN=BOTTOM SRC=Img/YellowBall.gif><A HREF=ftp.n.html>ftp</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=grab.n.html>grab</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=grid.n.html>grid</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=image.n.html>image</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=label.n.html>label</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=listbox.n.html>listbox</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=listener.n.html>listener</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=lower.n.html>lower</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=make-dialog.n.html>make-dialog</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=menu.n.html>menu</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=menubutton.n.html>menubutton</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=message.n.html>message</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=option.n.html>option</A>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=option-menu.n.html>option-menu</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=options.n.html>options</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=pack.n.html>pack</A>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=palette.n.html>palette</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=photo.n.html>photo</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=place.n.html>place</A>
<IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=popup.n.html>popup</A> <IMG ALIGN=BOTTOM SRC=Img/YellowBall.gif><A HREF=posix.n.html>posix</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=radiobutton.n.html>radiobutton</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=raise.n.html>raise</A> <IMG ALIGN=BOTTOM SRC=Img/GreenBall.gif><A HREF=report-error.n.html>report-error</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=scale.n.html>scale</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=scrollbar.n.html>scrollbar</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=selection.n.html>selection</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=send.n.html>send</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=text.n.html>text</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=tk.n.html>tk</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=tkvars.n.html>tkvars</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=tkwait.n.html>tkwait</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=toplevel.n.html>toplevel</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=update.n.html>update</A>
<IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=winfo.n.html>winfo</A> <IMG ALIGN=BOTTOM SRC=Img/BlueBall.gif><A HREF=wm.n.html>wm</A>
</PRE>
</UL>
</UL>
<UL>
<UL>
You can also find the <b>STk</b> interpreter man page
<A HREF="stk.1.html">here</a>.
<HR>
Page created by Erick Gallesio
<A HREF="mailto:eg@unice.fr">&lt;eg@unice.fr&gt;</a>
+5
View File
@@ -0,0 +1,5 @@
<H2><IMG ALIGN=BOTTOM SRC=Img/RefBookYellow.gif>The <I>STk</I> yellow pages</H2><HR><PRE>
<IMG ALIGN=BOTTOM SRC=Img/YellowBall.gif><A HREF=ftp.n.html>ftp</A> <IMG ALIGN=BOTTOM SRC=Img/YellowBall.gif><A HREF=posix.n.html>posix</A>
</PRE>
</UL>
</UL>
+82
View File
@@ -0,0 +1,82 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - after manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> after</H2>
<I>Execute a command after a time delay</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>after </B><I>ms</I>)<BR>
(<B>after </B><I>ms </I><I>thunk</I>)<BR>
(<B>after 'cancel </B><I>id</I>)<BR>
(<B>after 'cancel </B><I>thunk)</I><BR>
(<B>after 'idle </B>?<I>thunk</I>?)<BR>
(<B>after info</B>)<BR>
(<B>after info </B><I>id</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>after</B> procedure is used to delay execution of the program or to execute
a procedure in background after a delay. It has several forms,
depending on the first argument to the procedure:
<P>
<DL>
<DT><A NAME="M4">(<B>after </B><I>ms</I>)</A><DD>
<I>Ms</I> must be an integer giving a time in milliseconds.
The procedure sleeps for <I>ms</I> milliseconds and then returns.
While the procedure is sleeping the application does not respond to
X events or any other events.
<P>
<DT><A NAME="M5">(<B>after </B><I>ms thunk</I>)</A><DD>
In this form the procedure returns immediately, but it arranges
for a STk procedure to be executed <I>ms</I> milliseconds later as a
background event handler.
The procedure will be executed exactly once, at the given time.
The delayed procedure must be a <I>thunk</I>.
If an error occurs while executing the delayed procedure then the
<B>tkerror</B> mechanism is used to report the error.
The <B>after</B> procedure returns a symbol that can be used
to cancel the delayed procedure using <B>after cancel</B>.
<P>
<DT><A NAME="M6">(<B>after 'cancel </B><I>id</I>)</A><DD>
Cancels the execution of a delayed procedure that
was previously scheduled.
<I>Id</I> indicates which procedure should be canceled; it must have
been the return value from a previous <B>after</B> procedure.
If the procedure given by <I>id</I> has already been executed then
the <B>after cancel</B> procedure has no effect.
<P>
<DT><A NAME="M7">(<B>after 'cancel </B><I>thunk</I>)</A><DD>
This procedure also cancels the execution of a delayed procedure. If there is
a pending procedure that matches <I>thunk</I>, it is cancelled and will
never be executed; if no such procedure is currently
pending then the <B>after cancel</B> procedure has no effect.
<P>
<DT><A NAME="M8">(<B>after 'idle </B><I>thunk</I>)</A><DD>
Arranges for the given <I>thunk</I> to be evaluated later as an idle handler
The script will be run exactly once, the next time the Tk event
loop is entered and there are no events to process.
The procedure returns an identifier that can be used
to cancel the delayed procedure using <B>after cancel</B>.
If an error occurs while executing the script then the
<B>tkerror</B> mechanism is used to report the error.
<P>
<DT><A NAME="M9">(<B>after 'info </B><I>id</I>)</A><DD>
<DT><A NAME="M10">(<B>after 'info</B>)</A><DD>
This procedure returns information about existing event handlers.
If no <I>id</I> argument is supplied, then the procedure returns
a list of the identifiers for all existing
event handlers created by the <B>after</B> procedure for this
interpreter.
If <I>id</I> is supplied, it specifies an existing handler;
<I>id</I> must have been the return value from some previous call
to <B>after</B> and it must not have triggered yet or been cancelled.
In this case the procedure returns a list with two elements.
The first element of the list is the script associated
with <I>id</I>, and the second element is either
<B>idle</B> or <B>timer</B> to indicate what kind of event
handler it is.
<P>
</DL>
<H3><A NAME="M11">SEE ALSO</A></H3>
<B>tkerror</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+17
View File
@@ -0,0 +1,17 @@
<HTML>
<HEAD>
<TITLE>AMIB (A Mini Interface Builder) ( 2-Oct-1995)</TITLE>
<!-- Created by: Erick Gallesio, 1-Oct-1995 -->
<!-- Changed by: Erick Gallesio, 2-Oct-1995 -->
</HEAD>
<BODY>
<center><H1>AMIB (A Mini Interface Builder)</H1></center>
This is only a simple demo. A volunteer to make it more friendly would
be greatly appreciated.
<hr>
<address>Erick Gallesio (eg@unice.fr)</address>
</BODY>
</HTML>
+39
View File
@@ -0,0 +1,39 @@
<HTML>
<HEAD>
<TITLE>AMIB (A Mini Interface Builder) ( 5-Jul-1996)</TITLE>
<!-- Created by: Erick Gallesio, 1-Oct-1995 -->
<!-- Changed by: Erick Gallesio, 5-Jul-1996 -->
</HEAD>
<BODY>
<center><H1>AMIB (A Mini Interface Builder)</H1></center>
Amib is a mini interface builder which allows you to create a simple GUI by using
only the mouse and Drag and Drop. Once you have created your interface, you can
save it in a file to reuse it latter.
<br>
Heareafter are listed the main action available on the mouse.
<ul>
<li>To create a widget, click on the widget listbox and drop the widget on
the window labeled <B>Toplevel #x</B>.
<li>To resize a widget, place the mouse on the desired widget and
click on <TT>&lt;Shift-1&gt;</TT>. Handles will appear on the widget
to allow you to resize it.
<li>To move a widget, place the mouse on the desired widget and click on
<TT>&lt;Shift-1&gt;</TT>. The central handle permits to move the widget.
<li>To customize a widget, click on <TT>&lt;Button-2&gt;</TT> (or
<TT>&lt;Shift-Button-3&gt;</TT> if you have a 2 buttons mouse).
A menu will appear. Using <B>Packed</B> will use the <I>pack</I> geometry manager
rather than <I>place</I> which is used by default.
<li>To delete a widget, place the mouse on the desired widget and click on
<TT>&lt;Button-3&gt;</TT>.
</ul>
<hr>
<address>Erick Gallesio <eg@unice.fr></address>
</BODY>
</HTML>
+21
View File
@@ -0,0 +1,21 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bell manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> bell</H2>
<I>Ring a display's bell</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>bell</B>)<BR>
(<B>bell </B><B>:displayof </B><I>window</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure 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 procedure uses the current bell-related settings for the display, which
may be modified with programs such as <B>xset</B>.
<P>
This procedure 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.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+410
View File
@@ -0,0 +1,410 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bind manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> bind</H2>
<I>Arrange for X events to invoke STk scripts</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">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>
<H3><A NAME="M3">INTRODUCTION</A></H3>
The <B>bind</B> procedure associates STk scripts with X events.
If all three arguments are specified, <B>bind</B> will
arrange for <I>script</I> (a STk script) to be evaluated whenever
the event(s) given by <I>sequence</I> occur in the window(s)
identified by <I>tag</I>.
If is specified for a given sequence, it replaces
the previous 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 list.
<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 list 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="./bindtags.n.html">bindtags</A></B> procedure may be used to assign an
arbitrary set of binding tags to a window, the default binding
tags provide the following behavior:
<UL>
<P>
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="./button.n.html">Button</A></B>,
the binding applies to all widgets in that class;
<P>
If <I>tag</I> has the value <B>&quot;all&quot;</B>,
the binding applies to all windows in the application.
</UL>
<H3><A NAME="M4">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 either of two 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.
<H3><A NAME="M5">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></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> and <B>Triple</B> modifiers are a convenience
for specifying double mouse clicks and other repeated
events. They cause a particular event pattern to be
repeated 2 or 3 times, and also place a time and space requirement
on the sequence: for a sequence of events to match a <B>Double</B>
or <B>Triple</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="M6">EVENT TYPES</A></H3>
The <I>type</I> field may be any of the standard X event types, with a
few extra abbreviations. Below is a list of all the val%id types;
where two names appear together, they are synonyms.
<PRE><B>ButtonPress, Button Expose Map
ButtonRelease FocusIn Motion
Circulate FocusOut Property
Colormap Gravity Reparent
Configure KeyPress, Key Unmap
Destroy KeyRelease Visibility
Enter Leave</B></PRE>
<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> closure parameter 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="M7">BINDING SCRIPTS AND SUBSTITUTIONS</A></H3>
The <I>script</I> argument to <B>bind</B> must be a closure, which will
be executed whenever the given event sequence occurs. The closure can
have parameters. Those parameters are one character symbols (with
convention which are described below). Parameter list will be
evaluated just before the script is fired. Note that some parameters
are only valid for certain types of events; if they are used for other
types of events the value substituted is undefined.
<P>
<DL>
<DT><A NAME="M8"><B>%</B></A><DD>
Replaced with a single percent.
<P>
<DT><A NAME="M9"><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="M10"><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="M11"><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="M12"><B>c</B></A><DD>
The <I>count</I> field from the event. Valid only for <B>Expose</B> events.
<P>
<DT><A NAME="M13"><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:
<P>
<UL>
<PRE><B>NotifyAncestor NotifyNonlinearVirtual
NotifyDetailNone NotifyPointer
NotifyInferior NotifyPointerRoot
NotifyNonlinear NotifyVirtual</B></PRE>
For events other than these, the substituted string is undefined.
</UL>
<DT><A NAME="M14"><B>f</B></A><DD>
The <I>focus</I> field from the event (<B>#f</B> or <B>#t</B>). Valid only
for <B>Enter</B> and <B>Leave</B> events.
<P>
<DT><A NAME="M15"><B>h</B></A><DD>
The <I>height</I> field from the event. Valid only for <B>Configure</B>,
<B>Expose</B>, and <B>GraphicsExpose</B> events.
<P>
<DT><A NAME="M16"><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="M17"><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>EnterWindow</B>,
<B>FocusIn</B>, <B>FocusOut</B>, and <B>LeaveWindow</B> events.
<P>
<DT><A NAME="M18"><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="M19"><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="M20"><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="M21"><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="M22"><B>w</B></A><DD>
The <I>width</I> field from the event. Valid only for
<B>Configure</B>, <B>Expose</B>, and <B>GraphicsExpose</B> events.
<P>
<DT><A NAME="M23"><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="M24"><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="M25"><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="M26"><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="M27"><B>E</B></A><DD>
The <I>send_event</I> field from the event. Valid for all event types.
<P>
<DT><A NAME="M28"><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="M29"><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="M30"><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="M31"><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="M32"><B>T</B></A><DD>
The <I>type</I> field from the event. Valid for all event types.
<P>
<DT><A NAME="M33"><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="M34"><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="M35"><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 following example show how to display a message each time the l1 or l2 label is entered:
<PRE>(pack (label '.l1 :text &quot;One&quot;))
(pack (label '.l2 :text &quot;Two&quot;))
(let ((mess (lambda (|W| x y)
(format #t &quot;Entering ~S x=~a y=~a\n&quot; |W| x y))))
(bind .l1 &quot;&lt;Enter&gt;&quot; mess)
(bind .l2 &quot;&lt;Enter&gt;&quot; mess))</PRE>
<B>Note the usage of the &quot;|&quot; convention for the symbol parameters which must be in left in
upper-case.</B>
<H3><A NAME="M36">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="./bindtags.n.html">bindtags</A></B> procedure may be used to change this order for
a particular window or to associate additional binding tags with
the window.
<P>
If the binding procedure result is the symbol <B>break</B>, then 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) a longer sequence (in terms of number
of events matched) is more specific than a shorter sequence;
(b) an event pattern that specifies a specific button or key is more specific
than one that doesn't;
(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.
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 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.
<P>
The following example illustrates how to use the <B>break</B> symbol to
break a binding chain.
<PRE>(pack (entry '.e))
(bind .e &quot;&lt;KeyPress&gt;&quot; (lambda (|A|)
(unless (string-&gt;number |A|) 'break)))</PRE>
Bindings for the entry <B>.e</B> are executed before those for its
class (i.e. <B><A HREF="./entry.n.html">Entry</A></B>). This allows us to filter the characters
which are effectively passed to the <B>.e</B> widget. The test in this
binding closure breaks the chain of bindings if the typed character is
not a digit. Otherwise, the following binding, the one for the
<B><A HREF="./entry.n.html">Entry</A></B> class, is executed and inserts the character typed (a
digit).
Consequently, the simple previous binding makes <B>.e</B> a
controlled entry which only accepts integer numbers.
<H3><A NAME="M37">MULTI-EVENT SEQUENCES AND IGNORED EVENTS</A></H3>
When a <I>sequence</I> specified in a <B>bind</B> procedure 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="M38">ERRORS</A></H3>
If an error occurs in executing the script for a binding then the
<B>tkerror</B> mechanism is used to report the error.
<H3><A NAME="M39">SEE ALSO</A></H3>
<B><A HREF="./bindtags.n.html">bindtags</A></B>, <B>tkerror</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+61
View File
@@ -0,0 +1,61 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bindtags manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> bindtags</H2>
<I>Determine which bindings apply to a window, and order of evaluation</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>bindtags </B><I>window </I>?<I>tagList</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
When a binding is created with the <B><A HREF="./bind.n.html">bind</A></B> procedure, it is
associated either with a particular window such as <B>.a.b.c</B>,
a class name such as <B><A HREF="./button.n.html">Button</A></B>, the constant <B>&quot;all&quot;</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="./bind.n.html">bind</A></B> procedure 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>&quot;all&quot;</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> procedure 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 call
<PRE><B>(bindtags .b '(&quot;all&quot; *root* &quot;Button&quot; .b))</B></PRE>
reverses the order in which binding scripts will be evaluated for
a button named <B>.b</B> so that <B>&quot;all&quot;</B> bindings are invoked
first, following by bindings for <B>.b</B>'s toplevel (<B>*root</B>* or ``.''),
followed by class bindings, followed by bindings for <B>.b</B>.
<P>
The <B>bindtags</B> procedure may be used to introduce arbitrary
additional binding tags for a window, or to remove standard tags.
For example,
<PRE><B>(bindtags .b '(.b &quot;TrickyButton&quot; *root* &quot;all&quot;})</B></PRE>
replaces the <B><A HREF="./button.n.html">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="./button.n.html">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="M4">SEE ALSO</A></H3>
<B><A HREF="./bind.n.html">bind</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+105
View File
@@ -0,0 +1,105 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - bitmap manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> bitmap</H2>
<I>Images that display two colors</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>image 'create 'bitmap </B>?<I>name</I>? ?<I>options</I>?)<BR>
<H3><A NAME="M3">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="M4">CREATING BITMAPS</A></H3>
Like all images, bitmaps are created using the <B><A HREF=.././image.n.html>image create</A></B>
procedure.
Bitmaps support the following <I>options</I>:
<P>
<DL>
<DT><A NAME="M5"><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="M6"><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="M7"><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="M8"><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="M9"><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="M10"><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="M11">IMAGE PROCEDURE</A></H3>
When a bitmap image is created, Tk also creates a new procedure
whose name is the same as the image.
This procedure 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 procedure. The following
procedures are possible for bitmap images:
<P>
<DL>
<DT><A NAME="M12">(<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> procedure.
<P>
<DT><A NAME="M13">(<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>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the
<B>image create bitmap</B> procedure.
<P>
</DL>
<H3><A NAME="M14">SEE ALSO</A></H3>
<B><A HREF="./image.n.html">image</A></B>, <B><A HREF="./photo.n.html">photo</A></B>, <B>pixmap</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+177
View File
@@ -0,0 +1,177 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - button manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> button</H2>
<I>Create and manipulate button widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>button</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:activeforeground">:activeforeground</A></B>
<B><A HREF="options.n.html#M:anchor">:anchor</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:bitmap">:bitmap</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:disabledforeground">:disabledforeground</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:image">:image</A></B>
<B><A HREF="options.n.html#M:justify">:justify</A></B> <B><A HREF="options.n.html#M:padx">:padx</A></B>
<B><A HREF="options.n.html#M:pady">:pady</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B> <B><A HREF="options.n.html#M:text">:text</A></B>
<B><A HREF="options.n.html#M:textvariable">:textvariable</A></B> <B><A HREF="options.n.html#M:underline">:underline</A></B>
<B><A HREF="options.n.html#M:wraplength">:wraplength</A></B>
</PRE>
<H3><A NAME="M27">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>command</B>
<DT><I>Class</I>: <B>Command</B>
<DT><I>Option keyword</I>: <B><A NAME="M28">:command</A></B>
<DT><I>STklos slot name</I>: <B>command</B>
<DD>Specifies a STk procedure to associate with the button. This procedure
is typically invoked when mouse button 1 is released over the button
window.
<P>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M29">:height</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>state</B>
<DT><I>Class</I>: <B>State</B>
<DT><I>Option keyword</I>: <B><A NAME="M30">:state</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M31">:width</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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.
<P>
</DL>
<H3><A NAME="M32">DESCRIPTION</A></H3>
The <B>button</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a button widget.
Additional
options, described above, may be specified on the procedure 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> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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 STk procedure specified in the <B>:command</B>
option is invoked.
<H3><A NAME="M33">WIDGET PROCEDURE</A></H3>
The <B>button</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for button widgets:
<P>
<DL>
<DT><A NAME="M34">(<I>widget-name </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>
procedure.
<P>
<DT><A NAME="M35">(<I>widget-name </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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>button</B>
procedure.
<P>
<DT><A NAME="M36">(<I>widget-name </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 procedure was invoked.
This procedure is ignored if the button's state is <B>disabled</B>.
<P>
<DT><A NAME="M37">(<I>widget-name </I><B>'invoke</B>)</A><DD>
Invoke the STk procedure associated with the button, if there is one
(return value is undefined).
This procedure is ignored if the button's state is <B>disabled</B>.
<P>
</DL>
<H3><A NAME="M38">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for buttons that give them
the following default behavior:
<OL>
<LI>
A button activates whenever the mouse passes over it and deactivates
whenever the mouse leaves the button.
<LI>
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.
<LI>
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.
<LI>
When a button has the input focus, the space key causes the button
to be invoked.
</OL>
<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="M39">SEE ALSO</A></H3>
<B><A HREF="./checkbutton.n.html">checkbutton</A></B>, <B><A HREF="./radiobutton.n.html">radiobutton</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+1570
View File
File diff suppressed because it is too large Load Diff
+288
View File
@@ -0,0 +1,288 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - checkbutton manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> checkbutton</H2>
<I>Create and manipulate checkbutton widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>checkbutton</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:activeforeground">:activeforeground</A></B>
<B><A HREF="options.n.html#M:anchor">:anchor</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:bitmap">:bitmap</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:disabledforeground">:disabledforeground</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:image">:image</A></B>
<B><A HREF="options.n.html#M:justify">:justify</A></B> <B><A HREF="options.n.html#M:padx">:padx</A></B>
<B><A HREF="options.n.html#M:pady">:pady</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B> <B><A HREF="options.n.html#M:text">:text</A></B>
<B><A HREF="options.n.html#M:textvariable">:textvariable</A></B> <B><A HREF="options.n.html#M:underline">:underline</A></B>
<B><A HREF="options.n.html#M:wraplength">:wraplength</A></B>
</PRE>
<H3><A NAME="M27">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>command</B>
<DT><I>Class</I>: <B>Command</B>
<DT><I>Option keyword</I>: <B><A NAME="M28">:command</A></B>
<DT><I>STklos slot name</I>: <B>command</B>
<DD>Specifies a STk procedure to associate with the button. This procedure
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 procedure is invoked.
<P>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M29">:height</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>indicatorOn</B>
<DT><I>Class</I>: <B>IndicatorOn</B>
<DT><I>Option keyword</I>: <B><A NAME="M30">:indicatoron</A></B>
<DT><I>STklos slot name</I>: <B>indicator-on</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>
<P>
<DT><I>Name</I>: <B>offValue</B>
<DT><I>Class</I>: <B>Value</B>
<DT><I>Option keyword</I>: <B><A NAME="M31">:offvalue</A></B>
<DT><I>STklos slot name</I>: <B>off-value</B>
<DD>Specifies value to store in the button's associated variable whenever
this button is deselected. Defaults to <B>#f</B>.
<P>
<P>
<DT><I>Name</I>: <B>onValue</B>
<DT><I>Class</I>: <B>Value</B>
<DT><I>Option keyword</I>: <B><A NAME="M32">:onvalue</A></B>
<DT><I>STklos slot name</I>: <B>on-value</B>
<DD>Specifies value to store in the button's associated variable whenever
this button is selected. Defaults to <B>#t</B>.
<P>
<P>
<DT><I>Name</I>: <B>selectColor</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M33">:selectcolor</A></B>
<DT><I>STklos slot name</I>: <B>select-color</B>
<DD>Specifies a background color to use when the button is selected.
If <B>indicatorOn</B> is true then the color applicies to the indicator.
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>
<P>
<DT><I>Name</I>: <B>selectImage</B>
<DT><I>Class</I>: <B>SelectImage</B>
<DT><I>Option keyword</I>: <B><A NAME="M34">:selectimage</A></B>
<DT><I>STklos slot name</I>: <B>select-image</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>
<P>
<DT><I>Name</I>: <B>state</B>
<DT><I>Class</I>: <B>State</B>
<DT><I>Option keyword</I>: <B><A NAME="M35">:state</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>stringvalue</B>
<DT><I>Class</I>: <B>StringValue</B>
<DT><I>Option keyword</I>: <B><A NAME="M36">:stringvalue</A></B>
<DT><I>STklos slot name</I>: <B>string-value</B>
<DD>Specifies if the value set to <B>variable</B> by <B>:offvalue</B> or
<B>:onvalue</B> must be <I>stringified</I>. For instance, with
<P>
</DL>
<UL>
<PRE>(checkbutton '.c :text &quot;Try&quot; :variable 'x :stringvalue #t
:onvalue 10 :offvalue 20)</PRE>
the variabe <B>x</B> var is set to <I>&quot;10&quot;</I> or <I>&quot;20&quot;</I>, whereas
with
<PRE>(checkbutton '.c :text &quot;Try&quot; :variable 'x :stringvalue #f
:onvalue 10 :offvalue 20)</PRE>
it is set to 10 or 20. Default value for <B>:stringvalue</B> is <B>#t</B>.
</UL>
<DL>
<P>
<DT><I>Name</I>: <B>variable</B>
<DT><I>Class</I>: <B>Variable</B>
<DT><I>Option keyword</I>: <B><A NAME="M37">:variable</A></B>
<DT><I>STklos slot name</I>: <B>variable</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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M38">:width</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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.
<P>
</DL>
<H3><A NAME="M39">DESCRIPTION</A></H3>
The <B>checkbutton</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a checkbutton widget.
Additional
options, described above, may be specified on the procedure 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> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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 STk procedure 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 sunken relief and a special color, and
a STk variable associated with the checkbutton is set to a particular
value (normally 1).
If the checkbutton is not selected, then the indicator is drawn with a
raised relief and no special color, and the associated variable is
set to a different value (typically 0).
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 procedure 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="M40">WIDGET PROCEDURE</A></H3>
The <B>checkbutton</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for checkbutton widgets:
<P>
<DL>
<DT><A NAME="M41">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M42">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty list.
<I>Option</I> may have any of the values accepted by the <B>checkbutton</B>
procedure.
<P>
<DT><A NAME="M43">(<I>widget-name '</I><B>deselect</B>)</A><DD>
Deselects the checkbutton and sets the associated variable to its ``off''
value.
<P>
<DT><A NAME="M44">(<I>widget-name '</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 procedure was invoked.
This procedure is ignored if the checkbutton's state is <B>disabled</B>.
<P>
<DT><A NAME="M45">(<I>widget-name '</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 STk procedure associated with the checkbutton, if there is one
(return value is undefined)
This procedure is ignored if the checkbutton's state is <B>disabled</B>.
<P>
<DT><A NAME="M46">(<I>widget-name '</I><B>select</B>)</A><DD>
Selects the checkbutton and sets the associated variable to its ``on''
value.
<P>
<DT><A NAME="M47">(<I>widget-name '</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="M48">BINDINGS</A></H3>
Tk automatically creates class bindings for checkbuttons that give them
the following default behavior:
<OL>
<LI>
A checkbutton activates whenever the mouse passes over it and deactivates
whenever the mouse leaves the checkbutton.
<LI>
When mouse button 1 is pressed over a checkbutton it is invoked (its
selection state toggles and the procedure associated with the button is
invoked, if there is one).
<LI>
When a checkbutton has the input focus, the space key causes the checkbutton
to be invoked.
</OL>
<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="M49">SEE ALSO</A></H3>
<B><A HREF="./button.n.html">button</A></B>, <B><A HREF="./radiobutton.n.html">radiobutton</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+73
View File
@@ -0,0 +1,73 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - clipboard manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> clipboard</H2>
<I>Manipulate Tk clipboard</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>clipboard </B><I>option</I> ?<I>arg arg ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure provides a STk 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 procedure. The following
forms are currently supported:
<P>
<P>
<DL>
<DT><A NAME="M4">(<B>clipboard 'clear</B>)</A><DD>
<DT><A NAME="M5">(<B>clipboard 'clear</B> ?<B>:display-of</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 <B>*root*</B>. Returns an
empty list.
<P>
<DT><A NAME="M6">(<B>clipboard 'append</B> ?<B>:display-of</B> <I>window</I>? ?<B>:format</B> <I>format</I>? ?<B>:type</B> <I>type</I>? ?\fB:\|-\fR? \fIdata\fR)</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>
<UL>
<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 \fB:\|-\fR argument may be specified to mark the end of options: the
next argument will always be used as \fIdata\fR.
This feature may be convenient if, for example, \fIdata\fR starts
with a \fB:\fR.
</UL>
</DL>
<H3><A NAME="M7">SEE ALSO</A></H3>
<B><A HREF="./selection.n.html">selection</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+17
View File
@@ -0,0 +1,17 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - destroy manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> destroy</H2>
<I>Destroy one or more windows</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>destroy </B>?<I>window window ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure deletes the windows given by the
<I>window</I> arguments, plus all of their descendants.
If a <I>window</I> <B>*root*</B> (or ``.'') 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 procedure aborts without destroying the
remaining windows.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+436
View File
@@ -0,0 +1,436 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - entry manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> entry</H2>
<I>Create and manipulate entry widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>entry</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:background">:background</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:exportselection">:exportselection</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:insertbackground">:insertbackground</A></B>
<B><A HREF="options.n.html#M:insertborderwidth">:insertborderwidth</A></B> <B><A HREF="options.n.html#M:insertofftime">:insertofftime</A></B>
<B><A HREF="options.n.html#M:insertontime">:insertontime</A></B> <B><A HREF="options.n.html#M:insertwidth">:insertwidth</A></B>
<B><A HREF="options.n.html#M:justify">:justify</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:selectbackground">:selectbackground</A></B> <B><A HREF="options.n.html#M:selectborderwidth">:selectborderwidth</A></B>
<B><A HREF="options.n.html#M:selectforeground">:selectforeground</A></B> <B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
<B><A HREF="options.n.html#M:textvariable">:textvariable</A></B> <B><A HREF="options.n.html#M:xscrollcommand">:xscrollcommand</A></B>
</PRE>
<H3><A NAME="M26">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>show</B>
<DT><I>Class</I>: <B>Show</B>
<DT><I>Option keyword</I>: <B><A NAME="M27">:show</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>state</B>
<DT><I>Class</I>: <B>State</B>
<DT><I>Option keyword</I>: <B><A NAME="M28">:state</A></B>
<DT><I>STklos slot name</I>: <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
procedures and no insertion cursor will be displayed, even if the input focus is
in the widget.
<P>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M29">:width</A></B>
<DT><I>STklos slot name</I>: <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.
<P>
</DL>
<H3><A NAME="M30">DESCRIPTION</A></H3>
The <B>entry</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into an entry widget.
Additional options, described above, may be specified on the
procedure line or in the option database
to configure aspects of the entry such as its colors, font,
and relief. The <B>entry</B> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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 procedures 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>STRING</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; procedures 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="M31">WIDGET PROCEDURE</A></H3>
The <B>entry</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure.
<P>
Many of the widget procedures 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>
<DT><A NAME="M32"><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="M33"><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 procedures.
<P>
<DT><A NAME="M34"><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="M35"><B>insert</B></A><DD>
Indicates the character adjacent to and immediately following the
insertion cursor.
<P>
<DT><A NAME="M36"><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="M37"><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="M38"><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 procedures are possible for entry widgets:
<P>
<DL>
<DT><A NAME="M39">(<I>widget-name '</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="M40">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M41">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>entry</B>
procedure.
<P>
<DT><A NAME="M42">(<I>widget-name '</I><B>delete </B><I>first</I>)</A><DD>
<DT><A NAME="M43">(<I>widget-name '</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 procedure returns an empty string.
<P>
<DT><A NAME="M44">(<I>widget-name '</I><B>get</B>)</A><DD>
Returns the entry's string.
<P>
<DT><A NAME="M45">(<I>widget-name '</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="M46">(<I>widget-name '</I><B>index</B><I> index</I>)</A><DD>
Returns the numerical index corresponding to <I>index</I>.
<P>
<DT><A NAME="M47">(<I>widget-name '</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="M48">(<I>widget-name '</I><B>scan</B> <I>option args</I>)</A><DD>
This procedure is used to implement scanning on entries. It has
two forms, depending on <I>option</I>:
<P>
<P>
<DL>
<DT><A NAME="M49">(<I>widget-name '</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> procedures. Typically this
procedure is associated with a mouse button press in the widget. It
returns an empty string.
<P>
<DT><A NAME="M50">(<I>widget-name '</I><B>scan 'dragto </B><I>x</I>)</A><DD>
This procedure computes the difference between its <I>x</I> argument
and the <I>x</I> argument to the last <B>scan mark</B> procedure for
the widget. It then adjusts the view left or right by 10 times the
difference in x-coordinates. This procedure 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>
<DT><A NAME="M51">(<I>widget-name '</I><B>selection </B><I>option arg</I>)</A><DD>
This procedure is used to adjust the selection within an entry. It
has several forms, depending on <I>option</I>:
<P>
<P>
<DL>
<DT><A NAME="M52">(<I>widget-name '</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> procedures. 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="M53">(<I>widget-name '</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 procedure has no effect.
Returns an empty string.
<P>
<DT><A NAME="M54">(<I>widget-name '</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="M55">(<I>widget-name '</I><B>selection 'present</B>)</A><DD>
Returns <B>#t</B> if there is are characters selected in the entry,
<B>#f</B> if nothing is selected.
<P>
<DT><A NAME="M56">(<I>widget-name '</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="M57">(<I>widget-name '</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> procedure 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>
<DT><A NAME="M58">(<I>widget-name '</I><B>xview </B><I>args</I>)</A><DD>
This procedure 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>
<P>
<DL>
<DT><A NAME="M59">(<I>widget-name '</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="M60">(<I>widget-name '</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="M61">(<I>widget-name '</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="M62">(<I>widget-name '</I><B>xview 'scroll </B><I>number what</I>)</A><DD>
This procedure 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>
</DL>
<H3><A NAME="M63">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.
<OL>
<LI>
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.
<LI>
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.
<LI>
Triple-clicking with mouse button 1 selects all of the text in the
entry and positions the insertion cursor before the first character.
<LI>
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.
<LI>
Clicking mouse button 1 with the Control key down will position the
insertion cursor in the entry without affecting the selection.
<LI>
If any normal printing characters are typed in an entry, they are
inserted at the point of the insertion cursor.
<LI>
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.
<LI>
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).
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
Control-/ selects all the text in the entry.
<LI>
Control-&#92; clears any selection in the entry.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
Control-d deletes the character to the right of the insertion cursor.
<LI>
Meta-d deletes the word to the right of the insertion cursor.
<LI>
Control-k deletes all the characters to the right of the insertion
cursor.
<LI>
Control-w deletes the word to the left of the insertion cursor.
<LI>
Control-t reverses the order of the two characters to the right of
the insertion cursor.
</OL>
<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.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+39
View File
@@ -0,0 +1,39 @@
<HTML>
<HEAD>
<TITLE>STk error help (13-Sep-1995)</TITLE>
<!-- Changed by: Erick Gallesio, 13-Sep-1995 -->
</HEAD>
<BODY>
<H1><IMG ALIGN=BOTTOM SRC="Img/note.gif">STk stack window help</H1>
<IMG ALIGN=TOP SRC="Img/colorline.gif">
<BR>
This window allows you to see the stack when an error occurs. Two
sub-windows compose it.
<UL>
<LI> the topmost window (labeled <strong>Stack content</strong>)
shows the contents of the stack when the error occurred. Each line
contains the parameters passed to an invocation of the <TT>eval</TT>
procedure (last call to eval is on the first line).
<BR>
This window is also made of two sub-windows.
<UL>
<LI> On the left side is the environment in which the expression
must be evaluated. Click on an item of this list to view
the bindings defined in this environment.
<LI> On the right side, there is the expression to evaluate. Clicking on
an item of this list sets the <em>Listener</em>
default environment to the environment of this expression.
</UL>
<LI> the bottom window (labeled <strong>Listener</strong>) allows you to
interact with the <EM>STk</EM> interpreter. The listener reads an
expression in this window, evaluates it (in the environment previously
selected in the above <EM>Stack window</EM>) and prints its result in
this window.
</UL>
<hr>
<A HREF="STk-hlp.html"><IMG ALIGN=TOP SRC="Img/home.gif"> Go to top</A>
</BODY>
</HTML>
+33
View File
@@ -0,0 +1,33 @@
<HTML>
<HEAD>
<TITLE>STk File box help (20-Sep-1995)</TITLE>
<!-- Changed by: Erick Gallesio, 20-Sep-1995 -->
</HEAD>
<BODY>
<H1><IMG ALIGN=BOTTOM SRC="Img/note.gif">STk File box help</H1>
<IMG ALIGN=TOP SRC="Img/colorline.gif">
<BR>
This file box is an instance of the <TT>&lt;File-box&gt; </TT>composite class.
<P>
The <B>Parents</B> list contains current path exploded with one
directory per line. Clicking on an item of this list allows a rapid
access to a parent directory.
<P>
The <B>Files</B> list contains the files of the current
directory. Special files (i.e dotted files) are shown iff the check
button <I>All files</I>, situated on the bottom of the window, is set.
<P>
A file name can also be typed-in in the <B>File name</B>
entry. Use the <TT>Tab</TT> key to perform automatic completion.
<hr>
<A HREF="STk-hlp.html"><IMG ALIGN=TOP SRC="Img/home.gif"> Go to top </A>
</BODY>
</HTML>
+53
View File
@@ -0,0 +1,53 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - Tk:focus-next manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> Tk:focus-next, Tk:focus-prev, Tk:focus-follows-mouse, Tk:focus-on, Tk:focus-off</H2>
<I>Utility procedures for managing the input focus.</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>Tk:focus-next </B><I>window</I>)<BR>
(<B>Tk:focus-prev </B><I>window</I>)<BR>
(<B>Tk:focus-follows-mouse</B>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
<B>Tk:focus-next</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:focus-next</B> never returns a window in a different top-level
from <I>window</I>.
<P>
After computing the next window, <B>Tk:focus-next</B> examines the
window's <B>:takefocus</B> option to see whether it should be skipped.
If so, <B>Tk:focus-next</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:focus-prev</B> is similar to <B>Tk:focus-next</B> except that it
returns the window just before <I>window</I> in the focus order.
<P>
<B>Tk:focus-follows-mouse</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="./focus.n.html">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:focus-follows-mouse</B>.
<P>
<B>Tk:focus-on</B> and <B>Tk:focus-off</B> are simpy defined as
<PRE>(define Tk:focus-on (lambda (w) #t))
(define Tk:focus-off (lambda (w) #f))</PRE>
This procedures can be used by the focus traversal algorithm presented in the
<B><A HREF="./options.n.html">options</A></B> manual page.
<H3><A NAME="M4">SEE ALSO</A></H3>
<B><A HREF="./focus.n.html">focus</A></B>, <B><A HREF="./toplevel.n.html">toplevel</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+101
View File
@@ -0,0 +1,101 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - focus manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> focus</H2>
<I>Manage the input focus</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">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="M3">DESCRIPTION</A></H3>
The <B>focus</B> procedure 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 STk procedure <B>Tk:focus-follows-mouse</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 STk procedures <B>Tk:focus-next</B> and <B> Tk:focus-prev</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> procedure can take any of the following forms:
<P>
<DL>
<DT><A NAME="M4">(<B>focus</B>)</A><DD>
Returns the path name of the focus window on the display containing
the application's main window, or <B>#f</B> 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="M5">(<B>focus </B><I>window</I>)</A><DD>
If the application currently has the input focus on <I>window</I>'s
display, this procedure 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 procedure does nothing.
<P>
<DT><A NAME="M6">(<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 list.
<P>
<DT><A NAME="M7">(<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 procedure 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 procedure does nothing.
<P>
<DT><A NAME="M8">(<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="M9">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="M10">SEE ALSO</A></H3>
<B><A HREF="./grab.n.html">grab</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+142
View File
@@ -0,0 +1,142 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - frame manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> frame</H2>
<I>Create and manipulate frame widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>frame</B><I> widget-name ?options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
</PRE>
<H3><A NAME="M11">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>background</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M12">:background</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>class</B>
<DT><I>Class</I>: <B>Class</B>
<DT><I>Option keyword</I>: <B><A NAME="M13">:class</A></B>
<DT><I>STklos slot name</I>: <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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>colormap</B>
<DT><I>Class</I>: <B>Colormap</B>
<DT><I>Option keyword</I>: <B><A NAME="M14">:colormap</A></B>
<DT><I>STklos slot name</I>: <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>widget-name</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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M15">:height</A></B>
<DT><I>STklos slot name</I>: <B>height</B>
<DD>Specifies the desired height for the window in any of the forms
acceptable to <B>Tk_GetPixels</B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P>
<P>
<DT><I>Name</I>: <B>visual</B>
<DT><I>Class</I>: <B>Visual</B>
<DT><I>Option keyword</I>: <B><A NAME="M16">:visual</A></B>
<DT><I>STklos slot name</I>: <B>visual</B>
<DD>Specifies visual information for the new window in any of the
forms accepted by <B>Tk_GetVisual</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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M17">:width</A></B>
<DT><I>STklos slot name</I>: <B>width</B>
<DD>Specifies the desired width for the window in any of the forms
acceptable to <B>Tk_GetPixels</B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P>
</DL>
<H3><A NAME="M18">DESCRIPTION</A></H3>
The <B>frame</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a frame widget.
Additional
options, described above, may be specified on the procedure line
or in the option database
to configure aspects of the frame such as its background color
and relief. The <B>frame</B> procedure 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="M19">WIDGET PROCEDURE</A></H3>
The <B>frame</B> procedure creates a new STk procedure whose
name is the same as the path name of the frame's window. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>PathName</I> is the name of the procedure, 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 procedure. The following
procedures are possible for frame widgets:
<P>
<DL>
<DT><A NAME="M20">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M21">(<I>widget-name </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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>frame</B>
procedure.
<P>
</DL>
<H3><A NAME="M22">BINDINGS</A></H3>
When a new frame is created, it has no default event bindings:
frames are not intended to be interactive.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+104
View File
@@ -0,0 +1,104 @@
<HTML><HEAD><TITLE>STk procedures - ftp manual page</TITLE></HEAD>
<BODY bgcolor = #ffffa0>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageYellow.gif"> ftp </H2>
<I>A small (and very incomplete) FTP library</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>make </B><I>&lt;FTP-connection&gt; </I>?<I>options</I>?)<BR>
(<B>ftp-login f user pass</B>)<BR>
(<B>ftp-quit f</B>)<BR>
(<B>ftp-chdir f dir</B>)<BR>
(<B>ftp-pwd f</B>)<BR>
(<B>ftp-type f mode</B>)<BR>
(<B>ftp-help f</B>)<BR>
(<B>ftp-help f command</B>)<BR>
(<B>ftp-dir f</B>)<BR>
(<B>ftp-dir f args</B>)<BR>
(<B>ftp-get f file</B>)<BR>
(<B>ftp-put f file</B>)<BR>
(<B>ftp-display f file</B>)<BR>
<H3><A NAME="M3">CLASS DESCRIPTION</A></H3>
<DL>
<DT><A NAME="M4"><I>Included&nbsp;with:</I></A><DD>
(require &quot;ftp&quot;)
<P>
<DT><A NAME="M5"><I>Inherits&nbsp;from:</I></A><DD>
&lt;top&gt;
<P>
<DT><A NAME="M6"><I>Direct&nbsp;slots:</I></A><DD>
<B>host</B> contains the name of the host to connect to.
<P>
<P>
<P>
<B>port</B> specifies the port to use to establish the ftp connection.
This slot is initialized by default to 21 by default (the standard ftp port).
<P>
<P>
<P>
<B>echo</B> is the name of a one parameter procedure used to display
the messages sent by the ftp server. This slot is initialized to by
default to the standard <I>display</I> procedure.
<P>
</DL>
<H3><A NAME="M7">DESCRIPTION</A></H3>
This library is a first attempt to make the FTP protocol available
from the STk interpreter. It is still very incomplete and has not
been intensively tested. Any help to make the subset implemented
conform to RFC 959 would be greatly appreciated.
<P>
The following procedure are implemented by the library:
<P>
<DL>
<DT><A NAME="M8">(<B>ftp-quit f</B>)</A><DD>
close the connection <I>f</I> to the remote host and the associated files.
<P>
<DT><A NAME="M9">(<B>ftp-chdir f dir</B>)</A><DD>
changes the remote working directory on the <I>f</I> connection.
<P>
<DT><A NAME="M10">(<B>ftp-pwd f</B>)</A><DD>
returns the remote working directory on the <I>f</I> connection.
<P>
<DT><A NAME="M11">(<B>ftp-type f mode</B>)</A><DD>
set the file transfer type to <I>mode</I> on the <I>f</I>
connection. <I>Mode</I> must be a one letter symbol such as
'a (for ASCII) or 'i (for image).
<P>
<DT><A NAME="M12">(<B>ftp-help f</B>)</A><DD>
<DT><A NAME="M13">(<B>ftp-help f command</B>)</A><DD>
prints help from the server connected to <I>f</I> on the standard output port.
<P>
<DT><A NAME="M14">(<B>ftp-dir f</B>)</A><DD>
<DT><A NAME="M15">(<B>ftp-dir f args</B>)</A><DD>
gives the list of files in the current remote directory. If args is specified
it is passed to the ftp server.
<P>
<DT><A NAME="M16">(<B>ftp-get f file</B>)</A><DD>
retrieves <I>file</I> on the remote server.
<P>
<DT><A NAME="M17">(<B>ftp-put f file</B>)</A><DD>
stores <I>file</I> on the remote server.
<P>
<DT><A NAME="M18">(<B>ftp-display f file</B>)</A><DD>
prints on the standard output port the content of the file <I>file</I>
located the remote server.
<P>
</DL>
<P>
All these procedures return a boolean value which indicate if the requested
operation succeeded or not.
<H3><A NAME="M19">EXAMPLE</A></H3>
Hereafter is a simple session which prints the content of the /pub
directory and gets the last release of STk on the <I>kaolin</I>
workstation:
<PRE>(define f (make &lt;FTP-connection&gt; :host &quot;kaolin.unice.fr&quot;))
(when (ftp-login &quot;anonymous&quot; &quot;eg@unice.fr&quot;)
(ftp-chdir f &quot;/pub&quot;)
(ftp-dir f &quot;-lsa&quot;)
(ftp-get f &quot;STk.tar.gz&quot;)
(ftp-quit f))</PRE>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookYellow.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+116
View File
@@ -0,0 +1,116 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - grab manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> grab</H2>
<I>Confine pointer and keyboard events to a window sub-tree</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>grab </B><I>window</I>)<BR>
(<B>grab </B><B>:global</B> <I>window</I>)<BR>
(<B>grab </B><I>option </I>?<I>arg arg </I>...?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure 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="./focus.n.html">focus</A></B> procedure 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> procedure can take any of the following forms:
<P>
<DL>
<DT><A NAME="M4">(<B>grab </B> <I>window</I>)</A><DD>
<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>)</A><DD>
<DT><A NAME="M7">(<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 procedure 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="M8">(<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="M9">(<B>grab 'set </B> <I>window</I>)</A><DD>
<DT><A NAME="M10">(<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 procedure
does nothing. Returns an empty string.
<P>
<DT><A NAME="M11">(<B>grab 'status </B><I>window</I>)</A><DD>
Returns <B>&quot;none&quot;</B> if no grab is currently set on <I>window</I>,
<B>&quot;local&quot;</B> if a local grab is set on <I>window</I>, and
<B>&quot;global&quot;</B> if a global grab is set.
<P>
</DL>
<H3><A NAME="M12">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="M13">SEE ALSO</A></H3>
<B><A HREF="./focus.n.html">focus</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+248
View File
@@ -0,0 +1,248 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - grid manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> grid</H2>
<I>Geometry manager that arranges widgets in a grid</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>grid </B><I>option arg </I>?<I>arg ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>grid</B> procedure 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> procedure can have any of several forms, depending
on the <I>option</I> argument:
<P>
<DL>
<DT><A NAME="M4">(<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 procedure is processed in the same
way as <B>grid configure</B>.
<P>
<DT><A NAME="M5">(<B>grid 'bbox </B><I>master column row</I>)</A><DD>
The bounding box (in pixels) is returned for the space occupied by
the grid position indicated by <I>column</I> and <I>row</I>. 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
cell, and the second two are the width and height of the cell.
<P>
<DT><A NAME="M6">(<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> and <B>:weight</B>.
The <B>:minsize</B> option sets the minimum column size, in screen units,
and the <B>:weight</B> option (a floating point value)
sets the relative weight for apportioning
any extra spaces among
columns. If no value is specified, the current value is returned.
<P>
<DT><A NAME="M7">(<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>
<P>
<DL>
<DT><A NAME="M8"><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="M9"><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="M10"><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="M11"><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).
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="M12"><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).
The <I>amount</I> defaults to 0.
<P>
<DT><A NAME="M13"><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).
The <I>amount</I> defaults to 0.
<P>
<DT><A NAME="M14"><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).
The <I>amount</I> defaults to 0.
<P>
<DT><A NAME="M15"><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="M16"><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> procedure 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="M17"><B>:sticky </B><I>style</I></A><DD>
If a slave's parcel is larger than its requested dimensions, this
option may be used to position (or stretch) the slave within its cavity.
<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="./pack.n.html">pack</A></B>.
The default is the empty string, which causes the slave to be centered
in its cavity, at its requested size.
<P>
</DL>
<UL>
<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.
</UL>
<DT><A NAME="M18">(<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.
<P>
<DT><A NAME="M19">(<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="M20">(<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="M21">(<B>grid 'propagate </B><I>master</I>)</A><DD>
<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
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 list is returned.
If <I>boolean</I> is omitted then the procedure returns <B>#f</B> or
<B>#t</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>)</A><DD>
<DT><A NAME="M24">(<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> and <B>:weight</B>.
<B>Minsize</B> sets the minimum row size, in screen units, and <B>weight</B>
sets the relative weight for apportioning any extra spaces among
rows. If no value is specified, the current value is returned.
<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> or
<B>weight</B>.
<P>
<DT><A NAME="M26">(<B>grid 'slaves </B><I>master</I>)</A><DD>
<DT><A NAME="M27">(<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. <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="M28">RELATIVE PLACEMENT</A></H3>
The <B>grid</B> procedure 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 procedure, and the presence
of the characters <B>:</B>, <B>^</B>, and <B>^</B> in <B>grid</B>
procedure where <I>slave</I> names are normally expected.
<P>
<DL>
<DT><A NAME="M29"><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. S <B>:</B>
may not follow a <B>^</B> or a <B>x</B>.
<P>
<DT><A NAME="M30"><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="M31"><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="M32">GEOMETRY PROPAGATION</A></H3>
Grid 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> procedure 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.
<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> procedure is based on the <I>GridBag</I> geometry manager
written by D. Stein. The first table-based geometry manager for Tk
was <B>blt_table</B>, written by George Howlett; many of the features
of <B>grid</B> are similar to features in <B>blt_table</B>.
<H3><A NAME="M36">SEE ALSO</A></H3>
<B><A HREF="./pack.n.html">pack</A></B>, <B><A HREF="./place.n.html">place</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+88
View File
@@ -0,0 +1,88 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - image manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> image</H2>
<I>Create and manipulate images</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>image</B> <I>option </I>?<I>arg arg ...</I>?)<BR>
<H3><A NAME="M3">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>
<DT><A NAME="M4">(<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="./bitmap.n.html">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.
<P>
<DT><A NAME="M5">(<B>image 'delete </B><I>name</I> ?<I>name name</I> ...?)</A><DD>
Deletes each of the named images and returns an empty list.
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="M6">(<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="M7">(<B>image 'names</B>)</A><DD>
Returns a list containing the names of all existing images.
<P>
<DT><A NAME="M8">(<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="M9">(<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="M10">(<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="M11">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>
<DT><A NAME="M12"><B>bitmap</B></A><DD>
Each pixel in the image displays a foreground color, a background
color, or nothing.
See the <B><A HREF="./bitmap.n.html">bitmap</A></B> manual entry for more information.
<P>
<DT><A NAME="M13"><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="./photo.n.html">photo</A></B> manual entry for more information.
<P>
<DT><A NAME="M14"><B>pixmap</B></A><DD>
Displays a color images in X11 pixmap format. See the <B>pixmap</B> manual entry
for more information.
<P>
</DL>
<H3><A NAME="M15">SEE ALSO</A></H3>
<B><A HREF="./bitmap.n.html">bitmap</A></B>, <B><A HREF="./photo.n.html">photo</A></B>, <B>pixmap</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+110
View File
@@ -0,0 +1,110 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - label manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> label</H2>
<I>Create and manipulate label widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>label</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:anchor">:anchor</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:bitmap">:bitmap</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:font">:font</A></B>
<B><A HREF="options.n.html#M:foreground">:foreground</A></B> <B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B>
<B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B> <B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B>
<B><A HREF="options.n.html#M:image">:image</A></B> <B><A HREF="options.n.html#M:justify">:justify</A></B>
<B><A HREF="options.n.html#M:padx">:padx</A></B> <B><A HREF="options.n.html#M:pady">:pady</A></B>
<B><A HREF="options.n.html#M:relief">:relief</A></B> <B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
<B><A HREF="options.n.html#M:text">:text</A></B> <B><A HREF="options.n.html#M:textvariable">:textvariable</A></B>
<B><A HREF="options.n.html#M:underline">:underline</A></B> <B><A HREF="options.n.html#M:wraplength">:wraplength</A></B>
</PRE>
<H3><A NAME="M24">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M25">:height</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M26">:width</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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.
<P>
</DL>
<H3><A NAME="M27">DESCRIPTION</A></H3>
The <B>label</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a label widget.
Additional
options, described above, may be specified on the procedure 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> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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 procedures described below.
<H3><A NAME="M28">WIDGET PROCEDURE</A></H3>
The <B>label</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for label widgets:
<P>
<DL>
<DT><A NAME="M29">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M30">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>label</B>
procedure.
<P>
</DL>
<H3><A NAME="M31">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="M32">SEE ALSO</A></H3>
<B><A HREF="./message.n.html">message</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+505
View File
@@ -0,0 +1,505 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - listbox manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> listbox</H2>
<I>Create and manipulate listbox widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>listbox</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:background">:background</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:exportselection">:exportselection</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:height">:height</A></B> <B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B>
<B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B> <B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B>
<B><A HREF="options.n.html#M:relief">:relief</A></B> <B><A HREF="options.n.html#M:selectbackground">:selectbackground</A></B>
<B><A HREF="options.n.html#M:selectborderwidth">:selectborderwidth</A></B> <B><A HREF="options.n.html#M:selectforeground">:selectforeground</A></B>
<B><A HREF="options.n.html#M:setgrid">:setgrid</A></B> <B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
<B><A HREF="options.n.html#M:width">:width</A></B> <B><A HREF="options.n.html#M:xscrollcommand">:xscrollcommand</A></B>
<B><A HREF="options.n.html#M:yscrollcommand">:yscrollcommand</A></B>
</PRE>
<H3><A NAME="M23">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M24">:height</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>selectMode</B>
<DT><I>Class</I>: <B>SelectMode</B>
<DT><I>Option keyword</I>: <B><A NAME="M25">:selectmode</A></B>
<DT><I>STklos slot name</I>: <B>select-mode</B>
<DD>Speifies 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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M26">:width</A></B>
<DT><I>STklos slot name</I>: <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.
<P>
</DL>
<H3><A NAME="M27">DESCRIPTION</A></H3>
The <B>listbox</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a listbox widget.
Additional
options, described above, may be specified on the procedure line
or in the option database
to configure aspects of the listbox such as its colors, font,
text, and relief. The <B>listbox</B> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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 procedures 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>STRING</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; procedures described below
may be used to change the view in the window. Listboxes allow
scrolling in both directions using the standard <B>xScrollProcedure</B>
and <B>yScrollProcedure</B> options.
They also support scanning, as described below.
<H3><A NAME="M28">INDICES</A></H3>
Many of the widget procedures 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>
<DT><A NAME="M29"><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="M30"><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 procedure.
<P>
<DT><A NAME="M31"><B>anchor</B></A><DD>
Indicates the anchor point for the selection, which is set with the
``<I>selection anchor</I>'' widget procedure.
<P>
<DT><A NAME="M32"><B>end</B></A><DD>
Indicates the end of the listbox.
For some procedures this means just after the last element;
for other procedures it means the last element.
<P>
<DT><A NAME="M33"><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 procedure 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="M34">WIDGET PROCEDURE</A></H3>
The <B>listbox</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for listbox widgets:
<P>
<DL>
<DT><A NAME="M35">(<I>widget-name '</I><B>activate</B> <I>index</I>)</A><DD>
Sets the active element to the one indicated by <I>index</I>.
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="M36">(<I>widget-name '</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 then the result is an empty list; 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="M37">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M38">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty list.
<I>Option</I> may have any of the values accepted by the <B>listbox</B>
procedure.
<P>
<DT><A NAME="M39">(<I>widget-name '</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 <B>#f</B>
is returned.
<P>
<DT><A NAME="M40">(<I>widget-name '</I><B>delete </B><I>first</I>)</A><DD>
<DT><A NAME="M41">(<I>widget-name '</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="M42">(<I>widget-name '</I><B>get </B><I>first</I>)</A><DD>
<DT><A NAME="M43">(<I>widget-name '</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>.
If <I>last</I> is specified, the procedure 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="M44">(<I>widget-name '</I><B>index </B><I>index</I>)</A><DD>
Returns a decimal string giving the integer index value that
corresponds to <I>index</I>.
<P>
<DT><A NAME="M45">(<I>widget-name '</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 list.
<P>
<DT><A NAME="M46">(<I>widget-name '</I><B>nearest </B><I>y</I>)</A><DD>
Given a y-coordinate within the listbox window, this procedure returns
the index of the (visible) listbox element nearest to that y-coordinate.
<P>
<DT><A NAME="M47">(<I>widget-name '</I><B>scan</B> <I>option args</I>)</A><DD>
This procedure is used to implement scanning on listboxes. It has
two forms, depending on <I>option</I>:
<P>
<P>
<DL>
<DT><A NAME="M48">(<I>widget-name '</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> procedures.
Typically this procedure is associated with a mouse button press in
the widget. It returns an empty list.
<P>
<DT><A NAME="M49">(<I>widget-name '</I><B>scan 'dragto </B><I>x y</I>)</A><DD>
This procedure 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> procedure for the widget.
It then adjusts the view by 10 times the
difference in coordinates. This procedure 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 list.
<P>
</DL>
<DT><A NAME="M50">(<I>widget-name '</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 procedure 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="M51">(<I>widget-name '</I><B>selection </B><I>option arg</I>)</A><DD>
This procedure is used to adjust the selection within a listbox. It
has several forms, depending on <I>option</I>:
<P>
<P>
<DL>
<DT><A NAME="M52">(<I>widget-name </I><B>'selection 'anchor </B><I>index</I>)</A><DD>
Sets the selection anchor to the element given by <I>index</I>.
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="M53">(<I>widget-name </I><B>'selection 'clear </B><I>first</I>)</A><DD>
<DT><A NAME="M54">(<I>widget-name </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="M55">(<I>widget-name </I><B>'selection 'includes </B><I>index</I>)</A><DD>
Returns #t if the element indicated by <I>index</I> is currently
selected, #f if it isn't.
<P>
<DT><A NAME="M56">(<I>widget-name </I><B>'selection 'set </B><I>first</I>)</A><DD>
<DT><A NAME="M57">(<I>widget-name </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>
<DT><A NAME="M58">(<I>widget-name '</I><B>size</B>)</A><DD>
Returns a decimal string indicating the total number of elements
in the listbox.
<P>
<DT><A NAME="M59">(<I>widget-name '</I><B>xview </B><I>args</I>)</A><DD>
This procedure 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>
<P>
<DL>
<DT><A NAME="M60">(<I>widget-name '</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>:xscrollprocedure</B>
option.
<P>
<DT><A NAME="M61">(<I>widget-name '</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="M62">(<I>widget-name </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="M63">(<I>widget-name </I><B>'xview 'scroll </B><I>number what</I>)</A><DD>
This procedure 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>
<DT><A NAME="M64">(<I>widget-name '</I><B>yview </B><I>?args</I>?)</A><DD>
This procedure 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>
<P>
<DL>
<DT><A NAME="M65">(<I>widget-name '</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>:yscrollprocedure</B>
option.
<P>
<DT><A NAME="M66">(<I>widget-name '</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="M67">(<I>widget-name </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="M68">(<I>widget-name </I><B>'yview 'scroll </B><I>number what</I>)</A><DD>
This procedure 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>
</DL>
<H3><A NAME="M69">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>
In addition to the above behavior, the following additional behavior
is defined by the default bindings:
<OL>
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
The Prior and Next keys scroll the listbox view up and down
by one page (the height of the window).
<LI>
The Home and End keys scroll the listbox horizontally to
the left and right edges, respectively.
<LI>
Control-Home sets the location cursor to the the first element in
the listbox, selects that element, and deselects everything else
in the listbox.
<LI>
Control-End sets the location cursor to the the last element in
the listbox, selects that element, and deselects everything else
in the listbox.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
Control-backslash deselects everything in the widget, except in
<B>browse</B> mode where it has no effect.
<LI>
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.
</OL>
<P>
The behavior of listboxes can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
<H3><A NAME="M70">EXAMPLE</A></H3>
Herafter is an example of a listbox connected to a scrollbar
<PRE>;; Create list box and scrollbar
(listbox '.l :height 5
:yscroll (lambda l (apply .s 'set l)))
(scrollbar '.s :command (lambda l (apply .l 'yview l)))
;; Set some elements in the listbox
(.l 'insert 0 'one 'two 'three 'four 'five 'six 'seven 'eight)
;; Pack elements
(pack .l :side &quot;left&quot; :expand #t :fill &quot;both&quot;)
(pack .s :side &quot;right&quot; :expand #f :fill &quot;y&quot;)</PRE>
<H3><A NAME="M71">SEE ALSO</A></H3>
<B><A HREF="./scrollbar.n.html">scrollbar</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+83
View File
@@ -0,0 +1,83 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - listener manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> listener</H2>
<I>Create and manipulate listener widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>listener</B><I> widget-name </I>?<I>options</I>?)<BR>
<BR>
<H3><A NAME="M3">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B></B>
<DT><I>Class</I>: <B></B>
<DT><I>Option keyword</I>: <B><A NAME="M4">:command</A></B>
<DT><I>STklos slot name</I>: <B>command</B>
<DD>Specifies a STk procedure to associate with the listener. This procedure
is invoked when a complete s-expr is entered in the listener. This s-expr is
passed as a string to the procedure. The procedure must return the string
which will be inserted in response to the s-expr input. The default procedure
is the Identity procdure.
<P>
<P>
<DT><I>Name</I>: <B></B>
<DT><I>Class</I>: <B></B>
<DT><I>Option keyword</I>: <B><A NAME="M5">:output-color</A></B>
<DT><I>STklos slot name</I>: <B>output-color</B>
<DD>Specifies the color used the output lines
<P>
<P>
<DT><I>Name</I>: <B></B>
<DT><I>Class</I>: <B></B>
<DT><I>Option keyword</I>: <B><A NAME="M6">:prompt-color</A></B>
<DT><I>STklos slot name</I>: <B>prompt-color</B>
<DD>Specifies the color used for the prompt
<P>
<P>
<DT><I>Name</I>: <B></B>
<DT><I>Class</I>: <B></B>
<DT><I>Option keyword</I>: <B><A NAME="M7">:prompt</A></B>
<DT><I>STklos slot name</I>: <B>prompt</B>
<DD>Specifies the prompt used for reading s-expr. Defaults to &quot;&gt; &quot;
<P>
</DL>
<H3><A NAME="M8">DESCRIPTION</A></H3>
The <B>listener</B> procedure creates a new text window (given by the
<I>widget-name</I> argument) and associates it bindiangs suitable for a listener.
Since a listener is in fact a text widget, all the options of <B><A HREF="./text.n.html">text</A></B>
are applicable to a listener.
The <B>listener</B> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</I>'s parent must exist.
<P>
A listener is a widget for doing interactive I/O. Typical usage for
this widget consists of a text window whose inputs are sent to the
Scheme evaluator and whose result is displayed in the listener. An
example for this is shown at the end of this page.
<H3><A NAME="M9">WIDGET PROCEDURE</A></H3>
All the <B><A HREF="./text.n.html">text</A></B> procedure are avialble for a listener, plus
<P>
<DL>
<DT><A NAME="M10">(<B>listener-insert-string</B> <I>widget-name str</I>)</A><DD>
inserts the string <I>str</I> just before the input prompt.
<P>
</DL>
<H3><A NAME="M11">EXAMPLE</A></H3>
Hereafter is a simple use of the listener widget which interact with the
evaluator.
<P>
<PRE>(listener '.t :width 50
:height 10
:command (lambda (x)
(eval-string x (global-environment))))
(pack .t)</PRE>
<H3><A NAME="M12">DEFAULT BINDINGS</A></H3>
The defaults bindings are identical to the <B><A HREF="./text.n.html">text</A></B> bindings.
<H3><A NAME="M13">SEE ALSO</A></H3>
<B><A HREF="./text.n.html">text</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+25
View File
@@ -0,0 +1,25 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - lower manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> lower</H2>
<I>Change a window's position in the stacking order</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>lower </B><I>window</I>)<BR>
(<B>lower </B><I>window </I><I>belowThis</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
If the <I>belowThis</I> argument is omitted then the procedure 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> procedure 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="M4">SEE ALSO</A></H3>
<B><A HREF="./raise.n.html">raise</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+81
View File
@@ -0,0 +1,81 @@
<HTML><HEAD><TITLE>STk procedure - STk:make-dialog manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> STk:make-dialog</H2>
<I>Create modal dialog and wait for response</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>STk:make-dialog</B> <I>arguments ...</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure is part of the STk library. Its arguments describe a dialog box.
They can be set using the following keywords.
<P>
<DL>
<DT><A NAME="M4"><B>:window</B></A><DD>
Name of top-level window to use for dialog. The default value for
this parameter is <I>.dialog</I>. If a window with this name
already exists, it is destroyed.
<P>
<DT><A NAME="M5"><B>:title</B></A><DD>
Text to appear in the window manager's title bar for the dialog. Default to
<B>&quot;Dialog&quot;</B>.
<P>
<DT><A NAME="M6"><B>:text</B></A><DD>
Message to appear in the top portion of the dialog box. Default to the empty string.
<P>
<DT><A NAME="M7"><B>:bitmap</B></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 (or if not specified) then no bitmap is displayed
in the dialog.
<P>
<DT><A NAME="M8"><B>:default</B></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 then there won't be any default button.
By default, there is no default button.
<P>
<DT><A NAME="M9"><B>:buttons</B></A><DD>
the given argument must be a list of couples indicating for each the button text and
its associated action (a closure). The sepcified buttons are displayed
in order from left to right.
<P>
<DT><A NAME="M10"><B>:grab</B></A><DD>
is a boolean value indicating if the <B>STk:make-dialog</B> must wait that a
button be pressed before returning. Use the symbol <B>global</B> to have
a global grab. If grabbing is set, <B>STk:make-dialog</B> returns the button
pressed index (or -1 if the window is detroyed before a button is pressed).
By default, the grab is unset.
<P>
</DL>
<P>
Hereafter are simple uses of the <B>STk:make-dialog</B> procedure
<P>
<I>;; A simple dialog; returns after displaying the window</I>
<PRE>(STk:make-dialog :text &quot;Do you want to exit?&quot;
:bitmap &quot;question&quot;
:buttons (list (list &quot;Yes&quot; (lambda ()
(display &quot;Yes\n&quot;)))
(list &quot;No&quot; (lambda ()
(display &quot;No\n&quot;)))))</PRE>
<P>
<I>;; Another one which wait that the user chooses a response</I>
<BR>
<I>;; Default is &quot;bar&quot;</I>
<BR>
<I>;; Return value will be 0 1 or 2</I>
<BR>
<I>;; The @ in a bitmap allows to specify a file</I>
<PRE>(STk:make-dialog :text &quot;Choose one&quot;
:bitmap &quot;@/usr/include/X11/bitmaps/terminal&quot;
:default 1
:grab #t
:buttons (list (list &quot;foo&quot; (lambda ()
(display &quot;foo\n&quot;)))
(list &quot;bar&quot; (lambda ()
(display &quot;bar\n&quot;)))
(list &quot;baz&quot; (lambda ()
(display &quot;baz\n&quot;)))))</PRE>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+637
View File
@@ -0,0 +1,637 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - menu manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> menu</H2>
<I>Create and manipulate menu widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>menu</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:activeborderwidth">:activeborderwidth</A></B>
<B><A HREF="options.n.html#M:activeforeground">:activeforeground</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:disabledforeground">:disabledforeground</A></B> <B><A HREF="options.n.html#M:font">:font</A></B>
<B><A HREF="options.n.html#M:foreground">:foreground</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
</PRE>
<H3><A NAME="M15">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>postCommand</B>
<DT><I>Class</I>: <B>Command</B>
<DT><I>Option keyword</I>: <B><A NAME="M16">:postcommand</A></B>
<DT><I>STklos slot name</I>: <B>post-command</B>
<DD>If this option is specified then it provides a STk procedure to execute
each time the menu is posted. The procedure is invoked by the <B>post</B>
widget procedure before posting the menu.
<P>
<P>
<DT><I>Name</I>: <B>selectColor</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M17">:selectcolor</A></B>
<DT><I>STklos slot name</I>: <B>select-color</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>
<P>
<DT><I>Name</I>: <B>tearOff</B>
<DT><I>Class</I>: <B>TearOff</B>
<DT><I>Option keyword</I>: <B><A NAME="M18">:tearoff</A></B>
<DT><I>STklos slot name</I>: <B>tear-off</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>
<P>
<DT><I>Name</I>: <B>tearOffCommand</B>
<DT><I>Class</I>: <B>TearOffCommand</B>
<DT><I>Option keyword</I>: <B><A NAME="M19">:tearoffcommand</A></B>
<DT><I>STklos slot name</I>: <B>tear-off-command</B>
<DD>If this option has a non-empty value, then it specifies a STk procedure
to invoke whenever the menu is torn off. The actual procedure will
be called with two parameters: the name of the menu window and
the name of the name of the torn off menu window.
<P>
<P>
<DT><I>Name</I>: <B>transient</B>
<DT><I>Class</I>: <B>Transient</B>
<DT><I>Option keyword</I>: <B><A NAME="M20">:transient</A></B>
<DT><I>STklos slot name</I>: <B>transcient</B>
<DD>This option must have a boolean value. True means that the menu
is used on a transient basis, e.g. as a pop-up, pull-down, or
cascaded menu. False means that the menu will be displayed
on the screen continuously, for example as a torn-off menu.
If the option is true, no window manager border
will be displayed around the menu and redisplay will be optimized
using X's ``save under'' facility.
<P>
</DL>
<H3><A NAME="M21">INTRODUCTION</A></H3>
The <B>menu</B> procedure creates a new top-level window (given
by the <I>widget-name</I> argument) and makes it into a menu widget.
Additional
options, described above, may be specified on the procedure line
or in the option database
to configure aspects of the menu such as its colors and font.
The <B>menu</B> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</I>'s parent must exist.
<P>
A menu is a widget that displays a collection of one-line entries arranged
in a column. 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.
<H3><A NAME="M22">PROCEDURE ENTRIES</A></H3>
The most common kind of menu entry is a procedure entry, which
behaves much like a button widget. When a procedure entry is
invoked, a STk procedure is executed. The STk
procedure is specified with the <B>:command</B> option.
<H3><A NAME="M23">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="M24">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 STk procedure each time the entry
is invoked; this happens after toggling the entry's
selected state.
<H3><A NAME="M25">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 STk procedure each time the entry
is invoked; this happens after selecting the entry.
<H3><A NAME="M26">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 procedure can be used to post and unpost
the associated menu just to the right 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
STk procedure 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.
The lower-level menu is unposted by executing a STk procedure with
the form
<PRE>(<I>menu</I><B> 'unpost</B>)</PRE>
where <I>menu</I> is the name of the associated menu.
<P>
If a <B>:command</B> option is specified for a cascade entry then it is
evaluated as a STk procedure
whenever the entry is invoked.
<H3><A NAME="M27">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 procedure and
cannot be deleted with the <B>delete</B> widget procedure.
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="M28">WIDGET PROCEDURE</A></H3>
The <B>menu</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure.
<P>
Many of the widget procedures 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>
<DT><A NAME="M29"><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="M30"><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="M31"><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="M32"><B>last</B></A><DD>
Same as <B>end</B>.
<P>
<DT><A NAME="M33"><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 procedure.
This form may not be abbreviated.
<P>
<DT><A NAME="M34"><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="M35"><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>Tcl_StringMatch</B>
are used.
<P>
</DL>
<P>
The following widget procedures are possible for menu widgets:
<P>
<DL>
<DT><A NAME="M36">(<I>widget-name '</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="M37">(<I>widget-name </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>
<P>
<DL>
<DT><A NAME="M38"><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-strict-Motif*</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="M39"><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="M40"><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="M41"><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="M42"><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>Tk_GetBitmap</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="M43"><B>:command </B><I>value</I></A><DD>
Specifies a STk procedure to execute when the menu entry is invoked.
Not available for separator or tear-off entries.
<P>
<DT><A NAME="M44"><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>font</B> option for the overall menu is used.
This option is not available for separator or tear-off entries.
<P>
<DT><A NAME="M45"><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="M46"><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=.././image.n.html>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="M47"><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="M48"><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="M49"><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="M50"><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="M51"><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="M52"><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="M53"><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=.././image.n.html>image create</A></B>.
This option is ignored unless the <B>:image</B> option has
been specified.
<P>
<DT><A NAME="M54"><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="M55"><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="M56"><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.
<P>
<DT><A NAME="M57"><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.
<P>
</DL>
<UL>
<P>
The <B>add</B> widget procedure returns an empty list.
</UL>
<DT><A NAME="M58">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M59">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>menu</B>
procedure.
<P>
<DT><A NAME="M60">(<I>widget-name '</I><B>delete </B><I>index1</I>)</A><DD>
<DT><A NAME="M61">(<I>widget-name '</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="M62">(<I>widget-name '</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 procedure.
<P>
<DT><A NAME="M63">(<I>widget-name '</I><B>entryconfigure </B><I>index </I>?<I>options</I>?)</A><DD>
This procedure is similar to the <B>configure</B> procedure, 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 procedure. If <I>options</I> are specified, options are modified
as indicated
in the procedure and the procedure 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>Tk_ConfigureInfo</B> for
information on the format of this list).
<P>
<DT><A NAME="M64">(<I>widget-name '</I><B>index </B><I>index</I>)</A><DD>
Returns the numerical index corresponding to <I>index</I>, or
<B>&quot;none&quot;</B> if <I>index</I> was specified as <B>none</B>.
<P>
<DT><A NAME="M65">(<I>widget-name </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 procedure 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
procedure. It is not possible to insert new menu entries before the
tear-off entry, if the menu has one.
<P>
<DT><A NAME="M66">(<I>widget-name '</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 procedure associated with it then the result of that
procedure is returned as the result of the <B>invoke</B> widget
procedure. Otherwise the result is an empty list. 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 procedure.
<P>
<DT><A NAME="M67">(<I>widget-name '</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 procedure normally returns an empty string.
If the <B>postCommand</B> option has been specified, then it is called
before posting the menu.
If an error returns while executing the procedure, then the error is
returned without posting the menu.
<P>
<DT><A NAME="M68">(<I>widget-name '</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>widget-name</I> isn't posted,
the procedure has no effect except to unpost any currently posted
submenu.
<P>
<DT><A NAME="M69">(<I>widget-name '</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
procedure when the entry was created, such as <B>&quot;command&quot;</B>
or <B>&quot;separator&quot;</B>, or <B>&quot;tearoff&quot;</B> for a tear-off entry.
<P>
<DT><A NAME="M70">(<I>widget-name '</I><B>unpost</B>)</A><DD>
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.
<P>
<DT><A NAME="M71">(<I>widget-name '</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="M72">MENU CONFIGURATIONS</A></H3>
The default bindings support four different ways of using menus:
<P>
<DL>
<DT><A NAME="M73"><B>Pulldown Menus</B></A><DD>
This is the most common case. 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="./menubutton.n.html">menubutton</A></B> manual entry for details.
<P>
<DT><A NAME="M74"><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>Tk:popup</B> (see <B><A HREF="./popup.n.html">popup</A></B>) procedure
at the appropriate time
to post the top-level menu.
<P>
<DT><A NAME="M75"><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:option-menu</B> (see <B><A HREF="./option-menu.n.html">option-menu</A></B>)
procedure to create option
menubuttons and their menus.
<P>
<DT><A NAME="M76"><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="M77">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for menus that give them
the following default behavior:
<OL>
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
The Space and Return keys invoke the active entry and
unpost the menu.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
</OL>
<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="M78">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="M79">SEE ALSO</A></H3>
<B>popup option-menu menubutton</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+211
View File
@@ -0,0 +1,211 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - menubutton manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> menubutton</H2>
<I>Create and manipulate menubutton widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>menubutton</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:activeforeground">:activeforeground</A></B>
<B><A HREF="options.n.html#M:anchor">:anchor</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:bitmap">:bitmap</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:disabledforeground">:disabledforeground</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:image">:image</A></B>
<B><A HREF="options.n.html#M:justify">:justify</A></B> <B><A HREF="options.n.html#M:padx">:padx</A></B>
<B><A HREF="options.n.html#M:pady">:pady</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B> <B><A HREF="options.n.html#M:text">:text</A></B>
<B><A HREF="options.n.html#M:textvariable">:textvariable</A></B> <B><A HREF="options.n.html#M:underline">:underline</A></B>
<B><A HREF="options.n.html#M:wraplength">:wraplength</A></B>
</PRE>
<H3><A NAME="M27">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M28">:height</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>indicatorOn</B>
<DT><I>Class</I>: <B>IndicatorOn</B>
<DT><I>Option keyword</I>: <B><A NAME="M29">:indicatoron</A></B>
<DT><I>STklos slot name</I>: <B>indicator-on</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>
<P>
<DT><I>Name</I>: <B><A HREF="./menu.n.html">menu</A></B>
<DT><I>Class</I>: <B>MenuName</B>
<DT><I>Option keyword</I>: <B><A NAME="M30">:menu</A></B>
<DT><I>STklos slot name</I>: <B>menu-name</B>
<DD>Specifies the path name of the menu associated with this menubutton.
The menu must be a child of the menubutton.
<P>
<P>
<DT><I>Name</I>: <B>state</B>
<DT><I>Class</I>: <B>State</B>
<DT><I>Option keyword</I>: <B><A NAME="M31">:state</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M32">:width</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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.
<P>
</DL>
<H3><A NAME="M33">INTRODUCTION</A></H3>
The <B>menubutton</B> command creates a new window (given by the
<I>widget-name</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>widget-name</I> argument. At the time this command is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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="./menu.n.html">menu</A></B> manual entry for information on various menu configurations,
such as pulldown menus and option menus.
<H3><A NAME="M34">WIDGET COMMAND</A></H3>
The <B>menubutton</B> command creates a new STk command whose
name is <I>widget-name</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name 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>
<DT><A NAME="M35">(<I>widget-name '</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="M36">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</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="M37">DEFAULT BINDINGS</A></H3>
Tk automatically creates class bindings for menubuttons that give them
the following default behavior:
<OL>
<LI>
A menubutton activates whenever the mouse passes over it and deactivates
whenever the mouse leaves it.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
If button 1 is pressed over a menubutton and released outside
any menubutton or menu, the menubutton unposts without invoking
any menu entry.
<LI>
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="./menu.n.html">menu</A></B> manual entry for details on these bindings.
<LI>
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.
<LI>
The F10 key may be typed in any window to post the first menubutton
under its toplevel window that isn't disabled.
<LI>
If a menubutton has the input focus, the space and return keys
post the menubutton.
</OL>
<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="M38">SEE ALSO</A></H3>
<B>menu option-menu</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+156
View File
@@ -0,0 +1,156 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - message manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> message</H2>
<I>Create and manipulate message widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>message</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:anchor">:anchor</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:padx">:padx</A></B>
<B><A HREF="options.n.html#M:pady">:pady</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B> <B><A HREF="options.n.html#M:text">:text</A></B>
<B><A HREF="options.n.html#M:textvariable">:textvariable</A></B> <B><A HREF="options.n.html#M:width">:width</A></B>
</PRE>
<H3><A NAME="M20">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>aspect</B>
<DT><I>Class</I>: <B>Aspect</B>
<DT><I>Option keyword</I>: <B><A NAME="M21">:aspect</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>justify</B>
<DT><I>Class</I>: <B>Justify</B>
<DT><I>Option keyword</I>: <B><A NAME="M22">:justify</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M23">:width</A></B>
<DT><I>STklos slot name</I>: <B>width</B>
<DD>Specifies the length of lines in the window.
The value may have any of the forms acceptable to <B>Tk_GetPixels</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.
<P>
</DL>
<H3><A NAME="M24">DESCRIPTION</A></H3>
The <B>message</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a message widget.
Additional
options, described above, may be specified on the procedure 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> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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="M25">WIDGET PROCEDURE</A></H3>
The <B>message</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for message widgets:
<P>
<DL>
<DT><A NAME="M26">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M27">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>message</B>
procedure.
<P>
</DL>
<H3><A NAME="M28">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="M29">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="M30">KEYWORDS</A></H3>
message, widget
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+32
View File
@@ -0,0 +1,32 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - option-menu manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> option-menu</H2>
<I>Create an option menubutton and its menu</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>Tk:option-menu </B><I>w varname value </I>?<I>value value ...</I>?)<BR>
<H3><A NAME="M3">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:option-menu</B> is 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="M4">EXAMPLE</A></H3>
<PRE>(Tk:option-menu '.m 'foo &quot;One&quot; &quot;Two&quot; &quot;Three&quot;)
(pack .m)</PRE>
<H3><A NAME="M5">SEE ALSO</A></H3>
<B><A HREF="./menu.n.html">menu</A></B>, <B><A HREF="./popup.n.html">popup</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+80
View File
@@ -0,0 +1,80 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - option manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> option</H2>
<I>Add/retrieve window options to/from the option database</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>option 'add </B><I>pattern value</I>)<BR>
(<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>
(<B>option 'readfile </B><I>fileName </I><I>priority</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>option</B> procedure allows you to add entries to the Tk option
database or to retrieve options from the database. The <B>add</B>
form of the procedure 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>Tk_GetOption</B> or by
invocations of the <B>option get</B> procedure. 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 procedure always returns an empty list.
<P>
The <B>option clear</B> procedure 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 procedure
always returns an empty string.
<P>
The <B>option get</B> procedure 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 procedure 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 procedure 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> procedure are
normally specified symbolically using one of the following values:
<P>
<DL>
<DT><A NAME="M4"><B>widgetDefault</B></A><DD>
Level 20. Used for default values hard-coded into widgets.
<P>
<DT><A NAME="M5"><B>startupFile</B></A><DD>
Level 40. Used for options specified in application-specific
startup files.
<P>
<DT><A NAME="M6"><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="M7"><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.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+534
View File
@@ -0,0 +1,534 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - options manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> options</H2>
<I>Standard options supported by widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">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 &quot;black&quot;</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.
``Name'' refers to the option's name in the option database (e.g.
in .Xdefaults files). ``Class'' refers to the option's class value
in the option database. For each option, the <B>STklos</B> name is also
specified. The <B>STklos</B> name is usually the same as the option
name, except when it is a composite word, in which case words
are separated with a dash.
<DL>
<P>
<DT><I>Name</I>: <B>activeBackground</B>
<DT><I>Class</I>: <B>Foreground</B>
<DT><I>Option keyword</I>: <B><A NAME="M:activebackground">:activebackground</A></B>
<DT><I>STklos slot name</I>: <B>active-background</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-strict-motif*</B> variable, this option will normally be
ignored; the normal background color will be used instead.
<P>
<P>
<DT><I>Name</I>: <B>activeBorderWidth</B>
<DT><I>Class</I>: <B>BorderWidth</B>
<DT><I>Option keyword</I>: <B><A NAME="M:activeborderwidth">:activeborderwidth</A></B>
<DT><I>STklos slot name</I>: <B>active-border-width</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>Tk_GetPixels</B>.
This option is typically only available in widgets displaying more
than one element at a time (e.g. menus but not buttons).
<P>
<P>
<DT><I>Name</I>: <B>activeForeground</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M:activeforeground">:activeforeground</A></B>
<DT><I>STklos slot name</I>: <B>active-foreground</B>
<DD>Specifies foreground color to use when drawing active elements.
See above for definition of active elements.
<P>
<P>
<DT><I>Name</I>: <B>anchor</B>
<DT><I>Class</I>: <B>Anchor</B>
<DT><I>Option keyword</I>: <B><A NAME="M:anchor">:anchor</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>background</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M:background">:background</A></B>
<DT><I>STklos slot name</I>: <B>background</B>
<DD>Specifies the normal background color to use when displaying the
widget. This option can also be specified as <B>:bg</B>.
<P>
<P>
<DT><I>Name</I>: <B>bitmap</B>
<DT><I>Class</I>: <B>Bitmap</B>
<DT><I>Option keyword</I>: <B><A NAME="M:bitmap">:bitmap</A></B>
<DT><I>STklos slot name</I>: <B>bitmap</B>
<DD>Specifies a bitmap to display in the widget, in any of the forms
acceptable to <B>Tk_GetBitmap</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>
<P>
<DT><I>Name</I>: <B>borderWidth</B>
<DT><I>Class</I>: <B>BorderWidth</B>
<DT><I>Option keyword</I>: <B><A NAME="M:borderwidth">:borderwidth</A></B>
<DT><I>STklos slot name</I>: <B>:border-width</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>Tk_GetPixels</B>.
This option can also be specified as <B>:bd</B>.
<P>
<P>
<DT><I>Name</I>: <B>cursor</B>
<DT><I>Class</I>: <B>Cursor</B>
<DT><I>Option keyword</I>: <B><A NAME="M:cursor">:cursor</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetCursor</B>.
<P>
<P>
<DT><I>Name</I>: <B>disabledForeground</B>
<DT><I>Class</I>: <B>DisabledForeground</B>
<DT><I>Option keyword</I>: <B><A NAME="M:disabledforeground">:disabledforeground</A></B>
<DT><I>STklos slot name</I>: <B>disabled-foreground</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>
<P>
<DT><I>Name</I>: <B>exportSelection</B>
<DT><I>Class</I>: <B>ExportSelection</B>
<DT><I>Option keyword</I>: <B><A NAME="M:exportselection">:exportselection</A></B>
<DT><I>STklos slot name</I>: <B>export-selection</B>
<DD>Specifies whether or not a selection in the widget should also be the
X selection. The value must be a boolean value. 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>
<P>
<DT><I>Name</I>: <B>font</B>
<DT><I>Class</I>: <B>Font</B>
<DT><I>Option keyword</I>: <B><A NAME="M:font">:font</A></B>
<DT><I>STklos slot name</I>: <B>font</B>
<DD>Specifies the font to use when drawing text inside the widget.
<P>
<P>
<DT><I>Name</I>: <B>foreground</B>
<DT><I>Class</I>: <B>Foreground</B>
<DT><I>Option keyword</I>: <B><A NAME="M:foreground">:foreground</A></B>
<DT><I>STklos slot name</I>: <B>foreground</B>
<DD>Specifies the normal foreground color to use when displaying the widget.
This option can also be specified as <B>:fg</B>.
<P>
<P>
<DT><I>Name</I>: <B>geometry</B>
<DT><I>Class</I>: <B>Geometry</B>
<DT><I>Option keyword</I>: <B><A NAME="M:geometry">:geometry</A></B>
<DT><I>STklos slot name</I>: <B>geometry</B>
<DD>Specifies the desired geometry for the widget's window, in the
form <I>width</I><B>x</B><I>height</I>, where <I>width</I> is the desired
width of the window and <I>height</I> is the desired height. The
units for <I>width</I> and <I>height</I> depend on the particular
widget. For widgets displaying text the units are usually the
size of the characters in the font being displayed; for other
widgets the units are usually pixels.
<P>
<P>
<DT><I>Name</I>: <B>highlightBackground</B>
<DT><I>Class</I>: <B>HighlightBackground</B>
<DT><I>Option keyword</I>: <B><A NAME="M:highlightbackground">:highlightbackground</A></B>
<DT><I>STklos slot name</I>: <B>highlight-background</B>
<DD>Specifies the color to display in the traversal highlight region when
the widget does not have the input focus.
<P>
<P>
<DT><I>Name</I>: <B>highlightColor</B>
<DT><I>Class</I>: <B>HighlightColor</B>
<DT><I>Option keyword</I>: <B><A NAME="M:highlightcolor">:highlightcolor</A></B>
<DT><I>STklos slot name</I>: <B>highlight-color</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>
<P>
<DT><I>Name</I>: <B>highlightThickness</B>
<DT><I>Class</I>: <B>HighlightThickness</B>
<DT><I>Option keyword</I>: <B><A NAME="M:highlightthickness">:highlightthickness</A></B>
<DT><I>STklos slot name</I>: <B>highlight-thickness</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>Tk_GetPixels</B>.
If the value is zero, no focus highlight is drawn around the widget.
<P>
<P>
<DT><I>Name</I>: <B>image</B>
<DT><I>Class</I>: <B>Image</B>
<DT><I>Option keyword</I>: <B><A NAME="M:image">:image</A></B>
<DT><I>STklos slot name</I>: <B>image</B>
<DD>Specifies an image to display in the widget, which must have been
created with the <B><A HREF=.././image.n.html>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>
<P>
<DT><I>Name</I>: <B>insertBackground</B>
<DT><I>Class</I>: <B>Foreground</B>
<DT><I>Option keyword</I>: <B><A NAME="M:insertbackground">:insertbackground</A></B>
<DT><I>STklos slot name</I>: <B>insert-background</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>
<P>
<DT><I>Name</I>: <B>insertBorderWidth</B>
<DT><I>Class</I>: <B>BorderWidth</B>
<DT><I>Option keyword</I>: <B><A NAME="M:insertborderwidth">:insertborderwidth</A></B>
<DT><I>STklos slot name</I>: <B>insert-border-width</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>Tk_GetPixels</B>.
<P>
<P>
<DT><I>Name</I>: <B>insertOffTime</B>
<DT><I>Class</I>: <B>OffTime</B>
<DT><I>Option keyword</I>: <B><A NAME="M:insertofftime">:insertofftime</A></B>
<DT><I>STklos slot name</I>: <B>insert-off-time</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>
<P>
<DT><I>Name</I>: <B>insertOnTime</B>
<DT><I>Class</I>: <B>OnTime</B>
<DT><I>Option keyword</I>: <B><A NAME="M:insertontime">:insertontime</A></B>
<DT><I>STklos slot name</I>: <B>insert-on-time</B>
<DD>Specifies a non-negative integer value indicating the number of
milliseconds the insertion cursor should remain ``on'' in each blink cycle.
<P>
<P>
<DT><I>Name</I>: <B>insertWidth</B>
<DT><I>Class</I>: <B>InsertWidth</B>
<DT><I>Option keyword</I>: <B><A NAME="M:insertwidth">:insertwidth</A></B>
<DT><I>STklos slot name</I>: <B>insert-width</B>
<DD>Specifies a value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to <B>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>jump</B>
<DT><I>Class</I>: <B>Jump</B>
<DT><I>Option keyword</I>: <B><A NAME="M:jump">:jump</A></B>
<DT><I>STklos slot name</I>: <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>Tcl_GetBoolean</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>
<P>
<DT><I>Name</I>: <B>justify</B>
<DT><I>Class</I>: <B>Justify</B>
<DT><I>Option keyword</I>: <B><A NAME="M:justify">:justify</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>orient</B>
<DT><I>Class</I>: <B>Orient</B>
<DT><I>Option keyword</I>: <B><A NAME="M:orient">:orient</A></B>
<DT><I>STklos slot name</I>: <B>orientation</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>
<P>
<DT><I>Name</I>: <B>padX</B>
<DT><I>Class</I>: <B>Pad</B>
<DT><I>Option keyword</I>: <B><A NAME="M:padx">:padx</A></B>
<DT><I>STklos slot name</I>: <B>padx</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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>padY</B>
<DT><I>Class</I>: <B>Pad</B>
<DT><I>Option keyword</I>: <B><A NAME="M:pady">:pady</A></B>
<DT><I>STklos slot name</I>: <B>pady</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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>relief</B>
<DT><I>Class</I>: <B>Relief</B>
<DT><I>Option keyword</I>: <B><A NAME="M:relief">:relief</A></B>
<DT><I>STklos slot name</I>: <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>,
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>
<P>
<DT><I>Name</I>: <B>repeatDelay</B>
<DT><I>Class</I>: <B>RepeatDelay</B>
<DT><I>Option keyword</I>: <B><A NAME="M:repeatdelay">:repeatdelay</A></B>
<DT><I>STklos slot name</I>: <B>repeat-delay</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>
<P>
<DT><I>Name</I>: <B>repeatInterval</B>
<DT><I>Class</I>: <B>RepeatInterval</B>
<DT><I>Option keyword</I>: <B><A NAME="M:repeatinterval">:repeatinterval</A></B>
<DT><I>STklos slot name</I>: <B>repeat-interval</B>
<DD>Used in conjunction with <B>repeatDelay</B>: once auto-repeat
begins, this option determines the number of milliseconds between
auto-repeats.
<P>
<P>
<DT><I>Name</I>: <B>selectBackground</B>
<DT><I>Class</I>: <B>Foreground</B>
<DT><I>Option keyword</I>: <B><A NAME="M:selectbackground">:selectbackground</A></B>
<DT><I>STklos slot name</I>: <B>select-background</B>
<DD>Specifies the background color to use when displaying selected
items.
<P>
<P>
<DT><I>Name</I>: <B>selectBorderWidth</B>
<DT><I>Class</I>: <B>BorderWidth</B>
<DT><I>Option keyword</I>: <B><A NAME="M:selectborderwidth">:selectborderwidth</A></B>
<DT><I>STklos slot name</I>: <B>select-border-width</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>Tk_GetPixels</B>.
<P>
<P>
<DT><I>Name</I>: <B>selectForeground</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M:selectforeground">:selectforeground</A></B>
<DT><I>STklos slot name</I>: <B>select-foreground</B>
<DD>Specifies the foreground color to use when displaying selected
items.
<P>
<P>
<DT><I>Name</I>: <B>setGrid</B>
<DT><I>Class</I>: <B>SetGrid</B>
<DT><I>Option keyword</I>: <B><A NAME="M:setgrid">:setgrid</A></B>
<DT><I>STklos slot name</I>: <B>set-grid</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="./wm.n.html">wm</A></B> manual
entry for more details.
<P>
<P>
<DT><I>Name</I>: <B>takeFocus</B>
<DT><I>Class</I>: <B>TakeFocus</B>
<DT><I>Option keyword</I>: <B><A NAME="M:takefocus">:takefocus</A></B>
<DT><I>STklos slot name</I>: <B>take-focus</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>#f</B> means that the window should be skipped entirely
during keyboard traversal.
<B>#t</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 string 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.
Value can also be a one parameter procedure. This procedure is called
by the traversal algorithm with the window as parameter. The
value retuned by he procedure must be <B>#f</B>, <B>#t</B>, or an empty string: a
<B>#f</B> or <B>#t</B> value specifies whether the window will receive
the input focus, and an empty string results in the default decision
described above. See the <B>focus-next</B> page for the <B>focus-on</B>
and <B>focus-off</B> procedures.
<B>Note</B>: this interpretation of the option is defined entirely by
the STk 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>
<P>
<DT><I>Name</I>: <B><A HREF="./text.n.html">text</A></B>
<DT><I>Class</I>: <B><A HREF="./text.n.html">Text</A></B>
<DT><I>Option keyword</I>: <B><A NAME="M:text">:text</A></B>
<DT><I>STklos slot name</I>: <B><A HREF="./text.n.html">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>
<P>
<DT><I>Name</I>: <B>textVariable</B>
<DT><I>Class</I>: <B>Variable</B>
<DT><I>Option keyword</I>: <B><A NAME="M:textvariable">:textvariable</A></B>
<DT><I>STklos slot name</I>: <B>text-variable</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>
<P>
<DT><I>Name</I>: <B>troughColor</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M:troughcolor">:troughcolor</A></B>
<DT><I>STklos slot name</I>: <B>trough-color</B>
<DD>Specifies the color to use for the rectangular trough areas
in widgets such as scrollbars and scales.
<P>
<P>
<DT><I>Name</I>: <B>underline</B>
<DT><I>Class</I>: <B>Underline</B>
<DT><I>Option keyword</I>: <B><A NAME="M:underline">:underline</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>wrapLength</B>
<DT><I>Class</I>: <B>WrapLength</B>
<DT><I>Option keyword</I>: <B><A NAME="M:wraplength">:wraplength</A></B>
<DT><I>STklos slot name</I>: <B>wrap-length</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>
<P>
<DT><I>Name</I>: <B>xScrollCommand</B>
<DT><I>Class</I>: <B>ScrollCommand</B>
<DT><I>Option keyword</I>: <B><A NAME="M:xscrollcommand">:xscrollcommand</A></B>
<DT><I>STklos slot name</I>: <B>x-scroll-command</B>
<DD>Specifies the procedure 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 call this procedure with two numbers as parameters.
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.
Typically the
<B>xScrollCommand</B> option consists of a procedure of the form
<P>
</DL>
<PRE>(lambda l (apply .x.scrollbar 'set l))</PRE>
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.
<DL>
<P>
<DT><I>Name</I>: <B>yScrollCommand</B>
<DT><I>Class</I>: <B>ScrollCommand</B>
<DT><I>Option keyword</I>: <B><A NAME="M:yscrollcommand">:yscrollcommand</A></B>
<DT><I>STklos slot name</I>: <B>y-scroll-command</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.
<P>
</DL>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+257
View File
@@ -0,0 +1,257 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - pack manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> pack</H2>
<I>Geometry manager that packs around edges of cavity</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>pack </B><I>option arg </I>?<I>arg ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>pack</B> procedure 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> procedure can have any of several forms, depending
on the <I>option</I> argument:
<P>
<DL>
<DT><A NAME="M4">(<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 procedure is processed in the same
way as <B>pack configure</B>.
<P>
<DT><A NAME="M5">(<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>
<P>
<DL>
<DT><A NAME="M6"><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="M7"><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="M8"><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="M9"><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. Defaults to #f.
<P>
<DT><A NAME="M10"><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>
<P>
<DL>
<DT><A NAME="M11"><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="M12"><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="M13"><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="M14"><B>both</B></A><DD>
Stretch the slave both horizontally and vertically.
<P>
</DL>
<DT><A NAME="M15"><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="M16"><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="M17"><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="M18"><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="M19"><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="M20"><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>.
<P>
</DL>
<UL>
<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.
</UL>
<DT><A NAME="M21">(<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="M22">(<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="M23">(<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 procedure returns <B>#f</B> or
<B>#t</B> to indicate whether propagation is currently enabled
for <I>master</I>.
Propagation is enabled by default.
<P>
<DT><A NAME="M24">(<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="M25">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:
<OL>
<LI>
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)
<LI>
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.
<LI>
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.
</OL>
<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="M26">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="M27">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> procedure 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="M28">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="M29">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="./raise.n.html">raise</A></B> and <B><A HREF="./lower.n.html">lower</A></B> procedures to change
the stacking order of either the master or the slave.
<H3><A NAME="M30">SEE ALSO</A></H3>
<B><A HREF="./grid.n.html">grid</A></B>, <B><A HREF="./place.n.html">place</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+56
View File
@@ -0,0 +1,56 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - Tk:set-palette! manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> Tk:set-palette!, Tk:bisque</H2>
<I>Modify the Tk color palette</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>Tk:set-palette! </B><I>background</I>)<BR>
(<B>Tk:set-palette! </B><I>name value </I>?<I>name value ...</I>?)<BR>
(<B>Tk:bisque</B>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>Tk:set-palette!</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:set-palette!</B> is invoked with a single argument, the
argument is the name of a color to use as the normal background
color; <B>Tk:set-palette!</B> will compute a complete color palette
from this background color.
Alternatively, the arguments to <B>Tk:set-palette!</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:set-palette!</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:set-palette!</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:set-palette!</B>
will not change it. The default for an option is the one provided by
the widget <B>(list-ref (w 'configure option) 3)</B> unless
<B>Tk:set-palette!</B> has been run previously, in which case it is the
value specified in the previous invocation of <B>Tk:set-palette!</B>.
<P>
After modifying all the widgets in the application, <B>Tk:set-palette!</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.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+332
View File
@@ -0,0 +1,332 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - photo manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> photo</H2>
<I>Full-color images</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>image 'create 'photo </B>?<I>name</I>? ?<I>options</I>?)<BR>
<H3><A NAME="M3">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 (24
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="M4">CREATING PHOTOS</A></H3>
Like all images, photos are created using the <B><A HREF=.././image.n.html>image create</A></B>
command.
Photos support the following <I>options</I>:
<P>
<DL>
<DT><A NAME="M5"><B>:data </B><I>string</I></A><DD>
Specifies the contents of the image as a string. 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="M6"><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="M7"><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 from a file.
<P>
<DT><A NAME="M8"><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="M9"><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="M10"><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="M11"><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="M12">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>
<DT><A NAME="M13">(<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="M14">(<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="M15">(<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>Tk_ConfigureInfo</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="M16">(<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>
<P>
<DL>
<DT><A NAME="M17"><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="M18"><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="M19"><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="M20"><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="M21"><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>
<DT><A NAME="M22">(<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="M23">(<I>imageName '</I><B>put </B><I>data</I>)</A><DD>
<DT><A NAME="M24">(option <I>imageName '</I><B>put </B><I>data</I> <B>:to</B><I> x1 y1 x2 y2</I>)</A><DD>
Sets pixels in <I>imageName</I> to the colors specified in <I>data</I>.
<I>data</I> is used to form a two-dimensional array of pixels that are
then copied into the <I>imageName</I>. <I>data</I> is structured as a
list of horizontal rows, from top to bottom, each of which is a list
of colors, listed from left to right. Each color may be specified by name
(e.g., blue) or in hexadecimal form (e.g., #2376af). The
<B>:to</B> option can be used to specify the area of <I>imageName</I> to be
affected. If only <I>x1</I> and <I>y1</I> are given, the area affected
has its top-left corner at (<I>x1,y1</I>) and is the same size as the
array given in <I>data</I>. If all four coordinates are given, they
specify diagonally opposite corners of the affected rectangle, and the
array given in <I>data</I> will be replicated as necessary in the X and
Y directions to fill the rectangle.
<P>
<DT><A NAME="M25">(<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>
<P>
<DL>
<DT><A NAME="M26"><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="M27"><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="M28"><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="M29"><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>
<DT><A NAME="M30">(<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="M31">(<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>
<P>
<DL>
<DT><A NAME="M32"><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="M33"><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>
</DL>
</DL>
<H3><A NAME="M34">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>Tk_CreatePhotoImageFormat</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="M35">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="M36">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="M37">SEE ALSO</A></H3>
<B><A HREF="./bitmap.n.html">bitmap</A></B>, <B><A HREF="./image.n.html">image</A></B>, <B>pixmap</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+222
View File
@@ -0,0 +1,222 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - place manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> place</H2>
<I>Geometry manager for fixed or rubber-sheet placement</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">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="M3">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> procedure is a window path
name or <B>configure</B> then the procedure 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> procedure returns an empty string as result.
The following <I>option:value</I> pairs are supported:
<P>
<DL>
<DT><A NAME="M4"><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="M5"><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>Tk_GetPixels</B>) and need not lie within the bounds
of the master window.
<P>
<DT><A NAME="M6"><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="M7"><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>Tk_GetPixels</B>) and need not lie within the bounds
of the master window.
<P>
<DT><A NAME="M8"><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="M9"><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="M10"><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>Tk_GetPixels</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="M11"><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="M12"><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>Tk_GetPixels</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="M13"><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="M14"><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> procedure 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> procedure causes the placer to stop managing
the geometry of <I>window</I>. As a side effect of this procedure
<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
procedure has no effect.
<B>Place forget</B> returns an empty string as result.
<P>
The <B>place info</B> procedure 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>
procedure.
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="M15">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="M16">SEE ALSO</A></H3>
<B><A HREF="./grid.n.html">grid</A></B>, <B><A HREF="./pack.n.html">pack</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+24
View File
@@ -0,0 +1,24 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - Tk:popup manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> popup</H2>
<I>Post a popup menu</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
<B>(Tk:popup </B><I>menu x y </I>)<BR>
<B>(Tk:popup </B><I>menu x y </I> <I>entry</I>)<BR>
<H3><A NAME="M3">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="M4">SEE ALSO</A></H3>
<B><A HREF="./menu.n.html">menu</A></B>, <B><A HREF="./option-menu.n.html">option-menu</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+168
View File
@@ -0,0 +1,168 @@
<HTML><HEAD><TITLE>STk procedures - posix manual page</TITLE></HEAD>
<BODY bgcolor = #ffffa0>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageYellow.gif"> posix </H2>
<I>Access to posix functions</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
<P>
<DL>
<DT><A NAME="M3"><I>ERROR&nbsp;MANAGEMENT</I></A><DD>
<B>*errno*</B>
<P>
<P>
<P>
(<B>posix-perror</B> <I>str</I>)
<P>
<DT><A NAME="M4"><I>FILES&nbsp;AND&nbsp;DIRECTORIES</I></A><DD>
(<B>posix-stat</B> <I>filename</I>)
<P>
<P>
<P>
(<B>posix-stat-&gt;vector</B> <I>descr</I>)
<P>
<P>
<P>
(<B>posix-access </B><I>filename mode</I>)
<P>
<P>
<P>
(<B>posix-pipe</B>)
<P>
<DT><A NAME="M5"><I>TIME&nbsp;FUNCTIONS</I></A><DD>
(<B>posix-time</B>)
<P>
<P>
<P>
(<B>posix-asctime</B>)
<P>
<P>
<P>
(<B>posix-asctime</B> seconds)
<P>
<P>
<P>
(<B>posix-ctime</B>)
<P>
<P>
<P>
(<B>posix-ctime</B> <I>seconds</I>)
<P>
<P>
<P>
(<B>posix-localtime</B> <I> seconds</I>)
<P>
<P>
<P>
(<B>posix-gmtime</B> <I>seconds</I>)
<P>
<P>
<P>
(<B>posix-mktime</B> <I>time</I>)
<P>
<P>
<P>
(<B>posix-tm-&gt;vector</B> <I>time</I>)
<P>
<P>
<P>
(<B>vector-&gt;posix-tm</B> <I>vect</I>)
<P>
<P>
<P>
(<B>posix-strftime</B> <I>format</I>)
<P>
<P>
<P>
(<B>posix-strftime</B> <I>format time</I>)
<P>
<DT><A NAME="M6"><I>PROCESSES&nbsp;FUNCTIONS</I></A><DD>
<P>
<P>
(<B>posix-fork</B>)
<P>
<P>
<P>
(<B>posix-wait</B>)
<P>
<DT><A NAME="M7"><I>SYSTEM&nbsp;INFORMATIONS</I></A><DD>
<P>
<P>
(<B>posix-uname</B>)
<P>
<P>
<P>
(<B>posix-host</B>)
<P>
<P>
<P>
(<B>posix-domain</B>)
<P>
</DL>
<H3><A NAME="M8">DESCRIPTION</A></H3>
The functions of the posix library must be loaded before use with:
<PRE>(require &quot;posix&quot;)</PRE>
The functions will not be described here completely. For full details
about a functions and its behaviour, look at the corresponding Unix
manual page or to the POSIX.1 document.
<P>
<DL>
<DT><A NAME="M9"><I>ERROR&nbsp;MANAGEMENT</I></A><DD>
</DL>
<P>
<P>
<DL>
<DT><A NAME="M10"><B>*errno*</B></A><DD>
is a variable which always contains the error number of last
encountered error. It is equivalent to the errno POSIX.1 variable.
<P>
<DT><A NAME="M11">(<B>posix-perror</B> <I>str</I>)</A><DD>
produces a message on the standard error output, describing the last
error encountered during a call to a system or library function. The
<I>str</I> parameter is an identifying string which will be printed before
the error message.
See <B>perror(3)</B>.
<P>
<DT><A NAME="M12"><I>FILES&nbsp;AND&nbsp;DIRECTORIES</I></A><DD>
</DL>
<P>
<P>
<DL>
<DT><A NAME="M13">(<B>posix-stat</B> <I>filename</I>)</A><DD>
returns a C structure which contains a description of <I>filename</I>). This
structure is not viewable by itself. Use, <B>posix-stat-&gt;vector</B>
to access its content in Scheme.If <I>filename</I> does not exists, this procedure
returns <I>#f</I>.
<P>
<DT><A NAME="M14">(<B>posix-stat-&gt;vector</B> <I>descr</I>)</A><DD>
transforms a file description sructure obtained by <B>posix-stat</B> to a Scheme
vector. The components of the vector are given here with their index:
<P>
</DL>
<PRE>st_dev (0) st_ino (1)
st_mode (2) st_nlink (3)
st_uid (4) st_gid (5)
st_size (6) st_atime (7)
st_mtime (8) st_ctime (9)</PRE>
<PRE>See <B>fstat(2)</B> for details on the semantic of this fields.</PRE>
<P>
<DL>
<DT><A NAME="M15">(<B>posix-access </B><I>filename mode</I>)</A><DD>
checks whether the interpreter is allowed to read, write, execute or test for
existence of <I>filename</I>. <I>Mode</I> must be one of the following constants:
<B>|R_OK|</B>, <B>|W_OK|</B>, <B>|X_OK|</B> or <B>|F_OK|</B>.
If <I>filename</I> does not exit, this function returns <B>#f</B>.
See <B>access(2)</B> for details.
<P>
<DT><A NAME="M16">(<B>posix-pipe</B>)</A><DD>
returns a pair of Scheme ports associated to a
pipe inode. If a pipe cannot be created, this function returns
<B>#f</B>.
<P>
</DL>
<P>
<B>TO BE CONTINUED</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookYellow.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+270
View File
@@ -0,0 +1,270 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - radiobutton manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> radiobutton</H2>
<I>Create and manipulate radiobutton widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>radiobutton</B><I> widget-name </I>?<I>options</I>?-<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:activeforeground">:activeforeground</A></B>
<B><A HREF="options.n.html#M:anchor">:anchor</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:bitmap">:bitmap</A></B> <B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B>
<B><A HREF="options.n.html#M:cursor">:cursor</A></B> <B><A HREF="options.n.html#M:disabledforeground">:disabledforeground</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:image">:image</A></B>
<B><A HREF="options.n.html#M:justify">:justify</A></B> <B><A HREF="options.n.html#M:padx">:padx</A></B>
<B><A HREF="options.n.html#M:pady">:pady</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B> <B><A HREF="options.n.html#M:text">:text</A></B>
<B><A HREF="options.n.html#M:textvariable">:textvariable</A></B> <B><A HREF="options.n.html#M:underline">:underline</A></B>
<B><A HREF="options.n.html#M:wraplength">:wraplength</A></B>
</PRE>
<H3><A NAME="M27">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>command</B>
<DT><I>Class</I>: <B>Command</B>
<DT><I>Option keyword</I>: <B><A NAME="M28">:command</A></B>
<DT><I>STklos slot name</I>: <B>command</B>
<DD>Specifies a STk procedure to associate with the button. This procedure
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 procedure is invoked.
<P>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M29">:height</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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>
<P>
<DT><I>Name</I>: <B>indicatorOn</B>
<DT><I>Class</I>: <B>IndicatorOn</B>
<DT><I>Option keyword</I>: <B><A NAME="M30">:indicatoron</A></B>
<DT><I>STklos slot name</I>: <B>indicator-on</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>
<P>
<DT><I>Name</I>: <B>selectColor</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M31">:selectcolor</A></B>
<DT><I>STklos slot name</I>: <B>select-color</B>
<DD>Specifies a background color to use when the button is selected.
If <B>indicatorOn</B> is true, the color applicies to the indicator.
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, no special color is used for
displaying when the widget is selected.
<P>
<P>
<DT><I>Name</I>: <B>selectImage</B>
<DT><I>Class</I>: <B>SelectImage</B>
<DT><I>Option keyword</I>: <B><A NAME="M32">:selectimage</A></B>
<DT><I>STklos slot name</I>: <B>select-image</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>
<P>
<DT><I>Name</I>: <B>state</B>
<DT><I>Class</I>: <B>State</B>
<DT><I>Option keyword</I>: <B><A NAME="M33">:state</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>stringvalue</B>
<DT><I>Class</I>: <B>StringValue</B>
<DT><I>Option keyword</I>: <B><A NAME="M34">:stringvalue</A></B>
<DT><I>STklos slot name</I>: <B>string-value</B>
<DD>Specifies if the value set to <B>variable</B> by <B>:value</B> must be
<I>stringified</I>. Default value for this option is <B>#t</B>.
See <B><A HREF="./checkbutton.n.html">checkbutton</A></B> for a similar example.
<P>
<P>
<DT><I>Name</I>: <B>value</B>
<DT><I>Class</I>: <B>Value</B>
<DT><I>Option keyword</I>: <B><A NAME="M35">:value</A></B>
<DT><I>STklos slot name</I>: <B>value</B>
<DD>Specifies value to store in the button's associated variable whenever
this button is selected.
<P>
<P>
<DT><I>Name</I>: <B>variable</B>
<DT><I>Class</I>: <B>Variable</B>
<DT><I>Option keyword</I>: <B><A NAME="M36">:variable</A></B>
<DT><I>STklos slot name</I>: <B>variable</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>*selected-button*</B>.
<P>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M37">:width</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</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.
<P>
</DL>
<H3><A NAME="M38">DESCRIPTION</A></H3>
The <B>radiobutton</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a radiobutton widget.
Additional
options, described above, may be specified on the procedure 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> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</I>'s parent must exist.
<P>
A radiobutton is a widget
that displays a textual string, bitmap or image
and a diamond 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 STk procedure 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 sunken relief and a special color, and
a STk variable associated with the radiobutton is set to a particular
value.
If the radiobutton is not selected, the indicator is drawn with a
raised relief and no special color.
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>*selected-button*</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 procedure 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 radio
button is configured to select itself on button clicks.
<H3><A NAME="M39">WIDGET PROCEDURE</A></H3>
The <B>radiobutton</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for radiobutton widgets:
<P>
<DL>
<DT><A NAME="M40">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M41">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>radiobutton</B>
procedure.
<P>
<DT><A NAME="M42">(<I>widget-name '</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 procedure has
no effect.
<P>
<DT><A NAME="M43">(<I>widget-name '</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 procedure was invoked.
This procedure is ignored if the radiobutton's state is <B>disabled</B>.
<P>
<DT><A NAME="M44">(<I>widget-name '</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 STk procedure, if there is one (return value is undifined)..
This procedure is ignored if the radiobutton's state is <B>disabled</B>.
<P>
<DT><A NAME="M45">(<I>widget-name '</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="M46">BINDINGS</A></H3>
Tk automatically creates class bindings for radiobuttons that give them
the following default behavior:
<OL>
<LI>
The radiobutton activates whenever the mouse passes over it and deactivates
whenever the mouse leaves the radiobutton.
<LI>
When mouse button 1 is pressed over a radiobutton it is invoked (it
becomes selected and the procedure associated with the button is
invoked, if there is one).
<LI>
When a radiobutton has the input focus, the space key causes the radiobutton
to be invoked.
</OL>
<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="M47">SEE ALSO</A></H3>
<B><A HREF="./button.n.html">button</A></B>, <B><A HREF="./checkbutton.n.html">checkbutton</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+25
View File
@@ -0,0 +1,25 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - raise manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> raise</H2>
<I>Change a window's position in the stacking order</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>raise </B><I>window</I>)<BR>
(<B>raise </B><I>window </I><I>aboveThis</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
If the <I>aboveThis</I> argument is omitted then the procedure 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> procedure 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="M4">SEE ALSO</A></H3>
<B><A HREF="./lower.n.html">lower</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+37
View File
@@ -0,0 +1,37 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - report-error manual page</TITLE></HEAD>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> report-error</H2>
<I>Command invoked to process errors</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>report-error </B><I>head message obj</I>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
<B>Report-error</B> is called by the interpreter when an error occurs.
This procedure is written in Scheme and can be by an application which
needs to handle redefined to handle errors. The <I>head</I> argument is
a string which identify the kind of error. The <I>head</I> argument
contains the error message and <I>obj</I> contains the object which
causes the error (or the empty list when there is no object to incriminate).
<P>
The STk library includes a default <B>report-error</B> procedure
that posts a dialog box containing the error message and offers
the user a chance to see a stack trace showing where the
error occurred and its associated environment..
<P>
If an error occurs while is <B>report-error</B> execution, the
interpreter detect that the procedure is buggy and it redirect further
messages on the standard error port.
<P>
Hereafter is a simple non-graphical error reporter.
<PRE>(define (report-error head message obj)
(let ((port (current-error-port)))
;; Display message
(format port &quot;~A: ~A ~S\n\n&quot; head message obj)
;; Display stack
(let ((stack (%get-eval-stack))
(env (%get-environment-stack)))
(for-each (lambda (x y) (format port &quot;~A ~A\n&quot; x (uncode y)))
env
stack))))</PRE>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+324
View File
@@ -0,0 +1,324 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - scale manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> scale</H2>
<I>Create and manipulate scale widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>scale</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:font">:font</A></B> <B><A HREF="options.n.html#M:foreground">:foreground</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:orient">:orient</A></B>
<B><A HREF="options.n.html#M:relief">:relief</A></B> <B><A HREF="options.n.html#M:repeatdelay">:repeatdelay</A></B>
<B><A HREF="options.n.html#M:repeatinterval">:repeatinterval</A></B> <B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
<B><A HREF="options.n.html#M:troughcolor">:troughcolor</A></B>
</PRE>
<H3><A NAME="M19">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>bigIncrement</B>
<DT><I>Class</I>: <B>BigIncrement</B>
<DT><I>Option keyword</I>: <B><A NAME="M20">:bigincrement</A></B>
<DT><I>STklos slot name</I>: <B>big-increment</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>
<P>
<DT><I>Name</I>: <B>command</B>
<DT><I>Class</I>: <B>Command</B>
<DT><I>Option keyword</I>: <B><A NAME="M21">:command</A></B>
<DT><I>STklos slot name</I>: <B>command</B>
<DD>Specifies a STk command to invoke whenever the scale's
value is changed via a widget command.
The procedure is called with a real number indicating the
new value of the scale. Example:
<P>
</DL>
<UL>
<UL>
(scale '.s :command (lambda (x)
(format #t &quot;New position is ~S\n&quot; x)))
</UL>
</UL>
<DL>
<P>
<DT><I>Name</I>: <B>digits</B>
<DT><I>Class</I>: <B>Digits</B>
<DT><I>Option keyword</I>: <B><A NAME="M22">:digits</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>from</B>
<DT><I>Class</I>: <B>From</B>
<DT><I>Option keyword</I>: <B><A NAME="M23">:from</A></B>
<DT><I>STklos slot name</I>: <B>from</B>
<DD>A real value corresponding to the left or top end of the scale.
<P>
<P>
<DT><I>Name</I>: <B><A HREF="./label.n.html">label</A></B>
<DT><I>Class</I>: <B><A HREF="./label.n.html">Label</A></B>
<DT><I>Option keyword</I>: <B><A NAME="M24">:label</A></B>
<DT><I>STklos slot name</I>: <B><A HREF="./label.n.html">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>
<P>
<DT><I>Name</I>: <B>length</B>
<DT><I>Class</I>: <B>Length</B>
<DT><I>Option keyword</I>: <B><A NAME="M25">:length</A></B>
<DT><I>STklos slot name</I>: <B>length</B>
<DD>Specifies the desired long dimension of the scale in screen units
(i.e. any of the forms acceptable to <B>Tk_GetPixels</B>).
For vertical scales this is the scale's height; for horizontal scales
it is the scale's width.
<P>
<P>
<DT><I>Name</I>: <B>resolution</B>
<DT><I>Class</I>: <B>Resolution</B>
<DT><I>Option keyword</I>: <B><A NAME="M26">:resolution</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>showValue</B>
<DT><I>Class</I>: <B>ShowValue</B>
<DT><I>Option keyword</I>: <B><A NAME="M27">:showvalue</A></B>
<DT><I>STklos slot name</I>: <B>show-value</B>
<DD>Specifies a boolean value indicating whether or not the current
value of the scale is to be displayed.
<P>
<P>
<DT><I>Name</I>: <B>sliderLength</B>
<DT><I>Class</I>: <B>SliderLength</B>
<DT><I>Option keyword</I>: <B><A NAME="M28">:sliderlength</A></B>
<DT><I>STklos slot name</I>: <B></B>
<DD>Specifies 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>Tk_GetPixels</B>.
<P>
<P>
<DT><I>Name</I>: <B>sliderRelief</B>
<DT><I>Class</I>: <B>SliderRelief</B>
<DT><I>Option keyword</I>: <B><A NAME="M29">:sliderrelief</A></B>
<DT><I>STklos slot name</I>: <B>slider-relief</B>
<DD>Specifies the relief to use when drawing the slider, such as <B>raised</B>
or <B>sunken</B>.
<P>
<P>
<DT><I>Name</I>: <B>state</B>
<DT><I>Class</I>: <B>State</B>
<DT><I>Option keyword</I>: <B><A NAME="M30">:state</A></B>
<DT><I>STklos slot name</I>: <B>state</B>
<DD>Specifies one of three states for the scale: <B>&quot;normal&quot;</B>,
<B>&quot;active&quot;</B>, or <B>&quot;disabled&quot;</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>
<P>
<DT><I>Name</I>: <B>tickInterval</B>
<DT><I>Class</I>: <B>TickInterval</B>
<DT><I>Option keyword</I>: <B><A NAME="M31">:tickinterval</A></B>
<DT><I>STklos slot name</I>: <B>tick-interval</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>
<P>
<DT><I>Name</I>: <B>to</B>
<DT><I>Class</I>: <B>To</B>
<DT><I>Option keyword</I>: <B><A NAME="M32">:to</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>variable</B>
<DT><I>Class</I>: <B>Variable</B>
<DT><I>Option keyword</I>: <B><A NAME="M33">:variable</A></B>
<DT><I>STklos slot name</I>: <B>variable</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>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M34">:width</A></B>
<DT><I>STklos slot name</I>: <B>width</B>
<DD>Specifies the desired narrow dimension of the trough in screen units
(i.e. any of the forms acceptable to <B>Tk_GetPixels</B>).
For vertical scales this is the trough's width; for horizontal scales
this is the trough's height.
<P>
</DL>
<H3><A NAME="M35">DESCRIPTION</A></H3>
The <B>scale</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a scale widget.
Additional
options, described above, may be specified on the procedure line
or in the option database
to configure aspects of the scale such as its colors, orientation,
and relief. The <B>scale</B> procedure returns its
<I>widget-name</I> argument. At the time this procedure is invoked,
there must not exist a window named <I>widget-name</I>, but
<I>widget-name</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 STk
procedure 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 STk variable (using the <B>variable</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="M36">WIDGET PROCEDURE</A></H3>
The <B>scale</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for scale widgets:
<P>
<DL>
<DT><A NAME="M37">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M38">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty list.
<I>Option</I> may have any of the values accepted by the <B>scale</B>
procedure.
<P>
<DT><A NAME="M39">(<I>widget-name '</I><B>coords </B>)</A><DD>
<DT><A NAME="M40">(<I>widget-name '</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="M41">(<I>widget-name '</I><B>get</B>)</A><DD>
<DT><A NAME="M42">(<I>widget-name '</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 procedure 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="M43">(<I>widget-name '</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>&quot;slider&quot;</B> means that the point is over
the slider; <B>&quot;trough1&quot;</B> means that the point is over the
portion of the slider above or to the left of the slider;
and <B>&quot;trough2&quot;</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 list
is returned.
<P>
<DT><A NAME="M44">(<I>widget-name '</I><B>set</B> <I>value</I>)</A><DD>
This procedure 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 procedure has no effect if the scale is disabled.
<P>
</DL>
<H3><A NAME="M45">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.
<OL>
<LI>
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.
<LI>
If button 1 is pressed over the slider, the slider can be dragged
with the mouse.
<LI>
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.
<LI>
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.
<LI>
The Up and Left keys move the slider up (left) by the value
of the <B>resolution</B> option.
<LI>
The Down and Right keys move the slider down (right) by the value
of the <B>resolution</B> option.
<LI>
Control-Up and Control-Left move the slider up (left) by the
value of the <B>bigIncrement</B> option.
<LI>
Control-Down and Control-Right move the slider down (right) by the
value of the <B>bigIncrement</B> option.
<LI>
Home moves the slider to the top (left) end of its range.
<LI>
End moves the slider to the bottom (right) end of its range.
</OL>
<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.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+370
View File
@@ -0,0 +1,370 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - scrollbar manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> scrollbar</H2>
<I>Create and manipulate scrollbar widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>scrollbar</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:activebackground">:activebackground</A></B> <B><A HREF="options.n.html#M:background">:background</A></B>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:jump">:jump</A></B>
<B><A HREF="options.n.html#M:orient">:orient</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:repeatdelay">:repeatdelay</A></B> <B><A HREF="options.n.html#M:repeatinterval">:repeatinterval</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B> <B><A HREF="options.n.html#M:troughcolor">:troughcolor</A></B>
</PRE>
<H3><A NAME="M18">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>activeRelief</B>
<DT><I>Class</I>: <B>ActiveRelief</B>
<DT><I>Option keyword</I>: <B><A NAME="M19">:activerelief</A></B>
<DT><I>STklos slot name</I>: <B>active-relief</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>
<P>
<DT><I>Name</I>: <B>command</B>
<DT><I>Class</I>: <B>Command</B>
<DT><I>Option keyword</I>: <B><A NAME="M20">:command</A></B>
<DT><I>STklos slot name</I>: <B>command</B>
<DD>Specifies a STk procedure to invoke to change the view
in the widget associated with the scrollbar. When a user requests
a view change by manipulating the scrollbar, the procedure is
invoked. The parameters given to this
procedure are described later.
<P>
<P>
<DT><I>Name</I>: <B>elementBorderWidth</B>
<DT><I>Class</I>: <B>BorderWidth</B>
<DT><I>Option keyword</I>: <B><A NAME="M21">:elementborderwidth</A></B>
<DT><I>STklos slot name</I>: <B>element-border-width</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>Tk_GetPixels</B>.
If this value is less than zero, the value of the <B>borderWidth</B>
option is used in its place.
<P>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M22">:width</A></B>
<DT><I>STklos slot name</I>: <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>Tk_GetPixels</B>.
<P>
</DL>
<H3><A NAME="M23">DESCRIPTION</A></H3>
The <B>scrollbar</B> procedure creates a new window (given by the
<I>widget-name</I> argument) and makes it into a scrollbar widget.
Additional options, described above, may be specified on the procedure
line or in the option database to configure aspects of the scrollbar
such as its colors, orientation, and relief.
The <B>scrollbar</B> procedure returns its <I>widget-name</I> argument.
At the time this procedure is invoked, there must not exist a window
named <I>widget-name</I>, but <I>widget-name</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="M24">ELEMENTS</A></H3>
A scrollbar displays five elements, which are referred to in the
widget procedures for the scrollbar:
<P>
<DL>
<DT><A NAME="M25"><B>arrow1</B></A><DD>
The top or left arrow in the scrollbar.
<P>
<DT><A NAME="M26"><B>trough1</B></A><DD>
The region between the slider and <B>arrow1</B>.
<P>
<DT><A NAME="M27"><B>slider</B></A><DD>
The rectangle that indicates what is visible in the associated widget.
<P>
<DT><A NAME="M28"><B>trough2</B></A><DD>
The region between the slider and <B>arrow2</B>.
<P>
<DT><A NAME="M29"><B>arrow2</B></A><DD>
The bottom or right arrow in the scrollbar.
<P>
</DL>
<H3><A NAME="M30">WIDGET PROCEDURE</A></H3>
The <B>scrollbar</B> procedure creates a new STk procedure whose
name is <I>widget-name</I>. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the procedure. The following
procedures are possible for scrollbar widgets:
<P>
<DL>
<DT><A NAME="M31">(<I>widget-name '</I><B>activate </B>)</A><DD>
<DT><A NAME="M32">(<I>widget-name '</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 procedure 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 procedure returns
the name of the element that is currently active, or an empty list
if no element is active.
<P>
<DT><A NAME="M33">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M34">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>scrollbar</B>
procedure.
<P>
<DT><A NAME="M35">(<I>widget-name '</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="M36">(<I>widget-name '</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="M37">(<I>widget-name '</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 procedure.
<P>
<DT><A NAME="M38">(<I>widget-name '</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>&quot;arrow1&quot;</B>), or <B>#f</B>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="M39">(<I>widget-name '</I><B>set</B> <I>first last</I>)</A><DD>
This procedure is invoked by the scrollbar's associated widget to
tell the scrollbar about the current view in the widget.
The procedure 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="M40">SCROLLING PROCEDURES</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 calling the STk procedure
given to the scrollbar's \fB\:command\fR option. The parameters
passed to the procedure may take any of the following forms:
<P>
<DL>
<DT><A NAME="M41">'<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="M42">'<B>scroll </B><I>number '</I><B>unit</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="M43">'<B>scroll </B><I>number '</I><B>page</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="M44">OLD PROCEDURE SYNTAX</A></H3>
In versions of Tk before 4.0, the <B>set</B> and <B>get</B> widget
procedures used a different form.
This form is still supported for backward compatibility, but it
is deprecated.
In the old procedure syntax, the <B>set</B> widget procedure has the
following form:
<P>
<DL>
<DT><A NAME="M45">(<I>widget-name '</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 procedure 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 procedure.
<P>
The procedures generated by scrollbars also have a different form
when the old syntax is being used: a single parameter is passed to
the procedure given to the <B>:command</B> option. This integer
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 procedure.
<P>
The most recent <B>set</B> widget procedure 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="M46">EXAMPLE</A></H3>
The following example shows a procedure which is compatible with
the old and new syntax for procedure scrolling discussed earlier:
<PRE>.;; Create list box and scrollbar
(listbox '.l :height 5
:yscroll (lambda l (apply .s 'set l)))
(scrollbar '.s :command (lambda l (apply .l 'yview l)))
;; Set some elements in the listbox
(.l 'insert 0 'one 'two 'three 'four 'five 'six 'seven 'eight)
;; Pack elements
(pack .l :side &quot;left&quot; :expand #t :fill &quot;both&quot;)
(pack .s :side &quot;right&quot; :expand #f :fill &quot;y&quot;)</PRE>
Using apply and a variable length list of parameters for the scrollbar
procedure is compatible with old and new scrollbar procedure syntax.
<H3><A NAME="M47">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.
<OL>
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
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.
<LI>
The Prior and Next keys have the same behavior
as mouse clicks over <B>trough1</B> and <B>trough2</B>, respectively.
<LI>
The Home key adjusts the view to the top (left edge) of the document.
<LI>
The End key adjusts the view to the bottom (right edge) of the document.
</OL>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+125
View File
@@ -0,0 +1,125 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - selection manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> selection</H2>
<I>Manipulate the X selection</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>selection </B><I>option</I> ?<I>arg arg ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure provides a STk 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 procedure. The following
forms are currently supported:
<P>
<P>
<DL>
<DT><A NAME="M4">(<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 list.
<P>
<DT><A NAME="M5">(<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 ``*root*''.
<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> procedure 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>
</DL>
<P>
<P>
<DL>
<DT><A NAME="M6">(<B>selection 'handle</B> ?<B>:selection</B> <I>selection</I>? ?<B>:type</B> <I>type</I>? ?<B>:format</B> <I>format</I>? <I>window procedure</I>)</A><DD>
Creates a handler for selection requests, such that <I>procedure</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> procedure).
<I>Selection</I> defaults to PRIMARY, <I>type</I> defaults to STRING, and
<I>format</I> defaults to STRING. If <I>procedure</I> is an empty string
then any existing handler for <I>window</I>, <I>type</I>, and
<I>selection</I> is removed.
<P>
<UL>
<P>
When <I>selection</I> is requested, <I>window</I> is the selection owner,
and <I>type</I> is the requested type, <I>procedure</I> will be applied
as a STk procedure with a list of two numbers.
The two additional numbers
are <I>offset</I> and <I>maxBytes</I>: <I>offset</I> specifies a starting
character position in the selection and <I>maxBytes</I> gives the maximum
number of bytes to retrieve. The procedure should return a value consisting
of at most <I>maxBytes</I> of the selection, starting at position
<I>offset</I>. For very large selections (larger than <I>maxBytes</I>)
the selection will be retrieved using several invocations of <I>procedure</I>
with increasing <I>offset</I> values. If <I>procedure</I> returns a string
whose length is less than <I>maxBytes</I>, the return value is assumed to
include all of the remainder of the selection; if the length of
<I>procedure</I>'s result is equal to <I>maxBytes</I> then
<I>procedure</I> will be invoked again, until it eventually
returns a result shorter than <I>maxBytes</I>. The value of <I>maxBytes</I>
will always be relatively large (thousands of bytes).
<P>
If <I>procedure</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>procedure</I>). If <I>format</I> is
ATOM, then the return value from <I>procedure</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>procedure</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.
</UL>
</DL>
<P>
<P>
<DL>
<DT><A NAME="M7">(<B>selection 'own</B> ?<B>:displayof</B> <I>window</I>? ?<B>:selection</B> <I>selection</I>?)</A><DD>
<DT><A NAME="M8">(<B>selection 'own</B> ?<B>:procedure</B> <I>procedure</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 <B>#f</B> if no window in this
application owns the selection. <I>Selection</I> defaults to &quot;PRIMARY&quot; and
<I>window</I> defaults to ``*root*''.
<P>
<BR>
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 list as result. The existing owner, if any, is notified
that it has lost the selection.
If <I>procedure</I> is specified, it is a STk script to execute when
some other window claims ownership of the selection away from
<I>window</I>. <I>Selection</I> defaults to &quot;PRIMARY&quot;.
<P>
</DL>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+83
View File
@@ -0,0 +1,83 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - send manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> send</H2>
<I>Execute a command in a different application</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>send ?</B><I>options</I>? <I>app cmd </I>?<I>arg arg ...</I>?)<BR>
(<B>inhibit-send</B>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure 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 (converted to a string)
that procedure 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 procedure 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
procedure to be executed, just as for the <B>eval</B> procedure.
<P>
If the initial arguments of the procedure begin with ``-''
they are treated as options. The following options are
currently defined:
<P>
<DL>
<DT><A NAME="M4"><B>:async</B></A><DD>
Requests asynchronous invocation. In this case the <B>send</B>
procedure 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 procedure will be ignored.
If the target application is in the same process as the sending
application then the \fB\:async\fR option is ignored.
<P>
<DT><A NAME="M5"><B>:displayof</B> <I>widget-name</I></A><DD>
Specifies that the target application's main window is on the display
of the window given by <I>widget-name</I>, instead of the display containing
the application's main window.
<P>
<DT><A NAME="M6"><B>:-</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="M7">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=.././tk.n.html>tk appname</A></B> procedure.
<H3><A NAME="M8">DISABLING SENDS</A></H3>
The <B>send</B> procedure can be removed from an application
by calling the <B>inhibit-send</B><I> procedure.
If the </I><B>send</B> procedure is removed 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=.././tk.n.html>tk appname</A></B>
procedure.
<H3><A NAME="M9">SECURITY</A></H3>
The <B>send</B> procedure is potentially a serious security loophole,
since any application that can connect to your X server can send
scripts to your applications.
These incoming scripts can use STk 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>.
<H3><A NAME="M10">SEE ALSO</A></H3>
<B><A HREF="./tk.n.html">tk</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+180
View File
@@ -0,0 +1,180 @@
<HTML><HEAD><TITLE>4.0 - STk manual page</TITLE></HEAD>
<BODY bgcolor = white>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageWhite.gif"> stk, snow</H2>
<I>A Scheme interpreter using the Tk toolkit</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
<B>stk</B> [<I>options</I>] [<I>arg arg ...</I>]<BR>
<B>snow</B> [<I>options</I>] [<I>arg arg ...</I>]<BR>
<H3><A NAME="M3">OPTIONS</A></H3>
<B>stk</B> interpreter accepts several command-line options which may
be abbreviated, as long as the abbreviation
is unambiguous (e.g. <B>-h</B>, <B>-he</B>, <B>-hel</B> are three possibe
abbreviations for the <B>-help</B> option).
<P>
<DL>
<DT><A NAME="M4"><B>-display </B><I>display</I></A><DD>
Display (and screen) on which to display window.
<P>
<DT><A NAME="M5"><B>-file </B><I>fileName</I></A><DD>
Read commands from <I>fileName</I> rather than standard input. The
last element in <I>fileName</I> will be used as the title for the
application and name of its interpreter for <B><A HREF="./send.n.html">send</A></B>
commands (unless overridden by the <B>-name</B> option\fR).
<P>
<DT><A NAME="M6"><B>-geometry </B><I>geometry</I></A><DD>
Initial geometry to use for window.
<P>
<DT><A NAME="M7"><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="./send.n.html">send</A></B> commands.
<P>
<DT><A NAME="M8"><B>-new-colormap</B></A><DD>
Specifies that the main window should have a new private colormap instead of
using the default colormap for the screen.
<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>-visual </B><I>visual</I></A><DD>
Specifies the visual to use for the window.<I>Visual</I> may be one of the following:
<I>best</I>, <I>directcolor</I>, <I>grayscale</I>, <I>greyscale</I>,
<I>pseudocolor</I>, <I>staticcolor</I>, <I>staticgray</I>,
<I>staticgrey</I>, <I>truecolor</I>, or <I>default</I>
<P>
<DT><A NAME="M11"><B>-no-tk</B></A><DD>
Don't initialize the Tk toolkit
<P>
<DT><A NAME="M12"><B>-load </B><I>fileName</I></A><DD>
Evaluate expressions contained in <I>fileName</I> before reading
expressions from standard input.
<P>
<DT><A NAME="M13"><B>-image </B><I>fileName</I></A><DD>
Restore the state saved in <I>fileName</I> by the <I>dump</I> primitive
(Note: For now, <I>dump</I> works only on SunOS 4.1.x, Linux 1.x (a.out format)
and FreeBSD).
<P>
<DT><A NAME="M14"><B>-cells </B><I>number</I></A><DD>
Set the default size for the heap to <I>number</I> cells. The given number is
also the amount of cells used when extending the heap. Default value is 20000.
<P>
<DT><A NAME="M15"><B>-interactive</B></A><DD>
Tell the interpreter that it is used interactively (even if it doesn't
think so).
<P>
<DT><A NAME="M16"><B>-help</B></A><DD>
Print a summary of the command-line options and exit.
<P>
<DT><A NAME="M17"><B>--</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="M18">DESCRIPTION</A></H3>
<B>Stk</B> is a Scheme R4RS interpreter which provide a simple access to the
X11 Tk toolkit. If the <B>-no-tk</B> option is provided to the interpreter,
the Tk library is not initialized and no main window is created. If
<B>stk</B> is invoked with no <B>-f</B> option then it reads Scheme
expressions 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.
<P>
<B>Snow</B> is a <I>light</I> version of the <B>stk</B> interpreter which
does not provide support for the Tk toolkit. This interpreter does not
recognize the options <B>-display</B>, <B>-geometry</B>, <B>-sync</B>
<B>new-colormap</B>, <B>visual</B> and <B>-no-tk</B> which are meaningless
without Tk. This interpreter is called, rather than the standard one,
when the shell DISPLAY variable is not initialized.
<P>
If the <B>-file</B> option is provided to Tk, then <B>stk</B> reads Scheme
forms from the file named in the <B>-file</B> option. These
forms will normally create an interactive interface consisting
of one or more widgets. When the end of the command file is
reached, <B>stk</B> will continue to respond to X events until
all windows have been deleted.
<P>
The <B>-interactive</B> option forces the interpreter in interactive
mode. In this mode, standard output and standard error are unbuffered.
Use this option when you launch <B>stk</B> from <B>emacs</B>.
<H3><A NAME="M19">VARIABLES</A></H3>
Following Scheme variables are set when <B>Stk</B> starts:
<P>
<DL>
<DT><A NAME="M20"><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="M21"><B>*argv*</B></A><DD>
Contains a Scheme list whose elements are the <I>arg</I> arguments (not
including the options described above), in order, or an empty list
if there are no <I>arg</I> arguments.
<P>
<DT><A NAME="M22"><B>*program-name*</B></A><DD>
Contains <I>fileName</I> if it was specified.
Otherwise, contains the name by which <B>stk</B> was invoked.
<P>
</DL>
<H3><A NAME="M23">SCRIPT FILES</A></H3>
If you create a STk script in a file whose first line is
<PRE><B>#!/usr/local/bin/stk -f</B></PRE>
then you can invoke the script file directly from your shell if
you mark it as executable.
This assumes that <B>stk</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.
<H3><A NAME="M24">ENVIRONMENT VARIABLES</A></H3>
<B>stk</B> uses the following shell variables:
<P>
<DL>
<DT><A NAME="M25"><I>STK_LIBRARY</I></A><DD>
This variable indicates where the library files are located. This variable
allows to overload the default value of the Scheme variable <I>*stk-library*</I>
which is automatically calculated by the interpreter.(i.e. <I>stk</I> or <I>snow</I>).
<P>
<DT><A NAME="M26"><I>STK_LOAD_PATH</I></A><DD>
This variable serves to initialize the <I>*load-path*</I> Scheme variable. This
variable is a list of paths to try when in a load command.
<P>
<DT><A NAME="M27"><I>STK_HELP_PATH</I></A><DD>
This variable serves to initialize the <I>*help-path*</I> Scheme variable. It
must contain a list of documentation directories. This variable is used by the help
procedure.
<P>
</DL>
<H3><A NAME="M28">FILES</A></H3>
<DL>
<DT><A NAME="M29"><I>./init.stk</I></A><DD>
<DT><A NAME="M30"><I>$STK_LIBRARY/STk/init.stk</I></A><DD>
When <B>stk</B> starts running, it tries to load the file <I>init.stk</I>
in the current directory. If this file is not present, it tries to load
this file in the <B>STk_LIBRARY</B> directory (the value of <B>STk_LIBRARY</B>
is automatically computed to be in a sibling directory of the interpreter
executable.
<P>
<DT><A NAME="M31"><I>~/.stkrc</I></A><DD>
Standard <I>init.stk</I> file tries to load the file <I>~/.stkrc</I>. This file
can be used to store function definitions or variables settings that you want
to be executed at each interpretater invocation.
<P>
</DL>
<H3><A NAME="M32">SEE ALSO</A></H3>
<B>wish(1)</B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookWhite.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+1544
View File
File diff suppressed because it is too large Load Diff
+41
View File
@@ -0,0 +1,41 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tk manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> tk</H2>
<I>Manipulate Tk internal state</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>tk</B> <I>option </I>?<I>arg arg ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>tk</B> procedure provides access to miscellaneous
elements of Tk's internal state.
Most of the information manipulated by this procedure pertains to the
application as a whole, or to a screen or display, rather than to a
particular window.
The procedure can take any of a number of different forms
depending on the <I>option</I> argument. The legal forms are:
<P>
<DL>
<DT><A NAME="M4">(<B>tk 'appname</B>)</A><DD>
<DT><A NAME="M5">(<B>tk 'appname </B><I>newName</I>)</A><DD>
If <I>newName</I> isn't specified, this procedure returns the name
of the application (the name that may be used in <B><A HREF="./send.n.html">send</A></B>
procedures 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 procedure'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="./send.n.html">send</A></B> procedure,
(with <B>inhibit-send</B>) this procedure will reenable them and
recreate the <B><A HREF="./send.n.html">send</A></B> procedure.
<P>
</DL>
<H3><A NAME="M6">SEE ALSO</A></H3>
<B><A HREF="./send.n.html">send</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+39
View File
@@ -0,0 +1,39 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tkvars manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> tkvars</H2>
<I>Variables used or set by Tk</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">DESCRIPTION</A></H3>
The following STk variables are either set or used by Tk at various times
in its execution:
<P>
<DL>
<DT><A NAME="M3"><B>*tk-patch-level*</B></A><DD>
Contains a string which represent 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="M4"><B>*tk-strict-motif*</B></A><DD>
This variable is set to <B>#f</B> by default.
If an application sets it to a true value, 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="M5"><B>*tk-version*</B></A><DD>
Tk sets this variable in the interpreter for each
application. The value of this variable is a string which 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>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+33
View File
@@ -0,0 +1,33 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - tkwait manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> tkwait</H2>
<I>Wait for variable to change or window to be destroyed</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">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="M3">DESCRIPTION</A></H3>
The <B>tkwait</B> procedure 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>variable</B> (or any abbreviation of
it) then the second argument is the name of a global variable and the
procedure 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> procedure 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> procedure 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> procedure is waiting it processes events in
the normal fashion, so the application will continue to respond
to user interactions.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+160
View File
@@ -0,0 +1,160 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - toplevel manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> toplevel</H2>
<I>Create and manipulate toplevel widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>toplevel</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
</PRE>
<H3><A NAME="M11">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>background</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M12">:background</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>class</B>
<DT><I>Class</I>: <B>Class</B>
<DT><I>Option keyword</I>: <B><A NAME="M13">:class</A></B>
<DT><I>STklos slot name</I>: <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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>colormap</B>
<DT><I>Class</I>: <B>Colormap</B>
<DT><I>Option keyword</I>: <B><A NAME="M14">:colormap</A></B>
<DT><I>STklos slot name</I>: <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>widget-name</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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M15">:height</A></B>
<DT><I>STklos slot name</I>: <B>height</B>
<DD>Specifies the desired height for the window in any of the forms
acceptable to <B>Tk_GetPixels</B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P>
<P>
<DT><I>Name</I>: <B></B>
<DT><I>Class</I>: <B></B>
<DT><I>Option keyword</I>: <B><A NAME="M16">:screen</A></B>
<DT><I>STklos slot name</I>: <B></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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>visual</B>
<DT><I>Class</I>: <B>Visual</B>
<DT><I>Option keyword</I>: <B><A NAME="M17">:visual</A></B>
<DT><I>STklos slot name</I>: <B>visual</B>
<DD>Specifies visual information for the new window in any of the
forms accepted by <B>Tk_GetVisual</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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M18">:width</A></B>
<DT><I>STklos slot name</I>: <B>width</B>
<DD>Specifies the desired width for the window in any of the forms
acceptable to <B>Tk_GetPixels</B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P>
</DL>
<H3><A NAME="M19">DESCRIPTION</A></H3>
The <B>toplevel</B> procedure creates a new toplevel widget (given
by the <I>widget-name</I> argument). Additional
options, described above, may be specified on the procedure line
or in the option database
to configure aspects of the toplevel such as its background color
and relief. The <B>toplevel</B> procedure 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="M20">WIDGET PROCEDURE</A></H3>
The <B>toplevel</B> procedure creates a new STk procedure whose
name is the same as the path name of the toplevel's window. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>PathName</I> is the name of the procedure, 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 procedure. The following
procedures are possible for toplevel widgets:
<P>
<DL>
<DT><A NAME="M21">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M22">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>toplevel</B>
procedure.
<P>
</DL>
<H3><A NAME="M23">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="M24">SEE ALSO</A></H3>
<B><A HREF="./wm.n.html">wm</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+40
View File
@@ -0,0 +1,40 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - update manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> update</H2>
<I>Process pending events and/or when-idle handlers</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>update</B>)<BR>
(<B>update</B> '<B>idletasks</B>)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
This procedure is used to bring the entire application world
``up to date.''
It flushes all pending output to the display, waits for the
server to process that output and return errors or events,
handles all pending events of any sort (including when-idle handlers),
and repeats this set of operations until there are no pending
events, no pending when-idle handlers, no pending output to the server,
and no operations still outstanding at the server.
<P>
If the <B>idletasks</B> option is specified as an argument to the
procedure, then no new events or errors are processed; only when-idle
idlers are invoked.
This causes operations that are normally deferred, such as display
updates and window layout calculations, to be performed immediately.
<P>
The <B>update idletasks</B> procedure is useful in scripts where
changes have been made to the application's state and you want those
changes to appear on the display immediately, rather than waiting
for the script to complete. Most display updates are performed as
idle handlers, so <B>update idletasks</B> will cause them to run.
However, there are some kinds of updates that only happen in
response to events, such as those triggered by window size changes;
these updates will not occur in <B>update idletasks</B>.
<P>
The <B>update</B> procedure with no options is useful in scripts where
you are performing a long-running computation but you still want
the application to respond to user interactions; if you occasionally
call <B>update</B> then user input will be processed during the
next call to <B>update</B>.
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+319
View File
@@ -0,0 +1,319 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - winfo manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> winfo</H2>
<I>Return window-related information</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>winfo</B> <I>option </I>?<I>arg arg ...</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>winfo</B> procedure 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>
<DT><A NAME="M4">(<B>winfo 'atom </B> <I>name</I>)</A><DD>
<DT><A NAME="M5">(<B>winfo 'atom </B><B>:displayof </B><I>window</I> <I>name</I>)</A><DD>
Returns a 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> <I>id</I>)</A><DD>
<DT><A NAME="M7">(<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 procedure is the inverse of the <B>winfo atom</B> procedure.
It generates an error if no such atom exists.
<P>
<DT><A NAME="M8">(<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="M9">(<B>winfo 'children </B><I>window</I>)</A><DD>
Returns a list containing the path names of all the children
of <I>window</I>. Top-level windows are returned as children
of their logical parents.
<P>
<DT><A NAME="M10">(<B>winfo 'class </B><I>window</I>)</A><DD>
Returns the class name for <I>window</I>.
<P>
<DT><A NAME="M11">(<B>winfo 'colormapfull </B><I>window</I>)</A><DD>
Returns <B>#t</B> if the colormap for <I>window</I> is known to be full, <B>#f</B>
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="M12">(<B>winfo 'containing </B> <I>rootX rootY</I>)</A><DD>
<DT><A NAME="M13">(<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>Tk_GetPixels</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
list 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="M14">(<B>winfo 'depth </B><I>window</I>)</A><DD>
Returns an integer giving the depth of <I>window</I> (number
of bits per pixel).
<P>
<DT><A NAME="M15">(<B>winfo 'exists </B><I>window</I>)</A><DD>
Returns #t if there exists a window named <I>window</I>, #f if no such
window exists.
<P>
<DT><A NAME="M16">(<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>Tk_GetScreenMM</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="M17">(<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="M18">(<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="./update.n.html">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="M19">(<B>winfo 'id </B><I>window</I>)</A><DD>
Returns an integer indicating the X identifier for <I>window</I>.
<P>
<DT><A NAME="M20">(<B>winfo 'interps </B>)</A><DD>
<DT><A NAME="M21">(<B>winfo 'interps </B><B>:displayof </B><I>window</I>)</A><DD>
Returns a list whose members are the names of all STk 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="M22">(<B>winfo 'ismapped </B><I>window</I>)</A><DD>
Returns <B>#t</B> if <I>window</I> is currently mapped, <B>#f</B> otherwise.
<P>
<DT><A NAME="M23">(<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 list if <I>window</I>
isn't managed by any geometry manager.
The name is usually the name of the STk procedure for the geometry
manager, such as <B><A HREF="./pack.n.html">pack</A></B> or <B><A HREF="./place.n.html">place</A></B>.
If the geometry manager is a widget, such as canvases or text, the
name is the widget's class procedure, such as <B><A HREF="./canvas.n.html">canvas</A></B>.
<P>
<DT><A NAME="M24">(<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 procedure <B>(winfo name *root*)</B> will return the name of the application.
<P>
<DT><A NAME="M25">(<B>winfo 'parent </B><I>window</I>)</A><DD>
Returns the path name of <I>window</I>'s parent, or an empty list
if <I>window</I> is the main window of the application.
<P>
<DT><A NAME="M26">(<B>winfo 'pathname </B> <I>id</I>)</A><DD>
<DT><A NAME="M27">(<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="M28">(<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>Tk_GetPixels</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="M29">(<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="M30">(<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="M31">(<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="M32">(<B>winfo 'reqheight </B><I>window</I>)</A><DD>
Returns an integer 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="M33">(<B>winfo 'reqwidth </B><I>window</I>)</A><DD>
Returns an integer 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="M34">(<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="M35">(<B>winfo 'rootx </B><I>window</I>)</A><DD>
Returns an integer 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="M36">(<B>winfo 'rooty </B><I>window</I>)</A><DD>
Returns an integer 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="M37">(<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="M38">(<B>winfo 'screencells </B><I>window</I>)</A><DD>
Returns an integer giving the number of cells in the default
color map for <I>window</I>'s screen.
<P>
<DT><A NAME="M39">(<B>winfo 'screendepth </B><I>window</I>)</A><DD>
Returns an integer giving the depth of the root window
of <I>window</I>'s screen (number of bits per pixel).
<P>
<DT><A NAME="M40">(<B>winfo 'screenheight </B><I>window</I>)</A><DD>
Returns an integer giving the height of <I>window</I>'s screen,
in pixels.
<P>
<DT><A NAME="M41">(<B>winfo 'screenmmheight </B><I>window</I>)</A><DD>
Returns an integer giving the height of <I>window</I>'s screen,
in millimeters.
<P>
<DT><A NAME="M42"><B>winfo screenmmwidth </B><I>window</I></A><DD>
Returns an integer giving the width of <I>window</I>'s screen,
in millimeters.
<P>
<DT><A NAME="M43">(<B>winfo 'screenvisual </B><I>window</I>)</A><DD>
Returns one of the following symbol 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="M44">(<B>winfo 'screenwidth </B><I>window</I>)</A><DD>
Returns an integer giving the width of <I>window</I>'s screen,
in pixels.
<P>
<DT><A NAME="M45">(<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="M46">(<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="M47">(<B>winfo 'viewable </B><I>window</I>)</A><DD>
Returns <B>#t</B> if <I>window</I> and all of its ancestors up through the
nearest toplevel window are mapped. Returns <B>#f</B> if any of these
windows are not mapped.
<P>
<DT><A NAME="M48">(<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="M49">(<B>winfo 'visualid </B><I>window</I>)</A><DD>
Returns the X identifier for the visual for <I>window</I>.
<P>
<DT><A NAME="M50">(<B>winfo 'visualsavailable </B><I>window</I>)</A><DD>
<DT><A NAME="M51">(<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="M52">(<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="M53">(<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="M54">(<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="M55">(<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="M56">(<B>winfo 'width </B><I>window</I>)</A><DD>
Returns an integer 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="./update.n.html">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="M57">(<B>winfo 'x </B><I>window</I>)</A><DD>
Returns an integer 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="M58">(<B>winfo 'y </B><I>window</I>)</A><DD>
Returns an integer 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>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>
+507
View File
@@ -0,0 +1,507 @@
<HTML><HEAD><TITLE>Tk Built-In Commands - wm manual page</TITLE></HEAD>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> wm</H2>
<I>Communicate with window manager</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>wm</B> <I>option window </I>?<I>args</I>?)<BR>
<H3><A NAME="M3">DESCRIPTION</A></H3>
The <B>wm</B> procedure 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>
procedure 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> procedure are:
<P>
<DL>
<DT><A NAME="M4">(<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 procedure returns an
empty list. Otherwise, it returns
a STk 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 list is
returned).
<P>
<DT><A NAME="M5">(<B>wm 'client </B><I>window</I>)</A><DD>
<DT><A NAME="M6">(<B>wm 'client </B><I>window</I> <I>name</I>)</A><DD>
If <I>name</I> is specified, this procedure 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 procedure returns an empty list in this case.
If <I>name</I> isn't specified, the procedure returns the last name
set in a <B>wm client</B> procedure for <I>window</I>.
If <I>name</I> is specified as an empty string, the procedure deletes the
<B>WM_CLIENT_MACHINE</B> property from <I>window</I>.
<P>
<DT><A NAME="M7">(<B>wm 'colormapwindows </B><I>window</I>)</A><DD>
<DT><A NAME="M8">(<B>wm 'colormapwindows </B><I>window</I> <I>windowList</I>)</A><DD>
This procedure 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 procedure 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 procedure overwrites the <B>WM_COLORMAP_WINDOWS</B>
property with the given windows and returns an empty list.
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="M9">(<B>wm 'command </B><I>window</I>)</A><DD>
<DT><A NAME="M10">(<B>wm 'command </B><I>window</I> <I>value</I>)</A><DD>
If <I>value</I> is specified, this procedure 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 list.
<I>Value</I> must have proper list structure; the elements should
contain the words of the procedure used to invoke the application.
If <I>value</I> isn't specified then the procedure returns the last value
set in a <B>wm procedure</B> command for <I>window</I>.
If <I>value</I> is specified as an empty string, the procedure
deletes the <B>WM_COMMAND</B> property from <I>window</I>.
<P>
<DT><A NAME="M11">(<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 procedure will not map the window, but it will ensure
that when the window is first mapped it will be displayed
in de-iconified form. Returns an empty list.
<P>
<DT><A NAME="M12">(<B>wm 'focusmodel </B><I>window</I>)</A><DD>
<DT><A NAME="M13">(<B>wm 'focusmodel </B><I>window</I> '<B>active</B>)</A><DD>
<DT><A NAME="M14">(<B>wm 'focusmodel </B><I>window</I> '<B>passive</B>)</A><DD>
If <B>active</B> or <B>passive</B> is supplied as an optional argument
to the procedure, then it specifies the focus model for <I>window</I>.
In this case the procedure returns an empty list. If no additional
argument is supplied, then the procedure 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="./focus.n.html">focus</A></B> procedure
assumes a passive model of focussing.
<P>
<DT><A NAME="M15">(<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 procedure returns the X 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 procedure returns the
X window identifier for <I>window</I>.
<P>
<DT><A NAME="M16">(<B>wm 'geometry </B><I>window</I>)</A><DD>
<DT><A NAME="M17">(<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 list 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> procedure). <I>NewGeometry</I> has
the form &quot;<B>=</B><I>width</I><B>x</B><I>height</I><B>&#177;</B><I>x</I><B>&#177;</B><I>y</I>&quot;, 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="M18">(<B>wm 'grid </B><I>window</I>)</A><DD>
<DT><A NAME="M19">(<B>wm 'grid </B><I>window</I> <I>baseWidth baseHeight widthInc heightInc</I>)</A><DD>
This procedure 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>Tk_GeometryRequest</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 list.
Otherwise the return value is a STk 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 <B>#f</B>
is returned.
Note: this procedure should not be needed very often, since the
<B>Tk_SetGrid</B> library procedure and the <B>setGrid</B> option
provide easier access to the same functionality.
<P>
<DT><A NAME="M20">(<B>wm 'group </B><I>window</I>)</A><DD>
<DT><A NAME="M21">(<B>wm 'group </B><I>window</I> <I>widget-name</I>)</A><DD>
If <I>widget-name</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 <B>#f</B> to
remove <I>window</I> from any group association. If <I>widget-name</I> is
specified then the procedure returns an empty list; otherwise it
returns the path name of <I>window</I>'s current group leader, or <B>#f</B>
if <I>window</I> isn't part of any group.
<P>
<DT><A NAME="M22">(<B>wm 'iconbitmap </B><I>window</I>)</A><DD>
<DT><A NAME="M23">(<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>Tk_GetBitmap</B> manual entry for details).
This bitmap is passed to the window manager to be displayed in
<I>window</I>'s icon, and the procedure returns an empty list. If
<B>#f</B> 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 procedure returns an empty list.
Otherwise it returns the name of
the current icon bitmap associated with <I>window</I>, or <B>#f</B>
string if <I>window</I> has no icon bitmap.
<P>
<DT><A NAME="M24">(<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 procedure will arrange for
it to appear in the iconified state when it is eventually mapped.
<P>
<DT><A NAME="M25">(<B>wm 'iconmask </B><I>window</I>)</A><DD>
<DT><A NAME="M26">(<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>Tk_GetBitmap</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
<B>#f</B> 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 procedure returns an empty string. Otherwise it
returns the name of the current icon mask associated with
<I>window</I>, or <B>#f</B> if no mask is in effect.
<P>
<DT><A NAME="M27">(<B>wm 'iconname </B><I>window</I>)</A><DD>
<DT><A NAME="M28">(<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
list is returned as result. If <I>newName</I> isn't specified
then the procedure 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> procedure).
<P>
<DT><A NAME="M29">(<B>wm 'iconposition </B><I>window</I>)</A><DD>
<DT><A NAME="M30">(<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 list is returned. If <I>x</I> and <I>y</I> are
specified as <B>#f</B> then any existing icon position hint is cancelled.
If neither <I>x</I> nor <I>y</I> is specified, then the procedure returns
a list containing two values, which are the current icon position
hints (if no hints are in effect then <B>#f</B> list is returned).
<P>
<DT><A NAME="M31">(<B>wm 'iconwindow </B><I>window</I>)</A><DD>
<DT><A NAME="M32">(<B>wm 'iconwindow </B><I>window</I> <I>widget-name</I>)</A><DD>
If <I>widget-name</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>widget-name</I> will be mapped to serve as icon, and when <I>window</I>
is de-iconified then <I>widget-name</I> will be unmapped again. If
<I>widget-name</I> is specified as <B>#f</B> then any existing
icon window association for <I>window</I> will be cancelled. If
the <I>widget-name</I> argument is specified then an empty list is
returned. Otherwise the procedure returns the path name of the
current icon window for <I>window</I>, or <B>#f</B> 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="M33">(<B>wm 'maxsize </B><I>window</I>)</A><DD>
<DT><A NAME="M34">(<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 procedure returns an empty string. Otherwise
it returns a 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> procedure,
then this procedure has no effect.
See the sections on geometry management below for more information.
<P>
<DT><A NAME="M35">(<B>wm 'minsize </B><I>window</I>)</A><DD>
<DT><A NAME="M36">(<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 procedure returns an empty string. Otherwise
it returns a 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> procedure,
then this procedure has no effect.
See the sections on geometry management below for more information.
<P>
<DT><A NAME="M37">(<B>wm 'overrideredirect </B><I>window</I>)</A><DD>
<DT><A NAME="M38">(<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>#t</B> or <B>#f</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="M39">(<B>wm 'positionfrom </B><I>window</I>)</A><DD>
<DT><A NAME="M40">(<B>wm 'positionfrom </B><I>window</I> <I>who</I>)</A><DD>
If <I>who</I> is specified, it must be <B>program</B>,
<B>user</B> (or an abbreviation of one of these two), or <B>#f</B>.
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 <B>#f</B>, then the current position
source is cancelled.
If <I>who</I> is specified, then the procedure returns an empty list.
Otherwise it returns <B>user</B> or <B>window</B> to indicate the
source of the window's current position, or <B>#F</B> 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> procedure is invoked, unless the source has
been set explicitly to <B>program</B>.
<P>
<DT><A NAME="M41">(<B>wm 'protocol </B><I>window</I> ?<I>name</I>? ?<I>procedure</I>?)</A><DD>
This procedure 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>procedure</I> are specified, then <I>procedure</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>procedure</I> will
be invoked in the future whenever the window manager sends a
message to the client for that protocol.
In this case the procedure returns an empty list.
If <I>name</I> is specified but <I>procedure</I> isn't, then the current
procedure for <I>name</I> is returned, or an empty list if there
is no handler defined for <I>name</I>.
If <I>procedure</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>procedure</I> is specified, the
procedure returns a list of all the protocols for which handlers
are currently defined for <I>window</I>.
<P>
<UL>
<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.
</UL>
<DT><A NAME="M42">(<B>wm 'resizable </B><I>window</I>)</A><DD>
<DT><A NAME="M43">(<B>wm 'resizable </B><I>window</I> <I>width height</I>)</A><DD>
This procedure 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 procedure returns an empty string.
If <I>width</I> and <I>height</I> are omitted then the procedure
returns a list with two boolean 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>
procedure. If there has been no such operation then
the window's natural size will be used.
<P>
<DT><A NAME="M44">(<B>wm 'sizefrom </B><I>window</I>)</A><DD>
<DT><A NAME="M45">(<B>wm 'sizefrom </B><I>window</I> <I>who</I>)</A><DD>
If <I>who</I> is specified, it must be <B>program</B>
<B>user</B> (or an abbreviation of one of these two) or <B>#f</B> . 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 <B>#f</B>, then the current size
source is cancelled.
If <I>who</I> is specified, then the procedure 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 <B>#f</B> if
no source has been specified yet. Most window managers interpret
``no source'' as equivalent to <B>program</B>.
<P>
<DT><A NAME="M46">(<B>wm 'state </B><I>window</I>)</A><DD>
Returns the current state of <I>window</I>: either &quot;<B>normal</B>&quot;,
&quot;<B>iconic</B>&quot;, or &quot;<B>withdrawn</B>&quot;.
<P>
<DT><A NAME="M47">(<B>wm 'title </B><I>window</I>)</A><DD>
<DT><A NAME="M48">(<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 procedure returns an empty list. If <I>string</I> isn't
specified then the procedure returns the current title for the
<I>window</I>. The title for a window defaults to its name.
<P>
<DT><A NAME="M49">(<B>wm 'transient </B><I>window</I>)</A><DD>
<DT><A NAME="M50">(<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 <B>#f</B> then <I>window</I> is marked as not
being a transient window any more. If <I>master</I> is specified,
then the procedure returns an empty list. Otherwise the procedure
returns the path name of <I>window</I>'s current master, or
<B>#f</B> if <I>window</I> isn't currently a transient window.
<P>
<DT><A NAME="M51">(<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 procedure
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="M52">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> procedure.
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> procedures
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> procedure.
You can also use the procedure <B>wm resizable</B> to completely
disable interactive resizing in one or both dimensions.
<H3><A NAME="M53">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> procedure 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> procedure or by calling <B>Tk_SetGrid</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> procedures
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="M54">BUGS</A></H3>
Most existing window managers appear to have bugs that affect the
operation of the <B>wm</B> procedure. 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.
<H3><A NAME="M55">SEE ALSO</A></H3>
<B><A HREF="./toplevel.n.html">toplevel</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>