Compare commits

..

2 Commits

Author SHA1 Message Date
Zachary Ware
27e7dfc7da Import Tk 8.5.15 (as of svn r89086) 2017-09-04 14:25:47 -05:00
Zachary Ware
4b29e0458f Update README.md 2017-05-22 12:17:48 -07:00
726 changed files with 89452 additions and 153417 deletions

9745
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -5218,7 +5218,7 @@
2000-05-31 Eric Melski <ericm@scriptics.com> 2000-05-31 Eric Melski <ericm@scriptics.com>
* library/bgerror.tcl: Improved bgerror based on work by Donal * library/bgerror.tcl: Improved bgerror based on work by Donal
K. Fellows; no longer dependent on tk_dialog; features a K. Fellows; no longer dependant on tk_dialog; features a
Windows-esque "Details" button, and a customizable extra function Windows-esque "Details" button, and a customizable extra function
button that allows the user to (for example) save the stack trace button that allows the user to (for example) save the stack trace
to a file. to a file.

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +1,41 @@
# README: Tk README: Tk
This is the Tk 8.5.15 source distribution.
http://sourceforge.net/projects/tcl/files/Tcl/
You can get any source release of Tk from the URL above.
This is the **Tk 8.6.10** source distribution. 1. Introduction
---------------
You can get any source release of Tk from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
## <a id="intro">1.</a> Introduction
This directory contains the sources and documentation for Tk, a This directory contains the sources and documentation for Tk, a
cross-platform GUI toolkit implemented with the Tcl scripting language. cross-platform GUI toolkit implemented with the Tcl scripting language.
For details on features, incompatibilities, and potential problems with For details on features, incompatibilities, and potential problems with
this release, see [the Tcl/Tk 8.6 Web page](https://www.tcl.tk/software/tcltk/8.6.html) this release, see the Tcl/Tk 8.5 Web page at
http://www.tcl.tk/software/tcltk/8.5.html
or refer to the "changes" file in this directory, which contains a or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk. historical record of all changes to Tk.
Tk is maintained, enhanced, and distributed freely by the Tcl community. Tk is maintained, enhanced, and distributed freely by the Tcl community.
Source code development and tracking of bug reports and feature requests Source code development and tracking of bug reports and feature requests
takes place at [core.tcl-lang.org](https://core.tcl-lang.org/). takes place at:
Tcl/Tk release and mailing list services are [hosted by
SourceForge](https://sourceforge.net/projects/tcl/) http://core.tcl.tk/tk/
with the Tcl Developer Xchange hosted at
[www.tcl-lang.org](https://www.tcl-lang.org). with the Tcl Developer Xchange at:
http://www.tcl.tk/
Tk is a freely available open source package. You can do virtually Tk is a freely available open source package. You can do virtually
anything you like with it, such as modifying it, redistributing it, anything you like with it, such as modifying it, redistributing it,
and selling it either in whole or in part. See the file and selling it either in whole or in part. See the file
`license.terms` for complete information. "license.terms" for complete information.
## <a id="tcl">2.</a> See Tcl README.md 2. See Tcl README
-----------------
Please see the README.md file that comes with the associated Tcl release Please see the README file that comes with the associated Tcl release
for more information. There are pointers there to extensive for more information. There are pointers there to extensive
documentation. In addition, there are additional README files documentation. In addition, there are additional README files
in the subdirectories of this distribution. in the subdirectories of this distribution.

933
changes

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,7 @@
This software is copyrighted by the Regents of the University of This software is copyrighted by the Regents of the University of
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState California, Sun Microsystems, Inc., and other parties. The following
Corporation, Apple Inc. and other parties. The following terms apply to terms apply to all files associated with the software unless explicitly
all files associated with the software unless explicitly disclaimed in disclaimed in individual files.
individual files.
The authors hereby grant permission to use, copy, modify, distribute, The authors hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided and license this software and its documentation for any purpose, provided

22
compat/limits.h Normal file
View File

@@ -0,0 +1,22 @@
/*
* limits.h --
*
* This is a dummy header file to #include in Tcl when there
* is no limits.h in /usr/include. There are only a few
* definitions here; also see tclPort.h, which already
* #defines some of the things here if they're not arleady
* defined.
*
* Copyright (c) 1991 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#define LONG_MIN 0x80000000
#define LONG_MAX 0x7fffffff
#define INT_MIN 0x80000000
#define INT_MAX 0x7fffffff
#define SHRT_MIN 0x8000
#define SHRT_MAX 0x7fff

View File

@@ -29,6 +29,7 @@ extern char * malloc(unsigned int numBytes);
extern void qsort(void *base, int n, int size, int (*compar)( extern void qsort(void *base, int n, int size, int (*compar)(
const void *element1, const void *element2)); const void *element1, const void *element2));
extern char * realloc(char *ptr, unsigned int numBytes); extern char * realloc(char *ptr, unsigned int numBytes);
extern double strtod(const char *string, char **endPtr);
extern long strtol(const char *string, char **endPtr, int base); extern long strtol(const char *string, char **endPtr, int base);
extern unsigned long strtoul(const char *string, char **endPtr, int base); extern unsigned long strtoul(const char *string, char **endPtr, int base);

View File

@@ -20,7 +20,7 @@
#define NULL 0 #define NULL 0
#endif #endif
/* /*
* Strict POSIX stuff goes here. Extensions go down below, in the ifndef * Strict POSIX stuff goes here. Extensions go down below, in the ifndef
* _POSIX_SOURCE section. * _POSIX_SOURCE section.
*/ */

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_Alloc3DBorderFromObj, Tk_Get3DBorder, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance Tk_Alloc3DBorderFromObj, Tk_Get3DBorder, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance
@@ -64,12 +64,12 @@ Interpreter to use for error reporting.
Token for window (for all procedures except \fBTk_Get3DBorder\fR, Token for window (for all procedures except \fBTk_Get3DBorder\fR,
must be the window for which the border was allocated). must be the window for which the border was allocated).
.AP Tcl_Obj *objPtr in .AP Tcl_Obj *objPtr in
Pointer to value whose value describes color corresponding to Pointer to object whose value describes color corresponding to
background (flat areas). Illuminated edges will be brighter than background (flat areas). Illuminated edges will be brighter than
this and shadowed edges will be darker than this. this and shadowed edges will be darker than this.
.AP char *colorName in .AP char *colorName in
Same as \fIobjPtr\fR except value is supplied as a string rather Same as \fIobjPtr\fR except value is supplied as a string rather
than a value. than an object.
.AP Drawable drawable in .AP Drawable drawable in
X token for window or pixmap; indicates where graphics are to be drawn. X token for window or pixmap; indicates where graphics are to be drawn.
Must either be the X window for \fItkwin\fR or a pixmap with the Must either be the X window for \fItkwin\fR or a pixmap with the
@@ -91,7 +91,7 @@ Width of border in pixels. Positive means border is inside rectangle
given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means
border is outside rectangle. border is outside rectangle.
.AP int relief in .AP int relief in
Indicates 3-D position of interior of value relative to exterior; Indicates 3-D position of interior of object relative to exterior;
should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR, should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR,
\fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR (may also be \fBTK_RELIEF_FLAT\fR \fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR (may also be \fBTK_RELIEF_FLAT\fR
for \fBTk_Fill3DRectangle\fR). for \fBTk_Fill3DRectangle\fR).
@@ -114,7 +114,7 @@ should appear higher;
For \fBTk_Fill3DPolygon\fR, \fBTK_RELIEF_FLAT\fR may also be specified to For \fBTk_Fill3DPolygon\fR, \fBTK_RELIEF_FLAT\fR may also be specified to
indicate no difference in height. indicate no difference in height.
.AP int leftBevel in .AP int leftBevel in
Non-zero means this bevel forms the left side of the value; zero means Non-zero means this bevel forms the left side of the object; zero means
it forms the right side. it forms the right side.
.AP int leftIn in .AP int leftIn in
Non-zero means that the left edge of the horizontal bevel angles in, Non-zero means that the left edge of the horizontal bevel angles in,
@@ -128,12 +128,13 @@ so that the bottom of the edge is farther to the left than the top.
Zero means the edge angles out, so that the bottom is farther to the Zero means the edge angles out, so that the bottom is farther to the
right than the top. right than the top.
.AP int topBevel in .AP int topBevel in
Non-zero means this bevel forms the top side of the value; zero means Non-zero means this bevel forms the top side of the object; zero means
it forms the bottom side. it forms the bottom side.
.AP int which in .AP int which in
Specifies which of the border's graphics contexts is desired. Specifies which of the border's graphics contexts is desired.
Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR. Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures provide facilities for drawing window borders in a These procedures provide facilities for drawing window borders in a
@@ -152,15 +153,14 @@ darker than \fIobjPtr\fR.
\fBTk_Alloc3DBorderFromObj\fR returns a token that may be used in later calls \fBTk_Alloc3DBorderFromObj\fR returns a token that may be used in later calls
to \fBTk_Draw3DRectangle\fR. If an error occurs in allocating information to \fBTk_Draw3DRectangle\fR. If an error occurs in allocating information
for the border (e.g. a bogus color name was given) for the border (e.g. a bogus color name was given)
then NULL is returned and an error message is left as the result of then NULL is returned and an error message is left in \fIinterp->result\fR.
interpreter \fIinterp\fR.
If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches
information about the return value in \fIobjPtr\fR, which speeds up information about the return value in \fIobjPtr\fR, which speeds up
future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR. and \fItkwin\fR.
.PP .PP
\fBTk_Get3DBorder\fR is identical to \fBTk_Alloc3DBorderFromObj\fR except \fBTk_Get3DBorder\fR is identical to \fBTk_Alloc3DBorderFromObj\fR except
that the color is specified with a string instead of a value. This that the color is specified with a string instead of an object. This
prevents \fBTk_Get3DBorder\fR from caching the return value, so prevents \fBTk_Get3DBorder\fR from caching the return value, so
\fBTk_Get3DBorder\fR is less efficient than \fBTk_Alloc3DBorderFromObj\fR. \fBTk_Get3DBorder\fR is less efficient than \fBTk_Alloc3DBorderFromObj\fR.
.PP .PP
@@ -238,8 +238,8 @@ arguments that describe the rectangular area of the beveled edge
The \fIleftBorder\fR and \fItopBorder\fR arguments indicate the The \fIleftBorder\fR and \fItopBorder\fR arguments indicate the
position of the border relative to the position of the border relative to the
.QW inside .QW inside
of the value, and of the object, and
\fIrelief\fR indicates the relief of the inside of the value relative \fIrelief\fR indicates the relief of the inside of the object relative
to the outside. to the outside.
\fBTk_3DVerticalBevel\fR just draws a rectangular region. \fBTk_3DVerticalBevel\fR just draws a rectangular region.
\fBTk_3DHorizontalBevel\fR draws a trapezoidal region to generate \fBTk_3DHorizontalBevel\fR draws a trapezoidal region to generate
@@ -290,5 +290,6 @@ with the Tk_3DBorder token for the border.
There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or
\fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR \fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR
or \fBTk_Get3DBorder\fR. or \fBTk_Get3DBorder\fR.
.SH KEYWORDS .SH KEYWORDS
3D, background, border, color, depressed, illumination, value, polygon, raised, shadow, three-dimensional effect 3D, background, border, color, depressed, illumination, object, polygon, raised, shadow, three-dimensional effect

View File

@@ -2,8 +2,8 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved. '\" All rights reserved.
'\" '\"
.TH Tk_AddOption 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_AddOption 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_AddOption \- Add an option to the option database Tk_AddOption \- Add an option to the option database
@@ -23,6 +23,7 @@ Value of option.
.AP int priority in .AP int priority in
Overall priority level to use for option. Overall priority level to use for option.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This procedure is invoked to add an option to the database This procedure is invoked to add an option to the database
@@ -46,5 +47,6 @@ user-specific startup files.
.IP 80 .IP 80
Used for options specified interactively after the application starts Used for options specified interactively after the application starts
running. running.
.SH KEYWORDS .SH KEYWORDS
class, name, option, add class, name, option, add

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings, Tk_BindEvent \- invoke scripts in response to X events Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings, Tk_BindEvent \- invoke scripts in response to X events
@@ -45,7 +45,7 @@ call to \fBTk_CreateBindingTable\fR.
Identifies object with which binding is associated. Identifies object with which binding is associated.
.AP "const char" *eventString in .AP "const char" *eventString in
String describing event sequence. String describing event sequence.
.AP "const char" *script in .AP char *script in
Tcl script to invoke when binding triggers. Tcl script to invoke when binding triggers.
.AP int append in .AP int append in
Non-zero means append \fIscript\fR to existing script for binding, Non-zero means append \fIscript\fR to existing script for binding,
@@ -61,6 +61,7 @@ Number of object identifiers pointed to by \fIobjectPtr\fR.
Points to an array of object identifiers: bindings will be considered Points to an array of object identifiers: bindings will be considered
for each of these objects in order from first to last. for each of these objects in order from first to last.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures provide a general-purpose mechanism for creating These procedures provide a general-purpose mechanism for creating
@@ -111,25 +112,25 @@ select relevant events, or to disallow the use of certain events
in bindings. in bindings.
If an error occurred while creating the binding (e.g., \fIeventString\fR If an error occurred while creating the binding (e.g., \fIeventString\fR
refers to a non-existent event), then 0 is returned and an error refers to a non-existent event), then 0 is returned and an error
message is left as the result of interpreter \fIinterp\fR. message is left in \fIinterp->result\fR.
.PP .PP
\fBTk_DeleteBinding\fR removes from \fIbindingTable\fR the \fBTk_DeleteBinding\fR removes from \fIbindingTable\fR the
binding given by \fIobject\fR and \fIeventString\fR, if binding given by \fIobject\fR and \fIeventString\fR, if
such a binding exists. such a binding exists.
\fBTk_DeleteBinding\fR always returns \fBTCL_OK\fR. \fBTk_DeleteBinding\fR always returns \fBTCL_OK\fR.
In some cases it may reset the interpreter result to the default In some cases it may reset \fIinterp->result\fR to the default
empty value. empty value.
.PP .PP
\fBTk_GetBinding\fR returns a pointer to the script associated \fBTk_GetBinding\fR returns a pointer to the script associated
with \fIeventString\fR and \fIobject\fR in \fIbindingTable\fR. with \fIeventString\fR and \fIobject\fR in \fIbindingTable\fR.
If no such binding exists then NULL is returned and an error If no such binding exists then NULL is returned and an error
message is left as the result of interpreter \fIinterp\fR. message is left in \fIinterp->result\fR.
.PP .PP
\fBTk_GetAllBindings\fR returns in \fIinterp\fR's result a list \fBTk_GetAllBindings\fR returns in \fIinterp->result\fR a list
of all the event strings for which there are bindings in of all the event strings for which there are bindings in
\fIbindingTable\fR associated with \fIobject\fR. \fIbindingTable\fR associated with \fIobject\fR.
If there are no bindings for \fIobject\fR, the result will be an empty If there are no bindings for \fIobject\fR then an empty
string. string is returned in \fIinterp->result\fR.
.PP .PP
\fBTk_DeleteAllBindings\fR deletes all of the bindings in \fBTk_DeleteAllBindings\fR deletes all of the bindings in
\fIbindingTable\fR that are associated with \fIobject\fR. \fIbindingTable\fR that are associated with \fIobject\fR.
@@ -149,5 +150,6 @@ the object is skipped.
\fBTk_BindEvent\fR continues through all of the objects, handling \fBTk_BindEvent\fR continues through all of the objects, handling
exceptions such as errors, \fBbreak\fR, and \fBcontinue\fR as exceptions such as errors, \fBbreak\fR, and \fBcontinue\fR as
described in the documentation for \fBbind\fR. described in the documentation for \fBbind\fR.
.SH KEYWORDS .SH KEYWORDS
binding, event, object, script binding, event, object, script

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases
@@ -61,6 +61,7 @@ and so on.
.AP int numPoints in .AP int numPoints in
Number of points at \fIcoordPtr\fR. Number of points at \fIcoordPtr\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures are called by canvas type managers to carry out These procedures are called by canvas type managers to carry out
@@ -82,40 +83,38 @@ transformation.
of a bitmap. of a bitmap.
The Postscript is generated in proper image data format for Postscript, The Postscript is generated in proper image data format for Postscript,
i.e., as data between angle brackets, one bit per pixel. i.e., as data between angle brackets, one bit per pixel.
The Postscript is appended to the result of interpreter \fIinterp\fR The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned
and \fBTCL_OK\fR is returned unless an error occurs, in which case unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
\fBTCL_ERROR\fR is returned and the interpreter result is overwritten \fIinterp->result\fR is overwritten with an error message.
with an error message.
.PP .PP
\fBTk_CanvasPsColor\fR generates Postscript to set the current color \fBTk_CanvasPsColor\fR generates Postscript to set the current color
to correspond to its \fIcolorPtr\fR argument, taking into account any to correspond to its \fIcolorPtr\fR argument, taking into account any
color map specified in the \fBpostscript\fR command. color map specified in the \fBpostscript\fR command.
It appends the Postscript to the interpreter \fIinterp\fR's result and returns It appends the Postscript to \fIinterp->result\fR and returns
\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is \fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
returned and the interpreter's result is overwritten with an error message. \fIinterp->result\fR is overwritten with an error message.
.PP .PP
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font \fBTk_CanvasPsFont\fR generates Postscript that sets the current font
to match \fItkFont\fR as closely as possible. to match \fItkFont\fR as closely as possible.
\fBTk_CanvasPsFont\fR takes into account any font map specified \fBTk_CanvasPsFont\fR takes into account any font map specified
in the \fBpostscript\fR command, and it does in the \fBpostscript\fR command, and it does
the best it can at mapping X fonts to Postscript fonts. the best it can at mapping X fonts to Postscript fonts.
It appends the Postscript to interpreter \fIinterp\fR's result and It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR
returns \fBTCL_OK\fR unless an error occurs, in which case unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
\fBTCL_ERROR\fR is returned and the interpreter's result is \fIinterp->result\fR is overwritten with an error message.
overwritten with an error message.
.PP .PP
\fBTk_CanvasPsPath\fR generates Postscript to set the current path \fBTk_CanvasPsPath\fR generates Postscript to set the current path
to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR. to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR.
It appends the resulting Postscript to the result of interpreter \fIinterp\fR. It appends the resulting Postscript to \fIinterp->result\fR.
.PP .PP
\fBTk_CanvasPsStipple\fR generates Postscript that will fill the \fBTk_CanvasPsStipple\fR generates Postscript that will fill the
current path in stippled fashion. current path in stippled fashion.
It uses \fIbitmap\fR as the stipple pattern and the current Postscript It uses \fIbitmap\fR as the stipple pattern and the current Postscript
color; ones in the stipple bitmap are drawn in the current color, and color; ones in the stipple bitmap are drawn in the current color, and
zeroes are not drawn at all. zeroes are not drawn at all.
The Postscript is appended to interpreter \fIinterp\fR's result and The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is
\fBTCL_OK\fR is returned, unless an error occurs, in which case returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
\fBTCL_ERROR\fR is returned and the interpreter's result is \fIinterp->result\fR is overwritten with an error message.
overwritten with an error message.
.SH KEYWORDS .SH KEYWORDS
bitmap, canvas, color, font, path, Postscript, stipple bitmap, canvas, color, font, path, Postscript, stipple

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CanvasTkwin, Tk_CanvasGetCoord, Tk_CanvasDrawableCoords, Tk_CanvasSetStippleOrigin, Tk_CanvasWindowCoords, Tk_CanvasEventuallyRedraw, Tk_CanvasTagsOption \- utility procedures for canvas type managers Tk_CanvasTkwin, Tk_CanvasGetCoord, Tk_CanvasDrawableCoords, Tk_CanvasSetStippleOrigin, Tk_CanvasWindowCoords, Tk_CanvasEventuallyRedraw, Tk_CanvasTagsOption \- utility procedures for canvas type managers
@@ -71,6 +71,7 @@ the left of this coordinate need to be redisplayed.
Bottom edge of the region that needs redisplay. Only pixels above Bottom edge of the region that needs redisplay. Only pixels above
this coordinate need to be redisplayed. this coordinate need to be redisplayed.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures are called by canvas type managers to perform various These procedures are called by canvas type managers to perform various
@@ -85,7 +86,7 @@ canvas coordinate.
If \fIstring\fR is a valid coordinate description then \fBTk_CanvasGetCoord\fR If \fIstring\fR is a valid coordinate description then \fBTk_CanvasGetCoord\fR
stores the corresponding canvas coordinate at *\fIdoublePtr\fR stores the corresponding canvas coordinate at *\fIdoublePtr\fR
and returns \fBTCL_OK\fR. and returns \fBTCL_OK\fR.
Otherwise it stores an error message in the interpreter result and Otherwise it stores an error message in \fIinterp->result\fR and
returns \fBTCL_ERROR\fR. returns \fBTCL_ERROR\fR.
.PP .PP
\fBTk_CanvasDrawableCoords\fR is called by type managers during \fBTk_CanvasDrawableCoords\fR is called by type managers during
@@ -141,18 +142,18 @@ The code of a canvas type manager will not call these procedures
directly, but will use their addresses to create a \fBTk_CustomOption\fR directly, but will use their addresses to create a \fBTk_CustomOption\fR
structure for the \fB\-tags\fR option. The code typically looks structure for the \fB\-tags\fR option. The code typically looks
like this: like this:
.PP
.CS .CS
static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc, static Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
Tk_CanvasTagsPrintProc, NULL Tk_CanvasTagsPrintProc, (ClientData) NULL
}; };
static const Tk_ConfigSpec configSpecs[] = { static Tk_ConfigSpec configSpecs[] = {
... ...
{TK_CONFIG_CUSTOM, "\-tags", NULL, NULL, {TK_CONFIG_CUSTOM, "\-tags", (char *) NULL, (char *) NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
... ...
}; };
.CE .CE
.SH KEYWORDS .SH KEYWORDS
canvas, focus, item type, redisplay, selection, type manager canvas, focus, item type, redisplay, selection, type manager

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CanvasTextInfo \- additional information for managing text items in canvases Tk_CanvasTextInfo \- additional information for managing text items in canvases
@@ -20,6 +20,7 @@ Tk_CanvasTextInfo *
.AP Tk_Canvas canvas in .AP Tk_Canvas canvas in
A token that identifies a particular canvas widget. A token that identifies a particular canvas widget.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
Textual canvas items are somewhat more complicated to manage than Textual canvas items are somewhat more complicated to manage than
@@ -46,7 +47,7 @@ typedef struct Tk_CanvasTextInfo {
Tk_Item *\fIfocusItemPtr\fR; Tk_Item *\fIfocusItemPtr\fR;
int \fIgotFocus\fR; int \fIgotFocus\fR;
int \fIcursorOn\fR; int \fIcursorOn\fR;
} \fBTk_CanvasTextInfo\fR; } Tk_CanvasTextInfo;
.CE .CE
The \fBselBorder\fR field identifies a Tk_3DBorder that should be The \fBselBorder\fR field identifies a Tk_3DBorder that should be
used for drawing the background under selected text. used for drawing the background under selected text.
@@ -96,5 +97,6 @@ anchor, as determined by \fIselItemPtr\fR or \fIanchorItemPtr\fR).
If all of the selected text in the item is deleted, the item should If all of the selected text in the item is deleted, the item should
set \fIselItemPtr\fR to NULL to indicate that there is no longer a set \fIselItemPtr\fR to NULL to indicate that there is no longer a
selection. selection.
.SH KEYWORDS .SH KEYWORDS
canvas, focus, insertion cursor, selection, selection anchor, text canvas, focus, insertion cursor, selection, selection anchor, text

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard
@@ -31,9 +31,10 @@ Conversion type for this clipboard item; has same meaning as
.AP Atom format in .AP Atom format in
Representation to use when data is retrieved; has same meaning as Representation to use when data is retrieved; has same meaning as
\fIformat\fR argument to \fBTk_CreateSelHandler\fR. \fIformat\fR argument to \fBTk_CreateSelHandler\fR.
.AP "const char" *buffer in .AP char *buffer in
Null terminated string containing the data to be appended to the clipboard. Null terminated string containing the data to be appended to the clipboard.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These two procedures manage the clipboard for Tk. These two procedures manage the clipboard for Tk.
@@ -42,10 +43,9 @@ once, then calling \fBTk_ClipboardAppend\fR to add data for any
number of targets. number of targets.
.PP .PP
\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any \fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any
data items previously stored on the clipboard in this application. data items previously stored on the clipboard in this application.
It normally returns \fBTCL_OK\fR, but if an error occurs it returns It normally returns \fBTCL_OK\fR, but if an error occurs it returns
\fBTCL_ERROR\fR and leaves an error message in interpreter \fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR.
\fIinterp\fR's result.
\fBTk_ClipboardClear\fR must be called before a sequence of \fBTk_ClipboardClear\fR must be called before a sequence of
\fBTk_ClipboardAppend\fR calls can be issued. \fBTk_ClipboardAppend\fR calls can be issued.
.PP .PP
@@ -60,8 +60,8 @@ currently owned by the application, either
because \fBTk_ClipboardClear\fR has not been called or because because \fBTk_ClipboardClear\fR has not been called or because
ownership of the clipboard has changed since the last call to ownership of the clipboard has changed since the last call to
\fBTk_ClipboardClear\fR, \fBTk_ClipboardClear\fR,
\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error \fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in
message in the result of interpreter \fIinterp\fR. \fIinterp->result\fR.
.PP .PP
In order to guarantee atomicity, no event handling should occur In order to guarantee atomicity, no event handling should occur
between \fBTk_ClipboardClear\fR and the following between \fBTk_ClipboardClear\fR and the following
@@ -71,7 +71,8 @@ this application).
.PP .PP
\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary \fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary
Tcl scripts, as a result of losing the CLIPBOARD selection, so Tcl scripts, as a result of losing the CLIPBOARD selection, so
any calling function should take care to be re-entrant at the point any calling function should take care to be reentrant at the point
\fBTk_ClipboardClear\fR is invoked. \fBTk_ClipboardClear\fR is invoked.
.SH KEYWORDS .SH KEYWORDS
append, clipboard, clear, format, type append, clipboard, clear, format, type

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ClearSelection \- Deselect a selection Tk_ClearSelection \- Deselect a selection
@@ -23,9 +23,10 @@ window.
.AP Atom selection in .AP Atom selection in
The name of selection to be cleared. The name of selection to be cleared.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_ClearSelection\fR cancels the selection specified by the atom \fBTk_ClearSelection\fR cancels the selection specified by the atom
\fIselection\fR for the display containing \fItkwin\fR. \fIselection\fR for the display containing \fItkwin\fR.
The selection need not be in \fItkwin\fR itself or even in The selection need not be in \fItkwin\fR itself or even in
\fItkwin\fR's application. \fItkwin\fR's application.
@@ -34,5 +35,6 @@ owns \fIselection\fR, the window will be notified and the
selection will be cleared. selection will be cleared.
If there is no owner for \fIselection\fR on the display, then the If there is no owner for \fIselection\fR on the display, then the
procedure has no effect. procedure has no effect.
.SH KEYWORDS .SH KEYWORDS
clear, selection clear, selection

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- process configuration options for widgets Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- process configuration options for widgets
@@ -25,12 +25,12 @@ int
.sp .sp
\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR \fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS char *widgRec in/out .AS Tk_ConfigSpec *widgRec in/out
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for returning error messages. Interpreter to use for returning error messages.
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Window used to represent widget (needed to set up X resources). Window used to represent widget (needed to set up X resources).
.AP "const Tk_ConfigSpec" *specs in .AP Tk_ConfigSpec *specs in
Pointer to table specifying legal configuration options for this Pointer to table specifying legal configuration options for this
widget. widget.
.AP int argc in .AP int argc in
@@ -61,7 +61,7 @@ Display containing widget whose record is being freed; needed in
order to free up resources. order to free up resources.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
Note: \fBTk_ConfigureWidget\fR should be replaced with the new Note: \fBTk_ConfigureWidget\fR should be replaced with the new
\fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is \fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is
retained for backward compatibility. retained for backward compatibility.
@@ -89,7 +89,7 @@ to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
case it does not modify \fIinterp\fR. case it does not modify \fIinterp\fR.
If an error If an error
occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will
leave an error message in interpreter \fIinterp\fR's result in the standard Tcl leave an error message in \fIinterp->result\fR in the standard Tcl
fashion. fashion.
In the event of an error return, some of the fields of \fIwidgRec\fR In the event of an error return, some of the fields of \fIwidgRec\fR
could already have been set, if configuration information for them could already have been set, if configuration information for them
@@ -103,14 +103,14 @@ option and has the following structure:
.CS .CS
typedef struct { typedef struct {
int \fItype\fR; int \fItype\fR;
const char *\fIargvName\fR; char *\fIargvName\fR;
const char *\fIdbName\fR; char *\fIdbName\fR;
const char *\fIdbClass\fR; char *\fIdbClass\fR;
const char *\fIdefValue\fR; char *\fIdefValue\fR;
int \fIoffset\fR; int \fIoffset\fR;
int \fIspecFlags\fR; int \fIspecFlags\fR;
const Tk_CustomOption *\fIcustomPtr\fR; Tk_CustomOption *\fIcustomPtr\fR;
} \fBTk_ConfigSpec\fR; } Tk_ConfigSpec;
.CE .CE
The \fItype\fR field indicates what type of configuration option this is The \fItype\fR field indicates what type of configuration option this is
(e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for (e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for
@@ -174,7 +174,7 @@ legal values for \fItype\fR, and the corresponding actions, are:
\fBTK_CONFIG_ACTIVE_CURSOR\fR \fBTK_CONFIG_ACTIVE_CURSOR\fR
The value The value
must be an ASCII string identifying a cursor in a form must be an ASCII string identifying a cursor in a form
suitable for passing to \fBTk_GetCursor\fR. suitable for passing to \fBTk_GetCursor\fR.
The value is converted to a \fBTk_Cursor\fR by calling The value is converted to a \fBTk_Cursor\fR by calling
\fBTk_GetCursor\fR and the result is stored in the target. \fBTk_GetCursor\fR and the result is stored in the target.
In addition, the resulting cursor is made the active cursor In addition, the resulting cursor is made the active cursor
@@ -356,6 +356,7 @@ is an empty string then the target will be set to NULL.
\fBTK_CONFIG_WINDOW\fR \fBTK_CONFIG_WINDOW\fR
The value must be a window path name. It is translated to a The value must be a window path name. It is translated to a
\fBTk_Window\fR token and the token is stored in the target. \fBTk_Window\fR token and the token is stored in the target.
.SH "GROUPED ENTRIES" .SH "GROUPED ENTRIES"
.PP .PP
In some cases it is useful to generate multiple resources from In some cases it is useful to generate multiple resources from
@@ -373,6 +374,7 @@ Each of the entries after the first must have a NULL value in its
\fIargvName\fR field; this indicates that the entry is to be grouped \fIargvName\fR field; this indicates that the entry is to be grouped
with the entry that precedes it. Only the \fItype\fR and \fIoffset\fR with the entry that precedes it. Only the \fItype\fR and \fIoffset\fR
fields are used from these follow-on entries. fields are used from these follow-on entries.
.SH "FLAGS" .SH "FLAGS"
.PP .PP
The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used
@@ -432,11 +434,13 @@ once, save the value, and provide it before calling
.TP .TP
\fBTK_CONFIG_OPTION_SPECIFIED\fR \fBTK_CONFIG_OPTION_SPECIFIED\fR
This bit is This bit is
.VS 8.5
deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR
so that callers could detect what entries were specified in so that callers could detect what entries were specified in
\fIargv\fR, but it was removed because it was inherently \fIargv\fR, but it was removed because it was inherently
thread-unsafe. Code that wishes to detect what options were specified thread-unsafe. Code that wishes to detect what options were specified
should use \fBTk_SetOptions\fR instead. should use \fBTk_SetOptions\fR instead.
.VE 8.5
.PP .PP
The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
used to specify different default values for used to specify different default values for
@@ -469,6 +473,7 @@ for which this entry is valid. When calling \fBTk_ConfigureWidget\fR,
\fIflags\fR will have a single one of these bits set to select the \fIflags\fR will have a single one of these bits set to select the
entries for the desired widget type. For a working example of entries for the desired widget type. For a working example of
this feature, see the code in tkButton.c. this feature, see the code in tkButton.c.
.SH TK_OFFSET .SH TK_OFFSET
.PP .PP
The \fBTk_Offset\fR macro is provided as a safe way of generating The \fBTk_Offset\fR macro is provided as a safe way of generating
@@ -476,6 +481,7 @@ the \fIoffset\fR values for entries in Tk_ConfigSpec structures.
It takes two arguments: the name of a type of record, and the It takes two arguments: the name of a type of record, and the
name of a field in that record. It returns the byte offset of name of a field in that record. It returns the byte offset of
the named field in records of the given type. the named field in records of the given type.
.SH TK_CONFIGUREINFO .SH TK_CONFIGUREINFO
.PP .PP
The \fBTk_ConfigureInfo\fR procedure may be used to obtain The \fBTk_ConfigureInfo\fR procedure may be used to obtain
@@ -486,12 +492,12 @@ pointer to a widget record containing the current information for
a widget (\fIwidgRec\fR), and a NULL \fIargvName\fR argument, a widget (\fIwidgRec\fR), and a NULL \fIargvName\fR argument,
\fBTk_ConfigureInfo\fR generates a string describing all of the \fBTk_ConfigureInfo\fR generates a string describing all of the
configuration options for the window. The string is placed configuration options for the window. The string is placed
in interpreter \fIinterp\fR's result. Under normal circumstances in \fIinterp->result\fR. Under normal circumstances
it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR
and the interpreter's result will contain an error message. and \fIinterp->result\fR contains an error message.
.PP .PP
If \fIargvName\fR is NULL, then the value left in If \fIargvName\fR is NULL, then the value left in
the interpreter's result by \fBTk_ConfigureInfo\fR \fIinterp->result\fR by \fBTk_ConfigureInfo\fR
consists of a list of one or more entries, each of which describes consists of a list of one or more entries, each of which describes
one configuration option (i.e. one entry in \fIspecs\fR). Each one configuration option (i.e. one entry in \fIspecs\fR). Each
entry in the list will contain either two or five values. If the entry in the list will contain either two or five values. If the
@@ -504,25 +510,27 @@ field of \fIwidgRec\fR by calling procedures like \fBTk_NameOfColor\fR.
.PP .PP
If the \fIargvName\fR argument to \fBTk_ConfigureInfo\fR is non-NULL, If the \fIargvName\fR argument to \fBTk_ConfigureInfo\fR is non-NULL,
then it indicates a single option, and information is returned only then it indicates a single option, and information is returned only
for that option. The string placed in the interpreter's result will be for that option. The string placed in \fIinterp->result\fR will be
a list containing two or five values as described above; this will a list containing two or five values as described above; this will
be identical to the corresponding sublist that would have been returned be identical to the corresponding sublist that would have been returned
if \fIargvName\fR had been NULL. if \fIargvName\fR had been NULL.
.PP .PP
The \fIflags\fR argument to \fBTk_ConfigureInfo\fR is used to restrict The \fIflags\fR argument to \fBTk_ConfigureInfo\fR is used to restrict
the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR. the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR.
.SH TK_CONFIGUREVALUE .SH TK_CONFIGUREVALUE
.PP .PP
\fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR; \fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR;
instead of returning a list of values, it just returns the current value instead of returning a list of values, it just returns the current value
of the option given by \fIargvName\fR (\fIargvName\fR must not be NULL). of the option given by \fIargvName\fR (\fIargvName\fR must not be NULL).
The value is returned in interpreter \fIinterp\fR's result and \fBTCL_OK\fR is The value is returned in \fIinterp->result\fR and \fBTCL_OK\fR is
normally returned as the procedure's result. normally returned as the procedure's result.
If an error occurs in \fBTk_ConfigureValue\fR (e.g., \fIargvName\fR is If an error occurs in \fBTk_ConfigureValue\fR (e.g., \fIargvName\fR is
not a valid option name), \fBTCL_ERROR\fR is returned and an error message not a valid option name), \fBTCL_ERROR\fR is returned and an error message
is left in the interpreter's result. is left in \fIinterp->result\fR.
This procedure is typically called to implement \fBcget\fR widget This procedure is typically called to implement \fBcget\fR widget
commands. commands.
.SH TK_FREEOPTIONS .SH TK_FREEOPTIONS
.PP .PP
The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup
@@ -535,6 +543,7 @@ it contains a null pointer) then no resource is freed for that
entry. entry.
After freeing a resource, \fBTk_FreeOptions\fR sets the After freeing a resource, \fBTk_FreeOptions\fR sets the
corresponding field of the widget record to null. corresponding field of the widget record to null.
.SH "CUSTOM OPTION TYPES" .SH "CUSTOM OPTION TYPES"
.PP .PP
Applications can extend the built-in configuration types with additional Applications can extend the built-in configuration types with additional
@@ -545,22 +554,22 @@ typedef struct Tk_CustomOption {
Tk_OptionParseProc *\fIparseProc\fR; Tk_OptionParseProc *\fIparseProc\fR;
Tk_OptionPrintProc *\fIprintProc\fR; Tk_OptionPrintProc *\fIprintProc\fR;
ClientData \fIclientData\fR; ClientData \fIclientData\fR;
} \fBTk_CustomOption\fR; } Tk_CustomOption;
typedef int \fBTk_OptionParseProc\fR( typedef int Tk_OptionParseProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
char *\fIvalue\fR, char *\fIvalue\fR,
char *\fIwidgRec\fR, char *\fIwidgRec\fR,
int \fIoffset\fR); int \fIoffset\fR);
typedef const char *\fBTk_OptionPrintProc\fR( typedef char *Tk_OptionPrintProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
char *\fIwidgRec\fR, char *\fIwidgRec\fR,
int \fIoffset\fR, int \fIoffset\fR,
Tcl_FreeProc **\fIfreeProcPtr\fR); Tcl_FreeProc **\fIfreeProcPtr\fR);
.CE .CE
The Tk_CustomOption structure contains three fields, which are pointers The Tk_CustomOption structure contains three fields, which are pointers
to the two procedures and a \fIclientData\fR value to be passed to those to the two procedures and a \fIclientData\fR value to be passed to those
@@ -590,7 +599,7 @@ be placed. The procedure should translate the string to whatever
form is appropriate for the option and store the value in the widget form is appropriate for the option and store the value in the widget
record. It should normally return \fBTCL_OK\fR, but if an error occurs record. It should normally return \fBTCL_OK\fR, but if an error occurs
in translating the string to a value then it should return \fBTCL_ERROR\fR in translating the string to a value then it should return \fBTCL_ERROR\fR
and store an error message in interpreter \fIinterp\fR's result. and store an error message in \fIinterp->result\fR.
.PP .PP
The \fIprintProc\fR procedure is called The \fIprintProc\fR procedure is called
by \fBTk_ConfigureInfo\fR to produce a string value describing an by \fBTk_ConfigureInfo\fR to produce a string value describing an
@@ -613,6 +622,7 @@ Tk_CustomOption structure has been created for them, options of this
new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR
fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point
to the Tk_CustomOption structure. to the Tk_CustomOption structure.
.SH EXAMPLES .SH EXAMPLES
.PP .PP
Although the explanation of \fBTk_ConfigureWidget\fR is fairly Although the explanation of \fBTk_ConfigureWidget\fR is fairly
@@ -623,8 +633,10 @@ The library implementation of frames
(tkFrame.c) has a simple configuration table, and the library (tkFrame.c) has a simple configuration table, and the library
implementation of buttons (tkButton.c) has a much more complex implementation of buttons (tkButton.c) has a much more complex
table that uses many of the fancy \fIspecFlags\fR mechanisms. table that uses many of the fancy \fIspecFlags\fR mechanisms.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_SetOptions(3) Tk_SetOptions(3)
.SH KEYWORDS .SH KEYWORDS
anchor, bitmap, boolean, border, cap style, color, configuration options, anchor, bitmap, boolean, border, cap style, color, configuration options,
cursor, custom, double, font, integer, join style, justify, millimeters, cursor, custom, double, font, integer, join style, justify, millimeters,

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes, Tk_SetWindowBackground, Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder, Tk_SetWindowBorderPixmap, Tk_SetWindowColormap, Tk_DefineCursor, Tk_UndefineCursor \- change window configuration or attributes Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow, Tk_MoveResizeWindow, Tk_SetWindowBorderWidth, Tk_ChangeWindowAttributes, Tk_SetWindowBackground, Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder, Tk_SetWindowBorderPixmap, Tk_SetWindowColormap, Tk_DefineCursor, Tk_UndefineCursor \- change window configuration or attributes

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CoordsToWindow \- Find window containing a point Tk_CoordsToWindow \- Find window containing a point
@@ -25,6 +25,7 @@ Y-coordinate (in root window coordinates).
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Token for window that identifies application. Token for window that identifies application.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_CoordsToWindow\fR locates the window that contains a given point. \fBTk_CoordsToWindow\fR locates the window that contains a given point.
@@ -43,5 +44,6 @@ which window contains the mouse cursor: if a parent and a child both
contain the point then the child gets preference, and if two siblings contain the point then the child gets preference, and if two siblings
both contain the point then the highest one in the stacking order both contain the point then the highest one in the stacking order
(i.e. the one that's visible on the screen) gets preference. (i.e. the one that's visible on the screen) gets preference.
.SH KEYWORDS .SH KEYWORDS
containing, coordinates, root window containing, coordinates, root window

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate procedure callback with ClientMessage type X events Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate procedure callback with ClientMessage type X events
@@ -20,8 +20,10 @@ Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate proced
.AP Tk_ClientMessageProc *proc in .AP Tk_ClientMessageProc *proc in
Procedure to invoke whenever a ClientMessage X event occurs on any display. Procedure to invoke whenever a ClientMessage X event occurs on any display.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked \fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked
in the future whenever a ClientMessage X event occurs that is not handled by in the future whenever a ClientMessage X event occurs that is not handled by
\fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use \fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use
@@ -31,15 +33,15 @@ drop applications.
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
this mechanism only works in programs that dispatch events this mechanism only works in programs that dispatch events
through \fBTk_HandleEvent\fR (or through other Tk procedures that through \fBTk_HandleEvent\fR (or through other Tk procedures that
call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
\fBTk_MainLoop\fR). \fBTk_MainLoop\fR).
.PP .PP
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the
type \fBTk_ClientMessageProc\fR: type \fBTk_ClientMessageProc\fR:
.CS .CS
typedef int \fBTk_ClientMessageProc\fR( typedef int Tk_ClientMessageProc(
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
XEvent *\fIeventPtr\fR); XEvent *\fIeventPtr\fR);
.CE .CE
The \fItkwin\fR parameter to \fIproc\fR is the Tk window which is The \fItkwin\fR parameter to \fIproc\fR is the Tk window which is
associated with this event. \fIEventPtr\fR is a pointer to the X event. associated with this event. \fIEventPtr\fR is a pointer to the X event.
@@ -60,5 +62,6 @@ finds that matches the \fIproc\fR argument. If no such handler exists,
then \fBTk_DeleteClientMessageHandler\fR returns without doing anything. then \fBTk_DeleteClientMessageHandler\fR returns without doing anything.
Although Tk supports it, it's probably a bad idea to have more than one Although Tk supports it, it's probably a bad idea to have more than one
callback with the same \fIproc\fR argument. callback with the same \fIproc\fR argument.
.SH KEYWORDS .SH KEYWORDS
bind, callback, event, handler bind, callback, event, handler

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_InitConsoleChannels \- Install the console channels as standard channels Tk_InitConsoleChannels \- Install the console channels as standard channels

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateErrorHandler, Tk_DeleteErrorHandler \- handle X protocol errors Tk_CreateErrorHandler, Tk_DeleteErrorHandler \- handle X protocol errors
@@ -72,9 +72,9 @@ made when the handler was active (see below for more information).
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the
following type: following type:
.CS .CS
typedef int \fBTk_ErrorProc\fR( typedef int Tk_ErrorProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
XErrorEvent *\fIerrEventPtr\fR); XErrorEvent *\fIerrEventPtr\fR);
.CE .CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
argument given to \fBTcl_CreateErrorHandler\fR when the callback argument given to \fBTcl_CreateErrorHandler\fR when the callback
@@ -136,5 +136,6 @@ handlers deleted before the \fBXSync\fR call.
For the Tk error handling mechanism to work properly, it is essential For the Tk error handling mechanism to work properly, it is essential
that application code never calls \fBXSetErrorHandler\fR directly; that application code never calls \fBXSetErrorHandler\fR directly;
applications should use only \fBTk_CreateErrorHandler\fR. applications should use only \fBTk_CreateErrorHandler\fR.
.SH KEYWORDS .SH KEYWORDS
callback, error, event, handler callback, error, event, handler

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events
@@ -24,6 +24,7 @@ Procedure to invoke whenever any X event occurs on any display.
.AP ClientData clientData in .AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR. Arbitrary one-word value to pass to \fIproc\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be \fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be
@@ -38,15 +39,15 @@ use with Tk, and so on.
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
this mechanism only works in programs that dispatch events this mechanism only works in programs that dispatch events
through \fBTk_HandleEvent\fR (or through other Tk procedures that through \fBTk_HandleEvent\fR (or through other Tk procedures that
call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
\fBTk_MainLoop\fR). \fBTk_MainLoop\fR).
.PP .PP
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the
type \fBTk_GenericProc\fR: type \fBTk_GenericProc\fR:
.CS .CS
typedef int \fBTk_GenericProc\fR( typedef int Tk_GenericProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
XEvent *\fIeventPtr\fR); XEvent *\fIeventPtr\fR);
.CE .CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
argument given to \fBTk_CreateGenericHandler\fR when the callback argument given to \fBTk_CreateGenericHandler\fR when the callback

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
@@ -21,12 +21,11 @@ ClientData
.sp .sp
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR) \fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS "const Tk_ImageType" *typePtrPtr .AS Tk_ImageType *typePtrPtr
.AP "const Tk_ImageType" *typePtr in .AP Tk_ImageType *typePtr in
Structure that defines the new type of image. Structure that defines the new type of image.
For Tk 8.4 and earlier this must be static: a Must be static: a
pointer to this structure is retained by the image code. pointer to this structure is retained by the image code.
In Tk 8.5, this limitation was relaxed.
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter in which image was created. Interpreter in which image was created.
.AP "const char" *name in .AP "const char" *name in
@@ -39,6 +38,7 @@ Number of arguments
.AP char ***argvPtr in/out .AP char ***argvPtr in/out
Pointer to argument list Pointer to argument list
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_CreateImageType\fR is invoked to define a new kind of image. \fBTk_CreateImageType\fR is invoked to define a new kind of image.
@@ -59,13 +59,13 @@ the name of the image type and pointers to five procedures provided
by the image manager to deal with images of this type: by the image manager to deal with images of this type:
.CS .CS
typedef struct Tk_ImageType { typedef struct Tk_ImageType {
const char *\fIname\fR; char *\fIname\fR;
Tk_ImageCreateProc *\fIcreateProc\fR; Tk_ImageCreateProc *\fIcreateProc\fR;
Tk_ImageGetProc *\fIgetProc\fR; Tk_ImageGetProc *\fIgetProc\fR;
Tk_ImageDisplayProc *\fIdisplayProc\fR; Tk_ImageDisplayProc *\fIdisplayProc\fR;
Tk_ImageFreeProc *\fIfreeProc\fR; Tk_ImageFreeProc *\fIfreeProc\fR;
Tk_ImageDeleteProc *\fIdeleteProc\fR; Tk_ImageDeleteProc *\fIdeleteProc\fR;
} \fBTk_ImageType\fR; } Tk_ImageType;
.CE .CE
The fields of this structure will be described in later subsections The fields of this structure will be described in later subsections
of this entry. of this entry.
@@ -92,6 +92,7 @@ option specified for a widget or canvas item.
.PP .PP
The following subsections describe the fields of a Tk_ImageType The following subsections describe the fields of a Tk_ImageType
in more detail. in more detail.
.SS NAME .SS NAME
.PP .PP
\fItypePtr->name\fR provides a name for the image type. \fItypePtr->name\fR provides a name for the image type.
@@ -100,21 +101,21 @@ in \fBimage create\fR commands to create images of the new
type. type.
If there already existed an image type by this name then If there already existed an image type by this name then
the new image type replaces the old one. the new image type replaces the old one.
.SS CREATEPROC .SS CREATEPROC
.PP
\fItypePtr->createProc\fR provides the address of a procedure for \fItypePtr->createProc\fR provides the address of a procedure for
Tk to call whenever \fBimage create\fR is invoked to create Tk to call whenever \fBimage create\fR is invoked to create
an image of the new type. an image of the new type.
\fItypePtr->createProc\fR must match the following prototype: \fItypePtr->createProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageCreateProc\fR( typedef int Tk_ImageCreateProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
const char *\fIname\fR, char *\fIname\fR,
int \fIobjc\fR, int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[], Tcl_Obj *const \fIobjv\fR[],
const Tk_ImageType *\fItypePtr\fR, Tk_ImageType *\fItypePtr\fR,
Tk_ImageMaster \fImaster\fR, Tk_ImageMaster \fImaster\fR,
ClientData *\fImasterDataPtr\fR); ClientData *\fImasterDataPtr\fR);
.CE .CE
The \fIinterp\fR argument is the interpreter in which the \fBimage\fR The \fIinterp\fR argument is the interpreter in which the \fBimage\fR
command was invoked, and \fIname\fR is the name for the new image, command was invoked, and \fIname\fR is the name for the new image,
@@ -140,15 +141,16 @@ it should return \fBTCL_OK\fR.
.PP .PP
\fIcreateProc\fR should call \fBTk_ImageChanged\fR in order to set the \fIcreateProc\fR should call \fBTk_ImageChanged\fR in order to set the
size of the image and request an initial redisplay. size of the image and request an initial redisplay.
.SS GETPROC .SS GETPROC
.PP .PP
\fItypePtr->getProc\fR is invoked by Tk whenever a widget \fItypePtr->getProc\fR is invoked by Tk whenever a widget
calls \fBTk_GetImage\fR to use a particular image. calls \fBTk_GetImage\fR to use a particular image.
This procedure must match the following prototype: This procedure must match the following prototype:
.CS .CS
typedef ClientData \fBTk_ImageGetProc\fR( typedef ClientData Tk_ImageGetProc(
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
ClientData \fImasterData\fR); ClientData \fImasterData\fR);
.CE .CE
The \fItkwin\fR argument identifies the window in which the The \fItkwin\fR argument identifies the window in which the
image will be used and \fImasterData\fR is the value image will be used and \fImasterData\fR is the value
@@ -160,22 +162,23 @@ display the image in the given window.
is typically the address of the instance data structure. is typically the address of the instance data structure.
Tk will pass this value back to the image manager when invoking Tk will pass this value back to the image manager when invoking
its \fIdisplayProc\fR and \fIfreeProc\fR procedures. its \fIdisplayProc\fR and \fIfreeProc\fR procedures.
.SS DISPLAYPROC .SS DISPLAYPROC
.PP .PP
\fItypePtr->displayProc\fR is invoked by Tk whenever an image needs \fItypePtr->displayProc\fR is invoked by Tk whenever an image needs
to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR). to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR).
\fIdisplayProc\fR must match the following prototype: \fIdisplayProc\fR must match the following prototype:
.CS .CS
typedef void \fBTk_ImageDisplayProc\fR( typedef void Tk_ImageDisplayProc(
ClientData \fIinstanceData\fR, ClientData \fIinstanceData\fR,
Display *\fIdisplay\fR, Display *\fIdisplay\fR,
Drawable \fIdrawable\fR, Drawable \fIdrawable\fR,
int \fIimageX\fR, int \fIimageX\fR,
int \fIimageY\fR, int \fIimageY\fR,
int \fIwidth\fR, int \fIwidth\fR,
int \fIheight\fR, int \fIheight\fR,
int \fIdrawableX\fR, int \fIdrawableX\fR,
int \fIdrawableY\fR); int \fIdrawableY\fR);
.CE .CE
The \fIinstanceData\fR will be the same as the value returned by The \fIinstanceData\fR will be the same as the value returned by
\fIgetProc\fR when the instance was created. \fIgetProc\fR when the instance was created.
@@ -192,6 +195,7 @@ as specified in the most recent call to \fBTk_ImageChanged\fR.
the image should be displayed; \fIdisplayProc\fR should display the image should be displayed; \fIdisplayProc\fR should display
the given region of the image so that point (\fIimageX\fR, \fIimageY\fR) the given region of the image so that point (\fIimageX\fR, \fIimageY\fR)
in the image appears at (\fIdrawableX\fR, \fIdrawableY\fR) in \fIdrawable\fR. in the image appears at (\fIdrawableX\fR, \fIdrawableY\fR) in \fIdrawable\fR.
.SS FREEPROC .SS FREEPROC
.PP .PP
\fItypePtr->freeProc\fR contains the address of a procedure that \fItypePtr->freeProc\fR contains the address of a procedure that
@@ -202,15 +206,16 @@ in a canvas is deleted, or when the image displayed in a widget or
canvas item is changed. canvas item is changed.
\fIfreeProc\fR must match the following prototype: \fIfreeProc\fR must match the following prototype:
.CS .CS
typedef void \fBTk_ImageFreeProc\fR( typedef void Tk_ImageFreeProc(
ClientData \fIinstanceData\fR, ClientData \fIinstanceData\fR,
Display *\fIdisplay\fR); Display *\fIdisplay\fR);
.CE .CE
The \fIinstanceData\fR will be the same as the value returned by The \fIinstanceData\fR will be the same as the value returned by
\fIgetProc\fR when the instance was created, and \fIdisplay\fR \fIgetProc\fR when the instance was created, and \fIdisplay\fR
is the display containing the window for the instance. is the display containing the window for the instance.
\fIfreeProc\fR should release any resources associated with the \fIfreeProc\fR should release any resources associated with the
image instance, since the instance will never be used again. image instance, since the instance will never be used again.
.SS DELETEPROC .SS DELETEPROC
.PP .PP
\fItypePtr->deleteProc\fR is a procedure that Tk invokes when an \fItypePtr->deleteProc\fR is a procedure that Tk invokes when an
@@ -220,14 +225,15 @@ Before invoking \fIdeleteProc\fR Tk will invoke \fIfreeProc\fR for
each of the image's instances. each of the image's instances.
\fIdeleteProc\fR must match the following prototype: \fIdeleteProc\fR must match the following prototype:
.CS .CS
typedef void \fBTk_ImageDeleteProc\fR( typedef void Tk_ImageDeleteProc(
ClientData \fImasterData\fR); ClientData \fImasterData\fR);
.CE .CE
The \fImasterData\fR argument will be the same as the value The \fImasterData\fR argument will be the same as the value
stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the
image was created. image was created.
\fIdeleteProc\fR should release any resources associated with \fIdeleteProc\fR should release any resources associated with
the image. the image.
.SH TK_GETIMAGEMASTERDATA .SH TK_GETIMAGEMASTERDATA
.PP .PP
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
@@ -241,19 +247,19 @@ and the return value is the ClientData value returned by the
\fIcreateProc\fR when the image was created (this is typically a \fIcreateProc\fR when the image was created (this is typically a
pointer to the image master data structure). If no such image exists pointer to the image master data structure). If no such image exists
then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
.SH "LEGACY INTERFACE SUPPORT" .SH "LEGACY INTERFACE SUPPORT"
.PP
In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
was incompatibly different, with the following prototype: was incompatibly different, with the following prototype:
.CS .CS
typedef int \fBTk_ImageCreateProc\fR( typedef int Tk_ImageCreateProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
char *\fIname\fR, char *\fIname\fR,
int \fIargc\fR, int \fIargc\fR,
char **\fIargv\fR, char **\fIargv\fR,
Tk_ImageType *\fItypePtr\fR, Tk_ImageType *\fItypePtr\fR,
Tk_ImageMaster \fImaster\fR, Tk_ImageMaster \fImaster\fR,
ClientData *\fImasterDataPtr\fR); ClientData *\fImasterDataPtr\fR);
.CE .CE
Legacy programs and libraries dating from those days may still Legacy programs and libraries dating from those days may still
contain code that defines extended Tk image types using the old contain code that defines extended Tk image types using the old
@@ -277,7 +283,9 @@ use Tk 8.4 headers and stub libraries to do so.
.PP .PP
Any new code written today should not make use of the legacy Any new code written today should not make use of the legacy
interfaces. Expect their support to go away in Tk 9. interfaces. Expect their support to go away in Tk 9.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
.SH KEYWORDS .SH KEYWORDS
image manager, image type, instance, master image manager, image type, instance, master

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateItemType, Tk_GetItemTypes \- define new kind of canvas item Tk_CreateItemType, Tk_GetItemTypes \- define new kind of canvas item
@@ -44,7 +44,7 @@ NULL \fInextPtr\fR.
.PP .PP
You may find it easier to understand the rest of this manual entry You may find it easier to understand the rest of this manual entry
by looking at the code for an existing canvas item type such as by looking at the code for an existing canvas item type such as
bitmap (in the file tkCanvBmap.c) or text (tkCanvText.c). bitmap (file tkCanvBmap.c) or text (tkCanvText.c).
The easiest way to create a new type manager is to copy the code The easiest way to create a new type manager is to copy the code
for an existing type and modify it for the new type. for an existing type and modify it for the new type.
.PP .PP
@@ -60,13 +60,12 @@ structures.
The first data structure is a Tk_ItemType; it contains The first data structure is a Tk_ItemType; it contains
information such as the name of the type and pointers to information such as the name of the type and pointers to
the standard procedures implemented by the type manager: the standard procedures implemented by the type manager:
.PP
.CS .CS
typedef struct Tk_ItemType { typedef struct Tk_ItemType {
const char *\fIname\fR; char *\fIname\fR;
int \fIitemSize\fR; int \fIitemSize\fR;
Tk_ItemCreateProc *\fIcreateProc\fR; Tk_ItemCreateProc *\fIcreateProc\fR;
const Tk_ConfigSpec *\fIconfigSpecs\fR; Tk_ConfigSpec *\fIconfigSpecs\fR;
Tk_ItemConfigureProc *\fIconfigProc\fR; Tk_ItemConfigureProc *\fIconfigProc\fR;
Tk_ItemCoordProc *\fIcoordProc\fR; Tk_ItemCoordProc *\fIcoordProc\fR;
Tk_ItemDeleteProc *\fIdeleteProc\fR; Tk_ItemDeleteProc *\fIdeleteProc\fR;
@@ -83,7 +82,7 @@ typedef struct Tk_ItemType {
Tk_ItemInsertProc *\fIinsertProc\fR; Tk_ItemInsertProc *\fIinsertProc\fR;
Tk_ItemDCharsProc *\fIdCharsProc\fR; Tk_ItemDCharsProc *\fIdCharsProc\fR;
Tk_ItemType *\fInextPtr\fR; Tk_ItemType *\fInextPtr\fR;
} \fBTk_ItemType\fR; } Tk_ItemType;
.CE .CE
.PP .PP
The fields of a Tk_ItemType structure are described in more detail The fields of a Tk_ItemType structure are described in more detail
@@ -93,7 +92,7 @@ argument must point to a structure with all of the fields initialized
except \fInextPtr\fR, which Tk sets to link all the types together except \fInextPtr\fR, which Tk sets to link all the types together
into a list. into a list.
The structure must be in permanent memory (either statically The structure must be in permanent memory (either statically
allocated or dynamically allocated but never freed); Tk retains allocated or dynamically allocated but never freed); Tk retains
a pointer to this structure. a pointer to this structure.
.PP .PP
The second data structure manipulated by a type manager is an The second data structure manipulated by a type manager is an
@@ -103,12 +102,11 @@ All of the items of a given type generally have item records with
the same structure, but different types usually have different the same structure, but different types usually have different
formats for their item records. formats for their item records.
The first part of each item record is a header with a standard structure The first part of each item record is a header with a standard structure
defined by Tk via the type Tk_Item; the rest of the item defined by Tk via the type Tk_Item; the rest of the item
record is defined by the type manager. record is defined by the type manager.
A type manager must define its item records with a Tk_Item as A type manager must define its item records with a Tk_Item as
the first field. the first field.
For example, the item record for bitmap items is defined as follows: For example, the item record for bitmap items is defined as follows:
.PP
.CS .CS
typedef struct BitmapItem { typedef struct BitmapItem {
Tk_Item \fIheader\fR; Tk_Item \fIheader\fR;
@@ -118,9 +116,8 @@ typedef struct BitmapItem {
XColor *\fIfgColor\fR; XColor *\fIfgColor\fR;
XColor *\fIbgColor\fR; XColor *\fIbgColor\fR;
GC \fIgc\fR; GC \fIgc\fR;
} \fBBitmapItem\fR; } BitmapItem;
.CE .CE
.PP
The \fIheader\fR substructure contains information used by Tk The \fIheader\fR substructure contains information used by Tk
to manage the item, such as its identifier, its tags, its type, to manage the item, such as its identifier, its tags, its type,
and its bounding box. and its bounding box.
@@ -130,7 +127,7 @@ The type manager should not need to read or write any of the
fields in the header except for four fields fields in the header except for four fields
whose names are \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. whose names are \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
These fields give a bounding box for the items using integer These fields give a bounding box for the items using integer
canvas coordinates: the item should not cover any pixels canvas coordinates: the item should not cover any pixels
with x-coordinate lower than \fIx1\fR or y-coordinate with x-coordinate lower than \fIx1\fR or y-coordinate
lower than \fIy1\fR, nor should it cover any pixels with lower than \fIy1\fR, nor should it cover any pixels with
x-coordinate greater than or equal to \fIx2\fR or y-coordinate x-coordinate greater than or equal to \fIx2\fR or y-coordinate
@@ -140,12 +137,12 @@ date as the item is moved and reconfigured.
.PP .PP
Whenever Tk calls a procedure in a type manager it passes in a pointer Whenever Tk calls a procedure in a type manager it passes in a pointer
to an item record. to an item record.
The argument is always passed as a pointer to a Tk_Item; the type The argument is always passed as a pointer to a Tk_Item; the type
manager will typically cast this into a pointer to its own specific manager will typically cast this into a pointer to its own specific
type, such as BitmapItem. type, such as BitmapItem.
.PP .PP
The third data structure used by type managers has type The third data structure used by type managers has type
Tk_Canvas; it serves as an opaque handle for the canvas widget Tk_Canvas; it serves as an opaque handle for the canvas widget
as a whole. as a whole.
Type managers need not know anything about the contents of this Type managers need not know anything about the contents of this
structure. structure.
@@ -153,7 +150,6 @@ A Tk_Canvas handle is typically passed in to the
procedures of a type manager, and the type manager can pass the procedures of a type manager, and the type manager can pass the
handle back to library procedures such as Tk_CanvasTkwin handle back to library procedures such as Tk_CanvasTkwin
to fetch information about the canvas. to fetch information about the canvas.
.SH "TK_ITEMTYPE FIELDS"
.SS NAME .SS NAME
.PP .PP
This section and the ones that follow describe each of the fields This section and the ones that follow describe each of the fields
@@ -164,37 +160,8 @@ in \fBcreate\fR widget commands to create items of the new
type. type.
If there already existed an item type by this name then If there already existed an item type by this name then
the new item type replaces the old one. the new item type replaces the old one.
.SS "FLAGS (IN ALWAYSREDRAW)"
.PP
The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons)
contains a collection of flag bits that modify how the canvas core interacts
with the item. The following bits are defined:
.TP
\fB1\fR
.
Indicates that the item should always be redrawn when any part of the canvas
is redrawn, rather than only when the bounding box of the item overlaps the
area being redrawn. This is used by window items, for example, which need to
unmap subwindows that are not on the screen.
.TP
\fBTK_CONFIG_OBJS\fR
.
Indicates that operations which would otherwise take a string (or array of
strings) actually take a Tcl_Obj reference (or an array of such references).
The operations to which this applies are the \fIconfigProc\fR, the
\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the
\fIinsertProc\fR.
.TP
\fBTK_MOVABLE_POINTS\fR
.VS 8.6
Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and
\fIinsertProc\fR with the same semantics as Tk's built-in line and polygon
types, and that hence individual coordinate points can be moved. Must not be
set if any of the above methods is NULL.
.VE 8.6
.SS ITEMSIZE .SS ITEMSIZE
.PP \fItypePtr->itemSize\fR gives the size in bytes of item records
\fItypePtr\->itemSize\fR gives the size in bytes of item records
of this type, including the Tk_Item header. of this type, including the Tk_Item header.
Tk uses this size to allocate memory space for items of the type. Tk uses this size to allocate memory space for items of the type.
All of the item records for a given type must have the same size. All of the item records for a given type must have the same size.
@@ -203,38 +170,31 @@ of points for a polygon), the type manager can allocate a separate
object of variable length and keep a pointer to it in the item record. object of variable length and keep a pointer to it in the item record.
.SS CREATEPROC .SS CREATEPROC
.PP .PP
\fItypePtr\->createProc\fR points to a procedure for \fItypePtr->createProc\fR points to a procedure for
Tk to call whenever a new item of this type is created. Tk to call whenever a new item of this type is created.
\fItypePtr\->createProc\fR must match the following prototype: \fItypePtr->createProc\fR must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemCreateProc\fR( typedef int Tk_ItemCreateProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIobjc\fR, int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]); Tcl_Obj* const \fIobjv\fR[]);
.CE .CE
.PP
The \fIinterp\fR argument is the interpreter in which the canvas's The \fIinterp\fR argument is the interpreter in which the canvas's
\fBcreate\fR widget command was invoked, and \fIcanvas\fR is a \fBcreate\fR widget command was invoked, and \fIcanvas\fR is a
handle for the canvas widget. handle for the canvas widget.
\fIitemPtr\fR is a pointer to a newly-allocated item of \fIitemPtr\fR is a pointer to a newly-allocated item of
size \fItypePtr\->itemSize\fR. size \fItypePtr->itemSize\fR.
Tk has already initialized the item's header (the first Tk has already initialized the item's header (the first
\fBsizeof(Tk_ItemType)\fR bytes). \fBsizeof(Tk_ItemType)\fR bytes).
The \fIobjc\fR and \fIobjv\fR arguments describe all of the The \fIobjc\fR and \fIobjv\fR arguments describe all of the
arguments to the \fBcreate\fR command after the \fItype\fR arguments to the \fBcreate\fR command after the \fItype\fR
argument. argument.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the For example, in the widget command
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
contain a pointer to an array of constant strings.
For example, in the widget command:
.PP
.CS .CS
\fB\&.c create rectangle 10 20 50 50 \-fill black\fR \fB\&.c create rectangle 10 20 50 50 \-fill black\fR
.CE .CE
.PP
\fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the \fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the
integer object \fB10\fR. integer object \fB10\fR.
.PP .PP
@@ -242,7 +202,7 @@ integer object \fB10\fR.
the type-specific parts of the item record and set an initial value the type-specific parts of the item record and set an initial value
for the bounding box in the item's header. for the bounding box in the item's header.
It should return a standard Tcl completion code and leave an It should return a standard Tcl completion code and leave an
error message in the interpreter result if an error occurs. error message in \fIinterp->result\fR if an error occurs.
If an error occurs Tk will free the item record, so \fIcreateProc\fR If an error occurs Tk will free the item record, so \fIcreateProc\fR
must be sure to leave the item record in a clean state if it returns an error must be sure to leave the item record in a clean state if it returns an error
(e.g., it must free any additional memory that it allocated for (e.g., it must free any additional memory that it allocated for
@@ -252,84 +212,70 @@ the item).
Each type manager must provide a standard table describing its Each type manager must provide a standard table describing its
configuration options, in a form suitable for use with configuration options, in a form suitable for use with
\fBTk_ConfigureWidget\fR. \fBTk_ConfigureWidget\fR.
This table will normally be used by \fItypePtr\->createProc\fR This table will normally be used by \fItypePtr->createProc\fR
and \fItypePtr\->configProc\fR, but Tk also uses it directly and \fItypePtr->configProc\fR, but Tk also uses it directly
to retrieve option information in the \fBitemcget\fR and to retrieve option information in the \fBitemcget\fR and
\fBitemconfigure\fR widget commands. \fBitemconfigure\fR widget commands.
\fItypePtr\->configSpecs\fR must point to the configuration table \fItypePtr->configSpecs\fR must point to the configuration table
for this type. for this type.
Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR
for implementing the \fB\-tags\fR option; see an existing type for implementing the \fB\-tags\fR option; see an existing type
manager for an example of how to use it in \fIconfigSpecs\fR. manager for an example of how to use it in \fIconfigSpecs\fR.
.SS CONFIGPROC .SS CONFIGPROC
.PP .PP
\fItypePtr\->configProc\fR is called by Tk whenever the \fItypePtr->configProc\fR is called by Tk whenever the
\fBitemconfigure\fR widget command is invoked to change the \fBitemconfigure\fR widget command is invoked to change the
configuration options for a canvas item. configuration options for a canvas item.
This procedure must match the following prototype: This procedure must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemConfigureProc\fR( typedef int Tk_ItemConfigureProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIobjc\fR, int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[], Tcl_Obj* const \fIobjv\fR[],
int \fIflags\fR); int \fIflags\fR);
.CE .CE
.PP The \fIinterp\fR objument identifies the interpreter in which the
The \fIinterp\fR argument identifies the interpreter in which the widget command was invoked, \fIcanvas\fR is a handle for the canvas
widget command was invoked, \fIcanvas\fR is a handle for the canvas
widget, and \fIitemPtr\fR is a pointer to the item being configured. widget, and \fIitemPtr\fR is a pointer to the item being configured.
\fIobjc\fR and \fIobjv\fR contain the configuration options. \fIobjc\fR and \fIobjv\fR contain the configuration options. For
Note that if \fBTK_CONFIG_OBJS\fR is not set in the example, if the following command is invoked:
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
contain a pointer to an array of constant strings.
For example, if the following command is invoked:
.PP
.CS .CS
\fB\&.c itemconfigure 2 \-fill red \-outline black\fR \fB\&.c itemconfigure 2 \-fill red \-outline black\fR
.CE .CE
.PP
\fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR \fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR
through \fBblack\fR. through \fBblack\fR.
\fIobjc\fR will always be an even value. \fIobjc\fR will always be an even value.
The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR; The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
currently this value is always \fBTK_CONFIG_ARGV_ONLY\fR when Tk currently this value is always \fBTK_CONFIG_ARGV_ONLY\fR when Tk
invokes \fItypePtr\->configProc\fR, but the type manager's \fIcreateProc\fR invokes \fItypePtr->configProc\fR, but the type manager's \fIcreateProc\fR
procedure will usually invoke \fIconfigProc\fR with different flag values. procedure will usually invoke \fIconfigProc\fR with different flag values.
.PP .PP
\fItypePtr\->configProc\fR returns a standard Tcl completion code and \fItypePtr->configProc\fR returns a standard Tcl completion code and
leaves an error message in the interpreter result if an error occurs. leaves an error message in \fIinterp->result\fR if an error occurs.
It must update the item's bounding box to reflect the new configuration It must update the item's bounding box to reflect the new configuration
options. options.
.SS COORDPROC .SS COORDPROC
.PP .PP
\fItypePtr\->coordProc\fR is invoked by Tk to implement the \fBcoords\fR \fItypePtr->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
widget command for an item. widget command for an item.
It must match the following prototype: It must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemCoordProc\fR( typedef int Tk_ItemCoordProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIobjc\fR, int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]); Tcl_Obj* const \fIobjv\fR[]);
.CE .CE
.PP
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
describe the coordinate arguments. describe the coordinate arguments.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
contain a pointer to an array of constant strings.
For example, if the following widget command is invoked: For example, if the following widget command is invoked:
.PP
.CS .CS
\fB\&.c coords 2 30 90\fR \fB\&.c coords 2 30 90\fR
.CE .CE
.PP
\fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects \fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects
\fB30\fR and \fB90\fR. \fB30\fR and \fB90\fR.
.PP .PP
@@ -338,45 +284,41 @@ update the item appropriately (e.g., it must reset the bounding
box in the item's header), and return a standard Tcl completion box in the item's header), and return a standard Tcl completion
code. code.
If an error occurs, \fIcoordProc\fR must leave an error message in If an error occurs, \fIcoordProc\fR must leave an error message in
the interpreter result. \fIinterp->result\fR.
.SS DELETEPROC .SS DELETEPROC
.PP .PP
\fItypePtr\->deleteProc\fR is invoked by Tk to delete an item \fItypePtr->deleteProc\fR is invoked by Tk to delete an item
and free any resources allocated to it. and free any resources allocated to it.
It must match the following prototype: It must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemDeleteProc\fR( typedef void Tk_ItemDeleteProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
Display *\fIdisplay\fR); Display *\fIdisplay\fR);
.CE .CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual
interpretations, and \fIdisplay\fR identifies the X display containing interpretations, and \fIdisplay\fR identifies the X display containing
the canvas. the canvas.
\fIdeleteProc\fR must free up any resources allocated for the item, \fIdeleteProc\fR must free up any resources allocated for the item,
so that Tk can free the item record. so that Tk can free the item record.
\fIdeleteProc\fR should not actually free the item record; this will \fIdeleteProc\fR should not actually free the item record; this will
be done by Tk when \fIdeleteProc\fR returns. be done by Tk when \fIdeleteProc\fR returns.
.SS "DISPLAYPROC" .SS "DISPLAYPROC AND ALWAYSREDRAW"
.PP .PP
\fItypePtr\->displayProc\fR is invoked by Tk to redraw an item \fItypePtr->displayProc\fR is invoked by Tk to redraw an item
on the screen. on the screen.
It must match the following prototype: It must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemDisplayProc\fR( typedef void Tk_ItemDisplayProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
Display *\fIdisplay\fR, Display *\fIdisplay\fR,
Drawable \fIdst\fR, Drawable \fIdst\fR,
int \fIx\fR, int \fIx\fR,
int \fIy\fR, int \fIy\fR,
int \fIwidth\fR, int \fIwidth\fR,
int \fIheight\fR); int \fIheight\fR);
.CE .CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning. The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIdisplay\fR identifies the display containing the canvas, and \fIdisplay\fR identifies the display containing the canvas, and
\fIdst\fR specifies a drawable in which the item should be rendered; \fIdst\fR specifies a drawable in which the item should be rendered;
@@ -398,28 +340,25 @@ of \fIdst\fR.
.PP .PP
Normally an item's \fIdisplayProc\fR is only invoked if the item Normally an item's \fIdisplayProc\fR is only invoked if the item
overlaps the area being displayed. overlaps the area being displayed.
However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1, However, if \fItypePtr->alwaysRedraw\fR has a non-zero value, then
(i.e.\| \fIdisplayProc\fR is invoked during every redisplay operation,
.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" ) even if the item does not overlap the area of redisplay.
then \fIdisplayProc\fR is invoked during every redisplay operation, \fIalwaysRedraw\fR should normally be set to 0; it is only
even if the item does not overlap the area of redisplay; this is useful for set to 1 in special cases such as window items that need to be
cases such as window items, where the subwindow needs to be unmapped when it unmapped when they are off-screen.
is off the screen.
.SS POINTPROC .SS POINTPROC
.PP .PP
\fItypePtr\->pointProc\fR is invoked by Tk to find out how close \fItypePtr->pointProc\fR is invoked by Tk to find out how close
a given point is to a canvas item. a given point is to a canvas item.
Tk uses this procedure for purposes such as locating the item Tk uses this procedure for purposes such as locating the item
under the mouse or finding the closest item to a given point. under the mouse or finding the closest item to a given point.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef double \fBTk_ItemPointProc\fR( typedef double Tk_ItemPointProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
double *\fIpointPtr\fR); double *\fIpointPtr\fR);
.CE .CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning. \fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIpointPtr\fR points to an array of two numbers giving \fIpointPtr\fR points to an array of two numbers giving
the x and y coordinates of a point. the x and y coordinates of a point.
@@ -428,17 +367,15 @@ from the point to the item, or 0 if the point lies inside
the item. the item.
.SS AREAPROC .SS AREAPROC
.PP .PP
\fItypePtr\->areaProc\fR is invoked by Tk to find out the relationship \fItypePtr->areaProc\fR is invoked by Tk to find out the relationship
between an item and a rectangular area. between an item and a rectangular area.
It must match the following prototype: It must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemAreaProc\fR( typedef int Tk_ItemAreaProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
double *\fIrectPtr\fR); double *\fIrectPtr\fR);
.CE .CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning. \fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIrectPtr\fR points to an array of four real numbers; \fIrectPtr\fR points to an array of four real numbers;
the first two give the x and y coordinates of the upper left the first two give the x and y coordinates of the upper left
@@ -449,28 +386,26 @@ the given area, 0 if it lies partially inside and partially
outside the area, and 1 if it lies entirely inside the area. outside the area, and 1 if it lies entirely inside the area.
.SS POSTSCRIPTPROC .SS POSTSCRIPTPROC
.PP .PP
\fItypePtr\->postscriptProc\fR is invoked by Tk to generate \fItypePtr->postscriptProc\fR is invoked by Tk to generate
Postscript for an item during the \fBpostscript\fR widget command. Postscript for an item during the \fBpostscript\fR widget command.
If the type manager is not capable of generating Postscript then If the type manager is not capable of generating Postscript then
\fItypePtr\->postscriptProc\fR should be NULL. \fItypePtr->postscriptProc\fR should be NULL.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemPostscriptProc\fR( typedef int Tk_ItemPostscriptProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIprepass\fR); int \fIprepass\fR);
.CE .CE
.PP
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have
standard meanings; \fIprepass\fR will be described below. standard meanings; \fIprepass\fR will be described below.
If \fIpostscriptProc\fR completes successfully, it should append If \fIpostscriptProc\fR completes successfully, it should append
Postscript for the item to the information in the interpreter result Postscript for the item to the information in \fIinterp->result\fR
(e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR) (e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR)
and return \fBTCL_OK\fR. and return \fBTCL_OK\fR.
If an error occurs, \fIpostscriptProc\fR should clear the result If an error occurs, \fIpostscriptProc\fR should clear the result
and replace its contents with an error message; then it should and replace its contents with an error message; then it should
return \fBTCL_ERROR\fR. return \fBTCL_ERROR\fR.
.PP .PP
Tk provides a collection of utility procedures to simplify Tk provides a collection of utility procedures to simplify
@@ -492,29 +427,26 @@ In order to generate Postscript that complies with the Adobe Document
Structuring Conventions, Tk actually generates Postscript in two passes. Structuring Conventions, Tk actually generates Postscript in two passes.
It calls each item's \fIpostscriptProc\fR in each pass. It calls each item's \fIpostscriptProc\fR in each pass.
The only purpose of the first pass is to collect font information The only purpose of the first pass is to collect font information
(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is (which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
discarded. discarded.
Tk sets the \fIprepass\fR argument to \fIpostscriptProc\fR to 1 Tk sets the \fIprepass\fR argument to \fIpostscriptProc\fR to 1
during the first pass; the type manager can use \fIprepass\fR to skip during the first pass; the type manager can use \fIprepass\fR to skip
all Postscript generation except for calls to \fBTk_CanvasPsFont\fR. all Postscript generation except for calls to \fBTk_CanvasPsFont\fR.
During the second pass \fIprepass\fR will be 0, so the type manager During the second pass \fIprepass\fR will be 0, so the type manager
must generate complete Postscript. must generate complete Postscript.
.SS SCALEPROC .SS SCALEPROC
.PP \fItypePtr->scaleProc\fR is invoked by Tk to rescale a canvas item
\fItypePtr\->scaleProc\fR is invoked by Tk to rescale a canvas item
during the \fBscale\fR widget command. during the \fBscale\fR widget command.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemScaleProc\fR( typedef void Tk_ItemScaleProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
double \fIoriginX\fR, double \fIoriginX\fR,
double \fIoriginY\fR, double \fIoriginY\fR,
double \fIscaleX\fR, double \fIscaleX\fR,
double \fIscaleY\fR); double \fIscaleY\fR);
.CE .CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning. The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIoriginX\fR and \fIoriginY\fR specify an origin relative to which \fIoriginX\fR and \fIoriginY\fR specify an origin relative to which
the item is to be scaled, and \fIscaleX\fR and \fIscaleY\fR give the the item is to be scaled, and \fIscaleX\fR and \fIscaleY\fR give the
@@ -522,171 +454,146 @@ x and y scale factors.
The item should adjust its coordinates so that a point in the item The item should adjust its coordinates so that a point in the item
that used to have coordinates \fIx\fR and \fIy\fR will have new that used to have coordinates \fIx\fR and \fIy\fR will have new
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
.PP
.CS .CS
\fIx\(fm\fR = \fIoriginX\fR + \fIscaleX\fR \(mu (\fIx\fR \(mi \fIoriginX\fR) \fIx\(fm = originX + scaleX*(x-originX)
\fIy\(fm\fR = \fIoriginY\fR + \fIscaleY\fR \(mu (\fIy\fR \(mi \fIoriginY\fR) y\(fm = originY + scaleY*(y-originY)\fR
.CE .CE
.PP
\fIscaleProc\fR must also update the bounding box in the item's \fIscaleProc\fR must also update the bounding box in the item's
header. header.
.SS TRANSLATEPROC .SS TRANSLATEPROC
.PP \fItypePtr->translateProc\fR is invoked by Tk to translate a canvas item
\fItypePtr\->translateProc\fR is invoked by Tk to translate a canvas item
during the \fBmove\fR widget command. during the \fBmove\fR widget command.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemTranslateProc\fR( typedef void Tk_ItemTranslateProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
double \fIdeltaX\fR, double \fIdeltaX\fR,
double \fIdeltaY\fR); double \fIdeltaY\fR);
.CE .CE
.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning, The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning,
and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be
added to each x and y coordinate within the item. added to each x and y coordinate within the item.
The type manager should adjust the item's coordinates and The type manager should adjust the item's coordinates and
update the bounding box in the item's header. update the bounding box in the item's header.
.SS INDEXPROC .SS INDEXPROC
.PP \fItypePtr->indexProc\fR is invoked by Tk to translate a string
\fItypePtr\->indexProc\fR is invoked by Tk to translate a string
index specification into a numerical index, for example during the index specification into a numerical index, for example during the
\fBindex\fR widget command. \fBindex\fR widget command.
It is only relevant for item types that support indexable text or coordinates; It is only relevant for item types that support indexable text;
\fItypePtr\->indexProc\fR may be specified as NULL for non-textual \fItypePtr->indexProc\fR may be specified as NULL for non-textual
item types if they do not support detailed coordinate addressing. item types.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemIndexProc\fR( typedef int Tk_ItemIndexProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
Tcl_Obj *\fIindexObj\fR, char \fIindexString\fR,
int *\fIindexPtr\fR); int *\fIindexPtr\fR);
.CE .CE
.PP
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all
have the usual meaning. have the usual meaning.
\fIindexObj\fR contains a textual description of an index, \fIindexString\fR contains a textual description of an index,
and \fIindexPtr\fR points to an integer value that should be and \fIindexPtr\fR points to an integer value that should be
filled in with a numerical index. filled in with a numerical index.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will
actually contain a pointer to a constant string.
It is up to the type manager to decide what forms of index It is up to the type manager to decide what forms of index
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR, are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
\fBend\fR, etc.). \fBend\fR, etc.).
\fIindexProc\fR should return a Tcl completion code and set \fIindexProc\fR should return a Tcl completion code and set
the interpreter result in the event of an error. \fIinterp->result\fR in the event of an error.
.SS ICURSORPROC .SS ICURSORPROC
.PP .PP
\fItypePtr\->icursorProc\fR is invoked by Tk during \fItypePtr->icursorProc\fR is invoked by Tk during
the \fBicursor\fR widget command to set the position of the the \fBicursor\fR widget command to set the position of the
insertion cursor in a textual item. insertion cursor in a textual item.
It is only relevant for item types that support an insertion cursor; It is only relevant for item types that support an insertion cursor;
\fItypePtr\->icursorProc\fR may be specified as NULL for item types \fItypePtr->icursorProc\fR may be specified as NULL for item types
that do not support an insertion cursor. that do not support an insertion cursor.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemCursorProc\fR( typedef void Tk_ItemCursorProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIindex\fR); int \fIindex\fR);
.CE .CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and \fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and
\fIindex\fR is an index into the item's text, as returned by a \fIindex\fR is an index into the item's text, as returned by a
previous call to \fItypePtr\->insertProc\fR. previous call to \fItypePtr->insertProc\fR.
The type manager should position the insertion cursor in the The type manager should position the insertion cursor in the
item just before the character given by \fIindex\fR. item just before the character given by \fIindex\fR.
Whether or not to actually display the insertion cursor is Whether or not to actually display the insertion cursor is
determined by other information provided by \fBTk_CanvasGetTextInfo\fR. determined by other information provided by \fBTk_CanvasGetTextInfo\fR.
.SS SELECTIONPROC .SS SELECTIONPROC
.PP .PP
\fItypePtr\->selectionProc\fR is invoked by Tk during selection \fItypePtr->selectionProc\fR is invoked by Tk during selection
retrievals; it must return part or all of the selected text in retrievals; it must return part or all of the selected text in
the item (if any). the item (if any).
It is only relevant for item types that support text; It is only relevant for item types that support text;
\fItypePtr\->selectionProc\fR may be specified as NULL for non-textual \fItypePtr->selectionProc\fR may be specified as NULL for non-textual
item types. item types.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef int \fBTk_ItemSelectionProc\fR( typedef int Tk_ItemSelectionProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIoffset\fR, int \fIoffset\fR,
char *\fIbuffer\fR, char *\fIbuffer\fR,
int \fImaxBytes\fR); int \fImaxBytes\fR);
.CE .CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIoffset\fR is an offset in bytes into the selection where 0 refers \fIoffset\fR is an offset in bytes into the selection where 0 refers
to the first byte of the selection; it identifies to the first byte of the selection; it identifies
the first character that is to be returned in this call. the first character that is to be returned in this call.
\fIbuffer\fR points to an area of memory in which to store the \fIbuffer\fR points to an area of memory in which to store the
requested bytes, and \fImaxBytes\fR specifies the maximum number requested bytes, and \fImaxBytes\fR specifies the maximum number
of bytes to return. of bytes to return.
\fIselectionProc\fR should extract up to \fImaxBytes\fR characters \fIselectionProc\fR should extract up to \fImaxBytes\fR characters
from the selection and copy them to \fImaxBytes\fR; it should from the selection and copy them to \fImaxBytes\fR; it should
return a count of the number of bytes actually copied, which may return a count of the number of bytes actually copied, which may
be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
in the selection. in the selection.
.SS INSERTPROC .SS INSERTPROC
.PP .PP
\fItypePtr\->insertProc\fR is invoked by Tk during \fItypePtr->insertProc\fR is invoked by Tk during
the \fBinsert\fR widget command to insert new text or coordinates into a the \fBinsert\fR widget command to insert new text into a
canvas item. canvas item.
It is only relevant for item types that support the \fBinsert\fR method; It is only relevant for item types that support text;
\fItypePtr\->insertProc\fR may be specified as NULL for other \fItypePtr->insertProc\fR may be specified as NULL for non-textual
item types. item types.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemInsertProc\fR( typedef void Tk_ItemInsertProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIindex\fR, int \fIindex\fR,
Tcl_Obj *\fIobj\fR); char *\fIstring\fR);
.CE .CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIindex\fR is an index into the item's text, as returned by a \fIindex\fR is an index into the item's text, as returned by a
previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR previous call to \fItypePtr->insertProc\fR, and \fIstring\fR
contains new text to insert just before the character given contains new text to insert just before the character given
by \fIindex\fR. by \fIindex\fR.
Note that if \fBTK_CONFIG_OBJS\fR is not set in the
\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will
actually contain a pointer to a constant string to be inserted.
If the item supports modification of the coordinates list by this
.PP
The type manager should insert the text and recompute the bounding The type manager should insert the text and recompute the bounding
box in the item's header. box in the item's header.
.SS DCHARSPROC .SS DCHARSPROC
.PP .PP
\fItypePtr\->dCharsProc\fR is invoked by Tk during the \fBdchars\fR \fItypePtr->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
widget command to delete a range of text from a canvas item or a range of widget command to delete a range of text from a canvas item.
coordinates from a pathed item.
It is only relevant for item types that support text; It is only relevant for item types that support text;
\fItypePtr\->dCharsProc\fR may be specified as NULL for non-textual \fItypePtr->dCharsProc\fR may be specified as NULL for non-textual
item types that do not want to support coordinate deletion. item types.
The procedure must match the following prototype: The procedure must match the following prototype:
.PP
.CS .CS
typedef void \fBTk_ItemDCharsProc\fR( typedef void Tk_ItemDCharsProc(
Tk_Canvas \fIcanvas\fR, Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR, Tk_Item *\fIitemPtr\fR,
int \fIfirst\fR, int \fIfirst\fR,
int \fIlast\fR); int \fIlast\fR);
.CE .CE
.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIfirst\fR and \fIlast\fR give the indices of the first and last bytes \fIfirst\fR and \fIlast\fR give the indices of the first and last bytes
to be deleted, as returned by previous calls to \fItypePtr\->indexProc\fR. to be deleted, as returned by previous calls to \fItypePtr->indexProc\fR.
The type manager should delete the specified characters and update The type manager should delete the specified characters and update
the bounding box in the item's header. the bounding box in the item's header.
.SH "SEE ALSO" .SH "SEE ALSO"

View File

@@ -9,8 +9,8 @@
'\" Department of Computer Science, '\" Department of Computer Science,
'\" Australian National University. '\" Australian National University.
'\" '\"
.TH Tk_CreatePhotoImageFormat 3 8.5 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreatePhotoImageFormat 3 8.5 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreatePhotoImageFormat \- define new file format for photo images Tk_CreatePhotoImageFormat \- define new file format for photo images
@@ -20,10 +20,11 @@ Tk_CreatePhotoImageFormat \- define new file format for photo images
.sp .sp
\fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR) \fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS "const Tk_PhotoImageFormat" *formatPtr .AS Tk_PhotoImageFormat *formatPtr
.AP "const Tk_PhotoImageFormat" *formatPtr in .AP Tk_PhotoImageFormat *formatPtr in
Structure that defines the new file format. Structure that defines the new file format.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_CreatePhotoImageFormat\fR is invoked to define a new file format \fBTk_CreatePhotoImageFormat\fR is invoked to define a new file format
@@ -45,14 +46,14 @@ handler to deal with files and strings in this format. The
Tk_PhotoImageFormat structure contains the following fields: Tk_PhotoImageFormat structure contains the following fields:
.CS .CS
typedef struct Tk_PhotoImageFormat { typedef struct Tk_PhotoImageFormat {
const char *\fIname\fR; char *\fIname\fR;
Tk_ImageFileMatchProc *\fIfileMatchProc\fR; Tk_ImageFileMatchProc *\fIfileMatchProc\fR;
Tk_ImageStringMatchProc *\fIstringMatchProc\fR; Tk_ImageStringMatchProc *\fIstringMatchProc\fR;
Tk_ImageFileReadProc *\fIfileReadProc\fR; Tk_ImageFileReadProc *\fIfileReadProc\fR;
Tk_ImageStringReadProc *\fIstringReadProc\fR; Tk_ImageStringReadProc *\fIstringReadProc\fR;
Tk_ImageFileWriteProc *\fIfileWriteProc\fR; Tk_ImageFileWriteProc *\fIfileWriteProc\fR;
Tk_ImageStringWriteProc *\fIstringWriteProc\fR; Tk_ImageStringWriteProc *\fIstringWriteProc\fR;
} \fBTk_PhotoImageFormat\fR; } Tk_PhotoImageFormat;
.CE .CE
.PP .PP
The handler need not provide implementations of all six procedures. The handler need not provide implementations of all six procedures.
@@ -64,7 +65,8 @@ structure should be set to NULL. The handler must provide the
\fIfileMatchProc\fR procedure if it provides the \fIfileReadProc\fR \fIfileMatchProc\fR procedure if it provides the \fIfileReadProc\fR
procedure, and the \fIstringMatchProc\fR procedure if it provides the procedure, and the \fIstringMatchProc\fR procedure if it provides the
\fIstringReadProc\fR procedure. \fIstringReadProc\fR procedure.
.SS NAME
.SH NAME
.PP .PP
\fIformatPtr->name\fR provides a name for the image type. \fIformatPtr->name\fR provides a name for the image type.
Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used
@@ -75,20 +77,20 @@ the \fB\-format\fR option. The first character of \fIformatPtr->name\fR
must not be an uppercase character from the ASCII character set must not be an uppercase character from the ASCII character set
(that is, one of the characters \fBA\fR-\fBZ\fR). Such names are used (that is, one of the characters \fBA\fR-\fBZ\fR). Such names are used
only for legacy interface support (see below). only for legacy interface support (see below).
.SS FILEMATCHPROC
.PP .SH FILEMATCHPROC
\fIformatPtr->fileMatchProc\fR provides the address of a procedure for \fIformatPtr->fileMatchProc\fR provides the address of a procedure for
Tk to call when it is searching for an image file format handler Tk to call when it is searching for an image file format handler
suitable for reading data in a given file. suitable for reading data in a given file.
\fIformatPtr->fileMatchProc\fR must match the following prototype: \fIformatPtr->fileMatchProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageFileMatchProc\fR( typedef int Tk_ImageFileMatchProc(
Tcl_Channel \fIchan\fR, Tcl_Channel \fIchan\fR,
const char *\fIfileName\fR, const char *\fIfileName\fR,
Tcl_Obj *\fIformat\fR, Tcl_Obj *\fIformat\fR,
int *\fIwidthPtr\fR, int *\fIwidthPtr\fR,
int *\fIheightPtr\fR, int *\fIheightPtr\fR,
Tcl_Interp *\fIinterp\fR); Tcl_Interp *\fIinterp\fR);
.CE .CE
The \fIfileName\fR argument is the name of the file containing the The \fIfileName\fR argument is the name of the file containing the
image data, which is open for reading as \fIchan\fR. The image data, which is open for reading as \fIchan\fR. The
@@ -98,19 +100,19 @@ If the data in the file appears to be in the format supported by this
handler, the \fIformatPtr->fileMatchProc\fR procedure should store the handler, the \fIformatPtr->fileMatchProc\fR procedure should store the
width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR
respectively, and return 1. Otherwise it should return 0. respectively, and return 1. Otherwise it should return 0.
.SS STRINGMATCHPROC
.PP .SH STRINGMATCHPROC
\fIformatPtr->stringMatchProc\fR provides the address of a procedure for \fIformatPtr->stringMatchProc\fR provides the address of a procedure for
Tk to call when it is searching for an image file format handler for Tk to call when it is searching for an image file format handler for
suitable for reading data from a given string. suitable for reading data from a given string.
\fIformatPtr->stringMatchProc\fR must match the following prototype: \fIformatPtr->stringMatchProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageStringMatchProc\fR( typedef int Tk_ImageStringMatchProc(
Tcl_Obj *\fIdata\fR, Tcl_Obj *\fIdata\fR,
Tcl_Obj *\fIformat\fR, Tcl_Obj *\fIformat\fR,
int *\fIwidthPtr\fR, int *\fIwidthPtr\fR,
int *\fIheightPtr\fR, int *\fIheightPtr\fR,
Tcl_Interp *\fIinterp\fR); Tcl_Interp *\fIinterp\fR);
.CE .CE
The \fIdata\fR argument points to the object containing the image The \fIdata\fR argument points to the object containing the image
data. The \fIformat\fR argument contains the value given for data. The \fIformat\fR argument contains the value given for
@@ -120,21 +122,21 @@ this handler, the \fIformatPtr->stringMatchProc\fR procedure should
store the width and height of the image in *\fIwidthPtr\fR and store the width and height of the image in *\fIwidthPtr\fR and
*\fIheightPtr\fR respectively, and return 1. Otherwise it should *\fIheightPtr\fR respectively, and return 1. Otherwise it should
return 0. return 0.
.SS FILEREADPROC
.PP .SH FILEREADPROC
\fIformatPtr->fileReadProc\fR provides the address of a procedure for \fIformatPtr->fileReadProc\fR provides the address of a procedure for
Tk to call to read data from an image file into a photo image. Tk to call to read data from an image file into a photo image.
\fIformatPtr->fileReadProc\fR must match the following prototype: \fIformatPtr->fileReadProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageFileReadProc\fR( typedef int Tk_ImageFileReadProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tcl_Channel \fIchan\fR, Tcl_Channel \fIchan\fR,
const char *\fIfileName\fR, const char *\fIfileName\fR,
Tcl_Obj *\fIformat\fR, Tcl_Obj *\fIformat\fR,
PhotoHandle \fIimageHandle\fR, PhotoHandle \fIimageHandle\fR,
int \fIdestX\fR, int \fIdestY\fR, int \fIdestX\fR, int \fIdestY\fR,
int \fIwidth\fR, int \fIheight\fR, int \fIwidth\fR, int \fIheight\fR,
int \fIsrcX\fR, int \fIsrcY\fR); int \fIsrcX\fR, int \fIsrcY\fR);
.CE .CE
The \fIinterp\fR argument is the interpreter in which the command was The \fIinterp\fR argument is the interpreter in which the command was
invoked to read the image; it should be used for reporting errors. invoked to read the image; it should be used for reporting errors.
@@ -149,20 +151,20 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
image with its top-left corner at coordinates image with its top-left corner at coordinates
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure. (\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
The return value is a standard Tcl return value. The return value is a standard Tcl return value.
.SS STRINGREADPROC
.PP .SH STRINGREADPROC
\fIformatPtr->stringReadProc\fR provides the address of a procedure for \fIformatPtr->stringReadProc\fR provides the address of a procedure for
Tk to call to read data from a string into a photo image. Tk to call to read data from a string into a photo image.
\fIformatPtr->stringReadProc\fR must match the following prototype: \fIformatPtr->stringReadProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageStringReadProc\fR( typedef int Tk_ImageStringReadProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tcl_Obj *\fIdata\fR, Tcl_Obj *\fIdata\fR,
Tcl_Obj *\fIformat\fR, Tcl_Obj *\fIformat\fR,
PhotoHandle \fIimageHandle\fR, PhotoHandle \fIimageHandle\fR,
int \fIdestX\fR, int \fIdestY\fR, int \fIdestX\fR, int \fIdestY\fR,
int \fIwidth\fR, int \fIheight\fR, int \fIwidth\fR, int \fIheight\fR,
int \fIsrcX\fR, int \fIsrcY\fR); int \fIsrcX\fR, int \fIsrcY\fR);
.CE .CE
The \fIinterp\fR argument is the interpreter in which the command was The \fIinterp\fR argument is the interpreter in which the command was
invoked to read the image; it should be used for reporting errors. invoked to read the image; it should be used for reporting errors.
@@ -177,17 +179,17 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
image with its top-left corner at coordinates image with its top-left corner at coordinates
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure. (\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
The return value is a standard Tcl return value. The return value is a standard Tcl return value.
.SS FILEWRITEPROC
.PP .SH FILEWRITEPROC
\fIformatPtr->fileWriteProc\fR provides the address of a procedure for \fIformatPtr->fileWriteProc\fR provides the address of a procedure for
Tk to call to write data from a photo image to a file. Tk to call to write data from a photo image to a file.
\fIformatPtr->fileWriteProc\fR must match the following prototype: \fIformatPtr->fileWriteProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageFileWriteProc\fR( typedef int Tk_ImageFileWriteProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
const char *\fIfileName\fR, const char *\fIfileName\fR,
Tcl_Obj *\fIformat\fR, Tcl_Obj *\fIformat\fR,
Tk_PhotoImageBlock *\fIblockPtr\fR); Tk_PhotoImageBlock *\fIblockPtr\fR);
.CE .CE
The \fIinterp\fR argument is the interpreter in which the command was The \fIinterp\fR argument is the interpreter in which the command was
invoked to write the image; it should be used for reporting errors. invoked to write the image; it should be used for reporting errors.
@@ -202,16 +204,16 @@ after the name of the format. If appropriate, the
\fIformatPtr->fileWriteProc\fR procedure may interpret these \fIformatPtr->fileWriteProc\fR procedure may interpret these
characters to specify further details about the image file. characters to specify further details about the image file.
The return value is a standard Tcl return value. The return value is a standard Tcl return value.
.SS STRINGWRITEPROC
.PP .SH STRINGWRITEPROC
\fIformatPtr->stringWriteProc\fR provides the address of a procedure for \fIformatPtr->stringWriteProc\fR provides the address of a procedure for
Tk to call to translate image data from a photo image into a string. Tk to call to translate image data from a photo image into a string.
\fIformatPtr->stringWriteProc\fR must match the following prototype: \fIformatPtr->stringWriteProc\fR must match the following prototype:
.CS .CS
typedef int \fBTk_ImageStringWriteProc\fR( typedef int Tk_ImageStringWriteProc(
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
Tcl_Obj *\fIformat\fR, Tcl_Obj *\fIformat\fR,
Tk_PhotoImageBlock *\fIblockPtr\fR); Tk_PhotoImageBlock *\fIblockPtr\fR);
.CE .CE
The \fIinterp\fR argument is the interpreter in which the command was The \fIinterp\fR argument is the interpreter in which the command was
invoked to convert the image; it should be used for reporting errors. invoked to convert the image; it should be used for reporting errors.
@@ -226,8 +228,8 @@ after the name of the format. If appropriate, the
\fIformatPtr->stringWriteProc\fR procedure may interpret these \fIformatPtr->stringWriteProc\fR procedure may interpret these
characters to specify further details about the image file. characters to specify further details about the image file.
The return value is a standard Tcl return value. The return value is a standard Tcl return value.
.SH "LEGACY INTERFACE SUPPORT" .SH "LEGACY INTERFACE SUPPORT"
.PP
In Tk 8.2 and earlier, the definition of all the function pointer In Tk 8.2 and earlier, the definition of all the function pointer
types stored in fields of a \fBTk_PhotoImageFormat\fR struct were types stored in fields of a \fBTk_PhotoImageFormat\fR struct were
incompatibly different. Legacy programs and libraries dating from incompatibly different. Legacy programs and libraries dating from
@@ -264,7 +266,9 @@ use Tk 8.4 headers and stub libraries to do so.
.PP .PP
Any new code written today should not make use of the legacy Any new code written today should not make use of the legacy
interfaces. Expect their support to go away in Tk 9. interfaces. Expect their support to go away in Tk 9.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_FindPhoto, Tk_PhotoPutBlock Tk_FindPhoto, Tk_PhotoPutBlock
.SH KEYWORDS .SH KEYWORDS
photo image, image file photo image, image file

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateSelHandler, Tk_DeleteSelHandler \- arrange to handle requests for a selection Tk_CreateSelHandler, Tk_DeleteSelHandler \- arrange to handle requests for a selection
@@ -44,7 +44,7 @@ requestor.
\fBTk_CreateSelHandler\fR arranges for a particular procedure \fBTk_CreateSelHandler\fR arranges for a particular procedure
(\fIproc\fR) to be called whenever \fIselection\fR is owned by (\fIproc\fR) to be called whenever \fIselection\fR is owned by
\fItkwin\fR and the selection contents are requested in the \fItkwin\fR and the selection contents are requested in the
form given by \fItarget\fR. form given by \fItarget\fR.
\fITarget\fR should be one of \fITarget\fR should be one of
the entries defined in the left column of Table 2 of the the entries defined in the left column of Table 2 of the
X Inter-Client Communication Conventions Manual (ICCCM) or X Inter-Client Communication Conventions Manual (ICCCM) or
@@ -54,11 +54,11 @@ the selection. The most common form is STRING.
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the
type \fBTk_SelectionProc\fR: type \fBTk_SelectionProc\fR:
.CS .CS
typedef int \fBTk_SelectionProc\fR( typedef int Tk_SelectionProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
int \fIoffset\fR, int \fIoffset\fR,
char *\fIbuffer\fR, char *\fIbuffer\fR,
int \fImaxBytes\fR); int \fImaxBytes\fR);
.CE .CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the The \fIclientData\fR parameter to \fIproc\fR is a copy of the
\fIclientData\fR argument given to \fBTk_CreateSelHandler\fR. \fIclientData\fR argument given to \fBTk_CreateSelHandler\fR.
@@ -112,5 +112,6 @@ existing handler is replaced with a new one.
\fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR, \fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR,
\fIselection\fR, and \fItarget\fR, if such a handler exists. \fIselection\fR, and \fItarget\fR, if such a handler exists.
If there is no such handler then it has no effect. If there is no such handler then it has no effect.
.SH KEYWORDS .SH KEYWORDS
format, handler, selection, target format, handler, selection, target

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateWindow, Tk_CreateWindowFromPath, Tk_DestroyWindow, Tk_MakeWindowExist \- create or delete window Tk_CreateWindow, Tk_CreateWindowFromPath, Tk_DestroyWindow, Tk_MakeWindowExist \- create or delete window
@@ -52,14 +52,14 @@ Name of new window, specified as path name within application
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The procedures \fBTk_CreateWindow\fR, The procedures \fBTk_CreateWindow\fR,
\fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR \fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR
are used to create new windows for are used to create new windows for
use in Tk-based applications. Each of the procedures returns a token use in Tk-based applications. Each of the procedures returns a token
that can be used to manipulate the window in other calls to the Tk that can be used to manipulate the window in other calls to the Tk
library. If the window could not be created successfully, then NULL library. If the window could not be created successfully, then NULL
is returned and the result of interpreter \fIinterp\fR is modified to is returned and \fIinterp->result\fR is modified to hold an error
hold an error message. message.
.PP .PP
Tk supports two different kinds of windows: internal Tk supports two different kinds of windows: internal
windows and top-level windows. windows and top-level windows.
@@ -86,7 +86,7 @@ which would in turn be a child of the menu bar window. A dialog box might
have the application's main window as its parent. have the application's main window as its parent.
.PP .PP
\fBTk_CreateAnonymousWindow\fR differs from \fBTk_CreateWindow\fR in \fBTk_CreateAnonymousWindow\fR differs from \fBTk_CreateWindow\fR in
that it creates an unnamed window. This window will be manipulatable that it creates an unnamed window. This window will be manipulable
only using C interfaces, and will not be visible to Tcl scripts. Both only using C interfaces, and will not be visible to Tcl scripts. Both
interior windows and top-level windows may be created with interior windows and top-level windows may be created with
\fBTk_CreateAnonymousWindow\fR. \fBTk_CreateAnonymousWindow\fR.
@@ -141,6 +141,7 @@ but has not been mapped, so no X window exists, it is
possible to force the creation of the X window by possible to force the creation of the X window by
calling \fBTk_MakeWindowExist\fR. This procedure issues calling \fBTk_MakeWindowExist\fR. This procedure issues
the X commands to instantiate the window given by \fItkwin\fR. the X commands to instantiate the window given by \fItkwin\fR.
.SH KEYWORDS .SH KEYWORDS
create, deferred creation, destroy, display, internal window, create, deferred creation, destroy, display, internal window,
screen, top-level window, window screen, top-level window, window

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_DeleteImage \- Destroy an image. Tk_DeleteImage \- Destroy an image.
@@ -21,11 +21,13 @@ Interpreter for which the image was created.
.AP "const char" *name in .AP "const char" *name in
Name of the image. Name of the image.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR \fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR
and \fIname\fR, if there is one. All instances of that image and \fIname\fR, if there is one. All instances of that image
will redisplay as empty regions. If the given image does not will redisplay as empty regions. If the given image does not
exist then the procedure has no effect. exist then the procedure has no effect.
.SH KEYWORDS .SH KEYWORDS
delete image, image manager delete image, image manager

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget
@@ -27,10 +27,12 @@ Width of the highlight ring, in pixels.
Drawable in which to draw the highlight; usually an offscreen Drawable in which to draw the highlight; usually an offscreen
pixmap for double buffering. pixmap for double buffering.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the \fBTk_DrawFocusHighlight\fR is a utility procedure that draws the
traversal highlight ring for a widget. traversal highlight ring for a widget.
It is typically invoked by widgets during redisplay. It is typically invoked by widgets during redisplay.
.SH KEYWORDS .SH KEYWORDS
focus, traversal highlight focus, traversal highlight

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event
@@ -30,6 +30,7 @@ in the window given by \fItkwin\fR.
.AP ClientData clientData in .AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR. Arbitrary one-word value to pass to \fIproc\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be \fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be
@@ -38,15 +39,15 @@ by \fImask\fR occurs in the window specified by \fItkwin\fR.
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
this mechanism only works in programs that dispatch events this mechanism only works in programs that dispatch events
through \fBTk_HandleEvent\fR (or through other Tk procedures that through \fBTk_HandleEvent\fR (or through other Tk procedures that
call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
\fBTk_MainLoop\fR). \fBTk_MainLoop\fR).
.PP .PP
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the
type \fBTk_EventProc\fR: type \fBTk_EventProc\fR:
.CS .CS
typedef void \fBTk_EventProc\fR( typedef void Tk_EventProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
XEvent *\fIeventPtr\fR); XEvent *\fIeventPtr\fR);
.CE .CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
argument given to \fBTk_CreateEventHandler\fR when the callback argument given to \fBTk_CreateEventHandler\fR when the callback
@@ -71,5 +72,6 @@ automatically; in this case there is no need to call
If multiple handlers are declared for the same type of X event If multiple handlers are declared for the same type of X event
on the same window, then the handlers will be invoked in the on the same window, then the handlers will be invoked in the
order they were created. order they were created.
.SH KEYWORDS .SH KEYWORDS
bind, callback, event, handler bind, callback, event, handler

View File

@@ -4,13 +4,13 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
'\" Author: Paul Mackerras (paulus@cs.anu.edu.au), '\" Author: Paul Mackerras (paulus@cs.anu.edu.au),
'\" Department of Computer Science, '\" Department of Computer Science,
'\" Australian National University. '\" Australian National University.
'\" '\"
.TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_PhotoBlank, Tk_PhotoExpand, Tk_PhotoGetSize, Tk_PhotoSetSize \- manipulate the image data stored in a photo image. Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_PhotoBlank, Tk_PhotoExpand, Tk_PhotoGetSize, Tk_PhotoSetSize \- manipulate the image data stored in a photo image.
@@ -21,6 +21,7 @@ Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_Pho
Tk_PhotoHandle Tk_PhotoHandle
\fBTk_FindPhoto\fR(\fIinterp, imageName\fR) \fBTk_FindPhoto\fR(\fIinterp, imageName\fR)
.sp .sp
.VS 8.5
int int
\fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\ \fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
compRule\fR) compRule\fR)
@@ -28,6 +29,7 @@ compRule\fR)
int int
\fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\ \fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
zoomX, zoomY, subsampleX, subsampleY, compRule\fR) zoomX, zoomY, subsampleX, subsampleY, compRule\fR)
.VE 8.5
.sp .sp
int int
\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR) \fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR)
@@ -35,14 +37,18 @@ int
void void
\fBTk_PhotoBlank\fR(\fIhandle\fR) \fBTk_PhotoBlank\fR(\fIhandle\fR)
.sp .sp
.VS 8.5
int int
\fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR) \fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR)
.VE 8.5
.sp .sp
void void
\fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR) \fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR)
.sp .sp
.VS 8.5
int int
\fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR) \fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR)
.VE 8.5
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_PhotoImageBlock window_path .AS Tk_PhotoImageBlock window_path
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
@@ -93,14 +99,13 @@ being written to the photo image.
Specifies the zoom factor to be applied in the Y direction to pixels Specifies the zoom factor to be applied in the Y direction to pixels
being written to the photo image. being written to the photo image.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_FindPhoto\fR returns an opaque handle that is used to identify a \fBTk_FindPhoto\fR returns an opaque handle that is used to identify a
particular photo image to the other procedures. The parameter is the particular photo image to the other procedures. The parameter is the
name of the image, that is, the name specified to the \fBimage create name of the image, that is, the name specified to the \fBimage create
photo\fR command, or assigned by that command if no name was specified. photo\fR command, or assigned by that command if no name was specified.
If \fIimageName\fR does not exist or is not a photo image,
\fBTk_FindPhoto\fR returns NULL.
.PP .PP
\fBTk_PhotoPutBlock\fR is used to supply blocks of image data to be \fBTk_PhotoPutBlock\fR is used to supply blocks of image data to be
displayed. The call affects an area of the image of size displayed. The call affects an area of the image of size
@@ -123,30 +128,21 @@ typedef struct {
int \fIheight\fR; int \fIheight\fR;
int \fIpitch\fR; int \fIpitch\fR;
int \fIpixelSize\fR; int \fIpixelSize\fR;
int \fIoffset\fR[4]; int \fIoffset[4]\fR;
} \fBTk_PhotoImageBlock\fR; } Tk_PhotoImageBlock;
.CE .CE
The \fIpixelPtr\fR field points to the first pixel, that is, the The \fIpixelPtr\fR field points to the first pixel, that is, the
top-left pixel in the block. top-left pixel in the block.
The \fIwidth\fR and \fIheight\fR fields specify the dimensions of the The \fIwidth\fR and \fIheight\fR fields specify the dimensions of the
block of pixels. The \fIpixelSize\fR field specifies the address block of pixels. The \fIpixelSize\fR field specifies the address
difference between two horizontally adjacent pixels. It should be 4 for difference between two horizontally adjacent pixels. Often it is 3
RGB and 2 for grayscale image data. Other values are possible, if the or 4, but it can have any value. The \fIpitch\fR field specifies the
offsets in the \fIoffset\fR array are adjusted accordingly (e.g. for
red, green and blue data stored in different planes). Using such a
layout is strongly discouraged, though. Due to a bug, it might not work
correctly if an alpha channel is provided. (see the \fBBUGS\fR section
below). The \fIpitch\fR field specifies the
address difference between two vertically adjacent pixels. The address difference between two vertically adjacent pixels. The
\fIoffset\fR array contains the offsets from the address of a pixel \fIoffset\fR array contains the offsets from the address of a pixel
to the addresses of the bytes containing the red, green, blue and alpha to the addresses of the bytes containing the red, green, blue and alpha
(transparency) components. If the offsets for red, green and blue are (transparency) components. These are normally 0, 1, 2 and 3, but can
equal, the image is interpreted as grayscale. If they differ, RGB data have other values, e.g., for images that are stored as separate red,
is assumed. Normally the offsets will be 0, 1, 2, 3 for RGB data green and blue planes.
and 0, 0, 0, 1 for grayscale. It is possible to provide image data
without an alpha channel by setting the offset for alpha to a negative
value and adjusting the \fIpixelSize\fR field accordingly. This use is
discouraged, though (see the \fBBUGS\fR section below).
.PP .PP
The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a
compositing rule that says what to do with transparent pixels. The compositing rule that says what to do with transparent pixels. The
@@ -165,10 +161,12 @@ given are replicated (in a tiled fashion) to fill the specified area.
These rules operate independently in the horizontal and vertical These rules operate independently in the horizontal and vertical
directions. directions.
.PP .PP
.VS 8.5
\fBTk_PhotoPutBlock\fR normally returns \fBTCL_OK\fR, though if it cannot \fBTk_PhotoPutBlock\fR normally returns \fBTCL_OK\fR, though if it cannot
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
returned instead and, if the \fIinterp\fR argument is non-NULL, an returned instead and, if the \fIinterp\fR argument is non-NULL, an
error message is placed in the interpreter's result. error message is placed in the interpreter's result.
.VE 8.5
.PP .PP
\fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except that \fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except that
the image can be reduced or enlarged for display. The the image can be reduced or enlarged for display. The
@@ -192,18 +190,6 @@ in the structure pointed to by the \fIblockPtr\fR parameter with values
that describe the address and layout of the image data that the that describe the address and layout of the image data that the
photo image has stored internally. The values are valid photo image has stored internally. The values are valid
until the image is destroyed or its size is changed. until the image is destroyed or its size is changed.
.PP
It is possible to modify an image by writing directly to the data
the \fIpixelPtr\fR field points to. The size of the image cannot be
changed this way, though.
Also, changes made by writing directly to \fIpixelPtr\fR will not be
immediately visible, but only after a call to
\fBTk_ImageChanged\fR or after an event that causes the interested
widgets to redraw themselves.
For these reasons usually it is preferable to make changes to
a copy of the image data and write it back with
\fBTk_PhotoPutBlock\fR or \fBTk_PhotoPutZoomedBlock\fR.
.PP
\fBTk_PhotoGetImage\fR returns 1 for compatibility with the \fBTk_PhotoGetImage\fR returns 1 for compatibility with the
corresponding procedure in the old photo widget. corresponding procedure in the old photo widget.
.PP .PP
@@ -221,10 +207,12 @@ are being supplied in many small blocks, it is more efficient to use
allowing the image to expand in many small increments as image blocks allowing the image to expand in many small increments as image blocks
are supplied. are supplied.
.PP .PP
.VS 8.5
\fBTk_PhotoExpand\fR normally returns \fBTCL_OK\fR, though if it cannot \fBTk_PhotoExpand\fR normally returns \fBTCL_OK\fR, though if it cannot
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
returned instead and, if the \fIinterp\fR argument is non-NULL, an returned instead and, if the \fIinterp\fR argument is non-NULL, an
error message is placed in the interpreter's result. error message is placed in the interpreter's result.
.VE 8.5
.PP .PP
\fBTk_PhotoSetSize\fR specifies the size of the image, as if the user \fBTk_PhotoSetSize\fR specifies the size of the image, as if the user
had specified the given \fIwidth\fR and \fIheight\fR values to the had specified the given \fIwidth\fR and \fIheight\fR values to the
@@ -234,13 +222,16 @@ or height, but allows the width or height to be changed by subsequent
calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or
\fBTk_PhotoExpand\fR. \fBTk_PhotoExpand\fR.
.PP .PP
.VS 8.5
\fBTk_PhotoSetSize\fR normally returns \fBTCL_OK\fR, though if it cannot \fBTk_PhotoSetSize\fR normally returns \fBTCL_OK\fR, though if it cannot
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
returned instead and, if the \fIinterp\fR argument is non-NULL, an returned instead and, if the \fIinterp\fR argument is non-NULL, an
error message is placed in the interpreter's result. error message is placed in the interpreter's result.
.VE 8.5
.PP .PP
\fBTk_PhotoGetSize\fR returns the dimensions of the image in \fBTk_PhotoGetSize\fR returns the dimensions of the image in
*\fIwidthPtr\fR and *\fIheightPtr\fR. *\fIwidthPtr\fR and *\fIheightPtr\fR.
.SH PORTABILITY .SH PORTABILITY
.PP .PP
In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and
@@ -250,6 +241,7 @@ your code, compile it with the flag
-DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against -DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against
older versions of Tk will continue to work. older versions of Tk will continue to work.
.PP .PP
.VS 8.5
In Tk 8.4, \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR, In Tk 8.4, \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR,
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR did not take an \fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR did not take an
\fIinterp\fR argument or return any result code. If insufficient \fIinterp\fR argument or return any result code. If insufficient
@@ -257,27 +249,12 @@ memory was available for an image, Tk would panic. This behaviour is
still supported if you compile your extension with the additional flag still supported if you compile your extension with the additional flag
-DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against -DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against
older versions of Tk will continue to work. older versions of Tk will continue to work.
.SH BUGS .VE 8.5
The \fBTk_PhotoImageBlock\fR structure used to provide image data to
\fBTk_PhotoPutBlock\fR promises great flexibility in the layout of the
data (e.g. separate planes for the red, green, blue and alpha
channels). Unfortunately, the implementation fails to hold this
promise. The problem is that the \fIpixelSize\fR field is
(incorrectly) used to determine whether the image has an alpha channel.
Currently, if the offset for the alpha channel is greater or equal than
\fIpixelSize\fR, \fBtk_PhotoPutblock\fR assumes no alpha data is
present and makes the image fully opaque. This means that for layouts
where the channels are separate (or any other exotic layout where
\fIpixelSize\fR has to be smaller than the alpha offset), the alpha
channel will not be read correctly. In order to be on the safe side
if this issue will be corrected in a future release, it is strongly
recommended you always provide alpha data - even if the image has no
transparency - and only use the "standard" layout with a
\fIpixelSize\fR of 2 for grayscale and 4 for RGB data with
\fIoffset\fRs of 0, 0, 0, 1 or 0, 1, 2, 3 respectively.
.SH CREDITS .SH CREDITS
.PP .PP
The code for the photo image type was developed by Paul Mackerras, The code for the photo image type was developed by Paul Mackerras,
based on his earlier photo widget code. based on his earlier photo widget code.
.SH KEYWORDS .SH KEYWORDS
photo, image photo, image

View File

@@ -3,12 +3,12 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for
fonts fonts
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
@@ -37,7 +37,7 @@ Postscript font that corresponds to \fItkfont\fR will be appended.
.PP .PP
Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be
selected into an XGCValues structure in order to construct a graphics selected into an XGCValues structure in order to construct a graphics
context that can be used to draw text in the specified font. context that can be used to draw text in the specified font.
.PP .PP
\fBTk_GetFontMetrics\fR computes the ascent, descent, and linespace of the \fBTk_GetFontMetrics\fR computes the ascent, descent, and linespace of the
\fItkfont\fR in pixels and stores those values in the structure pointer to by \fItkfont\fR in pixels and stores those values in the structure pointer to by
@@ -45,7 +45,7 @@ context that can be used to draw text in the specified font.
multiple lines of text, to align the baselines of text in different multiple lines of text, to align the baselines of text in different
fonts, and to vertically align text in a given region. See the fonts, and to vertically align text in a given region. See the
documentation for the \fBfont\fR command for definitions of the terms documentation for the \fBfont\fR command for definitions of the terms
ascent, descent, and linespace, used in font metrics. ascent, descent, and linespace, used in font metrics.
.PP .PP
\fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding \fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding
Postscript font name that should be used when printing. The return value Postscript font name that should be used when printing. The return value
@@ -56,16 +56,15 @@ appended to \fIdsPtr\fR. \fIDsPtr\fR must refer to an initialized
Postscript printer, the Postscript printer, the
following screen font families should print correctly: following screen font families should print correctly:
.IP .IP
\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR, \fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR,
\fBCourier New\fR, \fBGeneva\fR, \fBHelvetica\fR, \fBMonaco\fR, \fBCourier New\fR, \fBGeneva\fR, \fBHelvetica\fR, \fBMonaco\fR,
\fBNew Century Schoolbook\fR, \fBNew York\fR, \fBPalatino\fR, \fBSymbol\fR, \fBNew Century Schoolbook\fR, \fBNew York\fR, \fBPalatino\fR, \fBSymbol\fR,
\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and \fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and
\fBZapf Dingbats\fR. \fBZapf Dingbats\fR.
.PP .PP
Any other font families may not print correctly because the computed Any other font families may not print correctly because the computed
Postscript font name may be incorrect or not exist on the printer. Postscript font name may be incorrect or not exist on the printer.
.SH "DATA STRUCTURES" .SH "DATA STRUCTURES"
.PP
The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to
return information about a font and is defined as follows: return information about a font and is defined as follows:
.CS .CS
@@ -73,7 +72,7 @@ typedef struct Tk_FontMetrics {
int \fIascent\fR; int \fIascent\fR;
int \fIdescent\fR; int \fIdescent\fR;
int \fIlinespace\fR; int \fIlinespace\fR;
} \fBTk_FontMetrics\fR; } Tk_FontMetrics;
.CE .CE
.PP .PP
The \fIascent\fR field is the amount in pixels that the tallest The \fIascent\fR field is the amount in pixels that the tallest

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_FreeXId \- make X resource identifier available for reuse Tk_FreeXId \- make X resource identifier available for reuse

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window
@@ -44,6 +44,7 @@ Space to leave for top side of internal border for \fItkwin\fR, in pixel units.
.AP int bottom in .AP int bottom in
Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GeometryRequest\fR is called by widget code to indicate its \fBTk_GeometryRequest\fR is called by widget code to indicate its
@@ -88,5 +89,6 @@ The information specified in calls to \fBTk_GeometryRequest\fR,
\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and \fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and
\fBTk_InternalBorderBottom\fR. \fBTk_InternalBorderBottom\fR.
See the \fBTk_WindowId\fR manual entry for details. See the \fBTk_WindowId\fR manual entry for details.
.SH KEYWORDS .SH KEYWORDS
geometry, request geometry, request

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings and anchor positions Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings and anchor positions
@@ -28,20 +28,17 @@ const char *
Interpreter to use for error reporting, or NULL. Interpreter to use for error reporting, or NULL.
.AP Tcl_Obj *objPtr in/out .AP Tcl_Obj *objPtr in/out
String value contains name of anchor point: String value contains name of anchor point:
.QW \fBn\fR , .QW n ,
.QW \fBne\fR , .QW ne ,
.QW \fBe\fR , .QW e ,
.QW \fBse\fR , .QW se ,
.QW \fBs\fR , .QW s ,
.QW \fBsw\fR , .QW sw ,
.QW \fBw\fR , .QW w ,
.QW \fBnw\fR , .QW nw ,
or or
.QW \fBcenter\fR ; .QW center ;
internal rep will be modified to cache corresponding Tk_Anchor. In the internal rep will be modified to cache corresponding Tk_Anchor.
case of
.QW \fBcenter\fR
on input, a non-empty abbreviation of it may also be used on input.
.AP "const char" *string in .AP "const char" *string in
Same as \fIobjPtr\fR except description of anchor point is passed as Same as \fIobjPtr\fR except description of anchor point is passed as
a string. a string.

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap \- maintain database of single-plane pixmaps Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap \- maintain database of single-plane pixmaps
@@ -49,7 +49,7 @@ Same as \fIobjPtr\fR except description of bitmap is passed as a string and
resulting Pixmap is not cached. resulting Pixmap is not cached.
.AP "const char" *name in .AP "const char" *name in
Name for new bitmap to be defined. Name for new bitmap to be defined.
.AP "const void" *source in .AP "const char" *source in
Data for bitmap, in standard bitmap format. Data for bitmap, in standard bitmap format.
Must be stored in static memory whose value will never change. Must be stored in static memory whose value will never change.
.AP "int" width in .AP "int" width in
@@ -66,6 +66,7 @@ Display for which \fIbitmap\fR was allocated.
Identifier for a bitmap allocated by \fBTk_AllocBitmapFromObj\fR or Identifier for a bitmap allocated by \fBTk_AllocBitmapFromObj\fR or
\fBTk_GetBitmap\fR. \fBTk_GetBitmap\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures manage a collection of bitmaps (one-plane pixmaps) These procedures manage a collection of bitmaps (one-plane pixmaps)
@@ -81,7 +82,7 @@ of the following forms:
.TP 20 .TP 20
\fB@\fIfileName\fR \fB@\fIfileName\fR
\fIFileName\fR must be the name of a file containing a bitmap \fIFileName\fR must be the name of a file containing a bitmap
description in the standard X11 format. description in the standard X11 or X10 format.
.TP 20 .TP 20
\fIname\fR \fIname\fR
\fIName\fR must be the name of a bitmap defined previously with \fIName\fR must be the name of a bitmap defined previously with
@@ -209,7 +210,7 @@ describe the bitmap.
\fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs \fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs
(e.g. a bitmap named \fInameId\fR has already been defined) then (e.g. a bitmap named \fInameId\fR has already been defined) then
\fBTCL_ERROR\fR is returned and an error message is left in \fBTCL_ERROR\fR is returned and an error message is left in
interpreter \fIinterp\fR's result. \fIinterp->result\fR.
Note: \fBTk_DefineBitmap\fR expects the memory pointed to by Note: \fBTk_DefineBitmap\fR expects the memory pointed to by
\fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make \fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make
a private copy of this memory, but uses the bytes pointed to a private copy of this memory, but uses the bytes pointed to
@@ -281,8 +282,8 @@ with its Pixmap token.
There should be exactly one call to \fBTk_FreeBitmapFromObj\fR There should be exactly one call to \fBTk_FreeBitmapFromObj\fR
or \fBTk_FreeBitmap\fR for each call to \fBTk_AllocBitmapFromObj\fR or or \fBTk_FreeBitmap\fR for each call to \fBTk_AllocBitmapFromObj\fR or
\fBTk_GetBitmap\fR. \fBTk_GetBitmap\fR.
.SH BUGS .SH BUGS
.PP
In determining whether an existing bitmap can be used to satisfy In determining whether an existing bitmap can be used to satisfy
a new request, \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR a new request, \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR
consider only the immediate value of the string description. For consider only the immediate value of the string description. For
@@ -292,5 +293,6 @@ bitmap created from the same file name: it will not check to
see whether the file itself has changed, or whether the current see whether the file itself has changed, or whether the current
directory has changed, thereby causing the name to refer to directory has changed, thereby causing the name to refer to
a different file. a different file.
.SH KEYWORDS .SH KEYWORDS
bitmap, pixmap bitmap, pixmap

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles
@@ -24,18 +24,18 @@ const char *
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting. Interpreter to use for error reporting.
.AP "const char" *string in .AP "const char" *string in
String containing name of cap style \- one of String containing name of cap style: one of
.QW \fBbutt\fR , .QW butt ,
.QW \fBprojecting\fR , .QW projecting ,
or or
.QW \fBround\fR .QW round .
\- or a unique abbreviation of one.
.AP int *capPtr out .AP int *capPtr out
Pointer to location in which to store X cap style corresponding to Pointer to location in which to store X cap style corresponding to
\fIstring\fR. \fIstring\fR.
.AP int cap in .AP int cap in
Cap style: one of \fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR. Cap style: one of \fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetCapStyle\fR places in \fI*capPtr\fR the X cap style \fBTk_GetCapStyle\fR places in \fI*capPtr\fR the X cap style
@@ -51,7 +51,7 @@ Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused. \fIinterp\fR is unused.
If \fIstring\fR does not contain a valid cap style If \fIstring\fR does not contain a valid cap style
or an abbreviation of one of these names, then an error message is or an abbreviation of one of these names, then an error message is
stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
\fI*capPtr\fR is unmodified. \fI*capPtr\fR is unmodified.
.PP .PP
\fBTk_NameOfCapStyle\fR is the logical inverse of \fBTk_GetCapStyle\fR. \fBTk_NameOfCapStyle\fR is the logical inverse of \fBTk_GetCapStyle\fR.
@@ -60,5 +60,6 @@ statically-allocated string corresponding to \fIcap\fR.
If \fIcap\fR is not a legal cap style, then If \fIcap\fR is not a legal cap style, then
.QW "unknown cap style" .QW "unknown cap style"
is returned. is returned.
.SH KEYWORDS .SH KEYWORDS
butt, cap style, projecting, round butt, cap style, projecting, round

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colormaps Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colormaps

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_NameOfColor, Tk_FreeColorFromObj, Tk_FreeColor \- maintain database of colors Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_NameOfColor, Tk_FreeColorFromObj, Tk_FreeColor \- maintain database of colors
@@ -58,6 +58,7 @@ call to \fBTk_AllocColorFromObj\fR, \fBTk_GetColor\fR or
Drawable in which the result graphics context will be used. Must have Drawable in which the result graphics context will be used. Must have
same screen and depth as the window for which the color was allocated. same screen and depth as the window for which the color was allocated.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures manage the colors being used by a Tk application. These procedures manage the colors being used by a Tk application.
@@ -67,8 +68,8 @@ colormap space is exhausted.
.PP .PP
Given a textual description of a color, \fBTk_AllocColorFromObj\fR Given a textual description of a color, \fBTk_AllocColorFromObj\fR
locates a pixel value that may be used to render the color locates a pixel value that may be used to render the color
in a particular window. The desired color is specified with a in a particular window. The desired color is specified with an
value whose string value must have one of the following forms: object whose string value must have one of the following forms:
.TP 20 .TP 20
\fIcolorname\fR \fIcolorname\fR
Any of the valid textual names for a color defined in the Any of the valid textual names for a color defined in the
@@ -106,7 +107,7 @@ such as \fBTk_AllocColorFromObj\fR and \fBTk_GetColorFromObj\fR.
.PP .PP
\fBTk_GetColor\fR is identical to \fBTk_AllocColorFromObj\fR except \fBTk_GetColor\fR is identical to \fBTk_AllocColorFromObj\fR except
that the description of the color is specified with a string instead that the description of the color is specified with a string instead
of a value. This prevents \fBTk_GetColor\fR from caching the of an object. This prevents \fBTk_GetColor\fR from caching the
return value, so \fBTk_GetColor\fR is less efficient than return value, so \fBTk_GetColor\fR is less efficient than
\fBTk_AllocColorFromObj\fR. \fBTk_AllocColorFromObj\fR.
.PP .PP
@@ -127,7 +128,7 @@ This package maintains a database
of all the colors currently in use. of all the colors currently in use.
If the same color is requested multiple times from If the same color is requested multiple times from
\fBTk_GetColor\fR or \fBTk_AllocColorFromObj\fR (e.g. by different \fBTk_GetColor\fR or \fBTk_AllocColorFromObj\fR (e.g. by different
windows), or if the windows), or if the
same intensities are requested multiple times from same intensities are requested multiple times from
\fBTk_GetColorByValue\fR, then existing pixel values will \fBTk_GetColorByValue\fR, then existing pixel values will
be re-used. Re-using an existing pixel avoids any interaction be re-used. Re-using an existing pixel avoids any interaction
@@ -173,4 +174,4 @@ There should be exactly one call to \fBTk_FreeColorFromObj\fR
or \fBTk_FreeColor\fR for each call to \fBTk_AllocColorFromObj\fR, or \fBTk_FreeColor\fR for each call to \fBTk_AllocColorFromObj\fR,
\fBTk_GetColor\fR, or \fBTk_GetColorByValue\fR. \fBTk_GetColor\fR, or \fBTk_GetColorByValue\fR.
.SH KEYWORDS .SH KEYWORDS
color, intensity, value, pixel value color, intensity, object, pixel value

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData, Tk_NameOfCursor, Tk_FreeCursorFromObj, Tk_FreeCursor \- maintain database of cursors Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData, Tk_NameOfCursor, Tk_FreeCursorFromObj, Tk_FreeCursor \- maintain database of cursors
@@ -67,6 +67,7 @@ Opaque Tk identifier for cursor. If passed to \fBTk_FreeCursor\fR, must
have been returned by some previous call to \fBTk_GetCursor\fR or have been returned by some previous call to \fBTk_GetCursor\fR or
\fBTk_GetCursorFromData\fR. \fBTk_GetCursorFromData\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures manage a collection of cursors These procedures manage a collection of cursors
@@ -117,8 +118,8 @@ in preference to black and white cursors.
\fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR \fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR
In this form, \fIsourceName\fR and \fImaskName\fR are the names of In this form, \fIsourceName\fR and \fImaskName\fR are the names of
files describing cursors for the cursor's source bits and mask. files describing cursors for the cursor's source bits and mask.
Each file must be in standard X11 cursor format. Each file must be in standard X11 or X10 cursor format.
\fIFgColor\fR and \fIbgColor\fR \fIFgColor\fR and \fIbgColor\fR
indicate the colors to use for the indicate the colors to use for the
cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This
form of the command will not work on Macintosh or Windows computers. form of the command will not work on Macintosh or Windows computers.
@@ -212,8 +213,8 @@ with its Tk_Cursor token.
There should be exactly one call to \fBTk_FreeCursor\fR for There should be exactly one call to \fBTk_FreeCursor\fR for
each call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, each call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
or \fBTk_GetCursorFromData\fR. or \fBTk_GetCursorFromData\fR.
.SH BUGS .SH BUGS
.PP
In determining whether an existing cursor can be used to satisfy In determining whether an existing cursor can be used to satisfy
a new request, \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, a new request, \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
and \fBTk_GetCursorFromData\fR and \fBTk_GetCursorFromData\fR
@@ -227,5 +228,6 @@ a different file. Similarly, \fBTk_GetCursorFromData\fR assumes
that if the same \fIsource\fR pointer is used in two different calls, that if the same \fIsource\fR pointer is used in two different calls,
then the pointers refer to the same data; it does not check to then the pointers refer to the same data; it does not check to
see if the actual data values have changed. see if the actual data values have changed.
.SH KEYWORDS .SH KEYWORDS
cursor cursor

View File

@@ -5,38 +5,36 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetDash \- convert from string to valid dash structure. Tk_GetDash \- convert from string to valid dash structure.
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp
int int
\fBTk_GetDash\fR(\fIinterp, string, dashPtr\fR) \fBTk_GetDash\fR(\fIinterp, string, dashPtr\fR)
.fi
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_Dash *dashPtr .AS Tk_Dash *dashPtr
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting. Interpreter to use for error reporting.
.AP "const char" *string in .AP "const char *" string in
Textual value to be converted. Textual value to be converted.
.AP Tk_Dash *dashPtr out .AP Tk_Dash *dashPtr out
Points to place to store the dash pattern Points to place to store the dash pattern
value converted from \fIstring\fR. Must not be NULL. value converted from \fIstring\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedure parses the string and fills in the result in the These procedure parses the string and fills in the result in the
Tk_Dash structure. The string can be a list of integers or a Tk_Dash structure. The string can be a list of integers or a
character string containing only character string containing only
.QW \fB.,-_\fR .QW \fB.,\-_\fR
and spaces. If all or spaces. If all
goes well, \fBTCL_OK\fR is returned and a dash descriptor is stored goes well, \fBTCL_OK\fR is returned. If \fIstring\fR does not have the
in the variable pointed to by \fIdashPtr\fR.
If \fIstring\fR does not have the
proper syntax then \fBTCL_ERROR\fR is returned, an error message is left proper syntax then \fBTCL_ERROR\fR is returned, an error message is left
in the interpreter's result, and nothing is stored at *\fIdashPtr\fR. in the interpreter's result, and nothing is stored at *\fIdashPtr\fR.
.PP .PP
@@ -48,35 +46,33 @@ color. The other segments are drawn transparent.
.PP .PP
The second possible syntax is a character list containing only The second possible syntax is a character list containing only
5 possible characters 5 possible characters
.QW "\fB.,-_ \fR" . .QW "\fB.,\-_ \fR" .
The space can be used The space can be used
to enlarge the space between other line elements, and can not to enlarge the space between other line elements, and can not
occur in the first position of the string. Some examples: occur as the first position in the string. Some examples:
.PP
.CS .CS
\-dash . = \-dash {2 4} \-dash . = \-dash {2 4}
\-dash - = \-dash {6 4} \-dash \- = \-dash {6 4}
\-dash -. = \-dash {6 4 2 4} \-dash \-. = \-dash {6 4 2 4}
\-dash -.. = \-dash {6 4 2 4 2 4} \-dash \-.. = \-dash {6 4 2 4 2 4}
\-dash {. } = \-dash {2 8} \-dash {. } = \-dash {2 8}
\-dash , = \-dash {4 4} \-dash , = \-dash {4 4}
.CE .CE
.PP .PP
The main difference between this syntax and the numeric is that it The main difference of this syntax with the previous is that it
is shape-conserving. This means that all values in the dash is shape-conserving. This means that all values in the dash
list will be multiplied by the line width before display. This list will be multiplied by the line width before display. This
ensures that assures that
.QW . .QW .
will always be displayed as a dot and will always be displayed as a dot and
.QW - .QW \-
always as a dash regardless of the line width. always as a dash regardless of the line width.
.PP .PP
On systems where only a limited set of dash patterns, the dash On systems where only a limited set of dash patterns, the dash
pattern will be displayed as the most close dash pattern that pattern will be displayed as the most close dash pattern that
is available. For example, on Windows only the first 4 of the is available. For example, on Windows only the first 4 of the
above examples are available; the last 2 examples will be above examples are available. The last 2 examples will be
displayed identically to the first one. displayed identically as the first one.
.SH "SEE ALSO"
canvas(n), Tk_CreateItemType(3)
.SH KEYWORDS .SH KEYWORDS
dash, conversion dash, conversion

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts
@@ -14,23 +14,24 @@ Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFr
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
Tk_Font Tk_Font
\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR \fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR
.sp .sp
Tk_Font Tk_Font
\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR \fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR
.sp .sp
Tk_Font Tk_Font
\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR \fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
.sp .sp
const char * const char *
\fBTk_NameOfFont(\fItkfont\fB)\fR \fBTk_NameOfFont(\fItkfont\fB)\fR
.sp .sp
Tk_Font Tk_Font
\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR \fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR
.sp .sp
void void
\fBTk_FreeFont(\fItkfont\fB)\fR \fBTk_FreeFont(\fItkfont\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS "const char" *tkfont .AS "const char" *tkfont
.AP "Tcl_Interp" *interp in .AP "Tcl_Interp" *interp in
@@ -55,7 +56,7 @@ returns a token that represents the font. The return value can be used
in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR, in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR,
\fBTk_MeasureChars\fR, and \fBTk_FreeFont\fR. The Tk_Font token \fBTk_MeasureChars\fR, and \fBTk_FreeFont\fR. The Tk_Font token
will remain valid until will remain valid until
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it. \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it.
\fIObjPtr\fR can contain either a symbolic name or a font description; see \fIObjPtr\fR can contain either a symbolic name or a font description; see
the documentation for the \fBfont\fR command for a description of the the documentation for the \fBfont\fR command for a description of the
valid formats. If \fBTk_AllocFontFromObj\fR is unsuccessful (because, valid formats. If \fBTk_AllocFontFromObj\fR is unsuccessful (because,
@@ -104,6 +105,7 @@ with the same information used to create it; for
with its Tk_Font token. There should be with its Tk_Font token. There should be
exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR
for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR. for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_FontId(3) Tk_FontId(3)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetGC 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetGC 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts
@@ -34,6 +34,7 @@ Display for which \fIgc\fR was allocated.
X identifier for graphics context that is no longer needed. X identifier for graphics context that is no longer needed.
Must have been allocated by \fBTk_GetGC\fR. Must have been allocated by \fBTk_GetGC\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts \fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts
@@ -66,5 +67,6 @@ each call to \fBTk_GetGC\fR.
When a graphics context is no longer in use anywhere (i.e. it has When a graphics context is no longer in use anywhere (i.e. it has
been freed as many times as it has been gotten) \fBTk_FreeGC\fR been freed as many times as it has been gotten) \fBTk_FreeGC\fR
will release it to the X server and delete it from the database. will release it to the X server and delete it from the database.
.SH KEYWORDS .SH KEYWORDS
graphics context graphics context

View File

@@ -2,8 +2,8 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved. '\" All rights reserved.
'\" '\"
.TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetHINSTANCE \- retrieve the global application instance handle Tk_GetHINSTANCE \- retrieve the global application instance handle

View File

@@ -2,8 +2,8 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved. '\" All rights reserved.
'\" '\"
.TH HWND 3 8.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH HWND 3 8.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window
@@ -32,5 +32,6 @@ window given by \fIwindow\fR.
\fBTk_AttachHWND\fR binds the Windows HWND identifier to the \fBTk_AttachHWND\fR binds the Windows HWND identifier to the
specified Tk_Window given by \fItkwin\fR. It returns an X Windows specified Tk_Window given by \fItkwin\fR. It returns an X Windows
window that encapsulates the HWND. window that encapsulates the HWND.
.SH KEYWORDS .SH KEYWORDS
identifier, window identifier, window

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetImage, Tk_RedrawImage, Tk_SizeOfImage, Tk_FreeImage \- use an image in a widget Tk_GetImage, Tk_RedrawImage, Tk_SizeOfImage, Tk_FreeImage \- use an image in a widget
@@ -63,6 +63,7 @@ Store width of \fIimage\fR (in pixels) here.
.AP "int" heightPtr out .AP "int" heightPtr out
Store height of \fIimage\fR (in pixels) here. Store height of \fIimage\fR (in pixels) here.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures are invoked by widgets that wish to display images. These procedures are invoked by widgets that wish to display images.
@@ -73,7 +74,7 @@ identifies the window where the image will be displayed.
\fBTk_GetImage\fR looks up the image in the table of existing \fBTk_GetImage\fR looks up the image in the table of existing
images and returns a token for a new instance of the image. images and returns a token for a new instance of the image.
If the image does not exist then \fBTk_GetImage\fR returns NULL If the image does not exist then \fBTk_GetImage\fR returns NULL
and leaves an error message in interpreter \fIinterp\fR's result. and leaves an error message in \fIinterp->result\fR.
.PP .PP
When a widget wishes to actually display an image it must When a widget wishes to actually display an image it must
call \fBTk_RedrawImage\fR, identifying the image (\fIimage\fR), call \fBTk_RedrawImage\fR, identifying the image (\fIimage\fR),
@@ -105,14 +106,14 @@ The \fIchangeProc\fR and \fIclientData\fR arguments to
\fIchangeProc\fR will be called by Tk whenever a change occurs \fIchangeProc\fR will be called by Tk whenever a change occurs
in the image; it must match the following prototype: in the image; it must match the following prototype:
.CS .CS
typedef void \fBTk_ImageChangedProc\fR( typedef void Tk_ImageChangedProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
int \fIx\fR, int \fIx\fR,
int \fIy\fR, int \fIy\fR,
int \fIwidth\fR, int \fIwidth\fR,
int \fIheight\fR, int \fIheight\fR,
int \fIimageWidth\fR, int \fIimageWidth\fR,
int \fIimageHeight\fR); int \fIimageHeight\fR);
.CE .CE
The \fIclientData\fR argument to \fIchangeProc\fR is the same as the The \fIclientData\fR argument to \fIchangeProc\fR is the same as the
\fIclientData\fR argument to \fBTk_GetImage\fR. \fIclientData\fR argument to \fBTk_GetImage\fR.
@@ -124,7 +125,9 @@ they are specified in pixels measured from the upper-left
corner of the image. corner of the image.
The arguments \fIimageWidth\fR and \fIimageHeight\fR give The arguments \fIimageWidth\fR and \fIimageHeight\fR give
the image's (new) size. the image's (new) size.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_CreateImageType Tk_CreateImageType
.SH KEYWORDS .SH KEYWORDS
images, redisplay images, redisplay

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles
@@ -24,18 +24,18 @@ const char *
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting. Interpreter to use for error reporting.
.AP "const char" *string in .AP "const char" *string in
String containing name of join style \- one of String containing name of join style: one of
.QW \fBbevel\fR , .QW bevel ,
.QW \fBmiter\fR , .QW miter ,
or or
.QW \fBround\fR .QW round .
\- or a unique abbreviation of one.
.AP int *joinPtr out .AP int *joinPtr out
Pointer to location in which to store X join style corresponding to Pointer to location in which to store X join style corresponding to
\fIstring\fR. \fIstring\fR.
.AP int join in .AP int join in
Join style: one of \fBJoinBevel\fR, \fBJoinMiter\fR, \fBJoinRound\fR. Join style: one of \fBJoinBevel\fR, \fBJoinMiter\fR, \fBJoinRound\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetJoinStyle\fR places in \fI*joinPtr\fR the X join style \fBTk_GetJoinStyle\fR places in \fI*joinPtr\fR the X join style
@@ -50,7 +50,7 @@ Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused. \fIinterp\fR is unused.
If \fIstring\fR does not contain a valid join style If \fIstring\fR does not contain a valid join style
or an abbreviation of one of these names, then an error message is or an abbreviation of one of these names, then an error message is
stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
\fI*joinPtr\fR is unmodified. \fI*joinPtr\fR is unmodified.
.PP .PP
\fBTk_NameOfJoinStyle\fR is the logical inverse of \fBTk_GetJoinStyle\fR. \fBTk_NameOfJoinStyle\fR is the logical inverse of \fBTk_GetJoinStyle\fR.
@@ -59,5 +59,6 @@ statically-allocated string corresponding to \fIjoin\fR.
If \fIjoin\fR is not a legal join style, then If \fIjoin\fR is not a legal join style, then
.QW "unknown join style" .QW "unknown join style"
is returned. is returned.
.SH KEYWORDS .SH KEYWORDS
bevel, join style, miter, round bevel, join style, miter, round

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strings and justification styles Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strings and justification styles
@@ -27,12 +27,11 @@ const char *
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting, or NULL. Interpreter to use for error reporting, or NULL.
.AP Tcl_Obj *objPtr in/out .AP Tcl_Obj *objPtr in/out
String value contains name of justification style \- one of String value contains name of justification style, one of
.QW \fBleft\fR , .QW left ,
.QW \fBright\fR , .QW right ,
or or
.QW \fBcenter\fR .QW center .
\- or a unique abbreviation of one.
The internal rep will be modified to cache corresponding justify value. The internal rep will be modified to cache corresponding justify value.
.AP "const char" *string in .AP "const char" *string in
Same as \fIobjPtr\fR except description of justification style is passed as Same as \fIobjPtr\fR except description of justification style is passed as
@@ -83,5 +82,6 @@ corresponding to \fIjustify\fR.
If \fIjustify\fR is not a legal justify value, then If \fIjustify\fR is not a legal justify value, then
.QW "unknown justification style" .QW "unknown justification style"
is returned. is returned.
.SH KEYWORDS .SH KEYWORDS
center, fill, justification, string center, fill, justification, string

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetOption 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetOption 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetOption \- retrieve an option from the option database Tk_GetOption \- retrieve an option from the option database
@@ -26,6 +26,7 @@ Name of desired option.
Class of desired option. Null means there is no class for Class of desired option. Null means there is no class for
this option; do lookup based on name only. this option; do lookup based on name only.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This procedure is invoked to retrieve an option from the database This procedure is invoked to retrieve an option from the database
@@ -38,5 +39,6 @@ is returned. If no option matches, then NULL is returned.
\fBTk_GetOption\fR caches options related to \fItkwin\fR so that \fBTk_GetOption\fR caches options related to \fItkwin\fR so that
successive calls for the same \fItkwin\fR will execute much more successive calls for the same \fItkwin\fR will execute much more
quickly than successive calls for different windows. quickly than successive calls for different windows.
.SH KEYWORDS .SH KEYWORDS
class, name, option, retrieve class, name, option, retrieve

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM \- translate between strings and screen units Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM \- translate between strings and screen units
@@ -43,6 +43,7 @@ Pointer to location in which to store converted distance in pixels.
.AP double *doublePtr out .AP double *doublePtr out
Pointer to location in which to store converted distance in millimeters. Pointer to location in which to store converted distance in millimeters.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures take as argument a specification of distance on These procedures take as argument a specification of distance on
@@ -84,12 +85,13 @@ value in \fIobjPtr\fR, which speeds up future calls to
\fBTk_GetPixels\fR is identical to \fBTk_GetPixelsFromObj\fR except \fBTk_GetPixels\fR is identical to \fBTk_GetPixelsFromObj\fR except
that the screen distance is specified with a string instead that the screen distance is specified with a string instead
of an object. This prevents \fBTk_GetPixels\fR from caching the of an object. This prevents \fBTk_GetPixels\fR from caching the
return value, so \fBTk_GetPixels\fR is less efficient than return value, so \fBTk_GetAnchor\fR is less efficient than
\fBTk_GetPixelsFromObj\fR. \fBTk_GetPixelsFromObj\fR.
.PP .PP
\fBTk_GetMMFromObj\fR and \fBTk_GetScreenMM\fR are similar to \fBTk_GetMMFromObj\fR and \fBTk_GetScreenMM\fR are similar to
\fBTk_GetPixelsFromObj\fR and \fBTk_GetPixels\fR (respectively) except \fBTk_GetPixelsFromObj\fR and \fBTk_GetPixels\fR (respectively) except
that they convert the screen distance to millimeters and that they convert the screen distance to millimeters and
store a double-precision floating-point result at \fI*doublePtr\fR. store a double-precision floating-point result at \fI*doublePtr\fR.
.SH KEYWORDS .SH KEYWORDS
centimeters, convert, inches, millimeters, pixels, points, screen units centimeters, convert, inches, millimeters, pixels, points, screen units

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps
@@ -33,6 +33,7 @@ Number of bits per pixel in pixmap.
.AP Pixmap pixmap in .AP Pixmap pixmap in
Pixmap to destroy. Pixmap to destroy.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR
@@ -48,5 +49,6 @@ with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR,
and returns its identifier. and returns its identifier.
\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes \fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes
its resource identifier available for reuse. its resource identifier available for reuse.
.SH KEYWORDS .SH KEYWORDS
pixmap, resource identifier pixmap, resource identifier

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings and relief values Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings and relief values
@@ -28,14 +28,13 @@ const char *
Interpreter to use for error reporting. Interpreter to use for error reporting.
.AP Tcl_Obj *objPtr in/out .AP Tcl_Obj *objPtr in/out
String value contains name of relief, one of String value contains name of relief, one of
.QW \fBflat\fR , .QW flat ,
.QW \fBgroove\fR , .QW groove ,
.QW \fBraised\fR , .QW raised ,
.QW \fBridge\fR , .QW ridge ,
.QW \fBsolid\fR , .QW solid ,
or or
.QW \fBsunken\fR .QW sunken ;
(or any unique abbreviation thereof on input);
the internal rep will be modified to cache corresponding relief value. the internal rep will be modified to cache corresponding relief value.
.AP char *string in .AP char *string in
Same as \fIobjPtr\fR except description of relief is passed as Same as \fIobjPtr\fR except description of relief is passed as

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetRootCoords 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetRootCoords 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetRootCoords \- Compute root-window coordinates of window Tk_GetRootCoords \- Compute root-window coordinates of window

View File

@@ -5,49 +5,50 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands Tk_GetScrollInfo, Tk_GetScrollInfoObj \- parse arguments for scrolling commands
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
int int
\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR \fBTk_GetScrollInfo(\fIinterp, argc, argv, dblPtr, intPtr\fB)\fR
.sp .sp
int int
\fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR \fBTk_GetScrollInfoObj(\fIinterp, objc, objv, dblPtr, intPtr\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS "Tcl_Interp" *fractionPtr .AS "Tcl_Interp" *dblPtr
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting. Interpreter to use for error reporting.
.AP int objc in
Number of Tcl_Obj's in \fIobjv\fR array.
.AP "Tcl_Obj *const" objv[] in
Argument objects. These represent the entire widget command, of
which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR.
.AP int argc in .AP int argc in
Number of strings in \fIargv\fR array. Number of strings in \fIargv\fR array.
.AP "const char" *argv[] in .AP "const char" *argv[] in
Argument strings. These represent the entire widget command, of Argument strings. These represent the entire widget command, of
which the first word is typically the widget name and the second which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR. word is typically \fBxview\fR or \fByview\fR.
.AP double *fractionPtr out .AP int objc in
Number of Tcl_Obj's in \fIobjv\fR array.
.AP "Tcl_Obj *const" objv[] in
Argument objects. These represent the entire widget command, of
which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR.
.AP double *dblPtr out
Filled in with fraction from \fBmoveto\fR option, if any. Filled in with fraction from \fBmoveto\fR option, if any.
.AP int *stepsPtr out .AP int *intPtr out
Filled in with line or page count from \fBscroll\fR option, if any. Filled in with line or page count from \fBscroll\fR option, if any.
The value may be negative. The value may be negative.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetScrollInfoObj\fR parses the arguments expected by widget \fBTk_GetScrollInfo\fR parses the arguments expected by widget
scrolling commands such as \fBxview\fR and \fByview\fR. scrolling commands such as \fBxview\fR and \fByview\fR.
It receives the entire list of words that make up a widget command It receives the entire list of words that make up a widget command
and parses the words starting with \fIobjv\fR[2]. and parses the words starting with \fIargv\fR[2].
The words starting with \fIobjv\fR[2] must have one of the following forms: The words starting with \fIargv\fR[2] must have one of the following forms:
.CS .CS
\fBmoveto \fIfraction\fR \fBmoveto \fIfraction\fR
\fBscroll \fInumber\fB units\fR \fBscroll \fInumber\fB units\fR
@@ -56,20 +57,20 @@ The words starting with \fIobjv\fR[2] must have one of the following forms:
.LP .LP
Any of the \fBmoveto\fR, \fBscroll\fR, \fBunits\fR, and \fBpages\fR Any of the \fBmoveto\fR, \fBscroll\fR, \fBunits\fR, and \fBpages\fR
keywords may be abbreviated. keywords may be abbreviated.
If \fIobjv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR If \fIargv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
is returned as result and \fI*fractionPtr\fR is filled in with the is returned as result and \fI*dblPtr\fR is filled in with the
\fIfraction\fR argument to the command, which must be a proper real \fIfraction\fR argument to the command, which must be a proper real
value. value.
If \fIobjv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR If \fIargv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
or \fBTK_SCROLL_PAGES\fR is returned and \fI*stepsPtr\fR is filled or \fBTK_SCROLL_PAGES\fR is returned and \fI*intPtr\fR is filled
in with the \fInumber\fR value, which must be a proper integer. in with the \fInumber\fR value, which must be a proper integer.
If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR
is returned and an error message is left in interpreter is returned and an error message is left in \fIinterp->result\fR.
\fIinterp\fR's result.
.PP .PP
\fBTk_GetScrollInfo\fR is identical in function to \fBTk_GetScrollInfoObj\fR is identical in function to
\fBTk_GetScrollInfoObj\fR. However, \fBTk_GetScrollInfo\fR accepts \fBTk_GetScrollInfo\fR. However, \fBTk_GetScrollInfoObj\fR accepts
string arguments, making it more appropriate for use with legacy Tcl_Obj style arguments, making it more appropriate for use with new
widgets. development.
.SH KEYWORDS .SH KEYWORDS
parse, scrollbar, scrolling command, xview, yview parse, scrollbar, scrolling command, xview, yview

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetSelection \- retrieve the contents of a selection Tk_GetSelection \- retrieve the contents of a selection
@@ -33,6 +33,7 @@ are retrieved.
.AP ClientData clientData in .AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR. Arbitrary one-word value to pass to \fIproc\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetSelection\fR retrieves the selection specified by the atom \fBTk_GetSelection\fR retrieves the selection specified by the atom
@@ -41,15 +42,13 @@ selection may actually be retrieved in several pieces; as each piece
is retrieved, \fIproc\fR is called to process the piece. \fIProc\fR is retrieved, \fIproc\fR is called to process the piece. \fIProc\fR
should have arguments and result that match the type should have arguments and result that match the type
\fBTk_GetSelProc\fR: \fBTk_GetSelProc\fR:
.PP
.CS .CS
typedef int \fBTk_GetSelProc\fR( typedef int Tk_GetSelProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR, Tcl_Interp *\fIinterp\fR,
char *\fIportion\fR); char *\fIportion\fR);
.CE .CE
.PP The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
will be copies of the corresponding arguments to will be copies of the corresponding arguments to
\fBTk_GetSelection\fR. \fIPortion\fR will be a pointer to \fBTk_GetSelection\fR. \fIPortion\fR will be a pointer to
a string containing part or all of the selection. For large a string containing part or all of the selection. For large
@@ -69,10 +68,10 @@ been completely retrieved and processed by \fIproc\fR, or when a
fatal error has occurred (e.g. the selection owner did not respond fatal error has occurred (e.g. the selection owner did not respond
promptly). \fBTk_GetSelection\fR normally returns \fBTCL_OK\fR; if promptly). \fBTk_GetSelection\fR normally returns \fBTCL_OK\fR; if
an error occurs, it returns \fBTCL_ERROR\fR and leaves an error message an error occurs, it returns \fBTCL_ERROR\fR and leaves an error message
in interpreter \fIinterp\fR's result. \fIProc\fR should also return either in \fIinterp->result\fR. \fIProc\fR should also return either
\fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in dealing with the
dealing with the selection, it should leave an error message in the selection, it should leave an error message in \fIinterp->result\fR
interpreter result and return \fBTCL_ERROR\fR; this will abort the and return \fBTCL_ERROR\fR; this will abort the selection retrieval.
selection retrieval.
.SH KEYWORDS .SH KEYWORDS
format, get, selection retrieval format, get, selection retrieval

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetUid 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetUid 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetUid, Tk_Uid \- convert from string to unique identifier Tk_GetUid, Tk_Uid \- convert from string to unique identifier
@@ -21,6 +21,7 @@ Tk_Uid
String for which the corresponding unique identifier is String for which the corresponding unique identifier is
desired. desired.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetUid\fR returns the unique identifier corresponding \fBTk_GetUid\fR returns the unique identifier corresponding
@@ -41,5 +42,6 @@ Tk_Uid may be compared directly (x == y) without having to call
\fBstrcmp\fR. \fBstrcmp\fR.
In addition, the return value from \fBTk_GetUid\fR will have the In addition, the return value from \fBTk_GetUid\fR will have the
same string value as its argument (strcmp(Tk_GetUid(a), a) == 0). same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
.SH KEYWORDS .SH KEYWORDS
atom, unique identifier atom, unique identifier

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetVRootGeometry \- Get location and size of virtual root for window Tk_GetVRootGeometry \- Get location and size of virtual root for window
@@ -28,6 +28,7 @@ Points to word in which to store width of virtual root.
.AP "int" heightPtr out .AP "int" heightPtr out
Points to word in which to store height of virtual root. Points to word in which to store height of virtual root.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetVRootGeometry\fR returns geometry information about the virtual \fBTk_GetVRootGeometry\fR returns geometry information about the virtual
@@ -42,5 +43,6 @@ If \fItkwin\fR is not associated with a virtual root (e.g.
because the window manager does not use virtual roots) then *\fIxPtr\fR and because the window manager does not use virtual roots) then *\fIxPtr\fR and
*\fIyPtr\fR will be set to 0 and *\fIwidthPtr\fR and *\fIheightPtr\fR *\fIyPtr\fR will be set to 0 and *\fIwidthPtr\fR and *\fIheightPtr\fR
will be set to the dimensions of the screen containing \fItkwin\fR. will be set to the dimensions of the screen containing \fItkwin\fR.
.SH KEYWORDS .SH KEYWORDS
geometry, height, location, virtual root, width, window manager geometry, height, location, virtual root, width, window manager

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetVisual \- translate from string to visual Tk_GetVisual \- translate from string to visual
@@ -39,7 +39,7 @@ It returns a pointer to the X Visual structure for the visual
and stores the number of bits per pixel for it at \fI*depthPtr\fR. and stores the number of bits per pixel for it at \fI*depthPtr\fR.
If \fIstring\fR is unrecognizable or if no suitable visual could If \fIstring\fR is unrecognizable or if no suitable visual could
be found, then NULL is returned and \fBTk_GetVisual\fR leaves be found, then NULL is returned and \fBTk_GetVisual\fR leaves
an error message in interpreter \fIinterp\fR's result. an error message in \fIinterp->result\fR.
If \fIcolormap\fR is non-NULL then \fBTk_GetVisual\fR If \fIcolormap\fR is non-NULL then \fBTk_GetVisual\fR
also locates an appropriate colormap for use with the result visual also locates an appropriate colormap for use with the result visual
and stores its X identifier at \fI*colormapPtr\fR. and stores its X identifier at \fI*colormapPtr\fR.

View File

@@ -2,8 +2,8 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved. '\" All rights reserved.
'\" '\"
.TH Tk_Grab 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_Grab 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_Grab, Tk_Ungrab \- manipulate grab state in an application Tk_Grab, Tk_Ungrab \- manipulate grab state in an application
@@ -16,6 +16,7 @@ int
.sp .sp
void void
\fBTk_Ungrab\fR(\fItkwin\fR) \fBTk_Ungrab\fR(\fItkwin\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting Interpreter to use for error reporting
@@ -24,6 +25,7 @@ Window on whose behalf the pointer is to be grabbed or released
.AP int grabGlobal in .AP int grabGlobal in
Boolean indicating whether the grab is global or application local Boolean indicating whether the grab is global or application local
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These functions are used to set or release a global or These functions are used to set or release a global or
@@ -37,6 +39,7 @@ intended for windows in other applications) will be redirected to
\fItkwin\fR. If the grab is application local, only mouse and \fItkwin\fR. If the grab is application local, only mouse and
keyboard events intended for a windows within the same application keyboard events intended for a windows within the same application
(but outside the tree rooted at \fItkwin\fR) will be redirected. (but outside the tree rooted at \fItkwin\fR) will be redirected.
.PP .PP
\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR \fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR
specifies the window on whose behalf the pointer is to be grabbed. specifies the window on whose behalf the pointer is to be grabbed.
@@ -49,10 +52,12 @@ successfully, no window outside the tree rooted at \fItkwin\fR will
receive pointer- or keyboard-related events until the next call to receive pointer- or keyboard-related events until the next call to
Tk_Ungrab. If a previous grab was in effect within the application, Tk_Ungrab. If a previous grab was in effect within the application,
then it is replaced with a new one. then it is replaced with a new one.
.PP .PP
\fBTk_Ungrab\fR releases a grab on the mouse pointer and keyboard, if \fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if
there is one set on the window given by \fItkwin\fR. Once a grab is there is one set on the window given by \fItkwin\fR. Once a grab is
released, pointer and keyboard events will start being delivered to released, pointer and keyboard events will start being delivered to
other windows again. other windows again.
.SH KEYWORDS .SH KEYWORDS
grab, window grab, window

View File

@@ -2,8 +2,8 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved. '\" All rights reserved.
'\" '\"
.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_HWNDToWindow \- Find Tk's window information for a Windows window Tk_HWNDToWindow \- Find Tk's window information for a Windows window
@@ -17,10 +17,12 @@ Tk_Window
.AP HWND hwnd in .AP HWND hwnd in
Windows handle for the window. Windows handle for the window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
Given a Windows HWND window identifier, this procedure returns the Given a Windows HWND window identifier, this procedure returns the
corresponding Tk_Window handle. If there is no Tk_Window corresponding corresponding Tk_Window handle. If there is no Tk_Window corresponding
to \fIhwnd\fR then NULL is returned. to \fIhwnd\fR then NULL is returned.
.SH KEYWORDS .SH KEYWORDS
Windows window id Windows window id

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_HandleEvent \- invoke event handlers for window system events Tk_HandleEvent \- invoke event handlers for window system events
@@ -21,6 +21,7 @@ Tk_HandleEvent \- invoke event handlers for window system events
Pointer to X event to dispatch to relevant handler(s). It is important Pointer to X event to dispatch to relevant handler(s). It is important
that all unused fields of the structure be set to zero. that all unused fields of the structure be set to zero.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_HandleEvent\fR is a lower-level procedure that deals with window \fBTk_HandleEvent\fR is a lower-level procedure that deals with window
@@ -42,5 +43,6 @@ as when a
notifier has been popped up and an application wishes to notifier has been popped up and an application wishes to
wait for the user to click a button in the notifier before wait for the user to click a button in the notifier before
doing anything else. doing anything else.
.SH KEYWORDS .SH KEYWORDS
callback, event, handler, window callback, event, handler, window

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_IdToWindow \- Find Tk's window information for an X window Tk_IdToWindow \- Find Tk's window information for an X window
@@ -22,11 +22,13 @@ X display containing the window.
.AP Window window in .AP Window window in
X id for window. X id for window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
Given an X window identifier and the X display it corresponds to, Given an X window identifier and the X display it corresponds to,
this procedure returns the corresponding Tk_Window handle. this procedure returns the corresponding Tk_Window handle.
If there is no Tk_Window corresponding to \fIwindow\fR then If there is no Tk_Window corresponding to \fIwindow\fR then
NULL is returned. NULL is returned.
.SH KEYWORDS .SH KEYWORDS
X window id X window id

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ImageChanged \- notify widgets that image needs to be redrawn Tk_ImageChanged \- notify widgets that image needs to be redrawn
@@ -35,6 +35,7 @@ Current width of image, in pixels.
.AP "int" imageHeight in .AP "int" imageHeight in
Current height of image, in pixels. Current height of image, in pixels.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
An image manager calls \fBTk_ImageChanged\fR for an image An image manager calls \fBTk_ImageChanged\fR for an image
@@ -58,7 +59,9 @@ that changed.
If the size of the image should change, then \fBTk_ImageChanged\fR If the size of the image should change, then \fBTk_ImageChanged\fR
must be called to indicate the new size, even if no pixels must be called to indicate the new size, even if no pixels
need to be redisplayed. need to be redisplayed.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_CreateImageType Tk_CreateImageType
.SH KEYWORDS .SH KEYWORDS
images, redisplay, image size changes images, redisplay, image size changes

View File

@@ -2,8 +2,8 @@
'\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved. '\" All rights reserved.
'\" '\"
.TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity time Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity time
@@ -14,21 +14,23 @@ Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity tim
long long
\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR \fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
.sp .sp
\fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR \fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS Display *display .AS Display *display
.AP Display *display in .AP Display *display in
The display on which the user inactivity timer is to be queried or The display on which the user inactivity timer is to be queried or
reset. reset.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_GetUserInactiveTime\fR returns the number of milliseconds that \fBTk_GetUserInactiveTime\fR returns the number of milliseconds that
have passed since the last user interaction (usually via keyboard or have passed since the last user interaction (usually via keyboard or
mouse) with the respective display. On systems and displays that do not mouse) with the respective display. On systems and displays that do not
support querying the user inactivity time, \fB\-1\fR is returned. support querying the user inactiviy time, \fB\-1\fR is returned.
\fBTk_ResetUserInactiveTime\fR resets the user inactivity timer of the \fBTk_GetUserInactiveTime\fR resets the user inactivity timer of the
given display to zero. On windowing systems that do not support given display to zero. On windowing systems that do not support
multiple displays \fIdisplay\fR can be passed as \fBNULL\fR. multiple displays \fIdisplay\fR can be passed as \fBNULL\fR.
.SH KEYWORDS .SH KEYWORDS
idle, inactive idle, inactive

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_InternAtom 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_InternAtom 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms
@@ -28,6 +28,7 @@ String name for which atom is desired.
.AP Atom atom in .AP Atom atom in
Atom for which corresponding string name is desired. Atom for which corresponding string name is desired.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures are similar to the Xlib procedures These procedures are similar to the Xlib procedures
@@ -51,5 +52,6 @@ for the same information can be serviced from the cache without
contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR
are generally much faster than their Xlib counterparts, and they are generally much faster than their Xlib counterparts, and they
should be used in place of the Xlib procedures. should be used in place of the Xlib procedures.
.SH KEYWORDS .SH KEYWORDS
atom, cache, display atom, cache, display

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_MainLoop \- loop for events until all windows are deleted Tk_MainLoop \- loop for events until all windows are deleted
@@ -16,6 +16,7 @@ Tk_MainLoop \- loop for events until all windows are deleted
.sp .sp
\fBTk_MainLoop\fR() \fBTk_MainLoop\fR()
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_MainLoop\fR is a procedure that loops repeatedly calling \fBTk_MainLoop\fR is a procedure that loops repeatedly calling
@@ -24,5 +25,6 @@ left in this process (i.e. no main windows exist anymore). Most
windowing applications will call \fBTk_MainLoop\fR after windowing applications will call \fBTk_MainLoop\fR after
initialization; the main execution of the application will consist initialization; the main execution of the application will consist
entirely of callbacks invoked via \fBTcl_DoOneEvent\fR. entirely of callbacks invoked via \fBTcl_DoOneEvent\fR.
.SH KEYWORDS .SH KEYWORDS
application, event, main loop application, event, main loop

View File

@@ -5,11 +5,12 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main window information Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main
window information
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
@@ -19,11 +20,13 @@ Tk_Window
.sp .sp
int int
\fBTk_GetNumMainWindows\fR() \fBTk_GetNumMainWindows\fR()
.SH ARGUMENTS .SH ARGUMENTS
.AS Tcl_Interp *pathName .AS Tcl_Interp *pathName
.AP Tcl_Interp *interp in/out .AP Tcl_Interp *interp in/out
Interpreter associated with the application. Interpreter associated with the application.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
A main window is a special kind of toplevel window used as the A main window is a special kind of toplevel window used as the
@@ -32,9 +35,10 @@ outermost window in an application.
If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR
returns the application's main window. If there is no Tk application returns the application's main window. If there is no Tk application
associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and
leaves an error message in interpreter \fIinterp\fR's result. leaves an error message in \fIinterp->result\fR.
.PP .PP
\fBTk_GetNumMainWindows\fR returns a count of the number of main \fBTk_GetNumMainWindows\fR returns a count of the number of main
windows currently open in the current thread. windows currently open in the process.
.SH KEYWORDS .SH KEYWORDS
application, main window application, main window

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_MaintainGeometry 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_MaintainGeometry 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_MaintainGeometry, Tk_UnmaintainGeometry \- maintain geometry of one window relative to another Tk_MaintainGeometry, Tk_UnmaintainGeometry \- maintain geometry of one window relative to another
@@ -36,6 +36,7 @@ Desired width for \fIslave\fR, in pixels.
.AP int height in .AP int height in
Desired height for \fIslave\fR, in pixels. Desired height for \fIslave\fR, in pixels.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_MaintainGeometry\fR and \fBTk_UnmaintainGeometry\fR make it \fBTk_MaintainGeometry\fR and \fBTk_UnmaintainGeometry\fR make it

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ManageGeometry 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ManageGeometry 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ManageGeometry \- arrange to handle geometry requests for a window Tk_ManageGeometry \- arrange to handle geometry requests for a window
@@ -45,7 +45,7 @@ typedef struct {
const char *\fIname\fR; const char *\fIname\fR;
Tk_GeomRequestProc *\fIrequestProc\fR; Tk_GeomRequestProc *\fIrequestProc\fR;
Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR; Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR;
} \fBTk_GeomMgr\fR; } Tk_GeomMgr;
.CE .CE
The \fIname\fR field is the textual name for the geometry manager, The \fIname\fR field is the textual name for the geometry manager,
such as \fBpack\fR or \fBplace\fR; this value will be returned such as \fBpack\fR or \fBplace\fR; this value will be returned
@@ -57,9 +57,9 @@ slave to change its desired geometry.
\fIrequestProc\fR should have arguments and results that match the \fIrequestProc\fR should have arguments and results that match the
type \fBTk_GeomRequestProc\fR: type \fBTk_GeomRequestProc\fR:
.CS .CS
typedef void \fBTk_GeomRequestProc\fR( typedef void Tk_GeomRequestProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
Tk_Window \fItkwin\fR); Tk_Window \fItkwin\fR);
.CE .CE
The parameters to \fIrequestProc\fR will be identical to the The parameters to \fIrequestProc\fR will be identical to the
corresponding parameters passed to \fBTk_ManageGeometry\fR. corresponding parameters passed to \fBTk_ManageGeometry\fR.
@@ -80,11 +80,12 @@ is the same as the window's current geometry manager.
\fIlostSlaveProc\fR should have \fIlostSlaveProc\fR should have
arguments and results that match the following prototype: arguments and results that match the following prototype:
.CS .CS
typedef void \fBTk_GeomLostSlaveProc\fR( typedef void Tk_GeomLostSlaveProc(
ClientData \fIclientData\fR, ClientData \fIclientData\fR,
Tk_Window \fItkwin\fR); Tk_Window \fItkwin\fR);
.CE .CE
The parameters to \fIlostSlaveProc\fR will be identical to the The parameters to \fIlostSlaveProc\fR will be identical to the
corresponding parameters passed to \fBTk_ManageGeometry\fR. corresponding parameters passed to \fBTk_ManageGeometry\fR.
.SH KEYWORDS .SH KEYWORDS
callback, geometry, managed, request, unmanaged callback, geometry, managed, request, unmanaged

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_MapWindow 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_MapWindow 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_MapWindow, Tk_UnmapWindow \- map or unmap a window Tk_MapWindow, Tk_UnmapWindow \- map or unmap a window
@@ -23,6 +23,7 @@ Tk_Window
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Token for window. Token for window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These procedures may be used to map and unmap windows These procedures may be used to map and unmap windows
@@ -35,9 +36,9 @@ deferred window creation.
from the screen. from the screen.
.PP .PP
If \fItkwin\fR is a child window (i.e. \fBTk_CreateWindow\fR was If \fItkwin\fR is a child window (i.e. \fBTk_CreateWindow\fR was
used to create a child window), then event handlers interested in map used to create a child window), then event handlers interested in map
and unmap events are invoked immediately. If \fItkwin\fR is not an and unmap events are invoked immediately. If \fItkwin\fR is not an
internal window, then the event handlers will be invoked later, after internal window, then the event handlers will be invoked later, after
X has seen the request and returned an event for it. X has seen the request and returned an event for it.
.PP .PP
These procedures should be used in place of the X procedures These procedures should be used in place of the X procedures
@@ -45,5 +46,6 @@ These procedures should be used in place of the X procedures
Tk's local data structure for \fItkwin\fR. Applications Tk's local data structure for \fItkwin\fR. Applications
using Tk should not invoke \fBXMapWindow\fR and \fBXUnmapWindow\fR using Tk should not invoke \fBXMapWindow\fR and \fBXUnmapWindow\fR
directly. directly.
.SH KEYWORDS .SH KEYWORDS
map, unmap, window map, unmap, window

View File

@@ -3,9 +3,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to measure and display simple single-line strings. Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to measure and display simple single-line strings.
@@ -32,7 +32,7 @@ returned by a previous call to \fBTk_GetFont\fR.
Text to be measured or displayed. Need not be null terminated. Any Text to be measured or displayed. Need not be null terminated. Any
non-printing meta-characters in the string (such as tabs, newlines, and non-printing meta-characters in the string (such as tabs, newlines, and
other control characters) will be measured or displayed in a other control characters) will be measured or displayed in a
platform-dependent manner. platform-dependent manner.
.AP int numBytes in .AP int numBytes in
The maximum number of bytes to consider when measuring or drawing The maximum number of bytes to consider when measuring or drawing
\fIstring\fR. Must be greater than or equal to 0. \fIstring\fR. Must be greater than or equal to 0.
@@ -60,11 +60,11 @@ Display on which to draw.
.AP Drawable drawable in .AP Drawable drawable in
Window or pixmap in which to draw. Window or pixmap in which to draw.
.AP GC gc in .AP GC gc in
Graphics context for drawing characters. The font selected into this GC Graphics context for drawing characters. The font selected into this GC
must be the same as the \fItkfont\fR. must be the same as the \fItkfont\fR.
.AP int "x, y" in .AP int "x, y" in
Coordinates at which to place the left edge of the baseline when displaying Coordinates at which to place the left edge of the baseline when displaying
\fIstring\fR. \fIstring\fR.
.AP int firstByte in .AP int firstByte in
The index of the first byte of the first character to underline in the The index of the first byte of the first character to underline in the
\fIstring\fR. Underlining begins at the left edge of this character. \fIstring\fR. Underlining begins at the left edge of this character.
@@ -80,7 +80,7 @@ single-line strings. To measure and display single-font, multi-line,
justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR. justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR.
There is no programming interface in the core of Tk that supports There is no programming interface in the core of Tk that supports
multi-font, multi-line text; support for that behavior must be built on multi-font, multi-line text; support for that behavior must be built on
top of simpler layers. top of simpler layers.
Note that the interfaces described here are Note that the interfaces described here are
byte-oriented not character-oriented, so index values coming from Tcl byte-oriented not character-oriented, so index values coming from Tcl
scripts need to be converted to byte offsets using the scripts need to be converted to byte offsets using the
@@ -95,7 +95,7 @@ escape sequences, while under Windows and Macintosh hollow or solid boxes
may be substituted. Refer to the documentation for may be substituted. Refer to the documentation for
\fBTk_ComputeTextLayout\fR for a programming interface that supports the \fBTk_ComputeTextLayout\fR for a programming interface that supports the
platform-independent expansion of tab characters into columns and platform-independent expansion of tab characters into columns and
newlines/returns into multi-line text. newlines/returns into multi-line text.
.PP .PP
\fBTk_MeasureChars\fR is used both to compute the length of a given \fBTk_MeasureChars\fR is used both to compute the length of a given
string and to compute how many characters from a string fit in a given string and to compute how many characters from a string fit in a given
@@ -106,12 +106,12 @@ value will be \fInumBytes\fR. \fI*lengthPtr\fR is filled with the computed
width, in pixels, of the portion of the string that was measured. For width, in pixels, of the portion of the string that was measured. For
example, if the return value is 5, then \fI*lengthPtr\fR is filled with the example, if the return value is 5, then \fI*lengthPtr\fR is filled with the
distance between the left edge of \fIstring\fR[0] and the right edge of distance between the left edge of \fIstring\fR[0] and the right edge of
\fIstring\fR[4]. \fIstring\fR[4].
.PP .PP
\fBTk_TextWidth\fR is a wrapper function that provides a simpler interface \fBTk_TextWidth\fR is a wrapper function that provides a simpler interface
to the \fBTk_MeasureChars\fR function. The return value is how much to the \fBTk_MeasureChars\fR function. The return value is how much
space in pixels the given \fIstring\fR needs. space in pixels the given \fIstring\fR needs.
.PP .PP
\fBTk_DrawChars\fR draws the \fIstring\fR at the given location in the \fBTk_DrawChars\fR draws the \fIstring\fR at the given location in the
given \fIdrawable\fR. given \fIdrawable\fR.
.PP .PP
@@ -120,7 +120,7 @@ given \fIstring\fR. It does not draw the characters (which are assumed to
have been displayed previously by \fBTk_DrawChars\fR); it just draws the have been displayed previously by \fBTk_DrawChars\fR); it just draws the
underline. This procedure is used to underline a few characters without underline. This procedure is used to underline a few characters without
having to construct an underlined font. To produce natively underlined having to construct an underlined font. To produce natively underlined
text, the appropriate underlined font should be constructed and used. text, the appropriate underlined font should be constructed and used.
.SH "SEE ALSO" .SH "SEE ALSO"
font(n), FontId(3) font(n), FontId(3)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_MoveToplevelWindow 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_MoveToplevelWindow 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_MoveToplevelWindow \- Adjust the position of a top-level window Tk_MoveToplevelWindow \- Adjust the position of a top-level window
@@ -28,6 +28,7 @@ New y-coordinate for the top-left pixel of \fItkwin\fR's border, or the
top-left pixel of the decorative border supplied for \fItkwin\fR by the top-left pixel of the decorative border supplied for \fItkwin\fR by the
window manager, if there is one. window manager, if there is one.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
In general, a window should never set its own position; this should be In general, a window should never set its own position; this should be
@@ -46,6 +47,7 @@ menus that want to appear at a particular place on the screen.
When \fBTk_MoveToplevelWindow\fR is called it does not immediately When \fBTk_MoveToplevelWindow\fR is called it does not immediately
pass on the new desired location to the window manager; it defers pass on the new desired location to the window manager; it defers
this action until all other outstanding work has been completed, this action until all other outstanding work has been completed,
using the \fBTcl_DoWhenIdle\fR mechanism. using the \fBTk_DoWhenIdle\fR mechanism.
.SH KEYWORDS .SH KEYWORDS
position, top-level window, window manager position, top-level window, window manager

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_Name 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_Name 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_Name, Tk_PathName, Tk_NameToWindow \- convert between names and window tokens Tk_Name, Tk_PathName, Tk_NameToWindow \- convert between names and window tokens
@@ -31,6 +31,7 @@ Interpreter to use for error reporting.
.AP "const char" *pathName in .AP "const char" *pathName in
Character string containing path name of window. Character string containing path name of window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
Each window managed by Tk has two names, a short name that identifies Each window managed by Tk has two names, a short name that identifies
@@ -48,7 +49,8 @@ as a Tk_Uid, which may be used just like a string pointer but also has
the properties of a unique identifier (see the manual entry for the properties of a unique identifier (see the manual entry for
\fBTk_GetUid\fR for details). \fBTk_GetUid\fR for details).
.PP .PP
The \fBTk_PathName\fR macro returns a hierarchical name for \fItkwin\fR. The \fBTk_PathName\fR macro returns a
hierarchical name for \fItkwin\fR.
Path names have a structure similar to file names in Unix but with Path names have a structure similar to file names in Unix but with
dots between elements instead of slashes: the main window for dots between elements instead of slashes: the main window for
an application has the path name an application has the path name
@@ -73,8 +75,7 @@ The procedure \fBTk_NameToWindow\fR returns the token for a window
given its path name (the \fIpathName\fR argument) and another window given its path name (the \fIpathName\fR argument) and another window
belonging to the same main window (\fItkwin\fR). It normally belonging to the same main window (\fItkwin\fR). It normally
returns a token for the named window, but if no such window exists returns a token for the named window, but if no such window exists
\fBTk_NameToWindow\fR leaves an error message in interpreter \fBTk_NameToWindow\fR leaves an error message in \fIinterp->result\fR
\fIinterp\fR's result
and returns NULL. The \fItkwin\fR argument to \fBTk_NameToWindow\fR and returns NULL. The \fItkwin\fR argument to \fBTk_NameToWindow\fR
is needed because path names are only unique within a single is needed because path names are only unique within a single
application hierarchy. If, for example, a single process has opened application hierarchy. If, for example, a single process has opened
@@ -82,5 +83,6 @@ two main windows, each will have a separate naming hierarchy and the
same path name might appear in each of the hierarchies. Normally same path name might appear in each of the hierarchies. Normally
\fItkwin\fR is the main window of the desired hierarchy, but this \fItkwin\fR is the main window of the desired hierarchy, but this
need not be the case: any window in the desired hierarchy may be used. need not be the case: any window in the desired hierarchy may be used.
.SH KEYWORDS .SH KEYWORDS
name, path name, token, window name, path name, token, window

View File

@@ -3,9 +3,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_NameOfImage \- Return name of image. Tk_NameOfImage \- Return name of image.
@@ -14,17 +14,19 @@ Tk_NameOfImage \- Return name of image.
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
const char * const char *
\fBTk_NameOfImage\fR(\fIimageMaster\fR) \fBTk_NameOfImage\fR(\fItypePtr\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_ImageMaster imageMaster .AS Tk_ImageMaster *masterPtr
.AP Tk_ImageMaster imageMaster in .AP Tk_ImageMaster *masterPtr in
Token for image, which was passed to image manager's \fIcreateProc\fR when Token for image, which was passed to image manager's \fIcreateProc\fR when
the image was created. the image was created.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This procedure is invoked by image managers to find out the name This procedure is invoked by image managers to find out the name
of an image. Given the token for the image, it returns the of an image. Given the token for the image, it returns the
string name for the image. string name for the image.
.SH KEYWORDS .SH KEYWORDS
image manager, image name image manager, image name

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_OwnSelection \- make a window the owner of the primary selection Tk_OwnSelection \- make a window the owner of the primary selection
@@ -26,6 +26,7 @@ Procedure to invoke when \fItkwin\fR loses selection ownership later.
.AP ClientData clientData in .AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR. Arbitrary one-word value to pass to \fIproc\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the \fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the
@@ -38,12 +39,12 @@ invoked so that the window can clean itself up (e.g. by
unhighlighting the selection). \fIProc\fR should have arguments and unhighlighting the selection). \fIProc\fR should have arguments and
result that match the type \fBTk_LostSelProc\fR: result that match the type \fBTk_LostSelProc\fR:
.CS .CS
typedef void \fBTk_LostSelProc\fR( typedef void Tk_LostSelProc(ClientData \fIclientData\fR);
ClientData \fIclientData\fR);
.CE .CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the The \fIclientData\fR parameter to \fIproc\fR is a copy of the
\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is \fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is
usually a pointer to a data structure containing application-specific usually a pointer to a data structure containing application-specific
information about \fItkwin\fR. information about \fItkwin\fR.
.SH KEYWORDS .SH KEYWORDS
own, selection owner own, selection owner

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ParseArgv 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ParseArgv 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ParseArgv \- process command-line options Tk_ParseArgv \- process command-line options
@@ -60,8 +60,8 @@ elements of \fIargv\fR.
.PP .PP
\fBTk_ParseArgv\fR normally returns the value \fBTCL_OK\fR. If an error \fBTk_ParseArgv\fR normally returns the value \fBTCL_OK\fR. If an error
occurs while parsing the arguments, then \fBTCL_ERROR\fR is returned and occurs while parsing the arguments, then \fBTCL_ERROR\fR is returned and
\fBTk_ParseArgv\fR will leave an error message in the result of \fBTk_ParseArgv\fR will leave an error message in \fIinterp->result\fR
interpreter \fIinterp\fR in the standard Tcl fashion. In in the standard Tcl fashion. In
the event of an error return, \fI*argvPtr\fR will not have been the event of an error return, \fI*argvPtr\fR will not have been
modified, but \fIargv\fR could have been partially modified. The modified, but \fIargv\fR could have been partially modified. The
possible causes of errors are explained below. possible causes of errors are explained below.
@@ -70,12 +70,12 @@ The \fIargTable\fR array specifies the kinds of arguments that are
expected; each of its entries has the following structure: expected; each of its entries has the following structure:
.CS .CS
typedef struct { typedef struct {
const char *\fIkey\fR; char *\fIkey\fR;
int \fItype\fR; int \fItype\fR;
char *\fIsrc\fR; char *\fIsrc\fR;
char *\fIdst\fR; char *\fIdst\fR;
const char *\fIhelp\fR; char *\fIhelp\fR;
} \fBTk_ArgvInfo\fR; } Tk_ArgvInfo;
.CE .CE
The \fIkey\fR field is a string such as The \fIkey\fR field is a string such as
.QW \-display .QW \-display
@@ -186,8 +186,7 @@ specifiers of this type are ignored (as if they did not exist).
\fBTK_ARGV_HELP\fR \fBTK_ARGV_HELP\fR
When this kind of option is encountered, \fBTk_ParseArgv\fR uses the When this kind of option is encountered, \fBTk_ParseArgv\fR uses the
\fIhelp\fR fields of \fIargTable\fR to format a message describing \fIhelp\fR fields of \fIargTable\fR to format a message describing
all the valid arguments. The message is placed in interpreter all the valid arguments. The message is placed in \fIinterp->result\fR
\fIinterp\fR's result
and \fBTk_ParseArgv\fR returns \fBTCL_ERROR\fR. When this happens, the and \fBTk_ParseArgv\fR returns \fBTCL_ERROR\fR. When this happens, the
caller normally prints the help message and aborts. If the \fIkey\fR caller normally prints the help message and aborts. If the \fIkey\fR
field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will
@@ -260,12 +259,11 @@ then return any that are left by compacting them to the beginning of
\fIargv\fR (starting at \fIargv\fR[0]). \fIGenfunc\fR \fIargv\fR (starting at \fIargv\fR[0]). \fIGenfunc\fR
should return a count of how many arguments are left in \fIargv\fR; should return a count of how many arguments are left in \fIargv\fR;
\fBTk_ParseArgv\fR will process them. If \fIgenfunc\fR encounters \fBTk_ParseArgv\fR will process them. If \fIgenfunc\fR encounters
an error then it should leave an error message in interpreter an error then it should leave an error message in \fIinterp->result\fR,
\fIinterp\fR's result,
in the usual Tcl fashion, and return \-1; when this happens in the usual Tcl fashion, and return \-1; when this happens
\fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR. \fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR.
.RE .RE
.SS "FLAGS" .SH "FLAGS"
.TP .TP
\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR
\fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program \fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program
@@ -314,14 +312,14 @@ Boolean exec = FALSE;
Tk_ArgvInfo argTable[] = { Tk_ArgvInfo argTable[] = {
{"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag, {"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag,
"Turn on debugging printfs"}, "Turn on debugging printfs"},
{"\-N", TK_ARGV_INT, NULL, (char *) &numReps, {"\-N", TK_ARGV_INT, (char *) NULL, (char *) &numReps,
"Number of repetitions"}, "Number of repetitions"},
{"\-of", TK_ARGV_STRING, NULL, (char *) &fileName, {"\-of", TK_ARGV_STRING, (char *) NULL, (char *) &fileName,
"Name of file for output"}, "Name of file for output"},
{"x", TK_ARGV_REST, NULL, (char *) &exec, {"x", TK_ARGV_REST, (char *) NULL, (char *) &exec,
"File to exec, followed by any arguments (must be last argument)."}, "File to exec, followed by any arguments (must be last argument)."},
{NULL, TK_ARGV_END, NULL, NULL, {(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
NULL} (char *) NULL}
}; };
main(argc, argv) main(argc, argv)
@@ -331,7 +329,7 @@ main(argc, argv)
\&... \&...
if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) { if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) {
fprintf(stderr, "%s\en", Tcl_GetString(Tcl_GetObjResult(interp))); fprintf(stderr, "%s\en", interp->result);
exit(1); exit(1);
} }

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue
@@ -30,6 +30,7 @@ that all unused fields of the structure be set to zero.
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR, Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR. \fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event \fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event
@@ -46,5 +47,6 @@ returns the previous value for collapse behavior on the \fIdisplay\fR.
The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has
the same significance as for \fBTcl_QueueEvent\fR; see the the same significance as for \fBTcl_QueueEvent\fR; see the
documentation for \fBTcl_QueueEvent\fR for details. documentation for \fBTcl_QueueEvent\fR for details.
.SH KEYWORDS .SH KEYWORDS
callback, clock, handler, modal timeout, events callback, clock, handler, modal timeout, events

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_RestackWindow \- Change a window's position in the stacking order Tk_RestackWindow \- Change a window's position in the stacking order
@@ -28,6 +28,7 @@ must be \fBAbove\fR or \fBBelow\fR.
Must be a sibling of \fItkwin\fR or a descendant of a sibling. Must be a sibling of \fItkwin\fR or a descendant of a sibling.
If NULL then \fItkwin\fR is restacked above or below all siblings. If NULL then \fItkwin\fR is restacked above or below all siblings.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative \fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative
@@ -41,5 +42,6 @@ just above or below \fIother\fR.
The \fIaboveBelow\fR argument must have one of the symbolic values The \fIaboveBelow\fR argument must have one of the symbolic values
\fBAbove\fR or \fBBelow\fR. \fBAbove\fR or \fBBelow\fR.
Both of these values are defined by the include file <X11/Xlib.h>. Both of these values are defined by the include file <X11/Xlib.h>.
.SH KEYWORDS .SH KEYWORDS
above, below, obscure, stacking order above, below, obscure, stacking order

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_RestrictEvents \- filter and selectively delay X events Tk_RestrictEvents \- filter and selectively delay X events
@@ -15,22 +15,23 @@ Tk_RestrictEvents \- filter and selectively delay X events
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
Tk_RestrictProc * Tk_RestrictProc *
\fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR) \fBTk_RestrictEvents\fR(\fIproc, clientData, prevClientDataPtr\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_RestrictProc **prevArgPtr .AS Tk_RestrictProc **prevClientDataPtr
.AP Tk_RestrictProc *proc in .AP Tk_RestrictProc *proc in
Predicate procedure to call to filter incoming X events. Predicate procedure to call to filter incoming X events.
NULL means do not restrict events at all. NULL means do not restrict events at all.
.AP ClientData arg in .AP ClientData clientData in
Arbitrary argument to pass to \fIproc\fR. Arbitrary argument to pass to \fIproc\fR.
.AP ClientData *prevArgPtr out .AP ClientData *prevClientDataPtr out
Pointer to place to save argument to previous restrict procedure. Pointer to place to save argument to previous restrict procedure.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This procedure is useful in certain situations where applications This procedure is useful in certain situations where applications
are only prepared to receive certain X events. After are only prepared to receive certain X events. After
\fBTk_RestrictEvents\fR is called, \fBTcl_DoOneEvent\fR (and \fBTk_RestrictEvents\fR is called, \fBTk_DoOneEvent\fR (and
hence \fBTk_MainLoop\fR) will filter X input events through hence \fBTk_MainLoop\fR) will filter X input events through
\fIproc\fR. \fIProc\fR indicates whether a \fIproc\fR. \fIProc\fR indicates whether a
given event is to be processed immediately, deferred until some given event is to be processed immediately, deferred until some
@@ -39,23 +40,23 @@ later time (e.g. when the event restriction is lifted), or discarded.
is a procedure with arguments and result that match is a procedure with arguments and result that match
the type \fBTk_RestrictProc\fR: the type \fBTk_RestrictProc\fR:
.CS .CS
typedef Tk_RestrictAction \fBTk_RestrictProc\fR( typedef Tk_RestrictAction Tk_RestrictProc(
ClientData \fIarg\fR, ClientData \fIclientData\fR,
XEvent *\fIeventPtr\fR); XEvent *\fIeventPtr\fR);
.CE .CE
The \fIarg\fR argument is a copy of the \fIarg\fR passed The \fIclientData\fR argument is a copy of the \fIclientData\fR passed
to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with
information it needs to filter events. The \fIeventPtr\fR points to information it needs to filter events. The \fIeventPtr\fR points to
an event under consideration. \fIProc\fR returns a restrict action an event under consideration. \fIProc\fR returns a restrict action
(enumerated type \fBTk_RestrictAction\fR) that indicates what (enumerated type \fBTk_RestrictAction\fR) that indicates what
\fBTcl_DoOneEvent\fR should do with the event. If the return value is \fBTk_DoOneEvent\fR should do with the event. If the return value is
\fBTK_PROCESS_EVENT\fR, then the event will be handled immediately. \fBTK_PROCESS_EVENT\fR, then the event will be handled immediately.
If the return value is \fBTK_DEFER_EVENT\fR, then the event will be If the return value is \fBTK_DEFER_EVENT\fR, then the event will be
left on the event queue for later processing. If the return value is left on the event queue for later processing. If the return value is
\fBTK_DISCARD_EVENT\fR, then the event will be removed from the event \fBTK_DISCARD_EVENT\fR, then the event will be removed from the event
queue and discarded without being processed. queue and discarded without being processed.
.PP .PP
\fBTk_RestrictEvents\fR uses its return value and \fIprevArgPtr\fR \fBTk_RestrictEvents\fR uses its return value and \fIprevClientDataPtr\fR
to return information about the current event restriction procedure to return information about the current event restriction procedure
(a NULL return value means there are currently no restrictions). (a NULL return value means there are currently no restrictions).
These values may be used to restore the previous restriction state These values may be used to restore the previous restriction state
@@ -74,6 +75,6 @@ solution in these situations is to call \fBXNextEvent\fR or
\fBXWindowEvent\fR, but these procedures cannot be used because \fBXWindowEvent\fR, but these procedures cannot be used because
Tk keeps its own event queue that is separate from the X event Tk keeps its own event queue that is separate from the X event
queue. Instead, call \fBTk_RestrictEvents\fR to set up a filter, queue. Instead, call \fBTk_RestrictEvents\fR to set up a filter,
then call \fBTcl_DoOneEvent\fR to retrieve the desired event(s). then call \fBTk_DoOneEvent\fR to retrieve the desired event(s).
.SH KEYWORDS .SH KEYWORDS
delay, event, filter, restriction delay, event, filter, restriction

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_SetAppName \- Set the name of an application for 'send' commands Tk_SetAppName \- Set the name of an application for 'send' commands
@@ -24,6 +24,7 @@ application.
.AP "const char" *name in .AP "const char" *name in
Name under which to register the application. Name under which to register the application.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_SetAppName\fR associates a name with a given application and \fBTk_SetAppName\fR associates a name with a given application and
@@ -58,5 +59,6 @@ so applications do not normally need to call it explicitly.
.PP .PP
The command \fBtk appname\fR provides Tcl-level access to the The command \fBtk appname\fR provides Tcl-level access to the
functionality of \fBTk_SetAppName\fR. functionality of \fBTk_SetAppName\fR.
.SH KEYWORDS .SH KEYWORDS
application, name, register, send command application, name, register, send command

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_SetCaretPos \- set the display caret location Tk_SetCaretPos \- set the display caret location
@@ -25,6 +25,7 @@ Window-relative y coordinate.
.AP int h in .AP int h in
Height of the caret in the window. Height of the caret in the window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_SetCaretPos\fR sets the caret location for the display of the \fBTk_SetCaretPos\fR sets the caret location for the display of the
@@ -32,5 +33,6 @@ specified Tk_Window \fItkwin\fR. The caret is the per-display cursor
location used for indicating global focus (e.g. to comply with Microsoft location used for indicating global focus (e.g. to comply with Microsoft
Accessibility guidelines), as well as for location of the over-the-spot XIM Accessibility guidelines), as well as for location of the over-the-spot XIM
(X Input Methods) or Windows IME windows. (X Input Methods) or Windows IME windows.
.SH KEYWORDS .SH KEYWORDS
caret, cursor caret, cursor

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetClass 3 "" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetClass 3 "" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_SetClass, Tk_Class \- set or retrieve a window's class Tk_SetClass, Tk_Class \- set or retrieve a window's class
@@ -25,6 +25,7 @@ Token for window.
.AP char *class in .AP char *class in
New class name for window. New class name for window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_SetClass\fR is called to associate a class with a particular \fBTk_SetClass\fR is called to associate a class with a particular
@@ -53,5 +54,6 @@ the properties of a unique identifier (see the manual entry for
\fBTk_GetUid\fR for details). \fBTk_GetUid\fR for details).
If \fItkwin\fR has not yet been given a class, then If \fItkwin\fR has not yet been given a class, then
\fBTk_Class\fR will return NULL. \fBTk_Class\fR will return NULL.
.SH KEYWORDS .SH KEYWORDS
class, unique identifier, window, window manager class, unique identifier, window, window manager

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_SetClassProcs \- register widget specific procedures Tk_SetClassProcs \- register widget specific procedures
@@ -18,13 +18,14 @@ Tk_SetClassProcs \- register widget specific procedures
.AS Tk_ClassProc instanceData .AS Tk_ClassProc instanceData
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Token for window to modify. Token for window to modify.
.AP "const Tk_ClassProcs" *procs in .AP Tk_ClassProcs *procs in
Pointer to data structure containing widget specific procedures. Pointer to data structure containing widget specific procedures.
The data structure pointed to by \fIprocs\fR must be static: The data structure pointed to by \fIprocs\fR must be static:
Tk keeps a reference to it as long as the window exists. Tk keeps a reference to it as long as the window exists.
.AP ClientData instanceData in .AP ClientData instanceData in
Arbitrary one-word value to pass to widget callbacks. Arbitrary one-word value to pass to widget callbacks.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_SetClassProcs\fR is called to register a set of procedures that \fBTk_SetClassProcs\fR is called to register a set of procedures that
@@ -37,7 +38,7 @@ typedef struct Tk_ClassProcs {
Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
Tk_ClassCreateProc *\fIcreateProc\fR; Tk_ClassCreateProc *\fIcreateProc\fR;
Tk_ClassModalProc *\fImodalProc\fR; Tk_ClassModalProc *\fImodalProc\fR;
} \fBTk_ClassProcs\fR; } Tk_ClassProcs;
.CE .CE
The \fIsize\fR field is used to simplify future expansion of the The \fIsize\fR field is used to simplify future expansion of the
structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR. structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR.
@@ -49,21 +50,21 @@ widgets configured to use that font alias must update their display
accordingly. \fIworldChangedProc\fR should have arguments and results accordingly. \fIworldChangedProc\fR should have arguments and results
that match the type \fBTk_ClassWorldChangedProc\fR: that match the type \fBTk_ClassWorldChangedProc\fR:
.CS .CS
typedef void \fBTk_ClassWorldChangedProc\fR( typedef void Tk_ClassWorldChangedProc(
ClientData \fIinstanceData\fR); ClientData \fIinstanceData\fR);
.CE .CE
The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
will be identical to the \fIinstanceData\fR parameter passed to will be identical to the \fIinstanceData\fR parameter passed to
\fBTk_SetClassProcs\fR. \fBTk_SetClassProcs\fR.
.PP .PP
\fIcreateProc\fR is used to create platform-dependent windows. It is \fIcreateProc\fR is used to create platform-dependant windows. It is
invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have
arguments and results that match the type \fBTk_ClassCreateProc\fR: arguments and results that match the type \fBTk_ClassCreateProc\fR:
.CS .CS
typedef Window \fBTk_ClassCreateProc\fR( typedef Window Tk_ClassCreateProc(
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
Window \fIparent\fR, Window \fIparent\fR,
ClientData \fIinstanceData\fR); ClientData \fIinstanceData\fR);
.CE .CE
The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to
the \fItkwin\fR and \fIinstanceData\fR parameters passed to the \fItkwin\fR and \fIinstanceData\fR parameters passed to
@@ -75,13 +76,14 @@ created window.
triggered in order to handle a modal loop. \fImodalProc\fR should triggered in order to handle a modal loop. \fImodalProc\fR should
have arguments and results that match the type \fBTk_ClassModalProc\fR: have arguments and results that match the type \fBTk_ClassModalProc\fR:
.CS .CS
typedef void \fBTk_ClassModalProc\fR( typedef void Tk_ClassModalProc(
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
XEvent *\fIeventPtr\fR); XEvent *\fIeventPtr\fR);
.CE .CE
The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the
\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The \fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The
\fIeventPtr\fR parameter will be a pointer to an XEvent structure \fIeventPtr\fR parameter will be a pointer to an XEvent structure
describing the event being processed. describing the event being processed.
.SH KEYWORDS .SH KEYWORDS
callback, class callback, class

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing
@@ -32,6 +32,7 @@ Width of one grid unit, in pixels.
.AP int heightInc in .AP int heightInc in
Height of one grid unit, in pixels. Height of one grid unit, in pixels.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's \fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's
@@ -59,5 +60,6 @@ toplevel, the calls for the new window have no effect.
.PP .PP
See the \fBwm\fR manual entry for additional information on gridded geometry See the \fBwm\fR manual entry for additional information on gridded geometry
management. management.
.SH KEYWORDS .SH KEYWORDS
grid, window, window manager grid, window, window manager

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_FreeSavedOptions, Tk_RestoreSavedOptions, Tk_GetOptionValue, Tk_GetOptionInfo, Tk_FreeConfigOptions, Tk_Offset \- process configuration options Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_FreeSavedOptions, Tk_RestoreSavedOptions, Tk_GetOptionValue, Tk_GetOptionInfo, Tk_FreeConfigOptions, Tk_Offset \- process configuration options
@@ -129,21 +129,19 @@ option table is no longer needed \fBTk_DeleteOptionTable\fR should be
called to free all of its resources. All of the option tables called to free all of its resources. All of the option tables
for a Tcl interpreter are freed automatically if the interpreter is deleted. for a Tcl interpreter are freed automatically if the interpreter is deleted.
.PP .PP
\fBTk_InitOptions\fR is invoked when a new widget is created to set the \fBTk_InitOptions\fR is invoked when a new widget is created to set
default values for all of the widget's configuration options that do not the default values for all of the widget's configuration options.
have \fBTK_OPTION_DONT_SET_DEFAULT\fR set in their \fIflags\fR field. \fBTk_InitOptions\fR is passed a token for an option table (\fIoptionTable\fR)
\fBTk_InitOptions\fR is passed a token for an option table and a pointer to a widget record (\fIrecordPtr\fR), which is the C
(\fIoptionTable\fR) and a pointer to a widget record (\fIrecordPtr\fR), structure that holds information about this widget. \fBTk_InitOptions\fR
which is the C structure that holds information about this widget. uses the information in the option table to
\fBTk_InitOptions\fR uses the information in the option table to choose an choose an appropriate default for each option, then it stores the default
appropriate default for each option, except those having value directly into the widget record, overwriting any information that
\fBTK_OPTION_DONT_SET_DEFAULT\fR set, then it stores the default value was already present in the widget record. \fBTk_InitOptions\fR normally
directly into the widget record, overwriting any information that was returns \fBTCL_OK\fR. If an error occurred while setting the default values
already present in the widget record. \fBTk_InitOptions\fR normally (e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is returned
returns \fBTCL_OK\fR. If an error occurred while setting the default and an error message is left in \fIinterp\fR's result if \fIinterp\fR
values (e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is not NULL.
is returned and an error message is left in \fIinterp\fR's result if
\fIinterp\fR is not NULL.
.PP .PP
\fBTk_SetOptions\fR is invoked to modify configuration options based \fBTk_SetOptions\fR is invoked to modify configuration options based
on information specified in a Tcl command. The command might be one that on information specified in a Tcl command. The command might be one that
@@ -261,7 +259,7 @@ typedef struct {
int \fIobjOffset\fR; int \fIobjOffset\fR;
int \fIinternalOffset\fR; int \fIinternalOffset\fR;
int \fIflags\fR; int \fIflags\fR;
const void *\fIclientData\fR; ClientData \fIclientData\fR;
int \fItypeMask\fR; int \fItypeMask\fR;
} \fBTk_OptionSpec\fR; } \fBTk_OptionSpec\fR;
.CE .CE
@@ -308,27 +306,19 @@ given by \fIinternalOffset\fR. For example, if the option's type is
value is not stored in that form. At least one of the offsets must be value is not stored in that form. At least one of the offsets must be
greater than or equal to zero. greater than or equal to zero.
.PP .PP
The \fIflags\fR field consists of one or more bits ORed together. The The \fIflags\fR field consists of one or more bits ORed together. At
following flags are supported: present only a single flag is supported: \fBTK_OPTION_NULL_OK\fR. If
.TP this bit is set for an option then an empty string will be accepted as
\fBTK_OPTION_NULL_OK\fR the value for the option and the resulting internal form will be a
If this bit is set for an option then an empty string will be accepted as NULL pointer, a zero value, or \fBNone\fR, depending on the type of
the value for the option and the resulting internal form will be a NULL the option. If the flag is not set then empty strings will result
pointer, a zero value, or \fBNone\fR, depending on the type of the option. in errors.
If the flag is not set then empty strings will result in errors.
\fBTK_OPTION_NULL_OK\fR is typically used to allow a \fBTK_OPTION_NULL_OK\fR is typically used to allow a
feature to be turned off entirely, e.g. set a cursor value to feature to be turned off entirely, e.g. set a cursor value to
\fBNone\fR so that a window simply inherits its parent's cursor. \fBNone\fR so that a window simply inherits its parent's cursor.
Not all option types support the \fBTK_OPTION_NULL_OK\fR Not all option types support the \fBTK_OPTION_NULL_OK\fR
flag; for those that do, there is an explicit indication of that fact flag; for those that do, there is an explicit indication of that fact
in the descriptions below. in the descriptions below.
.TP
\fBTK_OPTION_DONT_SET_DEFAULT\fR
If this bit is set for an option then no default value will be set in
\fBTk_InitOptions\fR for this option. Neither the option database, nor any
system default value, nor \fIoptionTable\fR are used to give a default
value to this option. Instead it is assumed that the caller has already
supplied a default value in the widget code.
.PP .PP
The \fItype\fR field of each Tk_OptionSpec structure determines The \fItype\fR field of each Tk_OptionSpec structure determines
how to parse the value of that configuration option. The how to parse the value of that configuration option. The

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_SetWindowVisual \- change visual characteristics of window Tk_SetWindowVisual \- change visual characteristics of window
@@ -28,6 +28,7 @@ Number of bits per pixel desired for \fItkwin\fR.
New colormap for \fItkwin\fR, which must be compatible with New colormap for \fItkwin\fR, which must be compatible with
\fIvisual\fR and \fIdepth\fR. \fIvisual\fR and \fIdepth\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
When Tk creates a new window it assigns it the default visual When Tk creates a new window it assigns it the default visual
@@ -46,5 +47,6 @@ completed successfully.
Note: \fBTk_SetWindowVisual\fR should not be called if you just want Note: \fBTk_SetWindowVisual\fR should not be called if you just want
to change a window's colormap without changing its visual or depth; to change a window's colormap without changing its visual or depth;
call \fBTk_SetWindowColormap\fR instead. call \fBTk_SetWindowColormap\fR instead.
.SH KEYWORDS .SH KEYWORDS
colormap, depth, visual colormap, depth, visual

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_StrictMotif \- Return value of tk_strictMotif variable Tk_StrictMotif \- Return value of tk_strictMotif variable
@@ -20,6 +20,7 @@ int
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Token for window. Token for window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This procedure returns the current value of the \fBtk_strictMotif\fR This procedure returns the current value of the \fBtk_strictMotif\fR
@@ -34,5 +35,6 @@ is good enough, and extra features are welcome.
This procedure uses a link to the Tcl variable to provide much This procedure uses a link to the Tcl variable to provide much
faster access to the variable's value than could be had by calling faster access to the variable's value than could be had by calling
\fBTcl_GetVar\fR. \fBTcl_GetVar\fR.
.SH KEYWORDS .SH KEYWORDS
Motif compliance, tk_strictMotif variable Motif compliance, tk_strictMotif variable

View File

@@ -3,9 +3,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_ComputeTextLayout 3 8.1 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_ComputeTextLayout 3 8.1 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayout, Tk_PointToChar, Tk_CharBbox, Tk_DistanceToTextLayout, Tk_IntersectTextLayout, Tk_TextLayoutToPostscript \- routines to measure and display single-font, multi-line, justified text. Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayout, Tk_PointToChar, Tk_CharBbox, Tk_DistanceToTextLayout, Tk_IntersectTextLayout, Tk_TextLayoutToPostscript \- routines to measure and display single-font, multi-line, justified text.
@@ -39,6 +39,7 @@ int
.sp .sp
void void
\fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR \fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_TextLayout "*xPtr, *yPtr" .AS Tk_TextLayout "*xPtr, *yPtr"
.AP Tk_Font tkfont in .AP Tk_Font tkfont in
@@ -48,7 +49,7 @@ have been returned by a previous call to \fBTk_GetFont\fR.
.AP "const char" *string in .AP "const char" *string in
Potentially multi-line string whose dimensions are to be computed and Potentially multi-line string whose dimensions are to be computed and
stored in the text layout. The \fIstring\fR must remain valid for the stored in the text layout. The \fIstring\fR must remain valid for the
lifetime of the text layout. lifetime of the text layout.
.AP int numChars in .AP int numChars in
The number of characters to consider from \fIstring\fR. If The number of characters to consider from \fIstring\fR. If
\fInumChars\fR is less than 0, then assumes \fIstring\fR is null \fInumChars\fR is less than 0, then assumes \fIstring\fR is null
@@ -77,7 +78,7 @@ measured and displayed in a platform-dependent manner as described in
\fBTk_MeasureChars\fR, and will not have any special behaviors. \fBTk_MeasureChars\fR, and will not have any special behaviors.
.AP int *widthPtr out .AP int *widthPtr out
If non-NULL, filled with either the width, in pixels, of the widest If non-NULL, filled with either the width, in pixels, of the widest
line in the text layout, or the width, in pixels, of the bounding box for the line in the text layout, or the width, in pixels, of the bounding box for the
character specified by \fIindex\fR. character specified by \fIindex\fR.
.AP int *heightPtr out .AP int *heightPtr out
If non-NULL, filled with either the total height, in pixels, of all If non-NULL, filled with either the total height, in pixels, of all
@@ -101,7 +102,7 @@ text layout when it is being drawn, or the coordinates of a point (with
respect to the upper-left hand corner of the text layout) to check respect to the upper-left hand corner of the text layout) to check
against the text layout. against the text layout.
.AP int firstChar in .AP int firstChar in
The index of the first character to draw from the given text layout. The index of the first character to draw from the given text layout.
The number 0 means to draw from the beginning. The number 0 means to draw from the beginning.
.AP int lastChar in .AP int lastChar in
The index of the last character up to which to draw. The character The index of the last character up to which to draw. The character
@@ -119,12 +120,13 @@ for the character specified by \fIindex\fR. Either or both \fIxPtr\fR
and \fIyPtr\fR may be NULL, in which case the corresponding value and \fIyPtr\fR may be NULL, in which case the corresponding value
is not calculated. is not calculated.
.AP int "width, height" in .AP int "width, height" in
Specifies the width and height, in pixels, of the rectangular area to Specifies the width and height, in pixels, of the rectangular area to
compare for intersection against the text layout. compare for intersection against the text layout.
.AP Tcl_Interp *interp out .AP Tcl_Interp *interp out
Postscript code that will print the text layout is appended to Postscript code that will print the text layout is appended to
the result of interpreter \fIinterp\fR. \fIinterp->result\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
These routines are for measuring and displaying single-font, multi-line, These routines are for measuring and displaying single-font, multi-line,
@@ -132,7 +134,7 @@ justified text. To measure and display simple single-font, single-line
strings, refer to the documentation for \fBTk_MeasureChars\fR. There is strings, refer to the documentation for \fBTk_MeasureChars\fR. There is
no programming interface in the core of Tk that supports multi-font, no programming interface in the core of Tk that supports multi-font,
multi-line text; support for that behavior must be built on top of multi-line text; support for that behavior must be built on top of
simpler layers. simpler layers.
Note that unlike the lower level text display routines, the functions Note that unlike the lower level text display routines, the functions
described here all operate on character-oriented lengths and indices described here all operate on character-oriented lengths and indices
rather than byte-oriented values. See the description of rather than byte-oriented values. See the description of
@@ -150,11 +152,11 @@ returns a Tk_TextLayout token that holds this information. This token is
used in subsequent calls to procedures such as \fBTk_DrawTextLayout\fR, used in subsequent calls to procedures such as \fBTk_DrawTextLayout\fR,
\fBTk_DistanceToTextLayout\fR, and \fBTk_FreeTextLayout\fR. The \fBTk_DistanceToTextLayout\fR, and \fBTk_FreeTextLayout\fR. The
\fIstring\fR and \fItkfont\fR used when computing the layout must remain \fIstring\fR and \fItkfont\fR used when computing the layout must remain
valid for the lifetime of this token. valid for the lifetime of this token.
.PP .PP
\fBTk_FreeTextLayout\fR is called to release the storage associated with \fBTk_FreeTextLayout\fR is called to release the storage associated with
\fIlayout\fR when it is no longer needed. A \fIlayout\fR should not be used \fIlayout\fR when it is no longer needed. A \fIlayout\fR should not be used
in any other text layout procedures once it has been released. in any other text layout procedures once it has been released.
.PP .PP
\fBTk_DrawTextLayout\fR uses the information in \fIlayout\fR to display a \fBTk_DrawTextLayout\fR uses the information in \fIlayout\fR to display a
single-font, multi-line, justified string of text at the specified location. single-font, multi-line, justified string of text at the specified location.
@@ -182,16 +184,14 @@ whose \fIx\fR-value is less than 0 will be considered closest to the first
character on that line; any point whose \fIx\fR-value is greater than the character on that line; any point whose \fIx\fR-value is greater than the
width of the text layout will be considered closest to the last character on width of the text layout will be considered closest to the last character on
that line. The return value is the index of the character that was closest that line. The return value is the index of the character that was closest
to the point, or one more than the index of any character (to indicate that to the point. Given a \fIlayout\fR with no characters, the value 0 will
the point was after the end of the string and that the corresponding caret always be returned, referring to a hypothetical zero-width placeholder
would be at the end of the string). Given a \fIlayout\fR with no characters, character.
the value 0 will always be returned, referring to a hypothetical zero-width
placeholder character.
.PP .PP
\fBTk_CharBbox\fR uses the information in \fIlayout\fR to return the \fBTk_CharBbox\fR uses the information in \fIlayout\fR to return the
bounding box for the character specified by \fIindex\fR. The width of the bounding box for the character specified by \fIindex\fR. The width of the
bounding box is the advance width of the character, and does not include any bounding box is the advance width of the character, and does not include any
left or right bearing. Any character that extends partially outside of left or right bearing. Any character that extends partially outside of
\fIlayout\fR is considered to be truncated at the edge. Any character \fIlayout\fR is considered to be truncated at the edge. Any character
that would be located completely outside of \fIlayout\fR is considered to that would be located completely outside of \fIlayout\fR is considered to
be zero-width and pegged against the edge. The height of the bounding be zero-width and pegged against the edge. The height of the bounding
@@ -231,9 +231,8 @@ array of strings that represent the individual lines in \fIlayout\fR. It
is the responsibility of the caller to take the Postscript array of is the responsibility of the caller to take the Postscript array of
strings and add some Postscript function operate on the array to render strings and add some Postscript function operate on the array to render
each of the lines. The code that represents the Postscript array of each of the lines. The code that represents the Postscript array of
strings is appended to interpreter \fIinterp\fR's result. strings is appended to \fIinterp->result\fR.
.SH "DISPLAY MODEL" .SH "DISPLAY MODEL"
.PP
When measuring a text layout, space characters that occur at the end of a When measuring a text layout, space characters that occur at the end of a
line are ignored. The space characters still exist and the insertion point line are ignored. The space characters still exist and the insertion point
can be positioned amongst them, but their additional width is ignored when can be positioned amongst them, but their additional width is ignored when
@@ -264,13 +263,13 @@ much as fits placed on the line and the rest on subsequent line(s). If
\fIwrapLength\fR is so small that not even one character can fit on a \fIwrapLength\fR is so small that not even one character can fit on a
given line, the \fIwrapLength\fR is ignored for that line and one given line, the \fIwrapLength\fR is ignored for that line and one
character will be placed on the line anyhow. When wrapping is turned character will be placed on the line anyhow. When wrapping is turned
off, only newline/return characters may cause a line break. off, only newline/return characters may cause a line break.
.PP .PP
When a text layout has been created using an underlined \fItkfont\fR, When a text layout has been created using an underlined \fItkfont\fR,
then any space characters that occur at the end of individual lines, then any space characters that occur at the end of individual lines,
newlines/returns, and tabs will not be displayed underlined when newlines/returns, and tabs will not be displayed underlined when
\fBTk_DrawTextLayout\fR is called, because those characters are never \fBTk_DrawTextLayout\fR is called, because those characters are never
actually drawn \- they are merely placeholders maintained in the actually drawn \- they are merely placeholders maintained in the
\fIlayout\fR. \fIlayout\fR.
.SH KEYWORDS .SH KEYWORDS
font font

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_InitStubs \- initialize the Tk stubs mechanism Tk_InitStubs \- initialize the Tk stubs mechanism
@@ -34,7 +34,7 @@ as \fIversion\fR.
The Tcl stubs mechanism defines a way to dynamically bind The Tcl stubs mechanism defines a way to dynamically bind
extensions to a particular Tcl implementation at run time. extensions to a particular Tcl implementation at run time.
the stubs mechanism requires no changes to applications the stubs mechanism requires no changes to applications
incorporating Tcl/Tk interpreters. Only developers creating incoporating Tcl/Tk interpreters. Only developers creating
C-based Tcl/Tk extensions need to take steps to use the C-based Tcl/Tk extensions need to take steps to use the
stubs mechanism with their extensions. stubs mechanism with their extensions.
See the \fBTcl_InitStubs\fR page for more information. See the \fBTcl_InitStubs\fR page for more information.
@@ -48,19 +48,15 @@ Tcl functions.
Call \fBTk_InitStubs\fR if the extension before calling any other Call \fBTk_InitStubs\fR if the extension before calling any other
Tk functions. Tk functions.
.IP 2) 5 .IP 2) 5
Define the \fBUSE_TCL_STUBS\fR and the \fBUSE_TK_STUBS\fR Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
symbols. Typically, you would include the \fB\-DUSE_TCL_STUBS\fR and \fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
the \fB\-DUSE_TK_STUBS\fR flags when compiling the extension.
.IP 3) 5 .IP 3) 5
Link the extension with the Tcl and Tk stubs libraries instead of the Link the extension with the Tcl and Tk stubs libraries instead of
standard Tcl and Tk libraries. On Unix platforms, the library names the standard Tcl and Tk libraries. On Unix platforms, the library
are \fIlibtclstub8.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows names are \fIlibtclstub8.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows
platforms, the library names are \fItclstub84.lib\fR and platforms, the library names are \fItclstub84.lib\fR and \fItkstub84.lib\fR
\fItkstub84.lib\fR. Adjust the library names with appropriate version (adjust names with appropriate version number).
number but note that the extension may only be used with versions of
Tcl/Tk that have that version number or higher.
.SH DESCRIPTION .SH DESCRIPTION
.PP
\fBTk_InitStubs\fR attempts to initialize the Tk stub table pointers \fBTk_InitStubs\fR attempts to initialize the Tk stub table pointers
and ensure that the correct version of Tk is loaded. In addition and ensure that the correct version of Tk is loaded. In addition
to an interpreter handle, it accepts as arguments a version number to an interpreter handle, it accepts as arguments a version number

View File

@@ -4,8 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_Init 3 8.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_Init 3 8.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_Init, Tk_SafeInit \- add Tk to an interpreter and make a new Tk application. Tk_Init, Tk_SafeInit \- add Tk to an interpreter and make a new Tk application.
@@ -23,6 +23,7 @@ int
Interpreter in which to load Tk. Tk should not already be loaded Interpreter in which to load Tk. Tk should not already be loaded
in this interpreter. in this interpreter.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_Init\fR is the package initialization procedure for Tk. \fBTk_Init\fR is the package initialization procedure for Tk.
@@ -33,7 +34,7 @@ and creates a new Tk application, including its main window.
If the initialization is successful \fBTk_Init\fR returns If the initialization is successful \fBTk_Init\fR returns
\fBTCL_OK\fR; if there is an error it returns \fBTCL_ERROR\fR. \fBTCL_OK\fR; if there is an error it returns \fBTCL_ERROR\fR.
\fBTk_Init\fR also leaves a result or error message \fBTk_Init\fR also leaves a result or error message
in interpreter \fIinterp\fR's result. in \fIinterp->result\fR.
.PP .PP
If there is a variable \fBargv\fR in \fIinterp\fR, \fBTk_Init\fR If there is a variable \fBargv\fR in \fIinterp\fR, \fBTk_Init\fR
treats the contents of this variable as a list of options for the treats the contents of this variable as a list of options for the
@@ -81,5 +82,6 @@ from the user.
\fBwm\fR \fBwm\fR
If toplevels are ever allowed, wm can be used to remove decorations, If toplevels are ever allowed, wm can be used to remove decorations,
move windows around, etc. move windows around, etc.
.SH KEYWORDS .SH KEYWORDS
safe, application, initialization, load, main window safe, application, initialization, load, main window

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_Main 3 4.0 Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_Main 3 4.0 Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_Main \- main program for Tk-based applications Tk_Main \- main program for Tk-based applications
@@ -20,16 +20,16 @@ Tk_Main \- main program for Tk-based applications
.AP int argc in .AP int argc in
Number of elements in \fIargv\fR. Number of elements in \fIargv\fR.
.AP char *argv[] in .AP char *argv[] in
Array of strings containing command-line arguments. On Windows, when Array of strings containing command-line arguments.
using -DUNICODE, the parameter type changes to wchar_t *.
.AP Tcl_AppInitProc *appInitProc in .AP Tcl_AppInitProc *appInitProc in
Address of an application-specific initialization procedure. Address of an application-specific initialization procedure.
The value for this argument is usually \fBTcl_AppInit\fR. The value for this argument is usually \fBTcl_AppInit\fR.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_Main\fR acts as the main program for most Tk-based applications. \fBTk_Main\fR acts as the main program for most Tk-based applications.
Starting with Tk 4.0 it is not called \fBmain\fR anymore because it Starting with Tk 4.0 it is not called \fBmain\fR anymore because it
is part of the Tk library and having a function \fBmain\fR is part of the Tk library and having a function \fBmain\fR
in a library (particularly a shared library) causes problems on many in a library (particularly a shared library) causes problems on many
systems. systems.
@@ -50,21 +50,11 @@ for the application to perform its own initialization, such as defining
application-specific commands. The procedure must have an interface application-specific commands. The procedure must have an interface
that matches the type \fBTcl_AppInitProc\fR: that matches the type \fBTcl_AppInitProc\fR:
.CS .CS
typedef int \fBTcl_AppInitProc\fR( typedef int Tcl_AppInitProc(Tcl_Interp *\fIinterp\fR);
Tcl_Interp *\fIinterp\fR);
.CE .CE
\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR; \fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR;
for more details on this procedure, see the documentation for more details on this procedure, see the documentation
for \fBTcl_AppInit\fR. for \fBTcl_AppInit\fR.
.PP
\fBTk_Main\fR functions much the same as \fBTcl_Main\fR. In particular,
\fBTk_Main\fR supports both an interactive mode and a startup script
mode, with the file name and encoding of a startup script under the
control of the \fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
routines. However it calls \fBTk_MainLoop\fR after processing any
supplied script, and in interactive uses events registered with
\fBTcl_CreateFileHandler\fR to process user input.
.SH "SEE ALSO"
Tcl_DoOneEvent(3)
.SH KEYWORDS .SH KEYWORDS
application-specific initialization, command-line arguments, main program application-specific initialization, command-line arguments, main program

View File

@@ -4,9 +4,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures"
.so man.macros .so man.macros
.TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures"
.BS .BS
.SH NAME .SH NAME
Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp \- retrieve information from Tk's local data structure Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp \- retrieve information from Tk's local data structure
@@ -102,6 +102,7 @@ Tcl_Interp *
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Token for window. Token for window.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
\fBTk_WindowId\fR and the other names listed above are \fBTk_WindowId\fR and the other names listed above are
@@ -168,7 +169,7 @@ the window's minimum requested size. These values correspond to the last
call to \fBTk_SetMinimumRequestSize\fR for \fItkwin\fR. call to \fBTk_SetMinimumRequestSize\fR for \fItkwin\fR.
.PP .PP
\fBTk_InternalBorderLeft\fR, \fBTk_InternalBorderRight\fR, \fBTk_InternalBorderLeft\fR, \fBTk_InternalBorderRight\fR,
\fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR \fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR
return the width of one side of the internal border return the width of one side of the internal border
that has been requested for \fItkwin\fR, or 0 if no internal border was that has been requested for \fItkwin\fR, or 0 if no internal border was
requested. The return value is simply the last value passed to requested. The return value is simply the last value passed to
@@ -182,6 +183,7 @@ and \fBTk_Colormap\fR returns the current
colormap for the window. The visual characteristics are colormap for the window. The visual characteristics are
normally set from the defaults for the window's screen, but normally set from the defaults for the window's screen, but
they may be overridden by calling \fBTk_SetWindowVisual\fR. they may be overridden by calling \fBTk_SetWindowVisual\fR.
.SH KEYWORDS .SH KEYWORDS
attributes, colormap, depth, display, height, geometry manager, attributes, colormap, depth, display, height, geometry manager,
identifier, mapped, requested size, screen, top-level, identifier, mapped, requested size, screen, top-level,

View File

@@ -6,8 +6,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH bell n 8.4 Tk "Tk Built-In Commands"
.so man.macros .so man.macros
.TH bell n 8.4 Tk "Tk Built-In Commands"
.BS .BS
'\" Note: do not modify the .SH NAME line immediately below! '\" Note: do not modify the .SH NAME line immediately below!
.SH NAME .SH NAME
@@ -15,6 +15,7 @@ bell \- Ring a display's bell
.SH SYNOPSIS .SH SYNOPSIS
\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR? \fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR?
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This command rings the bell on the display for \fIwindow\fR and This command rings the bell on the display for \fIwindow\fR and
@@ -27,8 +28,6 @@ may be modified with programs such as \fBxset\fR.
If \fB\-nice\fR is not specified, this command also resets the screen saver If \fB\-nice\fR is not specified, this command also resets the screen saver
for the screen. Some screen savers will ignore this, but others will reset for the screen. Some screen savers will ignore this, but others will reset
so that the screen becomes visible again. so that the screen becomes visible again.
.SH KEYWORDS .SH KEYWORDS
beep, bell, ring beep, bell, ring
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -5,9 +5,9 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH bind n 8.0 Tk "Tk Built-In Commands"
.so man.macros .so man.macros
.TH bind n 8.0 Tk "Tk Built-In Commands"
.BS .BS
'\" Note: do not modify the .SH NAME line immediately below! '\" Note: do not modify the .SH NAME line immediately below!
.SH NAME .SH NAME
@@ -19,10 +19,9 @@ bind \- Arrange for X events to invoke Tcl scripts
.PP .PP
The \fBbind\fR command associates Tcl scripts with X events. The \fBbind\fR command associates Tcl scripts with X events.
If all three arguments are specified, \fBbind\fR will If all three arguments are specified, \fBbind\fR will
arrange for \fIscript\fR (a Tcl script called the arrange for \fIscript\fR (a Tcl script) to be evaluated whenever
.QW "binding script") the event(s) given by \fIsequence\fR occur in the window(s)
to be evaluated whenever the event(s) given by \fIsequence\fR identified by \fItag\fR.
occur in the window(s) identified by \fItag\fR.
If \fIscript\fR is prefixed with a If \fIscript\fR is prefixed with a
.QW + , .QW + ,
then it is appended to then it is appended to
@@ -152,6 +151,7 @@ requirement.
The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR
resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys. resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys.
.PP .PP
.VS 8.5
The \fBExtended\fR modifier is, at present, specific to Windows. It The \fBExtended\fR modifier is, at present, specific to Windows. It
appears on events that are associated with the keys on the appears on events that are associated with the keys on the
.QW "extended keyboard" . .QW "extended keyboard" .
@@ -160,6 +160,7 @@ and \fBControl\fR keys at the right of the keyboard, the cursor keys
in the cluster to the left of the numeric pad, the \fBNumLock\fR key, in the cluster to the left of the numeric pad, the \fBNumLock\fR key,
the \fBBreak\fR key, the \fBPrintScreen\fR key, and the \fB/\fR and the \fBBreak\fR key, the \fBPrintScreen\fR key, and the \fB/\fR and
\fBEnter\fR keys in the numeric keypad. \fBEnter\fR keys in the numeric keypad.
.VE 8.5
.SS "EVENT TYPES" .SS "EVENT TYPES"
.PP .PP
The \fItype\fR field may be any of the standard X event types, with a The \fItype\fR field may be any of the standard X event types, with a
@@ -206,7 +207,9 @@ always routed to the window that currently has focus. When the event
is received you can use the \fB%D\fR substitution to get the is received you can use the \fB%D\fR substitution to get the
\fIdelta\fR field for the event, which is a integer value describing how \fIdelta\fR field for the event, which is a integer value describing how
the mouse wheel has moved. The smallest value for which the the mouse wheel has moved. The smallest value for which the
system will report is defined by the OS. The sign of the system will report is defined by the OS. On Windows 95 & 98 machines
this value is at least 120 before it is reported. However, higher
resolution devices may be available in the future. The sign of the
value determines which direction your widget should scroll. Positive value determines which direction your widget should scroll. Positive
values should scroll up and negative values should scroll down. values should scroll up and negative values should scroll down.
.IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5 .IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5
@@ -388,8 +391,7 @@ For example, \fB<Control\-comma>\fR is equivalent to
\fB<Control\-KeyPress\-comma>\fR. \fB<Control\-KeyPress\-comma>\fR.
.SH "BINDING SCRIPTS AND SUBSTITUTIONS" .SH "BINDING SCRIPTS AND SUBSTITUTIONS"
.PP .PP
The \fIscript\fR argument to \fBbind\fR is a Tcl script, called the The \fIscript\fR argument to \fBbind\fR is a Tcl script,
.QW "binding script",
which will be executed whenever the given event sequence occurs. which will be executed whenever the given event sequence occurs.
\fICommand\fR will be executed in the same interpreter that the \fICommand\fR will be executed in the same interpreter that the
\fBbind\fR command was executed in, and it will run at global \fBbind\fR command was executed in, and it will run at global
@@ -427,7 +429,10 @@ The \fIcount\fR field from the event. Valid only for \fBExpose\fR events.
Indicates that there are \fIcount\fR pending \fBExpose\fR events which have not Indicates that there are \fIcount\fR pending \fBExpose\fR events which have not
yet been delivered to the window. yet been delivered to the window.
.IP \fB%d\fR 5 .IP \fB%d\fR 5
The \fIdetail\fR or \fIuser_data\fR The \fIdetail\fR
.VS 8.5
or \fIuser_data\fR
.VE 8.5
field from the event. The \fB%d\fR is replaced by field from the event. The \fB%d\fR is replaced by
a string identifying the detail. For \fBEnter\fR, a string identifying the detail. For \fBEnter\fR,
\fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events, \fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events,
@@ -447,11 +452,13 @@ For \fBConfigureRequest\fR events, the string will be one of:
\fBBelow\fR \fBNone\fR \fBBelow\fR \fBNone\fR
\fBBottomIf\fR \fBTopIf\fR \fBBottomIf\fR \fBTopIf\fR
.DE .DE
.VS 8.5
For virtual events, the string will be whatever value is stored in the For virtual events, the string will be whatever value is stored in the
\fIuser_data\fR field when the event was created (typically with \fIuser_data\fR field when the event was created (typically with
\fBevent generate\fR), or the empty string if the field is NULL. \fBevent generate\fR), or the empty string if the field is NULL.
Virtual events corresponding to key sequence presses (see \fBevent Virtual events corresponding to key sequence presses (see \fBevent
add\fR for details) set the \fIuser_data\fR to NULL. add\fR for details) set the \fIuser_data\fR to NULL.
.VE 8.5
For events other than these, the substituted string is undefined. For events other than these, the substituted string is undefined.
.RE .RE
.IP \fB%f\fR 5 .IP \fB%f\fR 5
@@ -527,7 +534,9 @@ The \fIborder_width\fR field from the event. Valid only for
.IP \fB%D\fR 5 .IP \fB%D\fR 5
This reports the \fIdelta\fR value of a \fBMouseWheel\fR event. The This reports the \fIdelta\fR value of a \fBMouseWheel\fR event. The
\fIdelta\fR value represents the rotation units the mouse wheel has \fIdelta\fR value represents the rotation units the mouse wheel has
been moved. The sign of the value represents the direction the mouse been moved. On Windows 95 & 98 systems the smallest value for the
delta is 120. Future systems may support higher resolution values for
the delta. The sign of the value represents the direction the mouse
wheel was scrolled. wheel was scrolled.
.IP \fB%E\fR 5 .IP \fB%E\fR 5
The \fIsend_event\fR field from the event. Valid for all event types. The \fIsend_event\fR field from the event. Valid for all event types.
@@ -539,9 +548,6 @@ event generated by \fBSendEvent\fR.
.IP \fB%K\fR 5 .IP \fB%K\fR 5
The keysym corresponding to the event, substituted as a textual The keysym corresponding to the event, substituted as a textual
string. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events. string. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%M\fR 5
The number of script-based binding patterns matched so far for the
event. Valid for all event types.
.IP \fB%N\fR 5 .IP \fB%N\fR 5
The keysym corresponding to the event, substituted as a decimal The keysym corresponding to the event, substituted as a decimal
number. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events. number. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
@@ -566,8 +572,8 @@ The \fIx_root\fR and \fIy_root\fR fields from the event.
If a virtual-root window manager is being used then the substituted If a virtual-root window manager is being used then the substituted
values are the corresponding x-coordinate and y-coordinate in the virtual root. values are the corresponding x-coordinate and y-coordinate in the virtual root.
Valid only for Valid only for
\fBButtonPress\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBKeyPress\fR, \fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
\fBKeyRelease\fR, \fBLeave\fR and \fBMotion\fR events. and \fBMotion\fR events.
Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
window. window.
.LP .LP
@@ -608,21 +614,13 @@ the window.
.PP .PP
The \fBcontinue\fR and \fBbreak\fR commands may be used inside a The \fBcontinue\fR and \fBbreak\fR commands may be used inside a
binding script to control the processing of matching scripts. binding script to control the processing of matching scripts.
If \fBcontinue\fR is invoked within a binding script, then this If \fBcontinue\fR is invoked, then the current binding script
binding script, including all other is terminated but Tk will continue processing binding scripts
.QW + associated with other \fItag\fR's.
appended scripts, is terminated but Tk will continue processing
binding scripts associated with other \fItag\fR's.
If the \fBbreak\fR command is invoked within a binding script, If the \fBbreak\fR command is invoked within a binding script,
then that script terminates and no other scripts will be invoked then that script terminates and no other scripts will be invoked
for the event. for the event.
.PP .PP
Within a script called from the binding script, \fBreturn\fR
\fB-code ok\fR may be used to continue processing (including
.QW +
appended scripts), or \fBreturn\fR \fB-code break\fR may be used to
stop processing all other binding scripts.
.PP
If more than one binding matches a particular event and they If more than one binding matches a particular event and they
have the same \fItag\fR, then the most specific binding have the same \fItag\fR, then the most specific binding
is chosen and its script is evaluated. is chosen and its script is evaluated.
@@ -638,11 +636,11 @@ of events matched) is more specific than a shorter sequence;
.IP (c) .IP (c)
if the modifiers specified in one pattern are a subset of the if the modifiers specified in one pattern are a subset of the
modifiers in another pattern, then the pattern with more modifiers modifiers in another pattern, then the pattern with more modifiers
is more specific; is more specific.
.IP (d) .IP (d)
a virtual event whose physical pattern matches the sequence is less a virtual event whose physical pattern matches the sequence is less
specific than the same physical pattern that is not associated with a specific than the same physical pattern that is not associated with a
virtual event; virtual event.
.IP (e) .IP (e)
given a sequence that matches two or more virtual events, one given a sequence that matches two or more virtual events, one
of the virtual events will be chosen, but the order is undefined. of the virtual events will be chosen, but the order is undefined.
@@ -703,7 +701,6 @@ If an error occurs in executing the script for a binding then the
The \fBbgerror\fR command will be executed at global level The \fBbgerror\fR command will be executed at global level
(outside the context of any Tcl procedure). (outside the context of any Tcl procedure).
.SH "EXAMPLES" .SH "EXAMPLES"
.PP
Arrange for a string describing the motion of the mouse to be printed Arrange for a string describing the motion of the mouse to be printed
out when the mouse is double-clicked: out when the mouse is double-clicked:
.CS .CS
@@ -725,6 +722,3 @@ pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n) bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n)
.SH KEYWORDS .SH KEYWORDS
binding, event binding, event
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -5,8 +5,8 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH bindtags n 4.0 Tk "Tk Built-In Commands"
.so man.macros .so man.macros
.TH bindtags n 4.0 Tk "Tk Built-In Commands"
.BS .BS
'\" Note: do not modify the .SH NAME line immediately below! '\" Note: do not modify the .SH NAME line immediately below!
.SH NAME .SH NAME
@@ -14,6 +14,7 @@ bindtags \- Determine which bindings apply to a window, and order of evaluation
.SH SYNOPSIS .SH SYNOPSIS
\fBbindtags \fIwindow \fR?\fItagList\fR? \fBbindtags \fIwindow \fR?\fItagList\fR?
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
When a binding is created with the \fBbind\fR command, it is When a binding is created with the \fBbind\fR command, it is
@@ -72,7 +73,6 @@ associated with the \fBButton\fR tag, will no longer apply to \fB.b\fR,
but any bindings associated with \fBTrickyButton\fR (perhaps some but any bindings associated with \fBTrickyButton\fR (perhaps some
new button behavior) will apply. new button behavior) will apply.
.SH EXAMPLE .SH EXAMPLE
.PP
If you have a set of nested \fBframe\fR widgets and you want events If you have a set of nested \fBframe\fR widgets and you want events
sent to a \fBbutton\fR widget to also be delivered to all the widgets sent to a \fBbutton\fR widget to also be delivered to all the widgets
up to the current \fBtoplevel\fR (in contrast to Tk's default up to the current \fBtoplevel\fR (in contrast to Tk's default
@@ -93,10 +93,9 @@ proc setupBindtagsForTreeDelivery {widget} {
\fBbindtags\fR $widget $tags \fBbindtags\fR $widget $tags
} }
.CE .CE
.SH "SEE ALSO" .SH "SEE ALSO"
bind(n) bind(n)
.SH KEYWORDS .SH KEYWORDS
binding, event, tag binding, event, tag
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -5,20 +5,16 @@
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH bitmap n 4.0 Tk "Tk Built-In Commands"
.so man.macros .so man.macros
.TH bitmap n 4.0 Tk "Tk Built-In Commands"
.BS .BS
'\" Note: do not modify the .SH NAME line immediately below! '\" Note: do not modify the .SH NAME line immediately below!
.SH NAME .SH NAME
bitmap \- Images that display two colors bitmap \- Images that display two colors
.SH SYNOPSIS .SH SYNOPSIS
.nf
\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? \fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR?
\fIimageName \fBcget\fR \fIoption\fR
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.fi
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
A bitmap is an image whose pixels can display either of two colors A bitmap is an image whose pixels can display either of two colors
@@ -34,6 +30,7 @@ producing a transparent effect.
For other pixels, the image displays the foreground color if For other pixels, the image displays the foreground color if
the source data is one and the background color if the source the source data is one and the background color if the source
data is zero. data is zero.
.SH "CREATING BITMAPS" .SH "CREATING BITMAPS"
.PP .PP
Like all images, bitmaps are created using the \fBimage create\fR Like all images, bitmaps are created using the \fBimage create\fR
@@ -41,7 +38,6 @@ command.
Bitmaps support the following \fIoptions\fR: Bitmaps support the following \fIoptions\fR:
.TP .TP
\fB\-background \fIcolor\fR \fB\-background \fIcolor\fR
.
Specifies a background color for the image in any of the standard 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 ways accepted by Tk. If this option is set to an empty string
then the background pixels will be transparent. This effect then the background pixels will be transparent. This effect
@@ -49,7 +45,6 @@ is achieved by using the source bitmap as the mask bitmap, ignoring
any \fB\-maskdata\fR or \fB\-maskfile\fR options. any \fB\-maskdata\fR or \fB\-maskfile\fR options.
.TP .TP
\fB\-data \fIstring\fR \fB\-data \fIstring\fR
.
Specifies the contents of the source bitmap as a string. Specifies the contents of the source bitmap as a string.
The string must adhere to X11 bitmap format (e.g., as generated The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program). by the \fBbitmap\fR program).
@@ -57,19 +52,16 @@ If both the \fB\-data\fR and \fB\-file\fR options are specified,
the \fB\-data\fR option takes precedence. the \fB\-data\fR option takes precedence.
.TP .TP
\fB\-file \fIname\fR \fB\-file \fIname\fR
.
\fIname\fR gives the name of a file whose contents define the \fIname\fR gives the name of a file whose contents define the
source bitmap. source bitmap.
The file must adhere to X11 bitmap format (e.g., as generated The file must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program). by the \fBbitmap\fR program).
.TP .TP
\fB\-foreground \fIcolor\fR \fB\-foreground \fIcolor\fR
.
Specifies a foreground color for the image in any of the standard Specifies a foreground color for the image in any of the standard
ways accepted by Tk. ways accepted by Tk.
.TP .TP
\fB\-maskdata \fIstring\fR \fB\-maskdata \fIstring\fR
.
Specifies the contents of the mask as a string. Specifies the contents of the mask as a string.
The string must adhere to X11 bitmap format (e.g., as generated The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program). by the \fBbitmap\fR program).
@@ -77,11 +69,11 @@ If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified,
the \fB\-maskdata\fR option takes precedence. the \fB\-maskdata\fR option takes precedence.
.TP .TP
\fB\-maskfile \fIname\fR \fB\-maskfile \fIname\fR
.
\fIname\fR gives the name of a file whose contents define the \fIname\fR gives the name of a file whose contents define the
mask. mask.
The file must adhere to X11 bitmap format (e.g., as generated The file must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program). by the \fBbitmap\fR program).
.SH "IMAGE COMMAND" .SH "IMAGE COMMAND"
.PP .PP
When a bitmap image is created, Tk also creates a new command When a bitmap image is created, Tk also creates a new command
@@ -97,14 +89,12 @@ determine the exact behavior of the command. The following
commands are possible for bitmap images: commands are possible for bitmap images:
.TP .TP
\fIimageName \fBcget\fR \fIoption\fR \fIimageName \fBcget\fR \fIoption\fR
.
Returns the current value of the configuration option given Returns the current value of the configuration option given
by \fIoption\fR. by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fIOption\fR may have any of the values accepted by the
\fBimage create\fR \fBbitmap\fR command. \fBimage create bitmap\fR command.
.TP .TP
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
Query or modify the configuration options for the image. Query or modify the configuration options for the image.
If no \fIoption\fR is specified, returns a list describing all of If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
@@ -116,9 +106,7 @@ one or more \fIoption\-value\fR pairs are specified, then the command
modifies the given option(s) to have the given value(s); in modifies the given option(s) to have the given value(s); in
this case the command returns an empty string. this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fIOption\fR may have any of the values accepted by the
\fBimage create\fR \fBbitmap\fR command. \fBimage create bitmap\fR command.
.SH KEYWORDS .SH KEYWORDS
bitmap, image bitmap, image
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -1,275 +0,0 @@
'\"
'\" Copyright (c) 1993-1998 Lucent Technologies, Inc.
'\" Copyright (c) 2008 Jos Decoster
'\"
'\" Permission to use, copy, modify, and distribute this software and its
'\" documentation for any purpose and without fee is hereby granted, provided
'\" that the above copyright notice appear in all copies and that both that
'\" the copyright notice and warranty disclaimer appear in supporting
'\" documentation, and that the names of Lucent Technologies any of their
'\" entities not be used in advertising or publicity pertaining to
'\" distribution of the software without specific, written prior permission.
'\"
'\" Lucent Technologies disclaims all warranties with regard to this software,
'\" including all implied warranties of merchantability and fitness. In no
'\" event shall Lucent Technologies be liable for any special, indirect or
'\" consequential damages or any damages whatsoever resulting from loss of
'\" use, data or profits, whether in an action of contract, negligence or
'\" other tortuous action, arising out of or in connection with the use or
'\" performance of this software.
'\"
'\" BLT::busy command created by George Howlett.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH busy n "" Tk "Tk Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
busy \- confine pointer events to a window sub-tree
.SH SYNOPSIS
\fBtk busy\fR \fIwindow \fR?\fIoptions\fR?
.sp
\fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR?
.sp
\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
.sp
\fBtk busy forget\fR \fIwindow \fR?\fIwindow \fR?...
.sp
\fBtk busy current\fR ?\fIpattern\fR?
.sp
\fBtk busy status \fIwindow\fR
.BE
.SH DESCRIPTION
.PP
The \fBtk busy\fR command provides a simple means to block pointer events from
Tk widgets, while overriding the widget's cursor with a configurable busy
cursor. Note this command does not prevent keyboard events from being sent to
the widgets made busy.
.SH INTRODUCTION
.PP
There are many times in applications where you want to temporarily restrict
what actions the user can take. For example, an application could have a
.QW Run
button that when pressed causes some processing to occur. However, while the
application is busy processing, you probably don't want the user to be
able to click the
.QW Run
button again. You may also want restrict the user from other tasks such as
clicking a
.QW Print
button.
.PP
The \fBtk busy\fR command lets you make Tk widgets busy. This means that user
interactions such as button clicks, moving the mouse, typing at the keyboard,
etc.\0are ignored by the widget. You can set a special cursor (like a watch)
that overrides the widget's normal cursor, providing feedback that the
application (widget) is temporarily busy.
.PP
When a widget is made busy, the widget and all of its descendants will ignore
pointer events. It's easy to make an entire panel of widgets busy. You can
simply make the toplevel widget (such as
.QW . )
busy. This is easier and far much more efficient than recursively traversing
the widget hierarchy, disabling each widget and re-configuring its cursor.
.PP
Often, the \fBtk busy\fR command can be used instead of Tk's \fBgrab\fR
command. Unlike \fBgrab\fR which restricts all user interactions to one
widget, with the \fBtk busy\fR command you can have more than one widget
active (for example, a
.QW Cancel
dialog and a
.QW Help
button).
.SS EXAMPLE
.PP
You can make several widgets busy by simply making its ancestor widget busy
using the \fBhold\fR operation.
.PP
.CS
frame .top
button .top.button; canvas .top.canvas
pack .top.button .top.canvas
pack .top
# . . .
\fBtk busy\fR hold .top
update
.CE
.PP
All the widgets within \fB.top\fR (including \fB.top\fR) are now busy. Using
\fBupdate\fR insures that \fBtk busy\fR command will take effect before any
other user events can occur.
.PP
When the application is no longer busy processing, you can allow user
interactions again and free any resources it allocated by the \fBforget\fR
operation.
.PP
.CS
\fBtk busy\fR forget .top
.CE
.PP
The busy window has a configurable cursor. You can change the busy cursor
using the \fBconfigure\fR operation.
.PP
.CS
\fBtk busy\fR configure .top \-cursor "watch"
.CE
.PP
Destroying the widget will also clean up any resources allocated by the \fBtk
busy\fR command.
.PP
.SH OPERATIONS
.PP
The following operations are available for the \fBtk busy\fR command:
.TP
\fBtk busy \fIwindow\fR ?\fIoption value\fR?...
.
Shortcut for \fBtk busy hold\fR command.
.TP
\fBtk busy hold \fIwindow\fR ?\fIoption value\fR?...
.
Makes the specified \fIwindow\fR (and its descendants in the Tk window
hierarchy) appear busy. \fIWindow\fR must be a valid path name of a Tk widget.
A transparent window is put in front of the specified window. This transparent
window is mapped the next time idle tasks are processed, and the specified
window and its descendants will be blocked from user interactions. Normally
\fBupdate\fR should be called immediately afterward to insure that the hold
operation is in effect before the application starts its processing. The
following configuration options are valid:
.RS
.TP
\fB\-cursor \fIcursorName\fR
.
Specifies the cursor to be displayed when the widget is made busy.
\fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The
default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms.
.RE
.TP
\fBtk busy cget \fIwindow\fR \fIoption\fR
.
Queries the \fBtk busy\fR command configuration options for \fIwindow\fR.
\fIWindow\fR must be the path name of a widget previously made busy by the
\fBhold\fR operation. The command returns the present value of the specified
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
\fBhold\fR operation.
.TP
\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
.
Queries or modifies the \fBtk busy\fR command configuration options for
\fIwindow\fR. \fIWindow\fR must be the path name of a widget previously made
busy by the \fBhold\fR operation. If no options are specified, a list
describing all of the available options for \fIwindow\fR (see
\fBTk_ConfigureInfo\fR for information on the format of this list) is
returned. If \fIoption\fR is specified with no \fIvalue\fR, 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 \fIoption\fR is
specified). If one or more \fIoption\-value\fR pairs are specified, then the
command modifies the given widget option(s) to have the given value(s); in
this case the command returns the empty string. \fIOption\fR may have any of
the values accepted by the \fBhold\fR operation.
.RS
.PP
Please note that the option database is referenced through \fIwindow\fR. For
example, if the widget \fB.frame\fR is to be made busy, the busy cursor can be
specified for it by either \fBoption\fR command:
.PP
.CS
option add *frame.busyCursor gumby
option add *Frame.BusyCursor gumby
.CE
.RE
.TP
\fBtk busy forget \fIwindow\fR ?\fIwindow\fR?...
.
Releases resources allocated by the \fBtk busy\fR command for \fIwindow\fR,
including the transparent window. User events will again be received by
\fIwindow\fR. Resources are also released when \fIwindow\fR is destroyed.
\fIWindow\fR must be the name of a widget specified in the \fBhold\fR
operation, otherwise an error is reported.
.TP
\fBtk busy current \fR?\fIpattern\fR?
.
Returns the pathnames of all widgets that are currently busy. If a
\fIpattern\fR is given, only the path names of busy widgets matching
\fIpattern\fR are returned.
.TP
\fBtk busy status \fIwindow\fR
.
Returns the status of a widget \fIwindow\fR. If \fIwindow\fR presently can not
receive user interactions, \fB1\fR is returned, otherwise \fB0\fR.
.SH "EVENT HANDLING"
.SS BINDINGS
.PP
The event blocking feature is implemented by creating and mapping a
transparent window that completely covers the widget. When the busy window is
mapped, it invisibly shields the widget and its hierarchy from all events that
may be sent. Like Tk widgets, busy windows have widget names in the Tk window
hierarchy. This means that you can use the \fBbind\fR command, to handle
events in the busy window.
.PP
.CS
\fBtk busy\fR hold .frame.canvas
bind .frame.canvas_Busy <Enter> { ... }
.CE
.PP
Normally the busy window is a sibling of the widget. The name of the busy
window is
.QW \fIwidget\fB_Busy\fR
where \fIwidget\fR is the name of the widget to be made busy. In the previous
example, the pathname of the busy window is
.QW \fB.frame.canvas_Busy\fR .
The exception is when the widget is a toplevel widget (such as
.QW . )
where the busy window can't be made a sibling. The busy window is then a child
of the widget named
.QW \fIwidget\fB._Busy\fR
where \fIwidget\fR is the name of the toplevel widget. In the following
example, the pathname of the busy window is
.QW \fB._Busy\fR .
.PP
.CS
\fBtk busy\fR hold .
bind ._Busy <Enter> { ... }
.CE
.SS "ENTER/LEAVE EVENTS"
.PP
Mapping and unmapping busy windows generates Enter/Leave events for all
widgets they cover. Please note this if you are tracking Enter/Leave events in
widgets.
.SS "KEYBOARD EVENTS"
.PP
When a widget is made busy, the widget is prevented from gaining the keyboard
focus by a user clicking on it by the busy window. But if the widget already had
focus, it still may receive keyboard events. The widget can also still receive
focus through keyboard traversal. To prevent this, you must move
focus to another window and make sure the focus can not go back to the widgets
made busy (e.g. but restricting focus to a cancel button).
.PP
.CS
pack [frame .frame]
pack [text .frame.text]
\fBtk busy\fR hold .frame
pack [button .cancel -text "Cancel" -command exit]
focus .cancel
bind .cancel <Tab> {break}
bind .cancel <Shift-Tab> {break}
update
.CE
.PP
The above example moves the focus from .frame immediately after invoking the
\fBhold\fR so that no keyboard events will be sent to \fB.frame\fR or any of
its descendants. It also makes sure it's not possible to leave button
\fB.cancel\fR using the keyboard.
.SH PORTABILITY
.PP
Note that the \fBtk busy\fR command does not currently have any effect on OSX
when Tk is built using Aqua support.
.SH "SEE ALSO"
grab(n)
.SH KEYWORDS
busy, keyboard events, pointer events, window
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -4,13 +4,13 @@
'\" '\"
'\" See the file "license.terms" for information on usage and redistribution '\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" '\"
.TH button n 4.4 Tk "Tk Built-In Commands"
.so man.macros .so man.macros
.TH button n 4.4 Tk "Tk Built-In Commands"
.BS .BS
'\" Note: do not modify the .SH NAME line immediately below! '\" Note: do not modify the .SH NAME line immediately below!
.SH NAME .SH NAME
button \- Create and manipulate 'button' action widgets button \- Create and manipulate button widgets
.SH SYNOPSIS .SH SYNOPSIS
\fBbutton\fR \fIpathName \fR?\fIoptions\fR? \fBbutton\fR \fIpathName \fR?\fIoptions\fR?
.SO .SO
@@ -57,24 +57,25 @@ The empty string is the default value.
.OP \-state state State .OP \-state state State
Specifies one of three states for the button: \fBnormal\fR, \fBactive\fR, Specifies one of three states for the button: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the button is displayed using the or \fBdisabled\fR. In normal state the button is displayed using the
\fB\-foreground\fR and \fB\-background\fR options. The active state is \fBforeground\fR and \fBbackground\fR options. The active state is
typically used when the pointer is over the button. In active state typically used when the pointer is over the button. In active state
the button is displayed using the \fB\-activeforeground\fR and the button is displayed using the \fBactiveForeground\fR and
\fB\-activebackground\fR options. Disabled state means that the button \fBactiveBackground\fR options. Disabled state means that the button
should be insensitive: the default bindings will refuse to activate should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses. the widget and will ignore mouse button presses.
In this state the \fB\-disabledforeground\fR and In this state the \fBdisabledForeground\fR and
\fB\-background\fR options determine how the button is displayed. \fBbackground\fR options determine how the button is displayed.
.OP \-width width Width .OP \-width width Width
Specifies a desired width for the button. Specifies a desired width for the button.
If an image or bitmap is being displayed in the button then the value is in 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 \fBTk_GetPixels\fR). screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
For a text button (no image or with \fB\-compound none\fR) then the width For a text button (no image or with \fB\-compound none\fR) then the width
specifies how much space in characters to allocate for the text label. specifies how much space in characters to allocate for the text label.
If the width is negative then this specifies a minimum width. If the width is negative then this specifies a minimum width.
If this option is not specified, the button's desired width is computed If this option is not specified, the button's desired width is computed
from the size of the image or bitmap or text being displayed in it. from the size of the image or bitmap or text being displayed in it.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \fBbutton\fR command creates a new window (given by the The \fBbutton\fR command creates a new window (given by the
@@ -91,17 +92,18 @@ there must not exist a window named \fIpathName\fR, but
A button is a widget that displays a textual string, bitmap or image. 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 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 can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the \fB\-wraplength\fR option) and or if wrapping occurs because of the \fBwrapLength\fR option) and
one of the characters may optionally be underlined using the one of the characters may optionally be underlined using the
\fB\-underline\fR option. \fBunderline\fR option.
It can display itself in either of three different ways, according It can display itself in either of three different ways, according
to to
the \fB\-state\fR option; the \fBstate\fR option;
it can be made to appear raised, sunken, or flat; it can be made to appear raised, sunken, or flat;
and it can be made to flash. When a user invokes the and it can be made to flash. When a user invokes the
button (by pressing mouse button 1 with the cursor over the button (by pressing mouse button 1 with the cursor over the
button), then the Tcl command specified in the \fB\-command\fR button), then the Tcl command specified in the \fB\-command\fR
option is invoked. option is invoked.
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
.PP .PP
The \fBbutton\fR command creates a new Tcl command whose The \fBbutton\fR command creates a new Tcl command whose
@@ -137,9 +139,9 @@ command.
.TP .TP
\fIpathName \fBflash\fR \fIpathName \fBflash\fR
Flash the button. This is accomplished by redisplaying the button Flash the button. This is accomplished by redisplaying the button
several times, alternating between the configured activebackground several times, alternating between active and normal colors. At
and background colors. At the end of the flash the button is left the end of the flash the button is left in the same normal/active
in the same normal/active state as when the command was invoked. state as when the command was invoked.
This command is ignored if the button's state is \fBdisabled\fR. This command is ignored if the button's state is \fBdisabled\fR.
.TP .TP
\fIpathName \fBinvoke\fR \fIpathName \fBinvoke\fR
@@ -147,6 +149,7 @@ Invoke the Tcl command associated with the button, if there is one.
The return value is the return value from the Tcl command, or an The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the button. empty string if there is no command associated with the button.
This command is ignored if the button's state is \fBdisabled\fR. This command is ignored if the button's state is \fBdisabled\fR.
.SH "DEFAULT BINDINGS" .SH "DEFAULT BINDINGS"
.PP .PP
Tk automatically creates class bindings for buttons that give them Tk automatically creates class bindings for buttons that give them
@@ -173,38 +176,27 @@ actions occur: the button is completely non-responsive.
.PP .PP
The behavior of buttons can be changed by defining new bindings for The behavior of buttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings. individual widgets or by redefining the class bindings.
.SH "PLATFORM NOTES"
.PP
On Aqua/Mac OS X, some configuration options are ignored for the purpose of
drawing of the widget because they would otherwise conflict with platform
guidelines. The \fBconfigure\fR and \fBcget\fR subcommands can still
manipulate the values, but do not cause any variation to the look of the
widget. The options affected notably include \fB\-background\fR and
\fB\-relief\fR.
.SH EXAMPLES .SH EXAMPLES
.PP
This is the classic Tk This is the classic Tk
.QW "Hello, World!" .QW "Hello, World!"
demonstration: demonstration:
.PP .PP
.CS .CS
\fBbutton\fR .b \-text "Hello, World!" \-command exit \fBbutton\fR .b \-text "Hello, World!" \-command exit
pack .b pack .b
.CE .CE
.PP .PP
This example demonstrates how to handle button accelerators: This example demonstrates how to handle button accelerators:
.PP .PP
.CS .CS
\fBbutton\fR .b1 \-text Hello \-underline 0 \fBbutton\fR .b1 \-text Hello \-underline 0
\fBbutton\fR .b2 \-text World \-underline 0 \fBbutton\fR .b2 \-text World \-underline 0
bind . <Key\-h> {.b1 flash; .b1 invoke} bind . <Key\-h> {.b1 flash; .b1 invoke}
bind . <Key\-w> {.b2 flash; .b2 invoke} bind . <Key\-w> {.b2 flash; .b2 invoke}
pack .b1 .b2 pack .b1 .b2
.CE .CE
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::button(n) ttk::button(n)
.SH KEYWORDS .SH KEYWORDS
button, widget button, widget
'\" Local Variables:
'\" mode: nroff
'\" End:

Some files were not shown because too many files have changed in this diff Show More