Compare commits

..

3 Commits

Author SHA1 Message Date
Zachary Ware
c67b328f06 Update to tk 8.5.19 2017-11-24 17:53:51 -06:00
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
745 changed files with 89353 additions and 158193 deletions

View File

@@ -1,236 +0,0 @@
language: c
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
- gcc-mingw-w64
- gcc-mingw-w64-base
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- gcc-multilib
- tcl8.6-dev
- libx11-dev
- libxss-dev
- xvfb
homebrew:
packages:
- tcl-tk
# casks:
# - xquartz
jobs:
include:
# Testing on Linux GCC
- name: "Linux/GCC/Shared"
os: linux
dist: focal
services:
- xvfb
compiler: gcc
env:
- BUILD_DIR=unix
script: &x11gui
- make binaries libraries tktest
- make install
- make test-classic >out-classic.txt
- cat out-classic.txt
- grep -q "Failed 0" out-classic.txt
- make test-ttk >out-ttk.txt
- cat out-ttk.txt
- grep -q "Failed 0" out-ttk.txt
- name: "Linux/GCC/Shared/no-xft"
os: linux
dist: focal
services:
- xvfb
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="--disable-xft"
script: *x11gui
- name: "Linux/GCC/Shared/bionic"
os: linux
dist: bionic
services:
- xvfb
compiler: gcc
env:
- BUILD_DIR=unix
script: *x11gui
- name: "Linux/GCC/Shared/xenial"
os: linux
dist: xenial
services:
- xvfb
compiler: gcc
env:
- BUILD_DIR=unix
script: *x11gui
- name: "Linux/GCC/Static"
os: linux
dist: focal
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="--disable-shared"
- name: "Linux/GCC/Debug"
os: linux
dist: focal
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
# Newer/Older versions of GCC
- name: "Linux/GCC 10/Shared"
os: linux
dist: focal
compiler: gcc-10
addons:
apt:
packages:
- g++-10
env:
- BUILD_DIR=unix
- name: "Linux/GCC 5/Shared"
os: linux
dist: bionic
compiler: gcc-5
addons:
apt:
packages:
- g++-5
env:
- BUILD_DIR=unix
# Testing on Linux Clang
- name: "Linux/Clang/Shared"
os: linux
dist: focal
compiler: clang
env:
- BUILD_DIR=unix
- name: "Linux/Clang/Shared/no-xft"
os: linux
dist: focal
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT="--disable-xft"
- name: "Linux/Clang/Static"
os: linux
dist: focal
compiler: clang
env:
- CFGOPT="--disable-shared"
- BUILD_DIR=unix
- name: "Linux/Clang/Debug"
os: linux
dist: focal
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
# Testing on Mac, various styles
- name: "macOS/Xcode 12/Shared"
os: osx
osx_image: xcode12
env:
- BUILD_DIR=unix
- CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include"
- name: "macOS/Xcode 12/Static"
os: osx
osx_image: xcode12
env:
- BUILD_DIR=unix
- CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CFLAGS=-I/usr/local/opt/tcl-tk/include"
- name: "macOS/Xcode 12/Debug"
os: osx
osx_image: xcode12
env:
- BUILD_DIR=unix
- CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CFLAGS=-I/usr/local/opt/tcl-tk/include"
# - name: "macOS/Xcode 12/Shared/XQuartz"
# os: osx
# osx_image: xcode12
# env:
# - BUILD_DIR=unix
# - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include"
# Older MacOS versions
- name: "macOS/Xcode 11/Shared"
os: osx
osx_image: xcode11.7
env:
- BUILD_DIR=unix
- CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14"
- name: "macOS/Xcode 10/Shared"
os: osx
osx_image: xcode10.3
addons:
homebrew:
packages:
- tcl-tk
update: true
env:
- BUILD_DIR=unix
- CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14"
- name: "macOS/Xcode 9/Shared"
os: osx
osx_image: xcode9.4
addons:
homebrew:
packages:
- tcl-tk
update: true
env:
- BUILD_DIR=unix
- CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.13"
# Test on Windows with MSVC native
# - name: "Windows/MSVC/Shared"
# os: windows
# compiler: cl
# env: &vcenv
# - BUILD_DIR=win
# - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
# before_install: &vcpreinst
# - PATH="$PATH:$VCDIR"
# - cd ${BUILD_DIR}
# install: []
# script:
# - cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tktest
# "make dist" only
- name: "Linux: make dist"
os: linux
dist: focal
compiler: gcc
env:
- BUILD_DIR=unix
script:
- touch ../doc/man.macros
- make dist
before_install:
- |-
case $TRAVIS_OS_NAME in
windows)
choco install -y magicsplat-tcl-tk
;;
esac
- cd ${BUILD_DIR}
install:
- mkdir "$HOME/install dir"
- ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
script:
- make binaries libraries tktest
- make install
before_cache:
- |-
case $TRAVIS_OS_NAME in
osx)
brew cleanup
;;
esac
cache:
directories:
- $HOME/Library/Caches/Homebrew
- $HOME/AppData/Local/Temp/chocolatey
- $HOME/AppData/Local/Apps/Tcl86

9693
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

41
README Normal file
View File

@@ -0,0 +1,41 @@
README: Tk
This is the Tk 8.5.19 source distribution.
http://sourceforge.net/projects/tcl/files/Tcl/
You can get any source release of Tk from the URL above.
1. Introduction
---------------
This directory contains the sources and documentation for Tk, a
cross-platform GUI toolkit implemented with the Tcl scripting language.
For details on features, incompatibilities, and potential problems with
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
historical record of all changes to Tk.
Tk is maintained, enhanced, and distributed freely by the Tcl community.
Source code development and tracking of bug reports and feature requests
takes place at:
http://core.tcl.tk/tk/
with the Tcl Developer Xchange at:
http://www.tcl.tk/
Tk is a freely available open source package. You can do virtually
anything you like with it, such as modifying it, redistributing it,
and selling it either in whole or in part. See the file
"license.terms" for complete information.
2. See Tcl README
-----------------
Please see the README file that comes with the associated Tcl release
for more information. There are pointers there to extensive
documentation. In addition, there are additional README files
in the subdirectories of this distribution.

View File

@@ -1,40 +0,0 @@
# README: Tk
This is the **Tk 8.6.11** source distribution.
You can get any source release of Tk from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-6-branch)
## <a id="intro">1.</a> Introduction
This directory contains the sources and documentation for Tk, a
cross-platform GUI toolkit implemented with the Tcl scripting language.
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)
or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk.
Tk is maintained, enhanced, and distributed freely by the Tcl community.
Source code development and tracking of bug reports and feature requests
take place at [core.tcl-lang.org](https://core.tcl-lang.org/).
Tcl/Tk release and mailing list services are [hosted by
SourceForge](https://sourceforge.net/projects/tcl/)
with the Tcl Developer Xchange hosted at
[www.tcl-lang.org](https://www.tcl-lang.org).
Tk is a freely available open-source package. You can do virtually
anything you like with it, such as modifying it, redistributing it,
and selling it either in whole or in part. See the file
`license.terms` for complete information.
## <a id="tcl">2.</a> See Tcl README.md
Please see the README.md file that comes with the associated Tcl release
for more information. There are pointers there to extensive
documentation. In addition, there are additional README files
in the subdirectories of this distribution.

930
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

@@ -3,7 +3,7 @@
* *
* Declares facilities exported by the "stdlib" portion of the C library. * Declares facilities exported by the "stdlib" portion of the C library.
* This file isn't complete in the ANSI-C sense; it only declares things * This file isn't complete in the ANSI-C sense; it only declares things
* that are needed by Tk. This file is needed even on many systems with * that are needed by Tcl. This file is needed even on many systems with
* their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare * their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
* all the procedures needed here (such as strtod). * all the procedures needed here (such as strtod).
* *
@@ -17,10 +17,6 @@
#ifndef _STDLIB #ifndef _STDLIB
#define _STDLIB #define _STDLIB
#ifndef _TCL
# include <tcl.h>
#endif
extern void abort(void); extern void abort(void);
extern double atof(const char *string); extern double atof(const char *string);
extern int atoi(const char *string); extern int atoi(const char *string);

View File

@@ -15,9 +15,6 @@
#define _UNISTD #define _UNISTD
#include <sys/types.h> #include <sys/types.h>
#ifndef _TCL
# include <tcl.h>
#endif
#ifndef NULL #ifndef NULL
#define NULL 0 #define NULL 0
@@ -40,7 +37,7 @@ extern int execle(const char *path, ...);
extern int execlp(const char *file, ...); extern int execlp(const char *file, ...);
extern int execv(const char *path, char **argv); extern int execv(const char *path, char **argv);
extern int execve(const char *path, char **argv, char **envp); extern int execve(const char *path, char **argv, char **envp);
extern int execvp(const char *file, char **argv); extern int execvpw(const char *file, char **argv);
extern pid_t fork(void); extern pid_t fork(void);
extern char * getcwd(char *buf, size_t size); extern char * getcwd(char *buf, size_t size);
extern gid_t getegid(void); extern gid_t getegid(void);
@@ -68,7 +65,7 @@ extern int ftruncate(int fd, unsigned long length);
extern int ioctl(int fd, int request, ...); extern int ioctl(int fd, int request, ...);
extern int readlink(const char *path, char *buf, int bufsize); extern int readlink(const char *path, char *buf, int bufsize);
extern int setegid(gid_t group); extern int setegid(gid_t group);
extern int seteuid(uid_t user); extern int seteuidw(uid_t user);
extern int setreuid(int ruid, int euid); extern int setreuid(int ruid, int euid);
extern int symlink(const char *, const char *); extern int symlink(const char *, const char *);
extern int ttyslot(void); extern int ttyslot(void);
@@ -77,4 +74,3 @@ extern int vfork(void);
#endif /* _POSIX_SOURCE */ #endif /* _POSIX_SOURCE */
#endif /* _UNISTD */ #endif /* _UNISTD */

View File

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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.
@@ -44,8 +45,7 @@ number of targets.
\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

@@ -23,6 +23,7 @@ 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
@@ -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

@@ -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
@@ -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
@@ -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,9 +554,9 @@ 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,
@@ -555,7 +564,7 @@ typedef int \fBTk_OptionParseProc\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,
@@ -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

@@ -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

@@ -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,13 +33,13 @@ 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
@@ -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

@@ -72,7 +72,7 @@ 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
@@ -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

@@ -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,13 +39,13 @@ 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

View File

@@ -9,7 +9,7 @@
.so man.macros .so man.macros
.BS .BS
.SH NAME .SH NAME
Tk_CreateImageType, Tk_GetImageMasterData, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
@@ -19,19 +19,13 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_GetImageModelData, Tk_InitImageArg
ClientData ClientData
\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR) \fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
.sp .sp
.VS "TIP 581"
ClientData
\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR)
.VE "TIP 581"
.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
@@ -44,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.
@@ -64,19 +59,19 @@ 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.
.PP .PP
The second major data structure manipulated by an image manager The second major data structure manipulated by an image manager
is called an \fIimage model\fR; it contains overall information is called an \fIimage master\fR; it contains overall information
about a particular image, such as the values of the configuration about a particular image, such as the values of the configuration
options specified in an \fBimage create\fR command. options specified in an \fBimage create\fR command.
There will usually be one of these structures for each There will usually be one of these structures for each
@@ -97,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.
@@ -105,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 \fImodel\fR, Tk_ImageMaster \fImaster\fR,
ClientData *\fImodelDataPtr\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,
@@ -128,15 +124,15 @@ or generated automatically by the \fBimage\fR command.
The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration
options for the new image (everything after the name argument to options for the new image (everything after the name argument to
\fBimage\fR). \fBimage\fR).
The \fImodel\fR argument is a token that refers to Tk's information The \fImaster\fR argument is a token that refers to Tk's information
about this image; the image manager must return this token to about this image; the image manager must return this token to
Tk when invoking the \fBTk_ImageChanged\fR procedure. Tk when invoking the \fBTk_ImageChanged\fR procedure.
Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR
and create an image model data structure for the new image. and create an image master data structure for the new image.
\fIcreateProc\fR may store an arbitrary one-word value at \fIcreateProc\fR may store an arbitrary one-word value at
*\fImodelDataPtr\fR, which will be passed back to the *\fImasterDataPtr\fR, which will be passed back to the
image manager when other callbacks are invoked. image manager when other callbacks are invoked.
Typically the value is a pointer to the model data Typically the value is a pointer to the master data
structure for the image. structure for the image.
.PP .PP
If \fIcreateProc\fR encounters an error, it should leave an error If \fIcreateProc\fR encounters an error, it should leave an error
@@ -145,19 +141,20 @@ 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 \fImodelData\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 \fImodelData\fR is the value image will be used and \fImasterData\fR is the value
returned by \fIcreateProc\fR when the image model was created. returned by \fIcreateProc\fR when the image master was created.
\fIgetProc\fR will usually create a data structure for the new \fIgetProc\fR will usually create a data structure for the new
instance, including such things as the resources needed to instance, including such things as the resources needed to
display the image in the given window. display the image in the given window.
@@ -165,13 +162,14 @@ 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,
@@ -197,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
@@ -207,7 +206,7 @@ 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
@@ -216,6 +215,7 @@ The \fIinstanceData\fR will be the same as the value returned by
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
@@ -225,44 +225,41 @@ 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 \fImodelData\fR); ClientData \fImasterData\fR);
.CE .CE
The \fImodelData\fR argument will be the same as the value The \fImasterData\fR argument will be the same as the value
stored in \fI*modelDataPtr\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_GETIMAGEMODELDATA
.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
information about an image. For example, an image manager can use this information about an image. For example, an image manager can use this
procedure to locate its image model data for an image. procedure to locate its image master data for an image.
If there exists an image named \fIname\fR If there exists an image named \fIname\fR
in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is
filled in with type information for the image (the \fItypePtr\fR value filled in with type information for the image (the \fItypePtr\fR value
passed to \fBTk_CreateImageType\fR when the image type was registered) passed to \fBTk_CreateImageType\fR when the image type was registered)
and the return value is the ClientData value returned by the 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 model 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.
.PP
.VS "TIP 581"
\fBTk_GetImageModelData\fR is synonym for \fBTk_GetImageMasterData\fR
.VE "TIP 581"
.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 \fImodel\fR, Tk_ImageMaster \fImaster\fR,
ClientData *\fImodelDataPtr\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
@@ -270,10 +267,6 @@ interface. The Tk header file will still support this legacy
interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
defined. defined.
.PP .PP
.VS "TIP 581"
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
.VE "TIP 581"
.PP
When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may
see the routine \fBTk_InitImageArgs\fR in use. This was a migration see the routine \fBTk_InitImageArgs\fR in use. This was a migration
tool used to create stub-enabled extensions that could be loaded tool used to create stub-enabled extensions that could be loaded
@@ -290,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, model image manager, image type, instance, master

View File

@@ -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
@@ -108,7 +107,6 @@ 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.
@@ -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,20 +284,18 @@ 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.
@@ -359,14 +303,13 @@ the canvas.
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,
@@ -376,7 +319,6 @@ typedef void \fBTk_ItemDisplayProc\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,24 +386,22 @@ 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
@@ -500,13 +435,11 @@ 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,
@@ -514,7 +447,6 @@ typedef void \fBTk_ItemScaleProc\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,108 +454,93 @@ 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
@@ -638,55 +555,45 @@ 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

@@ -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,14 +77,14 @@ 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,
@@ -98,14 +100,14 @@ 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,
@@ -120,13 +122,13 @@ 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,
@@ -149,13 +151,13 @@ 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,
@@ -177,13 +179,13 @@ 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,
@@ -202,13 +204,13 @@ 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);
@@ -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

@@ -54,7 +54,7 @@ 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,
@@ -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

@@ -58,8 +58,8 @@ 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

@@ -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

@@ -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

@@ -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,13 +39,13 @@ 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
@@ -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

@@ -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

@@ -65,7 +65,6 @@ following screen font families should print correctly:
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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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
@@ -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

@@ -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,7 +118,7 @@ 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
@@ -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

@@ -13,30 +13,28 @@ 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

@@ -31,6 +31,7 @@ Tk_Font
.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
@@ -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

@@ -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

@@ -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

@@ -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,7 +106,7 @@ 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,
@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -9,45 +9,46 @@
.so man.macros .so man.macros
.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

@@ -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,14 +42,12 @@ 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
@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -14,10 +14,10 @@ Tk_ImageChanged \- notify widgets that image needs to be redrawn
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
\fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR) \fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_ImageMaster imageHeight .AS Tk_ImageMaster imageHeight
.AP Tk_ImageMaster model in .AP Tk_ImageMaster imageMaster in
Token for image, which was passed to image's \fIcreateProc\fR when Token for image, which was passed to image's \fIcreateProc\fR when
the image was created. the image was created.
.AP int x in .AP int x in
@@ -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
@@ -42,16 +43,12 @@ whenever anything happens that requires the image to be redrawn.
As a result of calling \fBTk_ImageChanged\fR, any widgets using As a result of calling \fBTk_ImageChanged\fR, any widgets using
the image are notified so that they can redisplay themselves the image are notified so that they can redisplay themselves
appropriately. appropriately.
The \fImodel\fR argument identifies the image, and The \fIimageMaster\fR argument identifies the image, and
\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR \fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR
specify a rectangular region within the image that needs to specify a rectangular region within the image that needs to
be redrawn. be redrawn.
\fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size. \fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size.
.PP .PP
.VS "TIP 581"
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
.VE "TIP 581"
.PP
An image manager should call \fBTk_ImageChanged\fR during An image manager should call \fBTk_ImageChanged\fR during
its \fIcreateProc\fR to specify the image's initial size and to its \fIcreateProc\fR to specify the image's initial size and to
force redisplay if there are existing instances for the image. force redisplay if there are existing instances for the image.
@@ -62,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

@@ -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

@@ -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

@@ -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

@@ -9,7 +9,8 @@
.so man.macros .so man.macros
.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

@@ -14,67 +14,68 @@ Tk_MaintainGeometry, Tk_UnmaintainGeometry \- maintain geometry of one window re
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
\fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR) \fBTk_MaintainGeometry\fR(\fIslave, master, x, y, width, height\fR)
.sp .sp
\fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR) \fBTk_UnmaintainGeometry\fR(\fIslave, master\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_Window container .AS Tk_Window master
.AP Tk_Window window in .AP Tk_Window slave in
Window whose geometry is to be controlled. Window whose geometry is to be controlled.
.AP Tk_Window container in .AP Tk_Window master in
Window relative to which \fIwindow\fR's geometry will be controlled. Window relative to which \fIslave\fR's geometry will be controlled.
.AP int x in .AP int x in
Desired x-coordinate of \fIwindow\fR in \fIcontainer\fR, measured in pixels Desired x-coordinate of \fIslave\fR in \fImaster\fR, measured in pixels
from the inside of \fIcontainer\fR's left border to the outside of from the inside of \fImaster\fR's left border to the outside of
\fIwindow\fR's left border. \fIslave\fR's left border.
.AP int y in .AP int y in
Desired y-coordinate of \fIwindow\fR in \fIcontainer\fR, measured in pixels Desired y-coordinate of \fIslave\fR in \fImaster\fR, measured in pixels
from the inside of \fIcontainer\fR's top border to the outside of from the inside of \fImaster\fR's top border to the outside of
\fIwindow\fR's top border. \fIslave\fR's top border.
.AP int width in .AP int width in
Desired width for \fIwindow\fR, in pixels. Desired width for \fIslave\fR, in pixels.
.AP int height in .AP int height in
Desired height for \fIwindow\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
easier for geometry managers to deal with windows whose containers are not easier for geometry managers to deal with slaves whose masters are not
their parents. their parents.
Three problems arise if the container for a window is not its parent: Three problems arise if the master for a slave is not its parent:
.IP [1] .IP [1]
The x- and y-position of the window must be translated from the The x- and y-position of the slave must be translated from the
coordinate system of the container to that of the parent before coordinate system of the master to that of the parent before
positioning the window. positioning the slave.
.IP [2] .IP [2]
If the container window, or any of its ancestors up to the window's If the master window, or any of its ancestors up to the slave's
parent, is moved, then the window must be repositioned within its parent, is moved, then the slave must be repositioned within its
parent in order to maintain the correct position relative to the parent in order to maintain the correct position relative to the
container. master.
.IP [3] .IP [3]
If the container or one of its ancestors is mapped or unmapped, then If the master or one of its ancestors is mapped or unmapped, then
the window must be mapped or unmapped to correspond. the slave must be mapped or unmapped to correspond.
.LP .LP
None of these problems is an issue if the parent and container are None of these problems is an issue if the parent and master are
the same. For example, if the container or one of its ancestors the same. For example, if the master or one of its ancestors
is unmapped, the window is automatically removed by the screen is unmapped, the slave is automatically removed by the screen
by X. by X.
.PP .PP
\fBTk_MaintainGeometry\fR deals with these problems for windows \fBTk_MaintainGeometry\fR deals with these problems for slaves
whose containers are not their parents, as well as handling the simpler whose masters are not their parents, as well as handling the simpler
case of windows whose container are their parents. case of slaves whose masters are their parents.
\fBTk_MaintainGeometry\fR is typically called by a window manager \fBTk_MaintainGeometry\fR is typically called by a window manager
once it has decided where a window should be positioned relative once it has decided where a slave should be positioned relative
to its container. to its master.
\fBTk_MaintainGeometry\fR translates the coordinates to the \fBTk_MaintainGeometry\fR translates the coordinates to the
coordinate system of \fIwindow\fR's parent and then moves and coordinate system of \fIslave\fR's parent and then moves and
resizes the window appropriately. resizes the slave appropriately.
Furthermore, it remembers the desired position and creates event Furthermore, it remembers the desired position and creates event
handlers to monitor the container and all of its ancestors up handlers to monitor the master and all of its ancestors up
to (but not including) the window's parent. to (but not including) the slave's parent.
If any of these windows is moved, mapped, or unmapped, If any of these windows is moved, mapped, or unmapped,
the window will be adjusted so that it is mapped only when the the slave will be adjusted so that it is mapped only when the
container is mapped and its geometry relative to the container master is mapped and its geometry relative to the master
remains as specified by \fIx\fR, \fIy\fR, \fIwidth\fR, and remains as specified by \fIx\fR, \fIy\fR, \fIwidth\fR, and
\fIheight\fR. \fIheight\fR.
.PP .PP
@@ -83,17 +84,17 @@ if it decides that it does not want the window to appear on the
screen under any conditions, it calls \fBTk_UnmaintainGeometry\fR. screen under any conditions, it calls \fBTk_UnmaintainGeometry\fR.
\fBTk_UnmaintainGeometry\fR unmaps the window and cancels any \fBTk_UnmaintainGeometry\fR unmaps the window and cancels any
previous calls to \fBTk_MaintainGeometry\fR for the previous calls to \fBTk_MaintainGeometry\fR for the
\fIcontainer\fR\-\fIwindow\fR pair, so that the window's \fImaster\fR\-\fIslave\fR pair, so that the slave's
geometry and mapped state are no longer maintained geometry and mapped state are no longer maintained
automatically. automatically.
\fBTk_UnmaintainGeometry\fR need not be called by a geometry \fBTk_UnmaintainGeometry\fR need not be called by a geometry
manager if the window, the container, or any of the container's ancestors manager if the slave, the master, or any of the master's ancestors
is destroyed: Tk will call it automatically. is destroyed: Tk will call it automatically.
.PP .PP
If \fBTk_MaintainGeometry\fR is called repeatedly for the same If \fBTk_MaintainGeometry\fR is called repeatedly for the same
\fIcontainer\fR\-\fIwindow\fR pair, the information from the most \fImaster\fR\-\fIslave\fR pair, the information from the most
recent call supersedes any older information. recent call supersedes any older information.
If \fBTk_UnmaintainGeometry\fR is called for a \fIcontainer\fR\-\fIwindow\fR If \fBTk_UnmaintainGeometry\fR is called for a \fImaster\fR\-\fIslave\fR
pair that is is not currently managed, the call has no effect. pair that is is not currently managed, the call has no effect.
.SH KEYWORDS .SH KEYWORDS
geometry manager, map, container, parent, position, window, unmap geometry manager, map, master, parent, position, slave, unmap

View File

@@ -32,7 +32,7 @@ Arbitrary one-word value to pass to geometry manager callbacks.
.PP .PP
\fBTk_ManageGeometry\fR arranges for a particular geometry manager, \fBTk_ManageGeometry\fR arranges for a particular geometry manager,
described by the \fImgrPtr\fR argument, to control the geometry described by the \fImgrPtr\fR argument, to control the geometry
of a particular content window, given by \fItkwin\fR. of a particular slave window, given by \fItkwin\fR.
If \fItkwin\fR was previously managed by some other geometry manager, If \fItkwin\fR was previously managed by some other geometry manager,
the previous manager loses control in favor of the new one. the previous manager loses control in favor of the new one.
If \fImgrPtr\fR is NULL, geometry management is cancelled for If \fImgrPtr\fR is NULL, geometry management is cancelled for
@@ -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
@@ -53,11 +53,11 @@ by the command \fBwinfo manager\fR.
.PP .PP
\fIrequestProc\fR is a procedure in the geometry manager that \fIrequestProc\fR is a procedure in the geometry manager that
will be invoked whenever \fBTk_GeometryRequest\fR is called by the will be invoked whenever \fBTk_GeometryRequest\fR is called by the
content window to change its desired geometry. 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
@@ -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

@@ -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
@@ -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

@@ -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

@@ -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

@@ -14,21 +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.
.PP
.VS "TIP 581"
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
.VE "TIP 581"
.SH KEYWORDS .SH KEYWORDS
image manager, image name image manager, image name

View File

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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,18 +50,18 @@ 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);
@@ -75,7 +76,7 @@ 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
@@ -83,5 +84,6 @@ 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

@@ -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

@@ -63,7 +63,7 @@ no window-dependent options, then a NULL value may be supplied for
this argument. this argument.
.AP int objc in .AP int objc in
Number of values in \fIobjv\fR. Number of values in \fIobjv\fR.
.AP Tcl_Obj "*const *objv" in .AP Tcl_Obj "*const objv[]" in
Command-line arguments for setting configuring options. Command-line arguments for setting configuring options.
.AP Tk_SavedOptions *savePtr out .AP Tk_SavedOptions *savePtr out
If not NULL, the structure pointed to by this argument is filled If not NULL, the structure pointed to by this argument is filled
@@ -261,7 +261,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
@@ -443,9 +443,7 @@ suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must
be one of the strings in the table, or a unique abbreviation of be one of the strings in the table, or a unique abbreviation of
one of the strings. The internal form is an integer giving the index one of the strings. The internal form is an integer giving the index
into the table of the matching string, like the return value into the table of the matching string, like the return value
from \fBTcl_GetStringFromObj\fR. This option type supports the from \fBTcl_GetStringFromObj\fR.
\fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal
representation is set to -1.
.TP .TP
\fBTK_OPTION_SYNONYM\fR \fBTK_OPTION_SYNONYM\fR
This type is used to provide alternative names for an option (for This type is used to provide alternative names for an option (for

View File

@@ -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

@@ -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

@@ -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
@@ -123,8 +124,9 @@ 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,
@@ -182,11 +184,9 @@ 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
@@ -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

View File

@@ -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

@@ -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

@@ -20,12 +20,12 @@ 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.
@@ -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

@@ -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
@@ -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

@@ -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

@@ -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
@@ -201,27 +202,16 @@ substitutions you would make when binding to these events.
Many contemporary mice support a mouse wheel, which is used Many contemporary mice support a mouse wheel, which is used
for scrolling documents without using the scrollbars. By rolling the for scrolling documents without using the scrollbars. By rolling the
wheel, the system will generate \fBMouseWheel\fR events that the wheel, the system will generate \fBMouseWheel\fR events that the
application can use to scroll. The event is routed to the application can use to scroll. Like \fBKey\fR events the event is
window currently under the mouse pointer. When the event 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 an 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.
.RS
.PP
Horizontal scrolling uses \fBShift-MouseWheel\fR events, with positive
\fB%D\fR \fIdelta\fR substitution indicating left scrolling and negative
right scrolling.
Only Windows and macOS Aqua typically fire \fBMouseWheel\fR and
\fBShift-MouseWheel\fR events. On
X11 vertical scrolling is rather supported through \fBButton-4\fR and
\fBButton-5\fR events, and horizontal scrolling through \fBShift-Button-4\fR
and \fBShift-Button-5\fR events. Horizontal scrolling events may fire from
many different hardware units such as tilt wheels or touchpads. Horizontal
scrolling can also be emulated by holding Shift and scrolling vertically.
.RE
.IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5 .IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5
The \fBKeyPress\fR and \fBKeyRelease\fR events are generated The \fBKeyPress\fR and \fBKeyRelease\fR events are generated
whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR
@@ -283,8 +273,7 @@ it is destroyed.
When the \fBDestroy\fR event is delivered When the \fBDestroy\fR event is delivered
to a widget, it is in a to a widget, it is in a
.QW half-dead .QW half-dead
state: the widget still exists, but operations that involve it state: the widget still exists, but most operations on it will fail.
may return invalid results, or return an error.
.RE .RE
.IP "\fBFocusIn\fR, \fBFocusOut\fR" 5 .IP "\fBFocusIn\fR, \fBFocusOut\fR" 5
The \fBFocusIn\fR and \fBFocusOut\fR events are generated The \fBFocusIn\fR and \fBFocusOut\fR events are generated
@@ -402,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
@@ -441,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,
@@ -461,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
@@ -524,9 +517,6 @@ For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
\fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events, \fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events,
\fB%x\fR and \fB%y\fR indicate the position of the mouse pointer \fB%x\fR and \fB%y\fR indicate the position of the mouse pointer
relative to the receiving window. relative to the receiving window.
For key events on the Macintosh these are the coordinates of the
mouse at the moment when an X11 KeyEvent is sent to Tk, which could
be slightly later than the time of the physical press or release.
For \fBEnter\fR and \fBLeave\fR events, the position where the For \fBEnter\fR and \fBLeave\fR events, the position where the
mouse pointer crossed the window, relative to the receiving window. mouse pointer crossed the window, relative to the receiving window.
For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR
@@ -534,18 +524,19 @@ coordinates of the window relative to its parent window.
.IP \fB%A\fR 5 .IP \fB%A\fR 5
Substitutes the UNICODE character corresponding to the event, or Substitutes the UNICODE character corresponding to the event, or
the empty string if the event does not correspond to a UNICODE character the empty string if the event does not correspond to a UNICODE character
(e.g. the shift key was pressed). On X11, \fBXmbLookupString\fR (or (e.g. the shift key was pressed). \fBXmbLookupString\fR (or
\fBXLookupString\fR when input method support is turned off) does all \fBXLookupString\fR when input method support is turned off) does all
the work of translating from the event to a UNICODE character. the work of translating from the event to a UNICODE character.
On X11, valid only for \fBKeyPress\fR event. On Windows and macOS/aqua, Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%B\fR 5 .IP \fB%B\fR 5
The \fIborder_width\fR field from the event. Valid only for The \fIborder_width\fR field from the event. Valid only for
\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events. \fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
.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.
@@ -584,8 +575,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
@@ -626,21 +617,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.
@@ -656,11 +639,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.
@@ -721,7 +704,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
@@ -743,6 +725,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

@@ -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

@@ -12,13 +12,9 @@
.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

@@ -10,7 +10,7 @@
.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,14 +57,14 @@ 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
@@ -75,6 +75,7 @@ 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:

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@
.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
checkbutton \- Create and manipulate 'checkbutton' boolean selection widgets checkbutton \- Create and manipulate checkbutton widgets
.SH SYNOPSIS .SH SYNOPSIS
\fBcheckbutton\fI pathName \fR?\fIoptions\fR? \fBcheckbutton\fI pathName \fR?\fIoptions\fR?
.SO .SO
@@ -38,7 +38,7 @@ If this option is not specified, the button's desired height 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.
.OP \-indicatoron indicatorOn IndicatorOn .OP \-indicatoron indicatorOn IndicatorOn
Specifies whether or not the indicator should be drawn. Must be a Specifies whether or not the indicator should be drawn. Must be a
proper boolean value. If false, the \fB\-relief\fR option is proper boolean value. If false, the \fBrelief\fR option is
ignored and the widget's relief is always sunken if the widget is ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise. selected and raised otherwise.
.OP \-offrelief offRelief OffRelief .OP \-offrelief offRelief OffRelief
@@ -79,30 +79,34 @@ whenever the widget is selected.
If specified as an empty string then no special color is used for If specified as an empty string then no special color is used for
displaying when the widget is selected. displaying when the widget is selected.
.OP \-selectimage selectImage SelectImage .OP \-selectimage selectImage SelectImage
Specifies an image to display (in place of the \fB\-image\fR option) Specifies an image to display (in place of the \fBimage\fR option)
when the checkbutton is selected. when the checkbutton is selected.
This option is ignored unless the \fB\-image\fR option has been This option is ignored unless the \fBimage\fR option has been
specified. specified.
.OP \-state state State .OP \-state state State
Specifies one of three states for the checkbutton: \fBnormal\fR, \fBactive\fR, Specifies one of three states for the checkbutton: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the checkbutton is displayed using the or \fBdisabled\fR. In normal state the checkbutton 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 checkbutton. In active state typically used when the pointer is over the checkbutton. In active state
the checkbutton is displayed using the \fB\-activeforeground\fR and the checkbutton is displayed using the \fBactiveForeground\fR and
\fB\-activebackground\fR options. Disabled state means that the checkbutton \fBactiveBackground\fR options. Disabled state means that the checkbutton
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 checkbutton is displayed. \fBbackground\fR options determine how the checkbutton is displayed.
.OP \-tristateimage tristateImage TristateImage .OP \-tristateimage tristateImage TristateImage
Specifies an image to display (in place of the \fB\-image\fR option) .VS 8.5
Specifies an image to display (in place of the \fBimage\fR option)
when the checkbutton is in tri-state mode. when the checkbutton is in tri-state mode.
This option is ignored unless the \fB\-image\fR option has been This option is ignored unless the \fBimage\fR option has been
specified. specified.
.VE 8.5
.OP \-tristatevalue tristateValue Value .OP \-tristatevalue tristateValue Value
.VS 8.5
Specifies the value that causes the checkbutton to display the multi-value Specifies the value that causes the checkbutton to display the multi-value
selection, also known as the tri-state mode. Defaults to selection, also known as the tri-state mode. Defaults to
.QW "" . .QW "" .
.VE 8.5
.OP \-variable variable Variable .OP \-variable variable Variable
Specifies the name of a global variable to set to indicate whether Specifies the name of a global variable to set to indicate whether
or not this button is selected. Defaults to the name of the or not this button is selected. Defaults to the name of the
@@ -134,13 +138,13 @@ that displays a textual string, bitmap or image
and a square called an \fIindicator\fR. and a square called an \fIindicator\fR.
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.
A checkbutton has A checkbutton has
all of the behavior of a simple button, including the all of the behavior of a simple button, including the
following: it can display itself in either of three different following: it can display itself in either of three different
ways, according to the \fB\-state\fR option; ways, according to the \fBstate\fR option;
it can be made to appear it can be made to appear
raised, sunken, or flat; it can be made to flash; and it invokes raised, sunken, or flat; it can be made to flash; and it invokes
a Tcl command whenever mouse button 1 is clicked over the a Tcl command whenever mouse button 1 is clicked over the
@@ -151,6 +155,7 @@ If a checkbutton is selected then the indicator is normally
drawn with a selected appearance, and drawn with a selected appearance, and
a Tcl variable associated with the checkbutton is set to a particular a Tcl variable associated with the checkbutton is set to a particular
value (normally 1). value (normally 1).
.VS 8.5
The indicator is drawn with a check mark inside. The indicator is drawn with a check mark inside.
If the checkbutton is not selected, then the indicator is drawn with a If the checkbutton is not selected, then the indicator is drawn with a
deselected appearance, and the associated variable is deselected appearance, and the associated variable is
@@ -185,6 +190,7 @@ changes to and from the button's
and and
.QW tristate .QW tristate
values. values.
.VE 8.5
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
.PP .PP
The \fBcheckbutton\fR command creates a new Tcl command whose The \fBcheckbutton\fR command creates a new Tcl command whose
@@ -264,8 +270,7 @@ invoked, if there is one).
.IP [3] .IP [3]
When a checkbutton has the input focus, the space key causes the checkbutton When a checkbutton has the input focus, the space key causes the checkbutton
to be invoked. Under Windows, there are additional key bindings; plus to be invoked. Under Windows, there are additional key bindings; plus
(\fB+\fR) and equal (\fB=\fR) select the button, and minus (\fB\-\fR) (+) and equal (=) select the button, and minus (\-) deselects the button.
deselects the button.
.PP .PP
If the checkbutton's state is \fBdisabled\fR then none of the above If the checkbutton's state is \fBdisabled\fR then none of the above
actions occur: the checkbutton is completely non-responsive. actions occur: the checkbutton is completely non-responsive.
@@ -273,21 +278,17 @@ actions occur: the checkbutton is completely non-responsive.
The behavior of checkbuttons can be changed by defining new bindings for The behavior of checkbuttons 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 EXAMPLE .SH EXAMPLE
.PP
This example shows a group of uncoupled checkbuttons. This example shows a group of uncoupled checkbuttons.
.PP .PP
.CS .CS
labelframe .lbl \-text "Steps:" labelframe .lbl \-text "Steps:"
\fBcheckbutton\fR .c1 \-text Lights \-variable lights \fBcheckbutton\fR .c1 \-text Lights \-variable lights
\fBcheckbutton\fR .c2 \-text Cameras \-variable cameras \fBcheckbutton\fR .c2 \-text Cameras \-variable cameras
\fBcheckbutton\fR .c3 \-text Action! \-variable action \fBcheckbutton\fR .c3 \-text Action! \-variable action
pack .c1 .c2 .c3 \-in .lbl pack .c1 .c2 .c3 \-in .lbl
pack .lbl pack .lbl
.CE .CE
.SH "SEE ALSO" .SH "SEE ALSO"
button(n), options(n), radiobutton(n), ttk::checkbutton(n) button(n), options(n), radiobutton(n), ttk::checkbutton(n)
.SH KEYWORDS .SH KEYWORDS
checkbutton, widget checkbutton, widget
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -13,6 +13,7 @@ tk_chooseColor \- pops up a dialog box for the user to select a color.
.SH SYNOPSIS .SH SYNOPSIS
\fBtk_chooseColor \fR?\fIoption value ...\fR? \fBtk_chooseColor \fR?\fIoption value ...\fR?
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The procedure \fBtk_chooseColor\fR pops up a dialog box for the The procedure \fBtk_chooseColor\fR pops up a dialog box for the
@@ -37,12 +38,9 @@ name of the color in a form acceptable to \fBTk_GetColor\fR. If the
user cancels the operation, both commands will return the empty user cancels the operation, both commands will return the empty
string. string.
.SH EXAMPLE .SH EXAMPLE
.PP
.CS .CS
button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"] button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"]
.CE .CE
.SH KEYWORDS .SH KEYWORDS
color, color selection, dialog color selection dialog
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -17,27 +17,13 @@ The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the
user to select a directory. The following \fIoption\-value\fR pairs are user to select a directory. The following \fIoption\-value\fR pairs are
possible as command line arguments: possible as command line arguments:
.TP .TP
\fB\-command\fR \fIstring\fR
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog after having selected an item. This callback is not called if the
user cancelled the dialog. The actual command consists of \fIstring\fR
followed by a space and the value selected by the user in the dialog. This
is only available on Mac OS X.
.TP
\fB\-initialdir\fR \fIdirname\fR \fB\-initialdir\fR \fIdirname\fR
Specifies that the directories in \fIdirectory\fR should be displayed Specifies that the directories in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified, when the dialog pops up. If this parameter is not specified, then
the initial directory defaults to the current working directory the directories in the current working directory are displayed. If the
on non-Windows systems and on Windows systems prior to Vista.
On Vista and later systems, the initial directory defaults to the last
user-selected directory for the application. If the
parameter specifies a relative path, the return value will convert the parameter specifies a relative path, the return value will convert the
relative path to an absolute path. relative path to an absolute path.
.TP .TP
\fB\-message\fR \fIstring\fR
Specifies a message to include in the client area of the dialog.
This is only available on Mac OS X.
.TP
\fB\-mustexist\fR \fIboolean\fR \fB\-mustexist\fR \fIboolean\fR
Specifies whether the user may specify non-existent directories. If Specifies whether the user may specify non-existent directories. If
this parameter is true, then the user may only select directories that this parameter is true, then the user may only select directories that
@@ -52,7 +38,6 @@ turns the file dialog into a sheet attached to the parent window.
Specifies a string to display as the title of the dialog box. If this Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title will be displayed. option is not specified, then a default title will be displayed.
.SH EXAMPLE .SH EXAMPLE
.PP
.CS .CS
set dir [\fBtk_chooseDirectory\fR \e set dir [\fBtk_chooseDirectory\fR \e
\-initialdir ~ \-title "Choose a directory"] \-initialdir ~ \-title "Choose a directory"]
@@ -62,10 +47,8 @@ if {$dir eq ""} {
label .l \-text "Selected $dir" label .l \-text "Selected $dir"
} }
.CE .CE
.SH "SEE ALSO" .SH "SEE ALSO"
tk_getOpenFile(n), tk_getSaveFile(n) tk_getOpenFile(n), tk_getSaveFile(n)
.SH KEYWORDS .SH KEYWORDS
directory, selection, dialog, platform-specific directory, selection, dialog, platform-specific
'\" Local Variables:
'\" mode: nroff
'\" End:

View File

@@ -14,6 +14,7 @@ clipboard \- Manipulate Tk clipboard
.SH SYNOPSIS .SH SYNOPSIS
\fBclipboard \fIoption\fR ?\fIarg arg ...\fR? \fBclipboard \fIoption\fR ?\fIarg arg ...\fR?
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
This command provides a Tcl interface to the Tk clipboard, This command provides a Tcl interface to the Tk clipboard,
@@ -27,9 +28,15 @@ appends should be completed before returning to the event loop.
The first argument to \fBclipboard\fR determines the format of the The first argument to \fBclipboard\fR determines the format of the
rest of the arguments and the behavior of the command. The following rest of the arguments and the behavior of the command. The following
forms are currently supported: forms are currently supported:
.PP
.TP
\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR?
Claims ownership of the clipboard on \fIwindow\fR's display and removes
any previous contents. \fIWindow\fR defaults to
.QW . .
Returns an empty string.
.TP .TP
\fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR \fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR
.
Appends \fIdata\fR to the clipboard on \fIwindow\fR's Appends \fIdata\fR to the clipboard on \fIwindow\fR's
display in the form given by \fItype\fR with the representation given display in the form given by \fItype\fR with the representation given
by \fIformat\fR and claims ownership of the clipboard on \fIwindow\fR's by \fIformat\fR and claims ownership of the clipboard on \fIwindow\fR's
@@ -40,15 +47,15 @@ display.
(the desired (the desired
.QW target .QW target
for conversion, in ICCCM terminology), and for conversion, in ICCCM terminology), and
should be an atom name such as \fBSTRING\fR or \fBFILE_NAME\fR; see the should be an atom name such as STRING or FILE_NAME; see the
Inter-Client Communication Conventions Manual for complete details. Inter-Client Communication Conventions Manual for complete details.
\fIType\fR defaults to \fBSTRING\fR. \fIType\fR defaults to STRING.
.PP .PP
The \fIformat\fR argument specifies the representation that should be The \fIformat\fR argument specifies the representation that should be
used to transmit the selection to the requester (the second column of used to transmit the selection to the requester (the second column of
Table 2 of the ICCCM), and defaults to \fBSTRING\fR. If \fIformat\fR is Table 2 of the ICCCM), and defaults to STRING. If \fIformat\fR is
\fBSTRING\fR, the selection is transmitted as 8-bit ASCII characters. If STRING, the selection is transmitted as 8-bit ASCII characters. If
\fIformat\fR is \fBATOM\fR, then the \fIdata\fR is \fIformat\fR is ATOM, then the \fIdata\fR is
divided into fields separated by white space; each field is converted divided into fields separated by white space; each field is converted
to its atom value, and the 32-bit atom value is transmitted instead of to its atom value, and the 32-bit atom value is transmitted instead of
the atom name. For any other \fIformat\fR, \fIdata\fR is divided the atom name. For any other \fIformat\fR, \fIdata\fR is divided
@@ -62,8 +69,8 @@ boundaries. All items appended to the clipboard with the same
.PP .PP
The \fIformat\fR argument is needed only for compatibility with The \fIformat\fR argument is needed only for compatibility with
clipboard requesters that do not use Tk. If the Tk toolkit is being clipboard requesters that do not use Tk. If the Tk toolkit is being
used to retrieve the \fBCLIPBOARD\fR selection then the value is used to retrieve the CLIPBOARD selection then the value is converted back to
converted back to a string at the requesting end, so \fIformat\fR is a string at the requesting end, so \fIformat\fR is
irrelevant. irrelevant.
.PP .PP
A \fB\-\|\-\fR argument may be specified to mark the end of options: the A \fB\-\|\-\fR argument may be specified to mark the end of options: the
@@ -72,30 +79,21 @@ This feature may be convenient if, for example, \fIdata\fR starts
with a \fB\-\fR. with a \fB\-\fR.
.RE .RE
.TP .TP
\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR?
.
Claims ownership of the clipboard on \fIwindow\fR's display and removes
any previous contents. \fIWindow\fR defaults to
.QW . .
Returns an empty string.
.TP
\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR? \fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR?
.
Retrieve data from the clipboard on \fIwindow\fR's display. Retrieve data from the clipboard on \fIwindow\fR's display.
\fIWindow\fR defaults to \fIWindow\fR defaults to
.QW . . .QW . .
\fIType\fR specifies the form in which \fIType\fR specifies the form in which
the data is to be returned and should be an atom name such as \fBSTRING\fR the data is to be returned and should be an atom name such as STRING
or \fBFILE_NAME\fR. \fIType\fR defaults to \fBSTRING\fR. This command is or FILE_NAME. \fIType\fR defaults to STRING. This command is
equivalent to equivalent to
.QW "\fBselection get\fR \fB\-selection CLIPBOARD\fR" . .QW "\fBselection get \-selection CLIPBOARD\fR" .
.RS .RS
.PP .PP
Note that on modern X11 systems, the most useful type to retrieve for Note that on modern X11 systems, the most useful type to retrieve for
transferred strings is not \fBSTRING\fR, but rather \fBUTF8_STRING\fR. transferred strings is not \fBSTRING\fR, but rather \fBUTF8_STRING\fR.
.RE .RE
.SH EXAMPLES .SH EXAMPLES
.PP
Get the current contents of the clipboard. Get the current contents of the clipboard.
.CS .CS
if {[catch {\fBclipboard get\fR} contents]} { if {[catch {\fBclipboard get\fR} contents]} {
@@ -148,10 +146,9 @@ bind $c <<Paste>> {
} }
} }
.CE .CE
.SH "SEE ALSO" .SH "SEE ALSO"
interp(n), selection(n) interp(n), selection(n)
.SH KEYWORDS .SH KEYWORDS
clear, format, clipboard, append, selection, type clear, format, clipboard, append, selection, type
'\" Local Variables:
'\" mode: nroff
'\" End:

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