Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6710de848 | ||
|
|
070b8750b0 | ||
|
|
42c69189d9 | ||
|
|
5ba5cbc9af | ||
|
|
753ac6b037 | ||
|
|
8e57feeeb9 | ||
|
|
b1c28856bb |
236
.travis.yml
Normal file
236
.travis.yml
Normal file
@@ -0,0 +1,236 @@
|
||||
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
|
||||
@@ -5218,7 +5218,7 @@
|
||||
2000-05-31 Eric Melski <ericm@scriptics.com>
|
||||
|
||||
* library/bgerror.tcl: Improved bgerror based on work by Donal
|
||||
K. Fellows; no longer dependant on tk_dialog; features a
|
||||
K. Fellows; no longer dependent on tk_dialog; features a
|
||||
Windows-esque "Details" button, and a customizable extra function
|
||||
button that allows the user to (for example) save the stack trace
|
||||
to a file.
|
||||
|
||||
5283
ChangeLog.2007
Normal file
5283
ChangeLog.2007
Normal file
File diff suppressed because it is too large
Load Diff
41
README
41
README
@@ -1,41 +0,0 @@
|
||||
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.
|
||||
40
README.md
Normal file
40
README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# README: Tk
|
||||
|
||||
This is the **Tk 8.6.12** source distribution.
|
||||
|
||||
You can get any source release of Tk from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
[](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-6-branch)
|
||||
[](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-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-lang.org/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.
|
||||
@@ -1,7 +1,8 @@
|
||||
This software is copyrighted by the Regents of the University of
|
||||
California, Sun Microsystems, Inc., and other parties. The following
|
||||
terms apply to all files associated with the software unless explicitly
|
||||
disclaimed in individual files.
|
||||
California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
|
||||
Corporation, Apple Inc. and other parties. The following terms apply to
|
||||
all files associated with the software unless explicitly disclaimed in
|
||||
individual files.
|
||||
|
||||
The authors hereby grant permission to use, copy, modify, distribute,
|
||||
and license this software and its documentation for any purpose, provided
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* 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
|
||||
* that are needed by Tcl. This file is needed even on many systems with
|
||||
* that are needed by Tk. This file is needed even on many systems with
|
||||
* their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
|
||||
* all the procedures needed here (such as strtod).
|
||||
*
|
||||
@@ -17,6 +17,10 @@
|
||||
#ifndef _STDLIB
|
||||
#define _STDLIB
|
||||
|
||||
#ifndef _TCL
|
||||
# include <tcl.h>
|
||||
#endif
|
||||
|
||||
extern void abort(void);
|
||||
extern double atof(const char *string);
|
||||
extern int atoi(const char *string);
|
||||
|
||||
@@ -15,12 +15,15 @@
|
||||
#define _UNISTD
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef _TCL
|
||||
# include <tcl.h>
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* Strict POSIX stuff goes here. Extensions go down below, in the ifndef
|
||||
* _POSIX_SOURCE section.
|
||||
*/
|
||||
@@ -37,7 +40,7 @@ extern int execle(const char *path, ...);
|
||||
extern int execlp(const char *file, ...);
|
||||
extern int execv(const char *path, char **argv);
|
||||
extern int execve(const char *path, char **argv, char **envp);
|
||||
extern int execvpw(const char *file, char **argv);
|
||||
extern int execvp(const char *file, char **argv);
|
||||
extern pid_t fork(void);
|
||||
extern char * getcwd(char *buf, size_t size);
|
||||
extern gid_t getegid(void);
|
||||
@@ -65,7 +68,7 @@ extern int ftruncate(int fd, unsigned long length);
|
||||
extern int ioctl(int fd, int request, ...);
|
||||
extern int readlink(const char *path, char *buf, int bufsize);
|
||||
extern int setegid(gid_t group);
|
||||
extern int seteuidw(uid_t user);
|
||||
extern int seteuid(uid_t user);
|
||||
extern int setreuid(int ruid, int euid);
|
||||
extern int symlink(const char *, const char *);
|
||||
extern int ttyslot(void);
|
||||
@@ -74,3 +77,4 @@ extern int vfork(void);
|
||||
#endif /* _POSIX_SOURCE */
|
||||
|
||||
#endif /* _UNISTD */
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -64,12 +64,12 @@ Interpreter to use for error reporting.
|
||||
Token for window (for all procedures except \fBTk_Get3DBorder\fR,
|
||||
must be the window for which the border was allocated).
|
||||
.AP Tcl_Obj *objPtr in
|
||||
Pointer to object whose value describes color corresponding to
|
||||
Pointer to value whose value describes color corresponding to
|
||||
background (flat areas). Illuminated edges will be brighter than
|
||||
this and shadowed edges will be darker than this.
|
||||
.AP char *colorName in
|
||||
Same as \fIobjPtr\fR except value is supplied as a string rather
|
||||
than an object.
|
||||
than a value.
|
||||
.AP Drawable drawable in
|
||||
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
|
||||
@@ -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
|
||||
border is outside rectangle.
|
||||
.AP int relief in
|
||||
Indicates 3-D position of interior of object relative to exterior;
|
||||
Indicates 3-D position of interior of value relative to exterior;
|
||||
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
|
||||
for \fBTk_Fill3DRectangle\fR).
|
||||
@@ -114,7 +114,7 @@ should appear higher;
|
||||
For \fBTk_Fill3DPolygon\fR, \fBTK_RELIEF_FLAT\fR may also be specified to
|
||||
indicate no difference in height.
|
||||
.AP int leftBevel in
|
||||
Non-zero means this bevel forms the left side of the object; zero means
|
||||
Non-zero means this bevel forms the left side of the value; zero means
|
||||
it forms the right side.
|
||||
.AP int leftIn in
|
||||
Non-zero means that the left edge of the horizontal bevel angles in,
|
||||
@@ -128,13 +128,12 @@ 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
|
||||
right than the top.
|
||||
.AP int topBevel in
|
||||
Non-zero means this bevel forms the top side of the object; zero means
|
||||
Non-zero means this bevel forms the top side of the value; zero means
|
||||
it forms the bottom side.
|
||||
.AP int which in
|
||||
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.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures provide facilities for drawing window borders in a
|
||||
@@ -153,14 +152,15 @@ darker than \fIobjPtr\fR.
|
||||
\fBTk_Alloc3DBorderFromObj\fR returns a token that may be used in later calls
|
||||
to \fBTk_Draw3DRectangle\fR. If an error occurs in allocating information
|
||||
for the border (e.g. a bogus color name was given)
|
||||
then NULL is returned and an error message is left in \fIinterp->result\fR.
|
||||
then NULL is returned and an error message is left as the result of
|
||||
interpreter \fIinterp\fR.
|
||||
If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches
|
||||
information about the return value in \fIobjPtr\fR, which speeds up
|
||||
future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR
|
||||
and \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_Get3DBorder\fR is identical to \fBTk_Alloc3DBorderFromObj\fR except
|
||||
that the color is specified with a string instead of an object. This
|
||||
that the color is specified with a string instead of a value. This
|
||||
prevents \fBTk_Get3DBorder\fR from caching the return value, so
|
||||
\fBTk_Get3DBorder\fR is less efficient than \fBTk_Alloc3DBorderFromObj\fR.
|
||||
.PP
|
||||
@@ -238,8 +238,8 @@ arguments that describe the rectangular area of the beveled edge
|
||||
The \fIleftBorder\fR and \fItopBorder\fR arguments indicate the
|
||||
position of the border relative to the
|
||||
.QW inside
|
||||
of the object, and
|
||||
\fIrelief\fR indicates the relief of the inside of the object relative
|
||||
of the value, and
|
||||
\fIrelief\fR indicates the relief of the inside of the value relative
|
||||
to the outside.
|
||||
\fBTk_3DVerticalBevel\fR just draws a rectangular region.
|
||||
\fBTk_3DHorizontalBevel\fR draws a trapezoidal region to generate
|
||||
@@ -290,6 +290,5 @@ with the Tk_3DBorder token for the border.
|
||||
There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or
|
||||
\fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR
|
||||
or \fBTk_Get3DBorder\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
3D, background, border, color, depressed, illumination, object, polygon, raised, shadow, three-dimensional effect
|
||||
3D, background, border, color, depressed, illumination, value, polygon, raised, shadow, three-dimensional effect
|
||||
|
||||
@@ -23,7 +23,6 @@ Value of option.
|
||||
.AP int priority in
|
||||
Overall priority level to use for option.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure is invoked to add an option to the database
|
||||
@@ -47,6 +46,5 @@ user-specific startup files.
|
||||
.IP 80
|
||||
Used for options specified interactively after the application starts
|
||||
running.
|
||||
|
||||
.SH KEYWORDS
|
||||
class, name, option, add
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -45,7 +45,7 @@ call to \fBTk_CreateBindingTable\fR.
|
||||
Identifies object with which binding is associated.
|
||||
.AP "const char" *eventString in
|
||||
String describing event sequence.
|
||||
.AP char *script in
|
||||
.AP "const char" *script in
|
||||
Tcl script to invoke when binding triggers.
|
||||
.AP int append in
|
||||
Non-zero means append \fIscript\fR to existing script for binding,
|
||||
@@ -61,7 +61,6 @@ Number of object identifiers pointed to by \fIobjectPtr\fR.
|
||||
Points to an array of object identifiers: bindings will be considered
|
||||
for each of these objects in order from first to last.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures provide a general-purpose mechanism for creating
|
||||
@@ -112,25 +111,25 @@ select relevant events, or to disallow the use of certain events
|
||||
in bindings.
|
||||
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
|
||||
message is left in \fIinterp->result\fR.
|
||||
message is left as the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
\fBTk_DeleteBinding\fR removes from \fIbindingTable\fR the
|
||||
binding given by \fIobject\fR and \fIeventString\fR, if
|
||||
such a binding exists.
|
||||
\fBTk_DeleteBinding\fR always returns \fBTCL_OK\fR.
|
||||
In some cases it may reset \fIinterp->result\fR to the default
|
||||
In some cases it may reset the interpreter result to the default
|
||||
empty value.
|
||||
.PP
|
||||
\fBTk_GetBinding\fR returns a pointer to the script associated
|
||||
with \fIeventString\fR and \fIobject\fR in \fIbindingTable\fR.
|
||||
If no such binding exists then NULL is returned and an error
|
||||
message is left in \fIinterp->result\fR.
|
||||
message is left as the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
\fBTk_GetAllBindings\fR returns in \fIinterp->result\fR a list
|
||||
\fBTk_GetAllBindings\fR returns in \fIinterp\fR's result a list
|
||||
of all the event strings for which there are bindings in
|
||||
\fIbindingTable\fR associated with \fIobject\fR.
|
||||
If there are no bindings for \fIobject\fR then an empty
|
||||
string is returned in \fIinterp->result\fR.
|
||||
If there are no bindings for \fIobject\fR, the result will be an empty
|
||||
string.
|
||||
.PP
|
||||
\fBTk_DeleteAllBindings\fR deletes all of the bindings in
|
||||
\fIbindingTable\fR that are associated with \fIobject\fR.
|
||||
@@ -150,6 +149,5 @@ the object is skipped.
|
||||
\fBTk_BindEvent\fR continues through all of the objects, handling
|
||||
exceptions such as errors, \fBbreak\fR, and \fBcontinue\fR as
|
||||
described in the documentation for \fBbind\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
binding, event, object, script
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -61,7 +61,6 @@ and so on.
|
||||
.AP int numPoints in
|
||||
Number of points at \fIcoordPtr\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are called by canvas type managers to carry out
|
||||
@@ -83,38 +82,40 @@ transformation.
|
||||
of a bitmap.
|
||||
The Postscript is generated in proper image data format for Postscript,
|
||||
i.e., as data between angle brackets, one bit per pixel.
|
||||
The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned
|
||||
unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
|
||||
\fIinterp->result\fR is overwritten with an error message.
|
||||
The Postscript is appended to the result of interpreter \fIinterp\fR
|
||||
and \fBTCL_OK\fR is returned unless an error occurs, in which case
|
||||
\fBTCL_ERROR\fR is returned and the interpreter result is overwritten
|
||||
with an error message.
|
||||
.PP
|
||||
\fBTk_CanvasPsColor\fR generates Postscript to set the current color
|
||||
to correspond to its \fIcolorPtr\fR argument, taking into account any
|
||||
color map specified in the \fBpostscript\fR command.
|
||||
It appends the Postscript to \fIinterp->result\fR and returns
|
||||
\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
|
||||
\fIinterp->result\fR is overwritten with an error message.
|
||||
It appends the Postscript to the interpreter \fIinterp\fR's result and returns
|
||||
\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is
|
||||
returned and the interpreter's result is overwritten with an error message.
|
||||
.PP
|
||||
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font
|
||||
to match \fItkFont\fR as closely as possible.
|
||||
\fBTk_CanvasPsFont\fR takes into account any font map specified
|
||||
in the \fBpostscript\fR command, and it does
|
||||
the best it can at mapping X fonts to Postscript fonts.
|
||||
It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR
|
||||
unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
|
||||
\fIinterp->result\fR is overwritten with an error message.
|
||||
It appends the Postscript to interpreter \fIinterp\fR's result and
|
||||
returns \fBTCL_OK\fR unless an error occurs, in which case
|
||||
\fBTCL_ERROR\fR is returned and the interpreter's result is
|
||||
overwritten with an error message.
|
||||
.PP
|
||||
\fBTk_CanvasPsPath\fR generates Postscript to set the current path
|
||||
to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR.
|
||||
It appends the resulting Postscript to \fIinterp->result\fR.
|
||||
It appends the resulting Postscript to the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
\fBTk_CanvasPsStipple\fR generates Postscript that will fill the
|
||||
current path in stippled fashion.
|
||||
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
|
||||
zeroes are not drawn at all.
|
||||
The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is
|
||||
returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
|
||||
\fIinterp->result\fR is overwritten with an error message.
|
||||
|
||||
The Postscript is appended to interpreter \fIinterp\fR's result and
|
||||
\fBTCL_OK\fR is returned, unless an error occurs, in which case
|
||||
\fBTCL_ERROR\fR is returned and the interpreter's result is
|
||||
overwritten with an error message.
|
||||
.SH KEYWORDS
|
||||
bitmap, canvas, color, font, path, Postscript, stipple
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -71,7 +71,6 @@ the left of this coordinate need to be redisplayed.
|
||||
Bottom edge of the region that needs redisplay. Only pixels above
|
||||
this coordinate need to be redisplayed.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are called by canvas type managers to perform various
|
||||
@@ -86,7 +85,7 @@ canvas coordinate.
|
||||
If \fIstring\fR is a valid coordinate description then \fBTk_CanvasGetCoord\fR
|
||||
stores the corresponding canvas coordinate at *\fIdoublePtr\fR
|
||||
and returns \fBTCL_OK\fR.
|
||||
Otherwise it stores an error message in \fIinterp->result\fR and
|
||||
Otherwise it stores an error message in the interpreter result and
|
||||
returns \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
\fBTk_CanvasDrawableCoords\fR is called by type managers during
|
||||
@@ -142,18 +141,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
|
||||
structure for the \fB\-tags\fR option. The code typically looks
|
||||
like this:
|
||||
.PP
|
||||
.CS
|
||||
static Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
|
||||
Tk_CanvasTagsPrintProc, (ClientData) NULL
|
||||
static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
|
||||
Tk_CanvasTagsPrintProc, NULL
|
||||
};
|
||||
|
||||
static Tk_ConfigSpec configSpecs[] = {
|
||||
static const Tk_ConfigSpec configSpecs[] = {
|
||||
...
|
||||
{TK_CONFIG_CUSTOM, "\-tags", (char *) NULL, (char *) NULL,
|
||||
(char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
|
||||
{TK_CONFIG_CUSTOM, "\-tags", NULL, NULL,
|
||||
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
|
||||
...
|
||||
};
|
||||
.CE
|
||||
|
||||
.SH KEYWORDS
|
||||
canvas, focus, item type, redisplay, selection, type manager
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -20,7 +20,6 @@ Tk_CanvasTextInfo *
|
||||
.AP Tk_Canvas canvas in
|
||||
A token that identifies a particular canvas widget.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Textual canvas items are somewhat more complicated to manage than
|
||||
@@ -47,7 +46,7 @@ typedef struct Tk_CanvasTextInfo {
|
||||
Tk_Item *\fIfocusItemPtr\fR;
|
||||
int \fIgotFocus\fR;
|
||||
int \fIcursorOn\fR;
|
||||
} Tk_CanvasTextInfo;
|
||||
} \fBTk_CanvasTextInfo\fR;
|
||||
.CE
|
||||
The \fBselBorder\fR field identifies a Tk_3DBorder that should be
|
||||
used for drawing the background under selected text.
|
||||
@@ -97,6 +96,5 @@ anchor, as determined by \fIselItemPtr\fR or \fIanchorItemPtr\fR).
|
||||
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
|
||||
selection.
|
||||
|
||||
.SH KEYWORDS
|
||||
canvas, focus, insertion cursor, selection, selection anchor, text
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -31,10 +31,9 @@ Conversion type for this clipboard item; has same meaning as
|
||||
.AP Atom format in
|
||||
Representation to use when data is retrieved; has same meaning as
|
||||
\fIformat\fR argument to \fBTk_CreateSelHandler\fR.
|
||||
.AP char *buffer in
|
||||
.AP "const char" *buffer in
|
||||
Null terminated string containing the data to be appended to the clipboard.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These two procedures manage the clipboard for Tk.
|
||||
@@ -43,9 +42,10 @@ once, then calling \fBTk_ClipboardAppend\fR to add data for any
|
||||
number of targets.
|
||||
.PP
|
||||
\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
|
||||
\fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR.
|
||||
\fBTCL_ERROR\fR and leaves an error message in interpreter
|
||||
\fIinterp\fR's result.
|
||||
\fBTk_ClipboardClear\fR must be called before a sequence of
|
||||
\fBTk_ClipboardAppend\fR calls can be issued.
|
||||
.PP
|
||||
@@ -60,8 +60,8 @@ currently owned by the application, either
|
||||
because \fBTk_ClipboardClear\fR has not been called or because
|
||||
ownership of the clipboard has changed since the last call to
|
||||
\fBTk_ClipboardClear\fR,
|
||||
\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in
|
||||
\fIinterp->result\fR.
|
||||
\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error
|
||||
message in the result of interpreter \fIinterp\fR.
|
||||
.PP
|
||||
In order to guarantee atomicity, no event handling should occur
|
||||
between \fBTk_ClipboardClear\fR and the following
|
||||
@@ -71,8 +71,7 @@ this application).
|
||||
.PP
|
||||
\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary
|
||||
Tcl scripts, as a result of losing the CLIPBOARD selection, so
|
||||
any calling function should take care to be reentrant at the point
|
||||
any calling function should take care to be re-entrant at the point
|
||||
\fBTk_ClipboardClear\fR is invoked.
|
||||
|
||||
.SH KEYWORDS
|
||||
append, clipboard, clear, format, type
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -23,10 +23,9 @@ window.
|
||||
.AP Atom selection in
|
||||
The name of selection to be cleared.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_ClearSelection\fR cancels the selection specified by the atom
|
||||
\fBTk_ClearSelection\fR cancels the selection specified by the atom
|
||||
\fIselection\fR for the display containing \fItkwin\fR.
|
||||
The selection need not be in \fItkwin\fR itself or even in
|
||||
\fItkwin\fR's application.
|
||||
@@ -35,6 +34,5 @@ owns \fIselection\fR, the window will be notified and the
|
||||
selection will be cleared.
|
||||
If there is no owner for \fIselection\fR on the display, then the
|
||||
procedure has no effect.
|
||||
|
||||
.SH KEYWORDS
|
||||
clear, selection
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -25,12 +25,12 @@ int
|
||||
.sp
|
||||
\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ConfigSpec *widgRec in/out
|
||||
.AS char *widgRec in/out
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for returning error messages.
|
||||
.AP Tk_Window tkwin in
|
||||
Window used to represent widget (needed to set up X resources).
|
||||
.AP Tk_ConfigSpec *specs in
|
||||
.AP "const Tk_ConfigSpec" *specs in
|
||||
Pointer to table specifying legal configuration options for this
|
||||
widget.
|
||||
.AP int argc in
|
||||
@@ -61,7 +61,7 @@ Display containing widget whose record is being freed; needed in
|
||||
order to free up resources.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.PP
|
||||
Note: \fBTk_ConfigureWidget\fR should be replaced with the new
|
||||
\fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is
|
||||
retained for backward compatibility.
|
||||
@@ -89,7 +89,7 @@ to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
|
||||
case it does not modify \fIinterp\fR.
|
||||
If an error
|
||||
occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will
|
||||
leave an error message in \fIinterp->result\fR in the standard Tcl
|
||||
leave an error message in interpreter \fIinterp\fR's result in the standard Tcl
|
||||
fashion.
|
||||
In the event of an error return, some of the fields of \fIwidgRec\fR
|
||||
could already have been set, if configuration information for them
|
||||
@@ -103,14 +103,14 @@ option and has the following structure:
|
||||
.CS
|
||||
typedef struct {
|
||||
int \fItype\fR;
|
||||
char *\fIargvName\fR;
|
||||
char *\fIdbName\fR;
|
||||
char *\fIdbClass\fR;
|
||||
char *\fIdefValue\fR;
|
||||
const char *\fIargvName\fR;
|
||||
const char *\fIdbName\fR;
|
||||
const char *\fIdbClass\fR;
|
||||
const char *\fIdefValue\fR;
|
||||
int \fIoffset\fR;
|
||||
int \fIspecFlags\fR;
|
||||
Tk_CustomOption *\fIcustomPtr\fR;
|
||||
} Tk_ConfigSpec;
|
||||
const Tk_CustomOption *\fIcustomPtr\fR;
|
||||
} \fBTk_ConfigSpec\fR;
|
||||
.CE
|
||||
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
|
||||
@@ -174,7 +174,7 @@ legal values for \fItype\fR, and the corresponding actions, are:
|
||||
\fBTK_CONFIG_ACTIVE_CURSOR\fR
|
||||
The value
|
||||
must be an ASCII string identifying a cursor in a form
|
||||
suitable for passing to \fBTk_GetCursor\fR.
|
||||
suitable for passing to \fBTk_GetCursor\fR.
|
||||
The value is converted to a \fBTk_Cursor\fR by calling
|
||||
\fBTk_GetCursor\fR and the result is stored in the target.
|
||||
In addition, the resulting cursor is made the active cursor
|
||||
@@ -356,7 +356,6 @@ is an empty string then the target will be set to NULL.
|
||||
\fBTK_CONFIG_WINDOW\fR
|
||||
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.
|
||||
|
||||
.SH "GROUPED ENTRIES"
|
||||
.PP
|
||||
In some cases it is useful to generate multiple resources from
|
||||
@@ -374,7 +373,6 @@ 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
|
||||
with the entry that precedes it. Only the \fItype\fR and \fIoffset\fR
|
||||
fields are used from these follow-on entries.
|
||||
|
||||
.SH "FLAGS"
|
||||
.PP
|
||||
The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used
|
||||
@@ -434,13 +432,11 @@ once, save the value, and provide it before calling
|
||||
.TP
|
||||
\fBTK_CONFIG_OPTION_SPECIFIED\fR
|
||||
This bit is
|
||||
.VS 8.5
|
||||
deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR
|
||||
so that callers could detect what entries were specified in
|
||||
\fIargv\fR, but it was removed because it was inherently
|
||||
thread-unsafe. Code that wishes to detect what options were specified
|
||||
should use \fBTk_SetOptions\fR instead.
|
||||
.VE 8.5
|
||||
.PP
|
||||
The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
|
||||
used to specify different default values for
|
||||
@@ -473,7 +469,6 @@ 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
|
||||
entries for the desired widget type. For a working example of
|
||||
this feature, see the code in tkButton.c.
|
||||
|
||||
.SH TK_OFFSET
|
||||
.PP
|
||||
The \fBTk_Offset\fR macro is provided as a safe way of generating
|
||||
@@ -481,7 +476,6 @@ the \fIoffset\fR values for entries in Tk_ConfigSpec structures.
|
||||
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
|
||||
the named field in records of the given type.
|
||||
|
||||
.SH TK_CONFIGUREINFO
|
||||
.PP
|
||||
The \fBTk_ConfigureInfo\fR procedure may be used to obtain
|
||||
@@ -492,12 +486,12 @@ pointer to a widget record containing the current information for
|
||||
a widget (\fIwidgRec\fR), and a NULL \fIargvName\fR argument,
|
||||
\fBTk_ConfigureInfo\fR generates a string describing all of the
|
||||
configuration options for the window. The string is placed
|
||||
in \fIinterp->result\fR. Under normal circumstances
|
||||
in interpreter \fIinterp\fR's result. Under normal circumstances
|
||||
it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR
|
||||
and \fIinterp->result\fR contains an error message.
|
||||
and the interpreter's result will contain an error message.
|
||||
.PP
|
||||
If \fIargvName\fR is NULL, then the value left in
|
||||
\fIinterp->result\fR by \fBTk_ConfigureInfo\fR
|
||||
the interpreter's result by \fBTk_ConfigureInfo\fR
|
||||
consists of a list of one or more entries, each of which describes
|
||||
one configuration option (i.e. one entry in \fIspecs\fR). Each
|
||||
entry in the list will contain either two or five values. If the
|
||||
@@ -510,27 +504,25 @@ field of \fIwidgRec\fR by calling procedures like \fBTk_NameOfColor\fR.
|
||||
.PP
|
||||
If the \fIargvName\fR argument to \fBTk_ConfigureInfo\fR is non-NULL,
|
||||
then it indicates a single option, and information is returned only
|
||||
for that option. The string placed in \fIinterp->result\fR will be
|
||||
for that option. The string placed in the interpreter's result will be
|
||||
a list containing two or five values as described above; this will
|
||||
be identical to the corresponding sublist that would have been returned
|
||||
if \fIargvName\fR had been NULL.
|
||||
.PP
|
||||
The \fIflags\fR argument to \fBTk_ConfigureInfo\fR is used to restrict
|
||||
the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR.
|
||||
|
||||
.SH TK_CONFIGUREVALUE
|
||||
.PP
|
||||
\fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR;
|
||||
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).
|
||||
The value is returned in \fIinterp->result\fR and \fBTCL_OK\fR is
|
||||
The value is returned in interpreter \fIinterp\fR's result and \fBTCL_OK\fR is
|
||||
normally returned as the procedure's result.
|
||||
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
|
||||
is left in \fIinterp->result\fR.
|
||||
is left in the interpreter's result.
|
||||
This procedure is typically called to implement \fBcget\fR widget
|
||||
commands.
|
||||
|
||||
.SH TK_FREEOPTIONS
|
||||
.PP
|
||||
The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup
|
||||
@@ -543,7 +535,6 @@ it contains a null pointer) then no resource is freed for that
|
||||
entry.
|
||||
After freeing a resource, \fBTk_FreeOptions\fR sets the
|
||||
corresponding field of the widget record to null.
|
||||
|
||||
.SH "CUSTOM OPTION TYPES"
|
||||
.PP
|
||||
Applications can extend the built-in configuration types with additional
|
||||
@@ -554,22 +545,22 @@ typedef struct Tk_CustomOption {
|
||||
Tk_OptionParseProc *\fIparseProc\fR;
|
||||
Tk_OptionPrintProc *\fIprintProc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
} Tk_CustomOption;
|
||||
} \fBTk_CustomOption\fR;
|
||||
|
||||
typedef int Tk_OptionParseProc(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Window \fItkwin\fR,
|
||||
char *\fIvalue\fR,
|
||||
char *\fIwidgRec\fR,
|
||||
int \fIoffset\fR);
|
||||
typedef int \fBTk_OptionParseProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Window \fItkwin\fR,
|
||||
char *\fIvalue\fR,
|
||||
char *\fIwidgRec\fR,
|
||||
int \fIoffset\fR);
|
||||
|
||||
typedef char *Tk_OptionPrintProc(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR,
|
||||
char *\fIwidgRec\fR,
|
||||
int \fIoffset\fR,
|
||||
Tcl_FreeProc **\fIfreeProcPtr\fR);
|
||||
typedef const char *\fBTk_OptionPrintProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR,
|
||||
char *\fIwidgRec\fR,
|
||||
int \fIoffset\fR,
|
||||
Tcl_FreeProc **\fIfreeProcPtr\fR);
|
||||
.CE
|
||||
The Tk_CustomOption structure contains three fields, which are pointers
|
||||
to the two procedures and a \fIclientData\fR value to be passed to those
|
||||
@@ -599,7 +590,7 @@ be placed. The procedure should translate the string to whatever
|
||||
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
|
||||
in translating the string to a value then it should return \fBTCL_ERROR\fR
|
||||
and store an error message in \fIinterp->result\fR.
|
||||
and store an error message in interpreter \fIinterp\fR's result.
|
||||
.PP
|
||||
The \fIprintProc\fR procedure is called
|
||||
by \fBTk_ConfigureInfo\fR to produce a string value describing an
|
||||
@@ -622,7 +613,6 @@ Tk_CustomOption structure has been created for them, options of this
|
||||
new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR
|
||||
fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point
|
||||
to the Tk_CustomOption structure.
|
||||
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
Although the explanation of \fBTk_ConfigureWidget\fR is fairly
|
||||
@@ -633,10 +623,8 @@ The library implementation of frames
|
||||
(tkFrame.c) has a simple configuration table, and the library
|
||||
implementation of buttons (tkButton.c) has a much more complex
|
||||
table that uses many of the fancy \fIspecFlags\fR mechanisms.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tk_SetOptions(3)
|
||||
|
||||
.SH KEYWORDS
|
||||
anchor, bitmap, boolean, border, cap style, color, configuration options,
|
||||
cursor, custom, double, font, integer, join style, justify, millimeters,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -25,7 +25,6 @@ Y-coordinate (in root window coordinates).
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window that identifies application.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CoordsToWindow\fR locates the window that contains a given point.
|
||||
@@ -44,6 +43,5 @@ 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
|
||||
both contain the point then the highest one in the stacking order
|
||||
(i.e. the one that's visible on the screen) gets preference.
|
||||
|
||||
.SH KEYWORDS
|
||||
containing, coordinates, root window
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -20,10 +20,8 @@ Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate proced
|
||||
.AP Tk_ClientMessageProc *proc in
|
||||
Procedure to invoke whenever a ClientMessage X event occurs on any display.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
|
||||
\fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked
|
||||
in the future whenever a ClientMessage X event occurs that is not handled by
|
||||
\fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use
|
||||
@@ -33,15 +31,15 @@ drop applications.
|
||||
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
|
||||
this mechanism only works in programs that dispatch events
|
||||
through \fBTk_HandleEvent\fR (or through other Tk procedures that
|
||||
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
|
||||
call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or
|
||||
\fBTk_MainLoop\fR).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_ClientMessageProc\fR:
|
||||
.CS
|
||||
typedef int Tk_ClientMessageProc(
|
||||
Tk_Window \fItkwin\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
typedef int \fBTk_ClientMessageProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fItkwin\fR parameter to \fIproc\fR is the Tk window which is
|
||||
associated with this event. \fIEventPtr\fR is a pointer to the X event.
|
||||
@@ -62,6 +60,5 @@ finds that matches the \fIproc\fR argument. If no such handler exists,
|
||||
then \fBTk_DeleteClientMessageHandler\fR returns without doing anything.
|
||||
Although Tk supports it, it's probably a bad idea to have more than one
|
||||
callback with the same \fIproc\fR argument.
|
||||
|
||||
.SH KEYWORDS
|
||||
bind, callback, event, handler
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -72,9 +72,9 @@ made when the handler was active (see below for more information).
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
following type:
|
||||
.CS
|
||||
typedef int Tk_ErrorProc(
|
||||
ClientData \fIclientData\fR,
|
||||
XErrorEvent *\fIerrEventPtr\fR);
|
||||
typedef int \fBTk_ErrorProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
XErrorEvent *\fIerrEventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
argument given to \fBTcl_CreateErrorHandler\fR when the callback
|
||||
@@ -136,6 +136,5 @@ handlers deleted before the \fBXSync\fR call.
|
||||
For the Tk error handling mechanism to work properly, it is essential
|
||||
that application code never calls \fBXSetErrorHandler\fR directly;
|
||||
applications should use only \fBTk_CreateErrorHandler\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
callback, error, event, handler
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -24,7 +24,6 @@ Procedure to invoke whenever any X event occurs on any display.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be
|
||||
@@ -39,15 +38,15 @@ use with Tk, and so on.
|
||||
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
|
||||
this mechanism only works in programs that dispatch events
|
||||
through \fBTk_HandleEvent\fR (or through other Tk procedures that
|
||||
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
|
||||
call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or
|
||||
\fBTk_MainLoop\fR).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_GenericProc\fR:
|
||||
.CS
|
||||
typedef int Tk_GenericProc(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
typedef int \fBTk_GenericProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
argument given to \fBTk_CreateGenericHandler\fR when the callback
|
||||
|
||||
135
doc/CrtImgType.3
135
doc/CrtImgType.3
@@ -4,12 +4,12 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
|
||||
Tk_CreateImageType, Tk_GetImageMasterData, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
@@ -19,13 +19,19 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind o
|
||||
ClientData
|
||||
\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
|
||||
.sp
|
||||
.VS "TIP 581"
|
||||
ClientData
|
||||
\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR)
|
||||
.VE "TIP 581"
|
||||
.sp
|
||||
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ImageType *typePtrPtr
|
||||
.AP Tk_ImageType *typePtr in
|
||||
.AS "const Tk_ImageType" *typePtrPtr
|
||||
.AP "const Tk_ImageType" *typePtr in
|
||||
Structure that defines the new type of image.
|
||||
Must be static: a
|
||||
For Tk 8.4 and earlier this must be static: a
|
||||
pointer to this structure is retained by the image code.
|
||||
In Tk 8.5, this limitation was relaxed.
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which image was created.
|
||||
.AP "const char" *name in
|
||||
@@ -38,7 +44,6 @@ Number of arguments
|
||||
.AP char ***argvPtr in/out
|
||||
Pointer to argument list
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateImageType\fR is invoked to define a new kind of image.
|
||||
@@ -59,19 +64,19 @@ the name of the image type and pointers to five procedures provided
|
||||
by the image manager to deal with images of this type:
|
||||
.CS
|
||||
typedef struct Tk_ImageType {
|
||||
char *\fIname\fR;
|
||||
const char *\fIname\fR;
|
||||
Tk_ImageCreateProc *\fIcreateProc\fR;
|
||||
Tk_ImageGetProc *\fIgetProc\fR;
|
||||
Tk_ImageDisplayProc *\fIdisplayProc\fR;
|
||||
Tk_ImageFreeProc *\fIfreeProc\fR;
|
||||
Tk_ImageDeleteProc *\fIdeleteProc\fR;
|
||||
} Tk_ImageType;
|
||||
} \fBTk_ImageType\fR;
|
||||
.CE
|
||||
The fields of this structure will be described in later subsections
|
||||
of this entry.
|
||||
.PP
|
||||
The second major data structure manipulated by an image manager
|
||||
is called an \fIimage master\fR; it contains overall information
|
||||
is called an \fIimage model\fR; it contains overall information
|
||||
about a particular image, such as the values of the configuration
|
||||
options specified in an \fBimage create\fR command.
|
||||
There will usually be one of these structures for each
|
||||
@@ -92,7 +97,6 @@ option specified for a widget or canvas item.
|
||||
.PP
|
||||
The following subsections describe the fields of a Tk_ImageType
|
||||
in more detail.
|
||||
|
||||
.SS NAME
|
||||
.PP
|
||||
\fItypePtr->name\fR provides a name for the image type.
|
||||
@@ -101,21 +105,21 @@ in \fBimage create\fR commands to create images of the new
|
||||
type.
|
||||
If there already existed an image type by this name then
|
||||
the new image type replaces the old one.
|
||||
|
||||
.SS CREATEPROC
|
||||
.PP
|
||||
\fItypePtr->createProc\fR provides the address of a procedure for
|
||||
Tk to call whenever \fBimage create\fR is invoked to create
|
||||
an image of the new type.
|
||||
\fItypePtr->createProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageCreateProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIname\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[],
|
||||
Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImaster\fR,
|
||||
ClientData *\fImasterDataPtr\fR);
|
||||
typedef int \fBTk_ImageCreateProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIname\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[],
|
||||
const Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImodel\fR,
|
||||
ClientData *\fImodelDataPtr\fR);
|
||||
.CE
|
||||
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,
|
||||
@@ -124,15 +128,15 @@ or generated automatically by the \fBimage\fR command.
|
||||
The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration
|
||||
options for the new image (everything after the name argument to
|
||||
\fBimage\fR).
|
||||
The \fImaster\fR argument is a token that refers to Tk's information
|
||||
The \fImodel\fR argument is a token that refers to Tk's information
|
||||
about this image; the image manager must return this token to
|
||||
Tk when invoking the \fBTk_ImageChanged\fR procedure.
|
||||
Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR
|
||||
and create an image master data structure for the new image.
|
||||
and create an image model data structure for the new image.
|
||||
\fIcreateProc\fR may store an arbitrary one-word value at
|
||||
*\fImasterDataPtr\fR, which will be passed back to the
|
||||
*\fImodelDataPtr\fR, which will be passed back to the
|
||||
image manager when other callbacks are invoked.
|
||||
Typically the value is a pointer to the master data
|
||||
Typically the value is a pointer to the model data
|
||||
structure for the image.
|
||||
.PP
|
||||
If \fIcreateProc\fR encounters an error, it should leave an error
|
||||
@@ -141,20 +145,19 @@ it should return \fBTCL_OK\fR.
|
||||
.PP
|
||||
\fIcreateProc\fR should call \fBTk_ImageChanged\fR in order to set the
|
||||
size of the image and request an initial redisplay.
|
||||
|
||||
.SS GETPROC
|
||||
.PP
|
||||
\fItypePtr->getProc\fR is invoked by Tk whenever a widget
|
||||
calls \fBTk_GetImage\fR to use a particular image.
|
||||
This procedure must match the following prototype:
|
||||
.CS
|
||||
typedef ClientData Tk_ImageGetProc(
|
||||
Tk_Window \fItkwin\fR,
|
||||
ClientData \fImasterData\fR);
|
||||
typedef ClientData \fBTk_ImageGetProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
ClientData \fImodelData\fR);
|
||||
.CE
|
||||
The \fItkwin\fR argument identifies the window in which the
|
||||
image will be used and \fImasterData\fR is the value
|
||||
returned by \fIcreateProc\fR when the image master was created.
|
||||
image will be used and \fImodelData\fR is the value
|
||||
returned by \fIcreateProc\fR when the image model was created.
|
||||
\fIgetProc\fR will usually create a data structure for the new
|
||||
instance, including such things as the resources needed to
|
||||
display the image in the given window.
|
||||
@@ -162,23 +165,22 @@ display the image in the given window.
|
||||
is typically the address of the instance data structure.
|
||||
Tk will pass this value back to the image manager when invoking
|
||||
its \fIdisplayProc\fR and \fIfreeProc\fR procedures.
|
||||
|
||||
.SS DISPLAYPROC
|
||||
.PP
|
||||
\fItypePtr->displayProc\fR is invoked by Tk whenever an image needs
|
||||
to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR).
|
||||
\fIdisplayProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void Tk_ImageDisplayProc(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Display *\fIdisplay\fR,
|
||||
Drawable \fIdrawable\fR,
|
||||
int \fIimageX\fR,
|
||||
int \fIimageY\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR,
|
||||
int \fIdrawableX\fR,
|
||||
int \fIdrawableY\fR);
|
||||
typedef void \fBTk_ImageDisplayProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Display *\fIdisplay\fR,
|
||||
Drawable \fIdrawable\fR,
|
||||
int \fIimageX\fR,
|
||||
int \fIimageY\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR,
|
||||
int \fIdrawableX\fR,
|
||||
int \fIdrawableY\fR);
|
||||
.CE
|
||||
The \fIinstanceData\fR will be the same as the value returned by
|
||||
\fIgetProc\fR when the instance was created.
|
||||
@@ -195,7 +197,6 @@ as specified in the most recent call to \fBTk_ImageChanged\fR.
|
||||
the image should be displayed; \fIdisplayProc\fR should display
|
||||
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.
|
||||
|
||||
.SS FREEPROC
|
||||
.PP
|
||||
\fItypePtr->freeProc\fR contains the address of a procedure that
|
||||
@@ -206,16 +207,15 @@ in a canvas is deleted, or when the image displayed in a widget or
|
||||
canvas item is changed.
|
||||
\fIfreeProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void Tk_ImageFreeProc(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Display *\fIdisplay\fR);
|
||||
typedef void \fBTk_ImageFreeProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Display *\fIdisplay\fR);
|
||||
.CE
|
||||
The \fIinstanceData\fR will be the same as the value returned by
|
||||
\fIgetProc\fR when the instance was created, and \fIdisplay\fR
|
||||
is the display containing the window for the instance.
|
||||
\fIfreeProc\fR should release any resources associated with the
|
||||
image instance, since the instance will never be used again.
|
||||
|
||||
.SS DELETEPROC
|
||||
.PP
|
||||
\fItypePtr->deleteProc\fR is a procedure that Tk invokes when an
|
||||
@@ -225,41 +225,44 @@ Before invoking \fIdeleteProc\fR Tk will invoke \fIfreeProc\fR for
|
||||
each of the image's instances.
|
||||
\fIdeleteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef void Tk_ImageDeleteProc(
|
||||
ClientData \fImasterData\fR);
|
||||
typedef void \fBTk_ImageDeleteProc\fR(
|
||||
ClientData \fImodelData\fR);
|
||||
.CE
|
||||
The \fImasterData\fR argument will be the same as the value
|
||||
stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the
|
||||
The \fImodelData\fR argument will be the same as the value
|
||||
stored in \fI*modelDataPtr\fR by \fIcreateProc\fR when the
|
||||
image was created.
|
||||
\fIdeleteProc\fR should release any resources associated with
|
||||
the image.
|
||||
|
||||
.SH TK_GETIMAGEMASTERDATA
|
||||
.SH TK_GETIMAGEMODELDATA
|
||||
.PP
|
||||
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
|
||||
information about an image. For example, an image manager can use this
|
||||
procedure to locate its image master data for an image.
|
||||
procedure to locate its image model data for an image.
|
||||
If there exists an image named \fIname\fR
|
||||
in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is
|
||||
filled in with type information for the image (the \fItypePtr\fR value
|
||||
passed to \fBTk_CreateImageType\fR when the image type was registered)
|
||||
and the return value is the ClientData value returned by the
|
||||
\fIcreateProc\fR when the image was created (this is typically a
|
||||
pointer to the image master data structure). If no such image exists
|
||||
pointer to the image model data structure). If no such image exists
|
||||
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"
|
||||
.PP
|
||||
In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
|
||||
was incompatibly different, with the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageCreateProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIname\fR,
|
||||
int \fIargc\fR,
|
||||
char **\fIargv\fR,
|
||||
Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImaster\fR,
|
||||
ClientData *\fImasterDataPtr\fR);
|
||||
typedef int \fBTk_ImageCreateProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIname\fR,
|
||||
int \fIargc\fR,
|
||||
char **\fIargv\fR,
|
||||
Tk_ImageType *\fItypePtr\fR,
|
||||
Tk_ImageMaster \fImodel\fR,
|
||||
ClientData *\fImodelDataPtr\fR);
|
||||
.CE
|
||||
Legacy programs and libraries dating from those days may still
|
||||
contain code that defines extended Tk image types using the old
|
||||
@@ -267,6 +270,10 @@ interface. The Tk header file will still support this legacy
|
||||
interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
|
||||
defined.
|
||||
.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
|
||||
see the routine \fBTk_InitImageArgs\fR in use. This was a migration
|
||||
tool used to create stub-enabled extensions that could be loaded
|
||||
@@ -283,9 +290,7 @@ use Tk 8.4 headers and stub libraries to do so.
|
||||
.PP
|
||||
Any new code written today should not make use of the legacy
|
||||
interfaces. Expect their support to go away in Tk 9.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
|
||||
|
||||
.SH KEYWORDS
|
||||
image manager, image type, instance, master
|
||||
image manager, image type, instance, model
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -44,7 +44,7 @@ NULL \fInextPtr\fR.
|
||||
.PP
|
||||
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
|
||||
bitmap (file tkCanvBmap.c) or text (tkCanvText.c).
|
||||
bitmap (in the file tkCanvBmap.c) or text (tkCanvText.c).
|
||||
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.
|
||||
.PP
|
||||
@@ -60,12 +60,13 @@ structures.
|
||||
The first data structure is a Tk_ItemType; it contains
|
||||
information such as the name of the type and pointers to
|
||||
the standard procedures implemented by the type manager:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tk_ItemType {
|
||||
char *\fIname\fR;
|
||||
const char *\fIname\fR;
|
||||
int \fIitemSize\fR;
|
||||
Tk_ItemCreateProc *\fIcreateProc\fR;
|
||||
Tk_ConfigSpec *\fIconfigSpecs\fR;
|
||||
const Tk_ConfigSpec *\fIconfigSpecs\fR;
|
||||
Tk_ItemConfigureProc *\fIconfigProc\fR;
|
||||
Tk_ItemCoordProc *\fIcoordProc\fR;
|
||||
Tk_ItemDeleteProc *\fIdeleteProc\fR;
|
||||
@@ -82,7 +83,7 @@ typedef struct Tk_ItemType {
|
||||
Tk_ItemInsertProc *\fIinsertProc\fR;
|
||||
Tk_ItemDCharsProc *\fIdCharsProc\fR;
|
||||
Tk_ItemType *\fInextPtr\fR;
|
||||
} Tk_ItemType;
|
||||
} \fBTk_ItemType\fR;
|
||||
.CE
|
||||
.PP
|
||||
The fields of a Tk_ItemType structure are described in more detail
|
||||
@@ -92,7 +93,7 @@ argument must point to a structure with all of the fields initialized
|
||||
except \fInextPtr\fR, which Tk sets to link all the types together
|
||||
into a list.
|
||||
The structure must be in permanent memory (either statically
|
||||
allocated or dynamically allocated but never freed); Tk retains
|
||||
allocated or dynamically allocated but never freed); Tk retains
|
||||
a pointer to this structure.
|
||||
.PP
|
||||
The second data structure manipulated by a type manager is an
|
||||
@@ -102,11 +103,12 @@ All of the items of a given type generally have item records with
|
||||
the same structure, but different types usually have different
|
||||
formats for their item records.
|
||||
The first part of each item record is a header with a standard structure
|
||||
defined by Tk via the type Tk_Item; the rest of the item
|
||||
defined by Tk via the type Tk_Item; the rest of the item
|
||||
record is defined by the type manager.
|
||||
A type manager must define its item records with a Tk_Item as
|
||||
the first field.
|
||||
For example, the item record for bitmap items is defined as follows:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct BitmapItem {
|
||||
Tk_Item \fIheader\fR;
|
||||
@@ -116,8 +118,9 @@ typedef struct BitmapItem {
|
||||
XColor *\fIfgColor\fR;
|
||||
XColor *\fIbgColor\fR;
|
||||
GC \fIgc\fR;
|
||||
} BitmapItem;
|
||||
} \fBBitmapItem\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fIheader\fR substructure contains information used by Tk
|
||||
to manage the item, such as its identifier, its tags, its type,
|
||||
and its bounding box.
|
||||
@@ -127,7 +130,7 @@ The type manager should not need to read or write any of the
|
||||
fields in the header except for four fields
|
||||
whose names are \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
|
||||
These fields give a bounding box for the items using integer
|
||||
canvas coordinates: the item should not cover any pixels
|
||||
canvas coordinates: the item should not cover any pixels
|
||||
with x-coordinate lower than \fIx1\fR or y-coordinate
|
||||
lower than \fIy1\fR, nor should it cover any pixels with
|
||||
x-coordinate greater than or equal to \fIx2\fR or y-coordinate
|
||||
@@ -137,12 +140,12 @@ date as the item is moved and reconfigured.
|
||||
.PP
|
||||
Whenever Tk calls a procedure in a type manager it passes in a pointer
|
||||
to an item record.
|
||||
The argument is always passed as a pointer to a Tk_Item; the type
|
||||
The argument is always passed as a pointer to a Tk_Item; the type
|
||||
manager will typically cast this into a pointer to its own specific
|
||||
type, such as BitmapItem.
|
||||
.PP
|
||||
The third data structure used by type managers has type
|
||||
Tk_Canvas; it serves as an opaque handle for the canvas widget
|
||||
Tk_Canvas; it serves as an opaque handle for the canvas widget
|
||||
as a whole.
|
||||
Type managers need not know anything about the contents of this
|
||||
structure.
|
||||
@@ -150,6 +153,7 @@ A Tk_Canvas handle is typically passed in to the
|
||||
procedures of a type manager, and the type manager can pass the
|
||||
handle back to library procedures such as Tk_CanvasTkwin
|
||||
to fetch information about the canvas.
|
||||
.SH "TK_ITEMTYPE FIELDS"
|
||||
.SS NAME
|
||||
.PP
|
||||
This section and the ones that follow describe each of the fields
|
||||
@@ -160,8 +164,37 @@ in \fBcreate\fR widget commands to create items of the new
|
||||
type.
|
||||
If there already existed an item type by this name then
|
||||
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
|
||||
\fItypePtr->itemSize\fR gives the size in bytes of item records
|
||||
.PP
|
||||
\fItypePtr\->itemSize\fR gives the size in bytes of item records
|
||||
of this type, including the Tk_Item header.
|
||||
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.
|
||||
@@ -170,31 +203,38 @@ 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.
|
||||
.SS CREATEPROC
|
||||
.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.
|
||||
\fItypePtr->createProc\fR must match the following prototype:
|
||||
\fItypePtr\->createProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemCreateProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj* const \fIobjv\fR[]);
|
||||
typedef int \fBTk_ItemCreateProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR argument is the interpreter in which the canvas's
|
||||
\fBcreate\fR widget command was invoked, and \fIcanvas\fR is a
|
||||
handle for the canvas widget.
|
||||
\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
|
||||
\fBsizeof(Tk_ItemType)\fR bytes).
|
||||
The \fIobjc\fR and \fIobjv\fR arguments describe all of the
|
||||
arguments to the \fBcreate\fR command after the \fItype\fR
|
||||
argument.
|
||||
For example, in the widget command
|
||||
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, in the widget command:
|
||||
.PP
|
||||
.CS
|
||||
\fB\&.c create rectangle 10 20 50 50 \-fill black\fR
|
||||
.CE
|
||||
.PP
|
||||
\fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the
|
||||
integer object \fB10\fR.
|
||||
.PP
|
||||
@@ -202,7 +242,7 @@ integer object \fB10\fR.
|
||||
the type-specific parts of the item record and set an initial value
|
||||
for the bounding box in the item's header.
|
||||
It should return a standard Tcl completion code and leave an
|
||||
error message in \fIinterp->result\fR if an error occurs.
|
||||
error message in the interpreter result if an error occurs.
|
||||
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
|
||||
(e.g., it must free any additional memory that it allocated for
|
||||
@@ -212,70 +252,84 @@ the item).
|
||||
Each type manager must provide a standard table describing its
|
||||
configuration options, in a form suitable for use with
|
||||
\fBTk_ConfigureWidget\fR.
|
||||
This table will normally be used by \fItypePtr->createProc\fR
|
||||
and \fItypePtr->configProc\fR, but Tk also uses it directly
|
||||
This table will normally be used by \fItypePtr\->createProc\fR
|
||||
and \fItypePtr\->configProc\fR, but Tk also uses it directly
|
||||
to retrieve option information in the \fBitemcget\fR and
|
||||
\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.
|
||||
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.
|
||||
.SS CONFIGPROC
|
||||
.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
|
||||
configuration options for a canvas item.
|
||||
This procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemConfigureProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj* const \fIobjv\fR[],
|
||||
int \fIflags\fR);
|
||||
typedef int \fBTk_ItemConfigureProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[],
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
The \fIinterp\fR objument identifies the interpreter in which the
|
||||
widget command was invoked, \fIcanvas\fR is a handle for the canvas
|
||||
.PP
|
||||
The \fIinterp\fR argument identifies the interpreter in which the
|
||||
widget command was invoked, \fIcanvas\fR is a handle for the canvas
|
||||
widget, and \fIitemPtr\fR is a pointer to the item being configured.
|
||||
\fIobjc\fR and \fIobjv\fR contain the configuration options. For
|
||||
example, if the following command is invoked:
|
||||
\fIobjc\fR and \fIobjv\fR contain the configuration options.
|
||||
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 command is invoked:
|
||||
.PP
|
||||
.CS
|
||||
\fB\&.c itemconfigure 2 \-fill red \-outline black\fR
|
||||
.CE
|
||||
.PP
|
||||
\fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR
|
||||
through \fBblack\fR.
|
||||
\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
|
||||
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.
|
||||
.PP
|
||||
\fItypePtr->configProc\fR returns a standard Tcl completion code and
|
||||
leaves an error message in \fIinterp->result\fR if an error occurs.
|
||||
\fItypePtr\->configProc\fR returns a standard Tcl completion code and
|
||||
leaves an error message in the interpreter result if an error occurs.
|
||||
It must update the item's bounding box to reflect the new configuration
|
||||
options.
|
||||
.SS COORDPROC
|
||||
.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.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemCoordProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj* const \fIobjv\fR[]);
|
||||
typedef int \fBTk_ItemCoordProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
.CE
|
||||
.PP
|
||||
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
|
||||
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
|
||||
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:
|
||||
.PP
|
||||
.CS
|
||||
\fB\&.c coords 2 30 90\fR
|
||||
.CE
|
||||
.PP
|
||||
\fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects
|
||||
\fB30\fR and \fB90\fR.
|
||||
.PP
|
||||
@@ -284,41 +338,45 @@ update the item appropriately (e.g., it must reset the bounding
|
||||
box in the item's header), and return a standard Tcl completion
|
||||
code.
|
||||
If an error occurs, \fIcoordProc\fR must leave an error message in
|
||||
\fIinterp->result\fR.
|
||||
the interpreter result.
|
||||
.SS DELETEPROC
|
||||
.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.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemDeleteProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Display *\fIdisplay\fR);
|
||||
typedef void \fBTk_ItemDeleteProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Display *\fIdisplay\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual
|
||||
interpretations, and \fIdisplay\fR identifies the X display containing
|
||||
the canvas.
|
||||
\fIdeleteProc\fR must free up any resources allocated for the item,
|
||||
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.
|
||||
.SS "DISPLAYPROC AND ALWAYSREDRAW"
|
||||
.SS "DISPLAYPROC"
|
||||
.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.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemDisplayProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Display *\fIdisplay\fR,
|
||||
Drawable \fIdst\fR,
|
||||
int \fIx\fR,
|
||||
int \fIy\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR);
|
||||
typedef void \fBTk_ItemDisplayProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Display *\fIdisplay\fR,
|
||||
Drawable \fIdst\fR,
|
||||
int \fIx\fR,
|
||||
int \fIy\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
|
||||
\fIdisplay\fR identifies the display containing the canvas, and
|
||||
\fIdst\fR specifies a drawable in which the item should be rendered;
|
||||
@@ -340,25 +398,28 @@ of \fIdst\fR.
|
||||
.PP
|
||||
Normally an item's \fIdisplayProc\fR is only invoked if the item
|
||||
overlaps the area being displayed.
|
||||
However, if \fItypePtr->alwaysRedraw\fR has a non-zero value, then
|
||||
\fIdisplayProc\fR is invoked during every redisplay operation,
|
||||
even if the item does not overlap the area of redisplay.
|
||||
\fIalwaysRedraw\fR should normally be set to 0; it is only
|
||||
set to 1 in special cases such as window items that need to be
|
||||
unmapped when they are off-screen.
|
||||
However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1,
|
||||
(i.e.\|
|
||||
.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" )
|
||||
then \fIdisplayProc\fR is invoked during every redisplay operation,
|
||||
even if the item does not overlap the area of redisplay; this is useful for
|
||||
cases such as window items, where the subwindow needs to be unmapped when it
|
||||
is off the screen.
|
||||
.SS POINTPROC
|
||||
.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.
|
||||
Tk uses this procedure for purposes such as locating the item
|
||||
under the mouse or finding the closest item to a given point.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef double Tk_ItemPointProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double *\fIpointPtr\fR);
|
||||
typedef double \fBTk_ItemPointProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double *\fIpointPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
|
||||
\fIpointPtr\fR points to an array of two numbers giving
|
||||
the x and y coordinates of a point.
|
||||
@@ -367,15 +428,17 @@ from the point to the item, or 0 if the point lies inside
|
||||
the item.
|
||||
.SS AREAPROC
|
||||
.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.
|
||||
It must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemAreaProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double *\fIrectPtr\fR);
|
||||
typedef int \fBTk_ItemAreaProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double *\fIrectPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
|
||||
\fIrectPtr\fR points to an array of four real numbers;
|
||||
the first two give the x and y coordinates of the upper left
|
||||
@@ -386,26 +449,28 @@ the given area, 0 if it lies partially inside and partially
|
||||
outside the area, and 1 if it lies entirely inside the area.
|
||||
.SS POSTSCRIPTPROC
|
||||
.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.
|
||||
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:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemPostscriptProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIprepass\fR);
|
||||
typedef int \fBTk_ItemPostscriptProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIprepass\fR);
|
||||
.CE
|
||||
.PP
|
||||
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
|
||||
Postscript for the item to the information in \fIinterp->result\fR
|
||||
Postscript for the item to the information in the interpreter result
|
||||
(e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR)
|
||||
and return \fBTCL_OK\fR.
|
||||
If an error occurs, \fIpostscriptProc\fR should clear the result
|
||||
and replace its contents with an error message; then it should
|
||||
and replace its contents with an error message; then it should
|
||||
return \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
Tk provides a collection of utility procedures to simplify
|
||||
@@ -427,26 +492,29 @@ In order to generate Postscript that complies with the Adobe Document
|
||||
Structuring Conventions, Tk actually generates Postscript in two passes.
|
||||
It calls each item's \fIpostscriptProc\fR in each pass.
|
||||
The only purpose of the first pass is to collect font information
|
||||
(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
|
||||
(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
|
||||
discarded.
|
||||
Tk sets the \fIprepass\fR argument to \fIpostscriptProc\fR to 1
|
||||
during the first pass; the type manager can use \fIprepass\fR to skip
|
||||
during the first pass; the type manager can use \fIprepass\fR to skip
|
||||
all Postscript generation except for calls to \fBTk_CanvasPsFont\fR.
|
||||
During the second pass \fIprepass\fR will be 0, so the type manager
|
||||
must generate complete Postscript.
|
||||
.SS SCALEPROC
|
||||
\fItypePtr->scaleProc\fR is invoked by Tk to rescale a canvas item
|
||||
.PP
|
||||
\fItypePtr\->scaleProc\fR is invoked by Tk to rescale a canvas item
|
||||
during the \fBscale\fR widget command.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemScaleProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double \fIoriginX\fR,
|
||||
double \fIoriginY\fR,
|
||||
double \fIscaleX\fR,
|
||||
double \fIscaleY\fR);
|
||||
typedef void \fBTk_ItemScaleProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double \fIoriginX\fR,
|
||||
double \fIoriginY\fR,
|
||||
double \fIscaleX\fR,
|
||||
double \fIscaleY\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
|
||||
\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
|
||||
@@ -454,146 +522,171 @@ x and y scale factors.
|
||||
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
|
||||
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
|
||||
.PP
|
||||
.CS
|
||||
\fIx\(fm = originX + scaleX*(x-originX)
|
||||
y\(fm = originY + scaleY*(y-originY)\fR
|
||||
\fIx\(fm\fR = \fIoriginX\fR + \fIscaleX\fR \(mu (\fIx\fR \(mi \fIoriginX\fR)
|
||||
\fIy\(fm\fR = \fIoriginY\fR + \fIscaleY\fR \(mu (\fIy\fR \(mi \fIoriginY\fR)
|
||||
.CE
|
||||
.PP
|
||||
\fIscaleProc\fR must also update the bounding box in the item's
|
||||
header.
|
||||
.SS TRANSLATEPROC
|
||||
\fItypePtr->translateProc\fR is invoked by Tk to translate a canvas item
|
||||
.PP
|
||||
\fItypePtr\->translateProc\fR is invoked by Tk to translate a canvas item
|
||||
during the \fBmove\fR widget command.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemTranslateProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double \fIdeltaX\fR,
|
||||
double \fIdeltaY\fR);
|
||||
typedef void \fBTk_ItemTranslateProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
double \fIdeltaX\fR,
|
||||
double \fIdeltaY\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning,
|
||||
and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be
|
||||
added to each x and y coordinate within the item.
|
||||
The type manager should adjust the item's coordinates and
|
||||
update the bounding box in the item's header.
|
||||
.SS INDEXPROC
|
||||
\fItypePtr->indexProc\fR is invoked by Tk to translate a string
|
||||
.PP
|
||||
\fItypePtr\->indexProc\fR is invoked by Tk to translate a string
|
||||
index specification into a numerical index, for example during the
|
||||
\fBindex\fR widget command.
|
||||
It is only relevant for item types that support indexable text;
|
||||
\fItypePtr->indexProc\fR may be specified as NULL for non-textual
|
||||
item types.
|
||||
It is only relevant for item types that support indexable text or coordinates;
|
||||
\fItypePtr\->indexProc\fR may be specified as NULL for non-textual
|
||||
item types if they do not support detailed coordinate addressing.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemIndexProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
char \fIindexString\fR,
|
||||
int *\fIindexPtr\fR);
|
||||
typedef int \fBTk_ItemIndexProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
Tcl_Obj *\fIindexObj\fR,
|
||||
int *\fIindexPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all
|
||||
have the usual meaning.
|
||||
\fIindexString\fR contains a textual description of an index,
|
||||
\fIindexObj\fR contains a textual description of an index,
|
||||
and \fIindexPtr\fR points to an integer value that should be
|
||||
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
|
||||
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
|
||||
are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
|
||||
\fBend\fR, etc.).
|
||||
\fIindexProc\fR should return a Tcl completion code and set
|
||||
\fIinterp->result\fR in the event of an error.
|
||||
the interpreter result in the event of an error.
|
||||
.SS ICURSORPROC
|
||||
.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
|
||||
insertion cursor in a textual item.
|
||||
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.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemCursorProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIindex\fR);
|
||||
typedef void \fBTk_ItemCursorProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIindex\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and
|
||||
\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
|
||||
item just before the character given by \fIindex\fR.
|
||||
Whether or not to actually display the insertion cursor is
|
||||
determined by other information provided by \fBTk_CanvasGetTextInfo\fR.
|
||||
.SS SELECTIONPROC
|
||||
.PP
|
||||
\fItypePtr->selectionProc\fR is invoked by Tk during selection
|
||||
retrievals; it must return part or all of the selected text in
|
||||
\fItypePtr\->selectionProc\fR is invoked by Tk during selection
|
||||
retrievals; it must return part or all of the selected text in
|
||||
the item (if any).
|
||||
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.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_ItemSelectionProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIoffset\fR,
|
||||
char *\fIbuffer\fR,
|
||||
int \fImaxBytes\fR);
|
||||
typedef int \fBTk_ItemSelectionProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIoffset\fR,
|
||||
char *\fIbuffer\fR,
|
||||
int \fImaxBytes\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
|
||||
\fIoffset\fR is an offset in bytes into the selection where 0 refers
|
||||
to the first byte of the selection; it identifies
|
||||
to the first byte of the selection; it identifies
|
||||
the first character that is to be returned in this call.
|
||||
\fIbuffer\fR points to an area of memory in which to store the
|
||||
requested bytes, and \fImaxBytes\fR specifies the maximum number
|
||||
of bytes to return.
|
||||
\fIselectionProc\fR should extract up to \fImaxBytes\fR characters
|
||||
from the selection and copy them to \fImaxBytes\fR; it should
|
||||
from the selection and copy them to \fImaxBytes\fR; it should
|
||||
return a count of the number of bytes actually copied, which may
|
||||
be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
|
||||
in the selection.
|
||||
.SS INSERTPROC
|
||||
.PP
|
||||
\fItypePtr->insertProc\fR is invoked by Tk during
|
||||
the \fBinsert\fR widget command to insert new text into a
|
||||
\fItypePtr\->insertProc\fR is invoked by Tk during
|
||||
the \fBinsert\fR widget command to insert new text or coordinates into a
|
||||
canvas item.
|
||||
It is only relevant for item types that support text;
|
||||
\fItypePtr->insertProc\fR may be specified as NULL for non-textual
|
||||
It is only relevant for item types that support the \fBinsert\fR method;
|
||||
\fItypePtr\->insertProc\fR may be specified as NULL for other
|
||||
item types.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemInsertProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIindex\fR,
|
||||
char *\fIstring\fR);
|
||||
typedef void \fBTk_ItemInsertProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIindex\fR,
|
||||
Tcl_Obj *\fIobj\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
|
||||
\fIindex\fR is an index into the item's text, as returned by a
|
||||
previous call to \fItypePtr->insertProc\fR, and \fIstring\fR
|
||||
previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR
|
||||
contains new text to insert just before the character given
|
||||
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
|
||||
box in the item's header.
|
||||
.SS DCHARSPROC
|
||||
.PP
|
||||
\fItypePtr->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
|
||||
widget command to delete a range of text from a canvas item.
|
||||
\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
|
||||
coordinates from a pathed item.
|
||||
It is only relevant for item types that support text;
|
||||
\fItypePtr->dCharsProc\fR may be specified as NULL for non-textual
|
||||
item types.
|
||||
\fItypePtr\->dCharsProc\fR may be specified as NULL for non-textual
|
||||
item types that do not want to support coordinate deletion.
|
||||
The procedure must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void Tk_ItemDCharsProc(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIfirst\fR,
|
||||
int \fIlast\fR);
|
||||
typedef void \fBTk_ItemDCharsProc\fR(
|
||||
Tk_Canvas \fIcanvas\fR,
|
||||
Tk_Item *\fIitemPtr\fR,
|
||||
int \fIfirst\fR,
|
||||
int \fIlast\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
|
||||
\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 bounding box in the item's header.
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
'\" Author: Paul Mackerras (paulus@cs.anu.edu.au),
|
||||
'\" Department of Computer Science,
|
||||
'\" Australian National University.
|
||||
@@ -20,11 +20,10 @@ Tk_CreatePhotoImageFormat \- define new file format for photo images
|
||||
.sp
|
||||
\fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_PhotoImageFormat *formatPtr
|
||||
.AP Tk_PhotoImageFormat *formatPtr in
|
||||
.AS "const Tk_PhotoImageFormat" *formatPtr
|
||||
.AP "const Tk_PhotoImageFormat" *formatPtr in
|
||||
Structure that defines the new file format.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreatePhotoImageFormat\fR is invoked to define a new file format
|
||||
@@ -46,14 +45,14 @@ handler to deal with files and strings in this format. The
|
||||
Tk_PhotoImageFormat structure contains the following fields:
|
||||
.CS
|
||||
typedef struct Tk_PhotoImageFormat {
|
||||
char *\fIname\fR;
|
||||
const char *\fIname\fR;
|
||||
Tk_ImageFileMatchProc *\fIfileMatchProc\fR;
|
||||
Tk_ImageStringMatchProc *\fIstringMatchProc\fR;
|
||||
Tk_ImageFileReadProc *\fIfileReadProc\fR;
|
||||
Tk_ImageStringReadProc *\fIstringReadProc\fR;
|
||||
Tk_ImageFileWriteProc *\fIfileWriteProc\fR;
|
||||
Tk_ImageStringWriteProc *\fIstringWriteProc\fR;
|
||||
} Tk_PhotoImageFormat;
|
||||
} \fBTk_PhotoImageFormat\fR;
|
||||
.CE
|
||||
.PP
|
||||
The handler need not provide implementations of all six procedures.
|
||||
@@ -65,8 +64,7 @@ structure should be set to NULL. The handler must provide the
|
||||
\fIfileMatchProc\fR procedure if it provides the \fIfileReadProc\fR
|
||||
procedure, and the \fIstringMatchProc\fR procedure if it provides the
|
||||
\fIstringReadProc\fR procedure.
|
||||
|
||||
.SH NAME
|
||||
.SS NAME
|
||||
.PP
|
||||
\fIformatPtr->name\fR provides a name for the image type.
|
||||
Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used
|
||||
@@ -77,20 +75,20 @@ the \fB\-format\fR option. The first character of \fIformatPtr->name\fR
|
||||
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
|
||||
only for legacy interface support (see below).
|
||||
|
||||
.SH FILEMATCHPROC
|
||||
.SS FILEMATCHPROC
|
||||
.PP
|
||||
\fIformatPtr->fileMatchProc\fR provides the address of a procedure for
|
||||
Tk to call when it is searching for an image file format handler
|
||||
suitable for reading data in a given file.
|
||||
\fIformatPtr->fileMatchProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageFileMatchProc(
|
||||
Tcl_Channel \fIchan\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
int *\fIwidthPtr\fR,
|
||||
int *\fIheightPtr\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
typedef int \fBTk_ImageFileMatchProc\fR(
|
||||
Tcl_Channel \fIchan\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
int *\fIwidthPtr\fR,
|
||||
int *\fIheightPtr\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
The \fIfileName\fR argument is the name of the file containing the
|
||||
image data, which is open for reading as \fIchan\fR. The
|
||||
@@ -100,19 +98,19 @@ If the data in the file appears to be in the format supported by this
|
||||
handler, the \fIformatPtr->fileMatchProc\fR procedure should store the
|
||||
width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR
|
||||
respectively, and return 1. Otherwise it should return 0.
|
||||
|
||||
.SH STRINGMATCHPROC
|
||||
.SS STRINGMATCHPROC
|
||||
.PP
|
||||
\fIformatPtr->stringMatchProc\fR provides the address of a procedure for
|
||||
Tk to call when it is searching for an image file format handler for
|
||||
suitable for reading data from a given string.
|
||||
\fIformatPtr->stringMatchProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageStringMatchProc(
|
||||
Tcl_Obj *\fIdata\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
int *\fIwidthPtr\fR,
|
||||
int *\fIheightPtr\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
typedef int \fBTk_ImageStringMatchProc\fR(
|
||||
Tcl_Obj *\fIdata\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
int *\fIwidthPtr\fR,
|
||||
int *\fIheightPtr\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
The \fIdata\fR argument points to the object containing the image
|
||||
data. The \fIformat\fR argument contains the value given for
|
||||
@@ -122,21 +120,21 @@ this handler, the \fIformatPtr->stringMatchProc\fR procedure should
|
||||
store the width and height of the image in *\fIwidthPtr\fR and
|
||||
*\fIheightPtr\fR respectively, and return 1. Otherwise it should
|
||||
return 0.
|
||||
|
||||
.SH FILEREADPROC
|
||||
.SS FILEREADPROC
|
||||
.PP
|
||||
\fIformatPtr->fileReadProc\fR provides the address of a procedure for
|
||||
Tk to call to read data from an image file into a photo image.
|
||||
\fIformatPtr->fileReadProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageFileReadProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Channel \fIchan\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
PhotoHandle \fIimageHandle\fR,
|
||||
int \fIdestX\fR, int \fIdestY\fR,
|
||||
int \fIwidth\fR, int \fIheight\fR,
|
||||
int \fIsrcX\fR, int \fIsrcY\fR);
|
||||
typedef int \fBTk_ImageFileReadProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Channel \fIchan\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
PhotoHandle \fIimageHandle\fR,
|
||||
int \fIdestX\fR, int \fIdestY\fR,
|
||||
int \fIwidth\fR, int \fIheight\fR,
|
||||
int \fIsrcX\fR, int \fIsrcY\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to read the image; it should be used for reporting errors.
|
||||
@@ -151,20 +149,20 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
|
||||
image with its top-left corner at coordinates
|
||||
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
|
||||
The return value is a standard Tcl return value.
|
||||
|
||||
.SH STRINGREADPROC
|
||||
.SS STRINGREADPROC
|
||||
.PP
|
||||
\fIformatPtr->stringReadProc\fR provides the address of a procedure for
|
||||
Tk to call to read data from a string into a photo image.
|
||||
\fIformatPtr->stringReadProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageStringReadProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Obj *\fIdata\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
PhotoHandle \fIimageHandle\fR,
|
||||
int \fIdestX\fR, int \fIdestY\fR,
|
||||
int \fIwidth\fR, int \fIheight\fR,
|
||||
int \fIsrcX\fR, int \fIsrcY\fR);
|
||||
typedef int \fBTk_ImageStringReadProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Obj *\fIdata\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
PhotoHandle \fIimageHandle\fR,
|
||||
int \fIdestX\fR, int \fIdestY\fR,
|
||||
int \fIwidth\fR, int \fIheight\fR,
|
||||
int \fIsrcX\fR, int \fIsrcY\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to read the image; it should be used for reporting errors.
|
||||
@@ -179,17 +177,17 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
|
||||
image with its top-left corner at coordinates
|
||||
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
|
||||
The return value is a standard Tcl return value.
|
||||
|
||||
.SH FILEWRITEPROC
|
||||
.SS FILEWRITEPROC
|
||||
.PP
|
||||
\fIformatPtr->fileWriteProc\fR provides the address of a procedure for
|
||||
Tk to call to write data from a photo image to a file.
|
||||
\fIformatPtr->fileWriteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageFileWriteProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
Tk_PhotoImageBlock *\fIblockPtr\fR);
|
||||
typedef int \fBTk_ImageFileWriteProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIfileName\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
Tk_PhotoImageBlock *\fIblockPtr\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to write the image; it should be used for reporting errors.
|
||||
@@ -204,16 +202,16 @@ after the name of the format. If appropriate, the
|
||||
\fIformatPtr->fileWriteProc\fR procedure may interpret these
|
||||
characters to specify further details about the image file.
|
||||
The return value is a standard Tcl return value.
|
||||
|
||||
.SH STRINGWRITEPROC
|
||||
.SS STRINGWRITEPROC
|
||||
.PP
|
||||
\fIformatPtr->stringWriteProc\fR provides the address of a procedure for
|
||||
Tk to call to translate image data from a photo image into a string.
|
||||
\fIformatPtr->stringWriteProc\fR must match the following prototype:
|
||||
.CS
|
||||
typedef int Tk_ImageStringWriteProc(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
Tk_PhotoImageBlock *\fIblockPtr\fR);
|
||||
typedef int \fBTk_ImageStringWriteProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Obj *\fIformat\fR,
|
||||
Tk_PhotoImageBlock *\fIblockPtr\fR);
|
||||
.CE
|
||||
The \fIinterp\fR argument is the interpreter in which the command was
|
||||
invoked to convert the image; it should be used for reporting errors.
|
||||
@@ -228,8 +226,8 @@ after the name of the format. If appropriate, the
|
||||
\fIformatPtr->stringWriteProc\fR procedure may interpret these
|
||||
characters to specify further details about the image file.
|
||||
The return value is a standard Tcl return value.
|
||||
|
||||
.SH "LEGACY INTERFACE SUPPORT"
|
||||
.PP
|
||||
In Tk 8.2 and earlier, the definition of all the function pointer
|
||||
types stored in fields of a \fBTk_PhotoImageFormat\fR struct were
|
||||
incompatibly different. Legacy programs and libraries dating from
|
||||
@@ -266,9 +264,7 @@ use Tk 8.4 headers and stub libraries to do so.
|
||||
.PP
|
||||
Any new code written today should not make use of the legacy
|
||||
interfaces. Expect their support to go away in Tk 9.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tk_FindPhoto, Tk_PhotoPutBlock
|
||||
|
||||
.SH KEYWORDS
|
||||
photo image, image file
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -44,7 +44,7 @@ requestor.
|
||||
\fBTk_CreateSelHandler\fR arranges for a particular procedure
|
||||
(\fIproc\fR) to be called whenever \fIselection\fR is owned by
|
||||
\fItkwin\fR and the selection contents are requested in the
|
||||
form given by \fItarget\fR.
|
||||
form given by \fItarget\fR.
|
||||
\fITarget\fR should be one of
|
||||
the entries defined in the left column of Table 2 of the
|
||||
X Inter-Client Communication Conventions Manual (ICCCM) or
|
||||
@@ -54,11 +54,11 @@ the selection. The most common form is STRING.
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_SelectionProc\fR:
|
||||
.CS
|
||||
typedef int Tk_SelectionProc(
|
||||
ClientData \fIclientData\fR,
|
||||
int \fIoffset\fR,
|
||||
char *\fIbuffer\fR,
|
||||
int \fImaxBytes\fR);
|
||||
typedef int \fBTk_SelectionProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
int \fIoffset\fR,
|
||||
char *\fIbuffer\fR,
|
||||
int \fImaxBytes\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the
|
||||
\fIclientData\fR argument given to \fBTk_CreateSelHandler\fR.
|
||||
@@ -112,6 +112,5 @@ existing handler is replaced with a new one.
|
||||
\fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR,
|
||||
\fIselection\fR, and \fItarget\fR, if such a handler exists.
|
||||
If there is no such handler then it has no effect.
|
||||
|
||||
.SH KEYWORDS
|
||||
format, handler, selection, target
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -52,14 +52,14 @@ Name of new window, specified as path name within application
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The procedures \fBTk_CreateWindow\fR,
|
||||
The procedures \fBTk_CreateWindow\fR,
|
||||
\fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR
|
||||
are used to create new windows for
|
||||
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
|
||||
library. If the window could not be created successfully, then NULL
|
||||
is returned and \fIinterp->result\fR is modified to hold an error
|
||||
message.
|
||||
is returned and the result of interpreter \fIinterp\fR is modified to
|
||||
hold an error message.
|
||||
.PP
|
||||
Tk supports two different kinds of windows: internal
|
||||
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.
|
||||
.PP
|
||||
\fBTk_CreateAnonymousWindow\fR differs from \fBTk_CreateWindow\fR in
|
||||
that it creates an unnamed window. This window will be manipulable
|
||||
that it creates an unnamed window. This window will be manipulatable
|
||||
only using C interfaces, and will not be visible to Tcl scripts. Both
|
||||
interior windows and top-level windows may be created with
|
||||
\fBTk_CreateAnonymousWindow\fR.
|
||||
@@ -141,7 +141,6 @@ but has not been mapped, so no X window exists, it is
|
||||
possible to force the creation of the X window by
|
||||
calling \fBTk_MakeWindowExist\fR. This procedure issues
|
||||
the X commands to instantiate the window given by \fItkwin\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
create, deferred creation, destroy, display, internal window,
|
||||
screen, top-level window, window
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -21,13 +21,11 @@ Interpreter for which the image was created.
|
||||
.AP "const char" *name in
|
||||
Name of the image.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR
|
||||
and \fIname\fR, if there is one. All instances of that image
|
||||
will redisplay as empty regions. If the given image does not
|
||||
exist then the procedure has no effect.
|
||||
|
||||
.SH KEYWORDS
|
||||
delete image, image manager
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -27,12 +27,10 @@ Width of the highlight ring, in pixels.
|
||||
Drawable in which to draw the highlight; usually an offscreen
|
||||
pixmap for double buffering.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the
|
||||
traversal highlight ring for a widget.
|
||||
It is typically invoked by widgets during redisplay.
|
||||
|
||||
.SH KEYWORDS
|
||||
focus, traversal highlight
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -30,7 +30,6 @@ in the window given by \fItkwin\fR.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be
|
||||
@@ -39,15 +38,15 @@ by \fImask\fR occurs in the window specified by \fItkwin\fR.
|
||||
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
|
||||
this mechanism only works in programs that dispatch events
|
||||
through \fBTk_HandleEvent\fR (or through other Tk procedures that
|
||||
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
|
||||
call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or
|
||||
\fBTk_MainLoop\fR).
|
||||
.PP
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
type \fBTk_EventProc\fR:
|
||||
.CS
|
||||
typedef void Tk_EventProc(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
typedef void \fBTk_EventProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
argument given to \fBTk_CreateEventHandler\fR when the callback
|
||||
@@ -72,6 +71,5 @@ automatically; in this case there is no need to call
|
||||
If multiple handlers are declared for the same type of X event
|
||||
on the same window, then the handlers will be invoked in the
|
||||
order they were created.
|
||||
|
||||
.SH KEYWORDS
|
||||
bind, callback, event, handler
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
'\" Author: Paul Mackerras (paulus@cs.anu.edu.au),
|
||||
'\" Department of Computer Science,
|
||||
'\" Australian National University.
|
||||
@@ -21,7 +21,6 @@ Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_Pho
|
||||
Tk_PhotoHandle
|
||||
\fBTk_FindPhoto\fR(\fIinterp, imageName\fR)
|
||||
.sp
|
||||
.VS 8.5
|
||||
int
|
||||
\fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
|
||||
compRule\fR)
|
||||
@@ -29,7 +28,6 @@ compRule\fR)
|
||||
int
|
||||
\fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
|
||||
zoomX, zoomY, subsampleX, subsampleY, compRule\fR)
|
||||
.VE 8.5
|
||||
.sp
|
||||
int
|
||||
\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR)
|
||||
@@ -37,18 +35,14 @@ int
|
||||
void
|
||||
\fBTk_PhotoBlank\fR(\fIhandle\fR)
|
||||
.sp
|
||||
.VS 8.5
|
||||
int
|
||||
\fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR)
|
||||
.VE 8.5
|
||||
.sp
|
||||
void
|
||||
\fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR)
|
||||
.sp
|
||||
.VS 8.5
|
||||
int
|
||||
\fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR)
|
||||
.VE 8.5
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_PhotoImageBlock window_path
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -99,13 +93,14 @@ being written to the photo image.
|
||||
Specifies the zoom factor to be applied in the Y direction to pixels
|
||||
being written to the photo image.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_FindPhoto\fR returns an opaque handle that is used to identify a
|
||||
particular photo image to the other procedures. The parameter is the
|
||||
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.
|
||||
If \fIimageName\fR does not exist or is not a photo image,
|
||||
\fBTk_FindPhoto\fR returns NULL.
|
||||
.PP
|
||||
\fBTk_PhotoPutBlock\fR is used to supply blocks of image data to be
|
||||
displayed. The call affects an area of the image of size
|
||||
@@ -128,21 +123,30 @@ typedef struct {
|
||||
int \fIheight\fR;
|
||||
int \fIpitch\fR;
|
||||
int \fIpixelSize\fR;
|
||||
int \fIoffset[4]\fR;
|
||||
} Tk_PhotoImageBlock;
|
||||
int \fIoffset\fR[4];
|
||||
} \fBTk_PhotoImageBlock\fR;
|
||||
.CE
|
||||
The \fIpixelPtr\fR field points to the first pixel, that is, the
|
||||
top-left pixel in the block.
|
||||
The \fIwidth\fR and \fIheight\fR fields specify the dimensions of the
|
||||
block of pixels. The \fIpixelSize\fR field specifies the address
|
||||
difference between two horizontally adjacent pixels. Often it is 3
|
||||
or 4, but it can have any value. The \fIpitch\fR field specifies the
|
||||
difference between two horizontally adjacent pixels. It should be 4 for
|
||||
RGB and 2 for grayscale image data. Other values are possible, if 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
|
||||
\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
|
||||
(transparency) components. These are normally 0, 1, 2 and 3, but can
|
||||
have other values, e.g., for images that are stored as separate red,
|
||||
green and blue planes.
|
||||
(transparency) components. If the offsets for red, green and blue are
|
||||
equal, the image is interpreted as grayscale. If they differ, RGB data
|
||||
is assumed. Normally the offsets will be 0, 1, 2, 3 for RGB data
|
||||
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
|
||||
The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a
|
||||
compositing rule that says what to do with transparent pixels. The
|
||||
@@ -161,12 +165,10 @@ given are replicated (in a tiled fashion) to fill the specified area.
|
||||
These rules operate independently in the horizontal and vertical
|
||||
directions.
|
||||
.PP
|
||||
.VS 8.5
|
||||
\fBTk_PhotoPutBlock\fR normally returns \fBTCL_OK\fR, though if it cannot
|
||||
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
|
||||
returned instead and, if the \fIinterp\fR argument is non-NULL, an
|
||||
error message is placed in the interpreter's result.
|
||||
.VE 8.5
|
||||
.PP
|
||||
\fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except that
|
||||
the image can be reduced or enlarged for display. The
|
||||
@@ -190,6 +192,18 @@ in the structure pointed to by the \fIblockPtr\fR parameter with values
|
||||
that describe the address and layout of the image data that the
|
||||
photo image has stored internally. The values are valid
|
||||
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
|
||||
corresponding procedure in the old photo widget.
|
||||
.PP
|
||||
@@ -207,12 +221,10 @@ 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
|
||||
are supplied.
|
||||
.PP
|
||||
.VS 8.5
|
||||
\fBTk_PhotoExpand\fR normally returns \fBTCL_OK\fR, though if it cannot
|
||||
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
|
||||
returned instead and, if the \fIinterp\fR argument is non-NULL, an
|
||||
error message is placed in the interpreter's result.
|
||||
.VE 8.5
|
||||
.PP
|
||||
\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
|
||||
@@ -222,16 +234,13 @@ or height, but allows the width or height to be changed by subsequent
|
||||
calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or
|
||||
\fBTk_PhotoExpand\fR.
|
||||
.PP
|
||||
.VS 8.5
|
||||
\fBTk_PhotoSetSize\fR normally returns \fBTCL_OK\fR, though if it cannot
|
||||
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
|
||||
returned instead and, if the \fIinterp\fR argument is non-NULL, an
|
||||
error message is placed in the interpreter's result.
|
||||
.VE 8.5
|
||||
.PP
|
||||
\fBTk_PhotoGetSize\fR returns the dimensions of the image in
|
||||
*\fIwidthPtr\fR and *\fIheightPtr\fR.
|
||||
|
||||
.SH PORTABILITY
|
||||
.PP
|
||||
In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and
|
||||
@@ -241,7 +250,6 @@ your code, compile it with the flag
|
||||
-DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against
|
||||
older versions of Tk will continue to work.
|
||||
.PP
|
||||
.VS 8.5
|
||||
In Tk 8.4, \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR,
|
||||
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR did not take an
|
||||
\fIinterp\fR argument or return any result code. If insufficient
|
||||
@@ -249,12 +257,27 @@ memory was available for an image, Tk would panic. This behaviour is
|
||||
still supported if you compile your extension with the additional flag
|
||||
-DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against
|
||||
older versions of Tk will continue to work.
|
||||
.VE 8.5
|
||||
|
||||
.SH BUGS
|
||||
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
|
||||
.PP
|
||||
The code for the photo image type was developed by Paul Mackerras,
|
||||
based on his earlier photo widget code.
|
||||
|
||||
.SH KEYWORDS
|
||||
photo, image
|
||||
|
||||
15
doc/FontId.3
15
doc/FontId.3
@@ -3,12 +3,12 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for
|
||||
Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for
|
||||
fonts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
@@ -37,7 +37,7 @@ Postscript font that corresponds to \fItkfont\fR will be appended.
|
||||
.PP
|
||||
Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be
|
||||
selected into an XGCValues structure in order to construct a graphics
|
||||
context that can be used to draw text in the specified font.
|
||||
context that can be used to draw text in the specified font.
|
||||
.PP
|
||||
\fBTk_GetFontMetrics\fR computes the ascent, descent, and linespace of the
|
||||
\fItkfont\fR in pixels and stores those values in the structure pointer to by
|
||||
@@ -45,7 +45,7 @@ context that can be used to draw text in the specified font.
|
||||
multiple lines of text, to align the baselines of text in different
|
||||
fonts, and to vertically align text in a given region. See the
|
||||
documentation for the \fBfont\fR command for definitions of the terms
|
||||
ascent, descent, and linespace, used in font metrics.
|
||||
ascent, descent, and linespace, used in font metrics.
|
||||
.PP
|
||||
\fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding
|
||||
Postscript font name that should be used when printing. The return value
|
||||
@@ -56,15 +56,16 @@ appended to \fIdsPtr\fR. \fIDsPtr\fR must refer to an initialized
|
||||
Postscript printer, the
|
||||
following screen font families should print correctly:
|
||||
.IP
|
||||
\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR,
|
||||
\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR,
|
||||
\fBCourier New\fR, \fBGeneva\fR, \fBHelvetica\fR, \fBMonaco\fR,
|
||||
\fBNew Century Schoolbook\fR, \fBNew York\fR, \fBPalatino\fR, \fBSymbol\fR,
|
||||
\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and
|
||||
\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and
|
||||
\fBZapf Dingbats\fR.
|
||||
.PP
|
||||
Any other font families may not print correctly because the computed
|
||||
Postscript font name may be incorrect or not exist on the printer.
|
||||
.SH "DATA STRUCTURES"
|
||||
.PP
|
||||
The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to
|
||||
return information about a font and is defined as follows:
|
||||
.CS
|
||||
@@ -72,7 +73,7 @@ typedef struct Tk_FontMetrics {
|
||||
int \fIascent\fR;
|
||||
int \fIdescent\fR;
|
||||
int \fIlinespace\fR;
|
||||
} Tk_FontMetrics;
|
||||
} \fBTk_FontMetrics\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fIascent\fR field is the amount in pixels that the tallest
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -44,7 +44,6 @@ Space to leave for top side of internal border for \fItkwin\fR, in pixel units.
|
||||
.AP int bottom in
|
||||
Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GeometryRequest\fR is called by widget code to indicate its
|
||||
@@ -89,6 +88,5 @@ The information specified in calls to \fBTk_GeometryRequest\fR,
|
||||
\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and
|
||||
\fBTk_InternalBorderBottom\fR.
|
||||
See the \fBTk_WindowId\fR manual entry for details.
|
||||
|
||||
.SH KEYWORDS
|
||||
geometry, request
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,17 +28,20 @@ const char *
|
||||
Interpreter to use for error reporting, or NULL.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
String value contains name of anchor point:
|
||||
.QW n ,
|
||||
.QW ne ,
|
||||
.QW e ,
|
||||
.QW se ,
|
||||
.QW s ,
|
||||
.QW sw ,
|
||||
.QW w ,
|
||||
.QW nw ,
|
||||
.QW \fBn\fR ,
|
||||
.QW \fBne\fR ,
|
||||
.QW \fBe\fR ,
|
||||
.QW \fBse\fR ,
|
||||
.QW \fBs\fR ,
|
||||
.QW \fBsw\fR ,
|
||||
.QW \fBw\fR ,
|
||||
.QW \fBnw\fR ,
|
||||
or
|
||||
.QW center ;
|
||||
internal rep will be modified to cache corresponding Tk_Anchor.
|
||||
.QW \fBcenter\fR ;
|
||||
internal rep will be modified to cache corresponding Tk_Anchor. In the
|
||||
case of
|
||||
.QW \fBcenter\fR
|
||||
on input, a non-empty abbreviation of it may also be used on input.
|
||||
.AP "const char" *string in
|
||||
Same as \fIobjPtr\fR except description of anchor point is passed as
|
||||
a string.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -49,7 +49,7 @@ Same as \fIobjPtr\fR except description of bitmap is passed as a string and
|
||||
resulting Pixmap is not cached.
|
||||
.AP "const char" *name in
|
||||
Name for new bitmap to be defined.
|
||||
.AP "const char" *source in
|
||||
.AP "const void" *source in
|
||||
Data for bitmap, in standard bitmap format.
|
||||
Must be stored in static memory whose value will never change.
|
||||
.AP "int" width in
|
||||
@@ -66,7 +66,6 @@ Display for which \fIbitmap\fR was allocated.
|
||||
Identifier for a bitmap allocated by \fBTk_AllocBitmapFromObj\fR or
|
||||
\fBTk_GetBitmap\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures manage a collection of bitmaps (one-plane pixmaps)
|
||||
@@ -82,7 +81,7 @@ of the following forms:
|
||||
.TP 20
|
||||
\fB@\fIfileName\fR
|
||||
\fIFileName\fR must be the name of a file containing a bitmap
|
||||
description in the standard X11 or X10 format.
|
||||
description in the standard X11 format.
|
||||
.TP 20
|
||||
\fIname\fR
|
||||
\fIName\fR must be the name of a bitmap defined previously with
|
||||
@@ -210,7 +209,7 @@ describe the bitmap.
|
||||
\fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs
|
||||
(e.g. a bitmap named \fInameId\fR has already been defined) then
|
||||
\fBTCL_ERROR\fR is returned and an error message is left in
|
||||
\fIinterp->result\fR.
|
||||
interpreter \fIinterp\fR's result.
|
||||
Note: \fBTk_DefineBitmap\fR expects the memory pointed to by
|
||||
\fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make
|
||||
a private copy of this memory, but uses the bytes pointed to
|
||||
@@ -282,8 +281,8 @@ with its Pixmap token.
|
||||
There should be exactly one call to \fBTk_FreeBitmapFromObj\fR
|
||||
or \fBTk_FreeBitmap\fR for each call to \fBTk_AllocBitmapFromObj\fR or
|
||||
\fBTk_GetBitmap\fR.
|
||||
|
||||
.SH BUGS
|
||||
.PP
|
||||
In determining whether an existing bitmap can be used to satisfy
|
||||
a new request, \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR
|
||||
consider only the immediate value of the string description. For
|
||||
@@ -293,6 +292,5 @@ bitmap created from the same file name: it will not check to
|
||||
see whether the file itself has changed, or whether the current
|
||||
directory has changed, thereby causing the name to refer to
|
||||
a different file.
|
||||
|
||||
.SH KEYWORDS
|
||||
bitmap, pixmap
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -24,18 +24,18 @@ const char *
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char" *string in
|
||||
String containing name of cap style: one of
|
||||
.QW butt ,
|
||||
.QW projecting ,
|
||||
String containing name of cap style \- one of
|
||||
.QW \fBbutt\fR ,
|
||||
.QW \fBprojecting\fR ,
|
||||
or
|
||||
.QW round .
|
||||
.QW \fBround\fR
|
||||
\- or a unique abbreviation of one.
|
||||
.AP int *capPtr out
|
||||
Pointer to location in which to store X cap style corresponding to
|
||||
\fIstring\fR.
|
||||
.AP int cap in
|
||||
Cap style: one of \fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\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.
|
||||
If \fIstring\fR does not contain a valid cap style
|
||||
or an abbreviation of one of these names, then an error message is
|
||||
stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
|
||||
stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and
|
||||
\fI*capPtr\fR is unmodified.
|
||||
.PP
|
||||
\fBTk_NameOfCapStyle\fR is the logical inverse of \fBTk_GetCapStyle\fR.
|
||||
@@ -60,6 +60,5 @@ statically-allocated string corresponding to \fIcap\fR.
|
||||
If \fIcap\fR is not a legal cap style, then
|
||||
.QW "unknown cap style"
|
||||
is returned.
|
||||
|
||||
.SH KEYWORDS
|
||||
butt, cap style, projecting, round
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -58,7 +58,6 @@ call to \fBTk_AllocColorFromObj\fR, \fBTk_GetColor\fR or
|
||||
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.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures manage the colors being used by a Tk application.
|
||||
@@ -68,8 +67,8 @@ colormap space is exhausted.
|
||||
.PP
|
||||
Given a textual description of a color, \fBTk_AllocColorFromObj\fR
|
||||
locates a pixel value that may be used to render the color
|
||||
in a particular window. The desired color is specified with an
|
||||
object whose string value must have one of the following forms:
|
||||
in a particular window. The desired color is specified with a
|
||||
value whose string value must have one of the following forms:
|
||||
.TP 20
|
||||
\fIcolorname\fR
|
||||
Any of the valid textual names for a color defined in the
|
||||
@@ -107,7 +106,7 @@ such as \fBTk_AllocColorFromObj\fR and \fBTk_GetColorFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetColor\fR is identical to \fBTk_AllocColorFromObj\fR except
|
||||
that the description of the color is specified with a string instead
|
||||
of an object. This prevents \fBTk_GetColor\fR from caching the
|
||||
of a value. This prevents \fBTk_GetColor\fR from caching the
|
||||
return value, so \fBTk_GetColor\fR is less efficient than
|
||||
\fBTk_AllocColorFromObj\fR.
|
||||
.PP
|
||||
@@ -128,7 +127,7 @@ This package maintains a database
|
||||
of all the colors currently in use.
|
||||
If the same color is requested multiple times from
|
||||
\fBTk_GetColor\fR or \fBTk_AllocColorFromObj\fR (e.g. by different
|
||||
windows), or if the
|
||||
windows), or if the
|
||||
same intensities are requested multiple times from
|
||||
\fBTk_GetColorByValue\fR, then existing pixel values will
|
||||
be re-used. Re-using an existing pixel avoids any interaction
|
||||
@@ -174,4 +173,4 @@ There should be exactly one call to \fBTk_FreeColorFromObj\fR
|
||||
or \fBTk_FreeColor\fR for each call to \fBTk_AllocColorFromObj\fR,
|
||||
\fBTk_GetColor\fR, or \fBTk_GetColorByValue\fR.
|
||||
.SH KEYWORDS
|
||||
color, intensity, object, pixel value
|
||||
color, intensity, value, pixel value
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -67,7 +67,6 @@ Opaque Tk identifier for cursor. If passed to \fBTk_FreeCursor\fR, must
|
||||
have been returned by some previous call to \fBTk_GetCursor\fR or
|
||||
\fBTk_GetCursorFromData\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures manage a collection of cursors
|
||||
@@ -118,8 +117,8 @@ in preference to black and white cursors.
|
||||
\fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR
|
||||
In this form, \fIsourceName\fR and \fImaskName\fR are the names of
|
||||
files describing cursors for the cursor's source bits and mask.
|
||||
Each file must be in standard X11 or X10 cursor format.
|
||||
\fIFgColor\fR and \fIbgColor\fR
|
||||
Each file must be in standard X11 cursor format.
|
||||
\fIFgColor\fR and \fIbgColor\fR
|
||||
indicate the colors to use for the
|
||||
cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This
|
||||
form of the command will not work on Macintosh or Windows computers.
|
||||
@@ -213,8 +212,8 @@ with its Tk_Cursor token.
|
||||
There should be exactly one call to \fBTk_FreeCursor\fR for
|
||||
each call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
|
||||
or \fBTk_GetCursorFromData\fR.
|
||||
|
||||
.SH BUGS
|
||||
.PP
|
||||
In determining whether an existing cursor can be used to satisfy
|
||||
a new request, \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
|
||||
and \fBTk_GetCursorFromData\fR
|
||||
@@ -228,6 +227,5 @@ a different file. Similarly, \fBTk_GetCursorFromData\fR assumes
|
||||
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
|
||||
see if the actual data values have changed.
|
||||
|
||||
.SH KEYWORDS
|
||||
cursor
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -13,28 +13,30 @@ Tk_GetDash \- convert from string to valid dash structure.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
|
||||
int
|
||||
\fBTk_GetDash\fR(\fIinterp, string, dashPtr\fR)
|
||||
.fi
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_Dash *dashPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char *" string in
|
||||
.AP "const char" *string in
|
||||
Textual value to be converted.
|
||||
.AP Tk_Dash *dashPtr out
|
||||
Points to place to store the dash pattern
|
||||
value converted from \fIstring\fR.
|
||||
value converted from \fIstring\fR. Must not be NULL.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
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
|
||||
character string containing only
|
||||
.QW \fB.,\-_\fR
|
||||
or spaces. If all
|
||||
goes well, \fBTCL_OK\fR is returned. If \fIstring\fR does not have the
|
||||
.QW \fB.,-_\fR
|
||||
and spaces. If all
|
||||
goes well, \fBTCL_OK\fR is returned and a dash descriptor is stored
|
||||
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
|
||||
in the interpreter's result, and nothing is stored at *\fIdashPtr\fR.
|
||||
.PP
|
||||
@@ -46,33 +48,35 @@ color. The other segments are drawn transparent.
|
||||
.PP
|
||||
The second possible syntax is a character list containing only
|
||||
5 possible characters
|
||||
.QW "\fB.,\-_ \fR" .
|
||||
.QW "\fB.,-_ \fR" .
|
||||
The space can be used
|
||||
to enlarge the space between other line elements, and can not
|
||||
occur as the first position in the string. Some examples:
|
||||
occur in the first position of the string. Some examples:
|
||||
.PP
|
||||
.CS
|
||||
\-dash . = \-dash {2 4}
|
||||
\-dash \- = \-dash {6 4}
|
||||
\-dash \-. = \-dash {6 4 2 4}
|
||||
\-dash \-.. = \-dash {6 4 2 4 2 4}
|
||||
\-dash - = \-dash {6 4}
|
||||
\-dash -. = \-dash {6 4 2 4}
|
||||
\-dash -.. = \-dash {6 4 2 4 2 4}
|
||||
\-dash {. } = \-dash {2 8}
|
||||
\-dash , = \-dash {4 4}
|
||||
.CE
|
||||
.PP
|
||||
The main difference of this syntax with the previous is that it
|
||||
The main difference between this syntax and the numeric is that it
|
||||
is shape-conserving. This means that all values in the dash
|
||||
list will be multiplied by the line width before display. This
|
||||
assures that
|
||||
ensures that
|
||||
.QW .
|
||||
will always be displayed as a dot and
|
||||
.QW \-
|
||||
.QW -
|
||||
always as a dash regardless of the line width.
|
||||
.PP
|
||||
On systems where only a limited set of dash patterns, the dash
|
||||
pattern will be displayed as the most close dash pattern that
|
||||
is available. For example, on Windows only the first 4 of the
|
||||
above examples are available. The last 2 examples will be
|
||||
displayed identically as the first one.
|
||||
|
||||
above examples are available; the last 2 examples will be
|
||||
displayed identically to the first one.
|
||||
.SH "SEE ALSO"
|
||||
canvas(n), Tk_CreateItemType(3)
|
||||
.SH KEYWORDS
|
||||
dash, conversion
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -14,24 +14,23 @@ Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFr
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
Tk_Font
|
||||
\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR
|
||||
Tk_Font
|
||||
\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
Tk_Font
|
||||
\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfFont(\fItkfont\fB)\fR
|
||||
.sp
|
||||
Tk_Font
|
||||
Tk_Font
|
||||
\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR
|
||||
.sp
|
||||
void
|
||||
\fBTk_FreeFont(\fItkfont\fB)\fR
|
||||
|
||||
.SH ARGUMENTS
|
||||
.AS "const char" *tkfont
|
||||
.AP "Tcl_Interp" *interp in
|
||||
@@ -56,7 +55,7 @@ returns a token that represents the font. The return value can be used
|
||||
in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR,
|
||||
\fBTk_MeasureChars\fR, and \fBTk_FreeFont\fR. The Tk_Font token
|
||||
will remain valid until
|
||||
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it.
|
||||
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it.
|
||||
\fIObjPtr\fR can contain either a symbolic name or a font description; see
|
||||
the documentation for the \fBfont\fR command for a description of the
|
||||
valid formats. If \fBTk_AllocFontFromObj\fR is unsuccessful (because,
|
||||
@@ -105,7 +104,6 @@ with the same information used to create it; for
|
||||
with its Tk_Font token. There should be
|
||||
exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR
|
||||
for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tk_FontId(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetGC 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -34,7 +34,6 @@ Display for which \fIgc\fR was allocated.
|
||||
X identifier for graphics context that is no longer needed.
|
||||
Must have been allocated by \fBTk_GetGC\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts
|
||||
@@ -67,6 +66,5 @@ each call to \fBTk_GetGC\fR.
|
||||
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
|
||||
will release it to the X server and delete it from the database.
|
||||
|
||||
.SH KEYWORDS
|
||||
graphics context
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH HWND 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -32,6 +32,5 @@ window given by \fIwindow\fR.
|
||||
\fBTk_AttachHWND\fR binds the Windows HWND identifier to the
|
||||
specified Tk_Window given by \fItkwin\fR. It returns an X Windows
|
||||
window that encapsulates the HWND.
|
||||
|
||||
.SH KEYWORDS
|
||||
identifier, window
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -63,7 +63,6 @@ Store width of \fIimage\fR (in pixels) here.
|
||||
.AP "int" heightPtr out
|
||||
Store height of \fIimage\fR (in pixels) here.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are invoked by widgets that wish to display images.
|
||||
@@ -74,7 +73,7 @@ identifies the window where the image will be displayed.
|
||||
\fBTk_GetImage\fR looks up the image in the table of existing
|
||||
images and returns a token for a new instance of the image.
|
||||
If the image does not exist then \fBTk_GetImage\fR returns NULL
|
||||
and leaves an error message in \fIinterp->result\fR.
|
||||
and leaves an error message in interpreter \fIinterp\fR's result.
|
||||
.PP
|
||||
When a widget wishes to actually display an image it must
|
||||
call \fBTk_RedrawImage\fR, identifying the image (\fIimage\fR),
|
||||
@@ -106,14 +105,14 @@ The \fIchangeProc\fR and \fIclientData\fR arguments to
|
||||
\fIchangeProc\fR will be called by Tk whenever a change occurs
|
||||
in the image; it must match the following prototype:
|
||||
.CS
|
||||
typedef void Tk_ImageChangedProc(
|
||||
ClientData \fIclientData\fR,
|
||||
int \fIx\fR,
|
||||
int \fIy\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR,
|
||||
int \fIimageWidth\fR,
|
||||
int \fIimageHeight\fR);
|
||||
typedef void \fBTk_ImageChangedProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
int \fIx\fR,
|
||||
int \fIy\fR,
|
||||
int \fIwidth\fR,
|
||||
int \fIheight\fR,
|
||||
int \fIimageWidth\fR,
|
||||
int \fIimageHeight\fR);
|
||||
.CE
|
||||
The \fIclientData\fR argument to \fIchangeProc\fR is the same as the
|
||||
\fIclientData\fR argument to \fBTk_GetImage\fR.
|
||||
@@ -125,9 +124,7 @@ they are specified in pixels measured from the upper-left
|
||||
corner of the image.
|
||||
The arguments \fIimageWidth\fR and \fIimageHeight\fR give
|
||||
the image's (new) size.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tk_CreateImageType
|
||||
|
||||
.SH KEYWORDS
|
||||
images, redisplay
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -24,18 +24,18 @@ const char *
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "const char" *string in
|
||||
String containing name of join style: one of
|
||||
.QW bevel ,
|
||||
.QW miter ,
|
||||
String containing name of join style \- one of
|
||||
.QW \fBbevel\fR ,
|
||||
.QW \fBmiter\fR ,
|
||||
or
|
||||
.QW round .
|
||||
.QW \fBround\fR
|
||||
\- or a unique abbreviation of one.
|
||||
.AP int *joinPtr out
|
||||
Pointer to location in which to store X join style corresponding to
|
||||
\fIstring\fR.
|
||||
.AP int join in
|
||||
Join style: one of \fBJoinBevel\fR, \fBJoinMiter\fR, \fBJoinRound\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\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.
|
||||
If \fIstring\fR does not contain a valid join style
|
||||
or an abbreviation of one of these names, then an error message is
|
||||
stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
|
||||
stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and
|
||||
\fI*joinPtr\fR is unmodified.
|
||||
.PP
|
||||
\fBTk_NameOfJoinStyle\fR is the logical inverse of \fBTk_GetJoinStyle\fR.
|
||||
@@ -59,6 +59,5 @@ statically-allocated string corresponding to \fIjoin\fR.
|
||||
If \fIjoin\fR is not a legal join style, then
|
||||
.QW "unknown join style"
|
||||
is returned.
|
||||
|
||||
.SH KEYWORDS
|
||||
bevel, join style, miter, round
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -27,11 +27,12 @@ const char *
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting, or NULL.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
String value contains name of justification style, one of
|
||||
.QW left ,
|
||||
.QW right ,
|
||||
String value contains name of justification style \- one of
|
||||
.QW \fBleft\fR ,
|
||||
.QW \fBright\fR ,
|
||||
or
|
||||
.QW center .
|
||||
.QW \fBcenter\fR
|
||||
\- or a unique abbreviation of one.
|
||||
The internal rep will be modified to cache corresponding justify value.
|
||||
.AP "const char" *string in
|
||||
Same as \fIobjPtr\fR except description of justification style is passed as
|
||||
@@ -82,6 +83,5 @@ corresponding to \fIjustify\fR.
|
||||
If \fIjustify\fR is not a legal justify value, then
|
||||
.QW "unknown justification style"
|
||||
is returned.
|
||||
|
||||
.SH KEYWORDS
|
||||
center, fill, justification, string
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetOption 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -26,7 +26,6 @@ Name of desired option.
|
||||
Class of desired option. Null means there is no class for
|
||||
this option; do lookup based on name only.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure is invoked to retrieve an option from the database
|
||||
@@ -39,6 +38,5 @@ is returned. If no option matches, then NULL is returned.
|
||||
\fBTk_GetOption\fR caches options related to \fItkwin\fR so that
|
||||
successive calls for the same \fItkwin\fR will execute much more
|
||||
quickly than successive calls for different windows.
|
||||
|
||||
.SH KEYWORDS
|
||||
class, name, option, retrieve
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -43,7 +43,6 @@ Pointer to location in which to store converted distance in pixels.
|
||||
.AP double *doublePtr out
|
||||
Pointer to location in which to store converted distance in millimeters.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures take as argument a specification of distance on
|
||||
@@ -85,13 +84,12 @@ value in \fIobjPtr\fR, which speeds up future calls to
|
||||
\fBTk_GetPixels\fR is identical to \fBTk_GetPixelsFromObj\fR except
|
||||
that the screen distance is specified with a string instead
|
||||
of an object. This prevents \fBTk_GetPixels\fR from caching the
|
||||
return value, so \fBTk_GetAnchor\fR is less efficient than
|
||||
return value, so \fBTk_GetPixels\fR is less efficient than
|
||||
\fBTk_GetPixelsFromObj\fR.
|
||||
.PP
|
||||
\fBTk_GetMMFromObj\fR and \fBTk_GetScreenMM\fR are similar to
|
||||
\fBTk_GetPixelsFromObj\fR and \fBTk_GetPixels\fR (respectively) except
|
||||
that they convert the screen distance to millimeters and
|
||||
store a double-precision floating-point result at \fI*doublePtr\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
centimeters, convert, inches, millimeters, pixels, points, screen units
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -33,7 +33,6 @@ Number of bits per pixel in pixmap.
|
||||
.AP Pixmap pixmap in
|
||||
Pixmap to destroy.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR
|
||||
@@ -49,6 +48,5 @@ with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR,
|
||||
and returns its identifier.
|
||||
\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes
|
||||
its resource identifier available for reuse.
|
||||
|
||||
.SH KEYWORDS
|
||||
pixmap, resource identifier
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,13 +28,14 @@ const char *
|
||||
Interpreter to use for error reporting.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
String value contains name of relief, one of
|
||||
.QW flat ,
|
||||
.QW groove ,
|
||||
.QW raised ,
|
||||
.QW ridge ,
|
||||
.QW solid ,
|
||||
.QW \fBflat\fR ,
|
||||
.QW \fBgroove\fR ,
|
||||
.QW \fBraised\fR ,
|
||||
.QW \fBridge\fR ,
|
||||
.QW \fBsolid\fR ,
|
||||
or
|
||||
.QW sunken ;
|
||||
.QW \fBsunken\fR
|
||||
(or any unique abbreviation thereof on input);
|
||||
the internal rep will be modified to cache corresponding relief value.
|
||||
.AP char *string in
|
||||
Same as \fIobjPtr\fR except description of relief is passed as
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetRootCoords 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
@@ -4,51 +4,50 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_GetScrollInfo, Tk_GetScrollInfoObj \- parse arguments for scrolling commands
|
||||
Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetScrollInfo(\fIinterp, argc, argv, dblPtr, intPtr\fB)\fR
|
||||
\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, dblPtr, intPtr\fB)\fR
|
||||
\fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS "Tcl_Interp" *dblPtr
|
||||
.AS "Tcl_Interp" *fractionPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP int argc in
|
||||
Number of strings in \fIargv\fR array.
|
||||
.AP "const char" *argv[] in
|
||||
Argument strings. 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 objc in
|
||||
Number of Tcl_Obj's in \fIobjv\fR array.
|
||||
.AP "Tcl_Obj *const" objv[] in
|
||||
.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
|
||||
.AP int argc in
|
||||
Number of strings in \fIargv\fR array.
|
||||
.AP "const char **" argv in
|
||||
Argument strings. 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 *fractionPtr out
|
||||
Filled in with fraction from \fBmoveto\fR option, if any.
|
||||
.AP int *intPtr out
|
||||
.AP int *stepsPtr out
|
||||
Filled in with line or page count from \fBscroll\fR option, if any.
|
||||
The value may be negative.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetScrollInfo\fR parses the arguments expected by widget
|
||||
\fBTk_GetScrollInfoObj\fR parses the arguments expected by widget
|
||||
scrolling commands such as \fBxview\fR and \fByview\fR.
|
||||
It receives the entire list of words that make up a widget command
|
||||
and parses the words starting with \fIargv\fR[2].
|
||||
The words starting with \fIargv\fR[2] must have one of the following forms:
|
||||
and parses the words starting with \fIobjv\fR[2].
|
||||
The words starting with \fIobjv\fR[2] must have one of the following forms:
|
||||
.CS
|
||||
\fBmoveto \fIfraction\fR
|
||||
\fBscroll \fInumber\fB units\fR
|
||||
@@ -57,20 +56,20 @@ The words starting with \fIargv\fR[2] must have one of the following forms:
|
||||
.LP
|
||||
Any of the \fBmoveto\fR, \fBscroll\fR, \fBunits\fR, and \fBpages\fR
|
||||
keywords may be abbreviated.
|
||||
If \fIargv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
|
||||
is returned as result and \fI*dblPtr\fR is filled in with the
|
||||
If \fIobjv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
|
||||
is returned as result and \fI*fractionPtr\fR is filled in with the
|
||||
\fIfraction\fR argument to the command, which must be a proper real
|
||||
value.
|
||||
If \fIargv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
|
||||
or \fBTK_SCROLL_PAGES\fR is returned and \fI*intPtr\fR is filled
|
||||
If \fIobjv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
|
||||
or \fBTK_SCROLL_PAGES\fR is returned and \fI*stepsPtr\fR is filled
|
||||
in with the \fInumber\fR value, which must be a proper integer.
|
||||
If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR
|
||||
is returned and an error message is left in \fIinterp->result\fR.
|
||||
is returned and an error message is left in interpreter
|
||||
\fIinterp\fR's result.
|
||||
.PP
|
||||
\fBTk_GetScrollInfoObj\fR is identical in function to
|
||||
\fBTk_GetScrollInfo\fR. However, \fBTk_GetScrollInfoObj\fR accepts
|
||||
Tcl_Obj style arguments, making it more appropriate for use with new
|
||||
development.
|
||||
|
||||
\fBTk_GetScrollInfo\fR is identical in function to
|
||||
\fBTk_GetScrollInfoObj\fR. However, \fBTk_GetScrollInfo\fR accepts
|
||||
string arguments, making it more appropriate for use with legacy
|
||||
widgets.
|
||||
.SH KEYWORDS
|
||||
parse, scrollbar, scrolling command, xview, yview
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -33,7 +33,6 @@ are retrieved.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetSelection\fR retrieves the selection specified by the atom
|
||||
@@ -42,13 +41,15 @@ selection may actually be retrieved in several pieces; as each piece
|
||||
is retrieved, \fIproc\fR is called to process the piece. \fIProc\fR
|
||||
should have arguments and result that match the type
|
||||
\fBTk_GetSelProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tk_GetSelProc(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIportion\fR);
|
||||
typedef int \fBTk_GetSelProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIportion\fR);
|
||||
.CE
|
||||
The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
|
||||
.PP
|
||||
The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
|
||||
will be copies of the corresponding arguments to
|
||||
\fBTk_GetSelection\fR. \fIPortion\fR will be a pointer to
|
||||
a string containing part or all of the selection. For large
|
||||
@@ -68,10 +69,10 @@ been completely retrieved and processed by \fIproc\fR, or when a
|
||||
fatal error has occurred (e.g. the selection owner did not respond
|
||||
promptly). \fBTk_GetSelection\fR normally returns \fBTCL_OK\fR; if
|
||||
an error occurs, it returns \fBTCL_ERROR\fR and leaves an error message
|
||||
in \fIinterp->result\fR. \fIProc\fR should also return either
|
||||
\fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in dealing with the
|
||||
selection, it should leave an error message in \fIinterp->result\fR
|
||||
and return \fBTCL_ERROR\fR; this will abort the selection retrieval.
|
||||
|
||||
in interpreter \fIinterp\fR's result. \fIProc\fR should also return either
|
||||
\fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in
|
||||
dealing with the selection, it should leave an error message in the
|
||||
interpreter result and return \fBTCL_ERROR\fR; this will abort the
|
||||
selection retrieval.
|
||||
.SH KEYWORDS
|
||||
format, get, selection retrieval
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetUid 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -21,7 +21,6 @@ Tk_Uid
|
||||
String for which the corresponding unique identifier is
|
||||
desired.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetUid\fR returns the unique identifier corresponding
|
||||
@@ -42,6 +41,5 @@ Tk_Uid may be compared directly (x == y) without having to call
|
||||
\fBstrcmp\fR.
|
||||
In addition, the return value from \fBTk_GetUid\fR will have the
|
||||
same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
|
||||
|
||||
.SH KEYWORDS
|
||||
atom, unique identifier
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,6 @@ Points to word in which to store width of virtual root.
|
||||
.AP "int" heightPtr out
|
||||
Points to word in which to store height of virtual root.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetVRootGeometry\fR returns geometry information about the virtual
|
||||
@@ -43,6 +42,5 @@ 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
|
||||
*\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.
|
||||
|
||||
.SH KEYWORDS
|
||||
geometry, height, location, virtual root, width, window manager
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -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.
|
||||
If \fIstring\fR is unrecognizable or if no suitable visual could
|
||||
be found, then NULL is returned and \fBTk_GetVisual\fR leaves
|
||||
an error message in \fIinterp->result\fR.
|
||||
an error message in interpreter \fIinterp\fR's result.
|
||||
If \fIcolormap\fR is non-NULL then \fBTk_GetVisual\fR
|
||||
also locates an appropriate colormap for use with the result visual
|
||||
and stores its X identifier at \fI*colormapPtr\fR.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_Grab 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -16,7 +16,6 @@ int
|
||||
.sp
|
||||
void
|
||||
\fBTk_Ungrab\fR(\fItkwin\fR)
|
||||
|
||||
.SH ARGUMENTS
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting
|
||||
@@ -25,7 +24,6 @@ Window on whose behalf the pointer is to be grabbed or released
|
||||
.AP int grabGlobal in
|
||||
Boolean indicating whether the grab is global or application local
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These functions are used to set or release a global or
|
||||
@@ -39,7 +37,6 @@ intended for windows in other applications) will be redirected to
|
||||
\fItkwin\fR. If the grab is application local, only mouse and
|
||||
keyboard events intended for a windows within the same application
|
||||
(but outside the tree rooted at \fItkwin\fR) will be redirected.
|
||||
|
||||
.PP
|
||||
\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR
|
||||
specifies the window on whose behalf the pointer is to be grabbed.
|
||||
@@ -52,12 +49,10 @@ successfully, no window outside the tree rooted at \fItkwin\fR will
|
||||
receive pointer- or keyboard-related events until the next call to
|
||||
Tk_Ungrab. If a previous grab was in effect within the application,
|
||||
then it is replaced with a new one.
|
||||
|
||||
.PP
|
||||
\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if
|
||||
\fBTk_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
|
||||
released, pointer and keyboard events will start being delivered to
|
||||
other windows again.
|
||||
|
||||
.SH KEYWORDS
|
||||
grab, window
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -17,12 +17,10 @@ Tk_Window
|
||||
.AP HWND hwnd in
|
||||
Windows handle for the window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Given a Windows HWND window identifier, this procedure returns the
|
||||
corresponding Tk_Window handle. If there is no Tk_Window corresponding
|
||||
to \fIhwnd\fR then NULL is returned.
|
||||
|
||||
.SH KEYWORDS
|
||||
Windows window id
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -21,7 +21,6 @@ Tk_HandleEvent \- invoke event handlers for window system events
|
||||
Pointer to X event to dispatch to relevant handler(s). It is important
|
||||
that all unused fields of the structure be set to zero.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_HandleEvent\fR is a lower-level procedure that deals with window
|
||||
@@ -43,6 +42,5 @@ as when a
|
||||
notifier has been popped up and an application wishes to
|
||||
wait for the user to click a button in the notifier before
|
||||
doing anything else.
|
||||
|
||||
.SH KEYWORDS
|
||||
callback, event, handler, window
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -22,13 +22,11 @@ X display containing the window.
|
||||
.AP Window window in
|
||||
X id for window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Given an X window identifier and the X display it corresponds to,
|
||||
this procedure returns the corresponding Tk_Window handle.
|
||||
If there is no Tk_Window corresponding to \fIwindow\fR then
|
||||
NULL is returned.
|
||||
|
||||
.SH KEYWORDS
|
||||
X window id
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -14,10 +14,10 @@ Tk_ImageChanged \- notify widgets that image needs to be redrawn
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR)
|
||||
\fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ImageMaster imageHeight
|
||||
.AP Tk_ImageMaster imageMaster in
|
||||
.AP Tk_ImageMaster model in
|
||||
Token for image, which was passed to image's \fIcreateProc\fR when
|
||||
the image was created.
|
||||
.AP int x in
|
||||
@@ -35,7 +35,6 @@ Current width of image, in pixels.
|
||||
.AP "int" imageHeight in
|
||||
Current height of image, in pixels.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
An image manager calls \fBTk_ImageChanged\fR for an image
|
||||
@@ -43,12 +42,16 @@ whenever anything happens that requires the image to be redrawn.
|
||||
As a result of calling \fBTk_ImageChanged\fR, any widgets using
|
||||
the image are notified so that they can redisplay themselves
|
||||
appropriately.
|
||||
The \fIimageMaster\fR argument identifies the image, and
|
||||
The \fImodel\fR argument identifies the image, and
|
||||
\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR
|
||||
specify a rectangular region within the image that needs to
|
||||
be redrawn.
|
||||
\fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size.
|
||||
.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
|
||||
its \fIcreateProc\fR to specify the image's initial size and to
|
||||
force redisplay if there are existing instances for the image.
|
||||
@@ -59,9 +62,7 @@ that changed.
|
||||
If the size of the image should change, then \fBTk_ImageChanged\fR
|
||||
must be called to indicate the new size, even if no pixels
|
||||
need to be redisplayed.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tk_CreateImageType
|
||||
|
||||
.SH KEYWORDS
|
||||
images, redisplay, image size changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -14,23 +14,21 @@ Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity tim
|
||||
long
|
||||
\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
|
||||
.sp
|
||||
\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
|
||||
\fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Display *display
|
||||
.AP Display *display in
|
||||
The display on which the user inactivity timer is to be queried or
|
||||
reset.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_GetUserInactiveTime\fR returns the number of milliseconds that
|
||||
have passed since the last user interaction (usually via keyboard or
|
||||
mouse) with the respective display. On systems and displays that do not
|
||||
support querying the user inactiviy time, \fB\-1\fR is returned.
|
||||
\fBTk_GetUserInactiveTime\fR resets the user inactivity timer of the
|
||||
support querying the user inactivity time, \fB\-1\fR is returned.
|
||||
\fBTk_ResetUserInactiveTime\fR resets the user inactivity timer of the
|
||||
given display to zero. On windowing systems that do not support
|
||||
multiple displays \fIdisplay\fR can be passed as \fBNULL\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
idle, inactive
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_InternAtom 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,6 @@ String name for which atom is desired.
|
||||
.AP Atom atom in
|
||||
Atom for which corresponding string name is desired.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are similar to the Xlib procedures
|
||||
@@ -52,6 +51,5 @@ for the same information can be serviced from the cache without
|
||||
contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR
|
||||
are generally much faster than their Xlib counterparts, and they
|
||||
should be used in place of the Xlib procedures.
|
||||
|
||||
.SH KEYWORDS
|
||||
atom, cache, display
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -16,7 +16,6 @@ Tk_MainLoop \- loop for events until all windows are deleted
|
||||
.sp
|
||||
\fBTk_MainLoop\fR()
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_MainLoop\fR is a procedure that loops repeatedly calling
|
||||
@@ -25,6 +24,5 @@ left in this process (i.e. no main windows exist anymore). Most
|
||||
windowing applications will call \fBTk_MainLoop\fR after
|
||||
initialization; the main execution of the application will consist
|
||||
entirely of callbacks invoked via \fBTcl_DoOneEvent\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
application, event, main loop
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main
|
||||
window information
|
||||
Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main window information
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
@@ -20,13 +19,11 @@ Tk_Window
|
||||
.sp
|
||||
int
|
||||
\fBTk_GetNumMainWindows\fR()
|
||||
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *pathName
|
||||
.AP Tcl_Interp *interp in/out
|
||||
Interpreter associated with the application.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
A main window is a special kind of toplevel window used as the
|
||||
@@ -35,10 +32,9 @@ outermost window in an application.
|
||||
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
|
||||
associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and
|
||||
leaves an error message in \fIinterp->result\fR.
|
||||
leaves an error message in interpreter \fIinterp\fR's result.
|
||||
.PP
|
||||
\fBTk_GetNumMainWindows\fR returns a count of the number of main
|
||||
windows currently open in the process.
|
||||
|
||||
windows currently open in the current thread.
|
||||
.SH KEYWORDS
|
||||
application, main window
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_MaintainGeometry 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -14,68 +14,67 @@ Tk_MaintainGeometry, Tk_UnmaintainGeometry \- maintain geometry of one window re
|
||||
.nf
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
\fBTk_MaintainGeometry\fR(\fIslave, master, x, y, width, height\fR)
|
||||
\fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR)
|
||||
.sp
|
||||
\fBTk_UnmaintainGeometry\fR(\fIslave, master\fR)
|
||||
\fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_Window master
|
||||
.AP Tk_Window slave in
|
||||
.AS Tk_Window container
|
||||
.AP Tk_Window window in
|
||||
Window whose geometry is to be controlled.
|
||||
.AP Tk_Window master in
|
||||
Window relative to which \fIslave\fR's geometry will be controlled.
|
||||
.AP Tk_Window container in
|
||||
Window relative to which \fIwindow\fR's geometry will be controlled.
|
||||
.AP int x in
|
||||
Desired x-coordinate of \fIslave\fR in \fImaster\fR, measured in pixels
|
||||
from the inside of \fImaster\fR's left border to the outside of
|
||||
\fIslave\fR's left border.
|
||||
Desired x-coordinate of \fIwindow\fR in \fIcontainer\fR, measured in pixels
|
||||
from the inside of \fIcontainer\fR's left border to the outside of
|
||||
\fIwindow\fR's left border.
|
||||
.AP int y in
|
||||
Desired y-coordinate of \fIslave\fR in \fImaster\fR, measured in pixels
|
||||
from the inside of \fImaster\fR's top border to the outside of
|
||||
\fIslave\fR's top border.
|
||||
Desired y-coordinate of \fIwindow\fR in \fIcontainer\fR, measured in pixels
|
||||
from the inside of \fIcontainer\fR's top border to the outside of
|
||||
\fIwindow\fR's top border.
|
||||
.AP int width in
|
||||
Desired width for \fIslave\fR, in pixels.
|
||||
Desired width for \fIwindow\fR, in pixels.
|
||||
.AP int height in
|
||||
Desired height for \fIslave\fR, in pixels.
|
||||
Desired height for \fIwindow\fR, in pixels.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_MaintainGeometry\fR and \fBTk_UnmaintainGeometry\fR make it
|
||||
easier for geometry managers to deal with slaves whose masters are not
|
||||
easier for geometry managers to deal with windows whose containers are not
|
||||
their parents.
|
||||
Three problems arise if the master for a slave is not its parent:
|
||||
Three problems arise if the container for a window is not its parent:
|
||||
.IP [1]
|
||||
The x- and y-position of the slave must be translated from the
|
||||
coordinate system of the master to that of the parent before
|
||||
positioning the slave.
|
||||
The x- and y-position of the window must be translated from the
|
||||
coordinate system of the container to that of the parent before
|
||||
positioning the window.
|
||||
.IP [2]
|
||||
If the master window, or any of its ancestors up to the slave's
|
||||
parent, is moved, then the slave must be repositioned within its
|
||||
If the container window, or any of its ancestors up to the window's
|
||||
parent, is moved, then the window must be repositioned within its
|
||||
parent in order to maintain the correct position relative to the
|
||||
master.
|
||||
container.
|
||||
.IP [3]
|
||||
If the master or one of its ancestors is mapped or unmapped, then
|
||||
the slave must be mapped or unmapped to correspond.
|
||||
If the container or one of its ancestors is mapped or unmapped, then
|
||||
the window must be mapped or unmapped to correspond.
|
||||
.LP
|
||||
None of these problems is an issue if the parent and master are
|
||||
the same. For example, if the master or one of its ancestors
|
||||
is unmapped, the slave is automatically removed by the screen
|
||||
None of these problems is an issue if the parent and container are
|
||||
the same. For example, if the container or one of its ancestors
|
||||
is unmapped, the window is automatically removed by the screen
|
||||
by X.
|
||||
.PP
|
||||
\fBTk_MaintainGeometry\fR deals with these problems for slaves
|
||||
whose masters are not their parents, as well as handling the simpler
|
||||
case of slaves whose masters are their parents.
|
||||
\fBTk_MaintainGeometry\fR deals with these problems for windows
|
||||
whose containers are not their parents, as well as handling the simpler
|
||||
case of windows whose container are their parents.
|
||||
\fBTk_MaintainGeometry\fR is typically called by a window manager
|
||||
once it has decided where a slave should be positioned relative
|
||||
to its master.
|
||||
once it has decided where a window should be positioned relative
|
||||
to its container.
|
||||
\fBTk_MaintainGeometry\fR translates the coordinates to the
|
||||
coordinate system of \fIslave\fR's parent and then moves and
|
||||
resizes the slave appropriately.
|
||||
coordinate system of \fIwindow\fR's parent and then moves and
|
||||
resizes the window appropriately.
|
||||
Furthermore, it remembers the desired position and creates event
|
||||
handlers to monitor the master and all of its ancestors up
|
||||
to (but not including) the slave's parent.
|
||||
handlers to monitor the container and all of its ancestors up
|
||||
to (but not including) the window's parent.
|
||||
If any of these windows is moved, mapped, or unmapped,
|
||||
the slave will be adjusted so that it is mapped only when the
|
||||
master is mapped and its geometry relative to the master
|
||||
the window will be adjusted so that it is mapped only when the
|
||||
container is mapped and its geometry relative to the container
|
||||
remains as specified by \fIx\fR, \fIy\fR, \fIwidth\fR, and
|
||||
\fIheight\fR.
|
||||
.PP
|
||||
@@ -84,17 +83,17 @@ if it decides that it does not want the window to appear on the
|
||||
screen under any conditions, it calls \fBTk_UnmaintainGeometry\fR.
|
||||
\fBTk_UnmaintainGeometry\fR unmaps the window and cancels any
|
||||
previous calls to \fBTk_MaintainGeometry\fR for the
|
||||
\fImaster\fR\-\fIslave\fR pair, so that the slave's
|
||||
\fIcontainer\fR\-\fIwindow\fR pair, so that the window's
|
||||
geometry and mapped state are no longer maintained
|
||||
automatically.
|
||||
\fBTk_UnmaintainGeometry\fR need not be called by a geometry
|
||||
manager if the slave, the master, or any of the master's ancestors
|
||||
manager if the window, the container, or any of the container's ancestors
|
||||
is destroyed: Tk will call it automatically.
|
||||
.PP
|
||||
If \fBTk_MaintainGeometry\fR is called repeatedly for the same
|
||||
\fImaster\fR\-\fIslave\fR pair, the information from the most
|
||||
\fIcontainer\fR\-\fIwindow\fR pair, the information from the most
|
||||
recent call supersedes any older information.
|
||||
If \fBTk_UnmaintainGeometry\fR is called for a \fImaster\fR\-\fIslave\fR
|
||||
If \fBTk_UnmaintainGeometry\fR is called for a \fIcontainer\fR\-\fIwindow\fR
|
||||
pair that is is not currently managed, the call has no effect.
|
||||
.SH KEYWORDS
|
||||
geometry manager, map, master, parent, position, slave, unmap
|
||||
geometry manager, map, container, parent, position, window, unmap
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ManageGeometry 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -32,7 +32,7 @@ Arbitrary one-word value to pass to geometry manager callbacks.
|
||||
.PP
|
||||
\fBTk_ManageGeometry\fR arranges for a particular geometry manager,
|
||||
described by the \fImgrPtr\fR argument, to control the geometry
|
||||
of a particular slave window, given by \fItkwin\fR.
|
||||
of a particular content window, given by \fItkwin\fR.
|
||||
If \fItkwin\fR was previously managed by some other geometry manager,
|
||||
the previous manager loses control in favor of the new one.
|
||||
If \fImgrPtr\fR is NULL, geometry management is cancelled for
|
||||
@@ -45,7 +45,7 @@ typedef struct {
|
||||
const char *\fIname\fR;
|
||||
Tk_GeomRequestProc *\fIrequestProc\fR;
|
||||
Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR;
|
||||
} Tk_GeomMgr;
|
||||
} \fBTk_GeomMgr\fR;
|
||||
.CE
|
||||
The \fIname\fR field is the textual name for the geometry manager,
|
||||
such as \fBpack\fR or \fBplace\fR; this value will be returned
|
||||
@@ -53,13 +53,13 @@ by the command \fBwinfo manager\fR.
|
||||
.PP
|
||||
\fIrequestProc\fR is a procedure in the geometry manager that
|
||||
will be invoked whenever \fBTk_GeometryRequest\fR is called by the
|
||||
slave to change its desired geometry.
|
||||
content window to change its desired geometry.
|
||||
\fIrequestProc\fR should have arguments and results that match the
|
||||
type \fBTk_GeomRequestProc\fR:
|
||||
.CS
|
||||
typedef void Tk_GeomRequestProc(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR);
|
||||
typedef void \fBTk_GeomRequestProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR);
|
||||
.CE
|
||||
The parameters to \fIrequestProc\fR will be identical to the
|
||||
corresponding parameters passed to \fBTk_ManageGeometry\fR.
|
||||
@@ -80,12 +80,11 @@ is the same as the window's current geometry manager.
|
||||
\fIlostSlaveProc\fR should have
|
||||
arguments and results that match the following prototype:
|
||||
.CS
|
||||
typedef void Tk_GeomLostSlaveProc(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR);
|
||||
typedef void \fBTk_GeomLostSlaveProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tk_Window \fItkwin\fR);
|
||||
.CE
|
||||
The parameters to \fIlostSlaveProc\fR will be identical to the
|
||||
corresponding parameters passed to \fBTk_ManageGeometry\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
callback, geometry, managed, request, unmanaged
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_MapWindow 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -23,7 +23,6 @@ Tk_Window
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures may be used to map and unmap windows
|
||||
@@ -36,9 +35,9 @@ deferred window creation.
|
||||
from the screen.
|
||||
.PP
|
||||
If \fItkwin\fR is a child window (i.e. \fBTk_CreateWindow\fR was
|
||||
used to create a child window), then event handlers interested in map
|
||||
and unmap events are invoked immediately. If \fItkwin\fR is not an
|
||||
internal window, then the event handlers will be invoked later, after
|
||||
used to create a child window), then event handlers interested in map
|
||||
and unmap events are invoked immediately. If \fItkwin\fR is not an
|
||||
internal window, then the event handlers will be invoked later, after
|
||||
X has seen the request and returned an event for it.
|
||||
.PP
|
||||
These procedures should be used in place of the X procedures
|
||||
@@ -46,6 +45,5 @@ These procedures should be used in place of the X procedures
|
||||
Tk's local data structure for \fItkwin\fR. Applications
|
||||
using Tk should not invoke \fBXMapWindow\fR and \fBXUnmapWindow\fR
|
||||
directly.
|
||||
|
||||
.SH KEYWORDS
|
||||
map, unmap, window
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -32,7 +32,7 @@ returned by a previous call to \fBTk_GetFont\fR.
|
||||
Text to be measured or displayed. Need not be null terminated. Any
|
||||
non-printing meta-characters in the string (such as tabs, newlines, and
|
||||
other control characters) will be measured or displayed in a
|
||||
platform-dependent manner.
|
||||
platform-dependent manner.
|
||||
.AP int numBytes in
|
||||
The maximum number of bytes to consider when measuring or drawing
|
||||
\fIstring\fR. Must be greater than or equal to 0.
|
||||
@@ -60,11 +60,11 @@ Display on which to draw.
|
||||
.AP Drawable drawable in
|
||||
Window or pixmap in which to draw.
|
||||
.AP GC gc in
|
||||
Graphics context for drawing characters. The font selected into this GC
|
||||
Graphics context for drawing characters. The font selected into this GC
|
||||
must be the same as the \fItkfont\fR.
|
||||
.AP int "x, y" in
|
||||
Coordinates at which to place the left edge of the baseline when displaying
|
||||
\fIstring\fR.
|
||||
\fIstring\fR.
|
||||
.AP int firstByte in
|
||||
The index of the first byte of the first character to underline in the
|
||||
\fIstring\fR. Underlining begins at the left edge of this character.
|
||||
@@ -80,7 +80,7 @@ single-line strings. To measure and display single-font, multi-line,
|
||||
justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR.
|
||||
There is no programming interface in the core of Tk that supports
|
||||
multi-font, multi-line text; support for that behavior must be built on
|
||||
top of simpler layers.
|
||||
top of simpler layers.
|
||||
Note that the interfaces described here are
|
||||
byte-oriented not character-oriented, so index values coming from Tcl
|
||||
scripts need to be converted to byte offsets using the
|
||||
@@ -95,7 +95,7 @@ escape sequences, while under Windows and Macintosh hollow or solid boxes
|
||||
may be substituted. Refer to the documentation for
|
||||
\fBTk_ComputeTextLayout\fR for a programming interface that supports the
|
||||
platform-independent expansion of tab characters into columns and
|
||||
newlines/returns into multi-line text.
|
||||
newlines/returns into multi-line text.
|
||||
.PP
|
||||
\fBTk_MeasureChars\fR is used both to compute the length of a given
|
||||
string and to compute how many characters from a string fit in a given
|
||||
@@ -106,12 +106,12 @@ value will be \fInumBytes\fR. \fI*lengthPtr\fR is filled with the computed
|
||||
width, in pixels, of the portion of the string that was measured. For
|
||||
example, if the return value is 5, then \fI*lengthPtr\fR is filled with the
|
||||
distance between the left edge of \fIstring\fR[0] and the right edge of
|
||||
\fIstring\fR[4].
|
||||
\fIstring\fR[4].
|
||||
.PP
|
||||
\fBTk_TextWidth\fR is a wrapper function that provides a simpler interface
|
||||
to the \fBTk_MeasureChars\fR function. The return value is how much
|
||||
space in pixels the given \fIstring\fR needs.
|
||||
.PP
|
||||
.PP
|
||||
\fBTk_DrawChars\fR draws the \fIstring\fR at the given location in the
|
||||
given \fIdrawable\fR.
|
||||
.PP
|
||||
@@ -120,7 +120,7 @@ given \fIstring\fR. It does not draw the characters (which are assumed to
|
||||
have been displayed previously by \fBTk_DrawChars\fR); it just draws the
|
||||
underline. This procedure is used to underline a few characters without
|
||||
having to construct an underlined font. To produce natively underlined
|
||||
text, the appropriate underlined font should be constructed and used.
|
||||
text, the appropriate underlined font should be constructed and used.
|
||||
.SH "SEE ALSO"
|
||||
font(n), FontId(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_MoveToplevelWindow 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,6 @@ 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
|
||||
window manager, if there is one.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
In general, a window should never set its own position; this should be
|
||||
@@ -47,7 +46,6 @@ menus that want to appear at a particular place on the screen.
|
||||
When \fBTk_MoveToplevelWindow\fR is called it does not immediately
|
||||
pass on the new desired location to the window manager; it defers
|
||||
this action until all other outstanding work has been completed,
|
||||
using the \fBTk_DoWhenIdle\fR mechanism.
|
||||
|
||||
using the \fBTcl_DoWhenIdle\fR mechanism.
|
||||
.SH KEYWORDS
|
||||
position, top-level window, window manager
|
||||
|
||||
10
doc/Name.3
10
doc/Name.3
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_Name 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -31,7 +31,6 @@ Interpreter to use for error reporting.
|
||||
.AP "const char" *pathName in
|
||||
Character string containing path name of window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Each window managed by Tk has two names, a short name that identifies
|
||||
@@ -49,8 +48,7 @@ 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
|
||||
\fBTk_GetUid\fR for details).
|
||||
.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
|
||||
dots between elements instead of slashes: the main window for
|
||||
an application has the path name
|
||||
@@ -75,7 +73,8 @@ The procedure \fBTk_NameToWindow\fR returns the token for a window
|
||||
given its path name (the \fIpathName\fR argument) and another window
|
||||
belonging to the same main window (\fItkwin\fR). It normally
|
||||
returns a token for the named window, but if no such window exists
|
||||
\fBTk_NameToWindow\fR leaves an error message in \fIinterp->result\fR
|
||||
\fBTk_NameToWindow\fR leaves an error message in interpreter
|
||||
\fIinterp\fR's result
|
||||
and returns NULL. The \fItkwin\fR argument to \fBTk_NameToWindow\fR
|
||||
is needed because path names are only unique within a single
|
||||
application hierarchy. If, for example, a single process has opened
|
||||
@@ -83,6 +82,5 @@ two main windows, each will have a separate naming hierarchy and the
|
||||
same path name might appear in each of the hierarchies. Normally
|
||||
\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.
|
||||
|
||||
.SH KEYWORDS
|
||||
name, path name, token, window
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -14,19 +14,21 @@ Tk_NameOfImage \- Return name of image.
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTk_NameOfImage\fR(\fItypePtr\fR)
|
||||
\fBTk_NameOfImage\fR(\fIimageMaster\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_ImageMaster *masterPtr
|
||||
.AP Tk_ImageMaster *masterPtr in
|
||||
.AS Tk_ImageMaster imageMaster
|
||||
.AP Tk_ImageMaster imageMaster in
|
||||
Token for image, which was passed to image manager's \fIcreateProc\fR when
|
||||
the image was created.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure is invoked by image managers to find out the name
|
||||
of an image. Given the token for the image, it returns the
|
||||
string name for the image.
|
||||
|
||||
.PP
|
||||
.VS "TIP 581"
|
||||
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
|
||||
.VE "TIP 581"
|
||||
.SH KEYWORDS
|
||||
image manager, image name
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -26,7 +26,6 @@ Procedure to invoke when \fItkwin\fR loses selection ownership later.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the
|
||||
@@ -39,12 +38,12 @@ invoked so that the window can clean itself up (e.g. by
|
||||
unhighlighting the selection). \fIProc\fR should have arguments and
|
||||
result that match the type \fBTk_LostSelProc\fR:
|
||||
.CS
|
||||
typedef void Tk_LostSelProc(ClientData \fIclientData\fR);
|
||||
typedef void \fBTk_LostSelProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the
|
||||
\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is
|
||||
usually a pointer to a data structure containing application-specific
|
||||
information about \fItkwin\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
own, selection owner
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ParseArgv 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -60,8 +60,8 @@ elements of \fIargv\fR.
|
||||
.PP
|
||||
\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
|
||||
\fBTk_ParseArgv\fR will leave an error message in \fIinterp->result\fR
|
||||
in the standard Tcl fashion. In
|
||||
\fBTk_ParseArgv\fR will leave an error message in the result of
|
||||
interpreter \fIinterp\fR in the standard Tcl fashion. In
|
||||
the event of an error return, \fI*argvPtr\fR will not have been
|
||||
modified, but \fIargv\fR could have been partially modified. The
|
||||
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:
|
||||
.CS
|
||||
typedef struct {
|
||||
char *\fIkey\fR;
|
||||
const char *\fIkey\fR;
|
||||
int \fItype\fR;
|
||||
char *\fIsrc\fR;
|
||||
char *\fIdst\fR;
|
||||
char *\fIhelp\fR;
|
||||
} Tk_ArgvInfo;
|
||||
const char *\fIhelp\fR;
|
||||
} \fBTk_ArgvInfo\fR;
|
||||
.CE
|
||||
The \fIkey\fR field is a string such as
|
||||
.QW \-display
|
||||
@@ -186,7 +186,8 @@ specifiers of this type are ignored (as if they did not exist).
|
||||
\fBTK_ARGV_HELP\fR
|
||||
When this kind of option is encountered, \fBTk_ParseArgv\fR uses the
|
||||
\fIhelp\fR fields of \fIargTable\fR to format a message describing
|
||||
all the valid arguments. The message is placed in \fIinterp->result\fR
|
||||
all the valid arguments. The message is placed in interpreter
|
||||
\fIinterp\fR's result
|
||||
and \fBTk_ParseArgv\fR returns \fBTCL_ERROR\fR. When this happens, the
|
||||
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
|
||||
@@ -259,11 +260,12 @@ then return any that are left by compacting them to the beginning of
|
||||
\fIargv\fR (starting at \fIargv\fR[0]). \fIGenfunc\fR
|
||||
should return a count of how many arguments are left in \fIargv\fR;
|
||||
\fBTk_ParseArgv\fR will process them. If \fIgenfunc\fR encounters
|
||||
an error then it should leave an error message in \fIinterp->result\fR,
|
||||
an error then it should leave an error message in interpreter
|
||||
\fIinterp\fR's result,
|
||||
in the usual Tcl fashion, and return \-1; when this happens
|
||||
\fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR.
|
||||
.RE
|
||||
.SH "FLAGS"
|
||||
.SS "FLAGS"
|
||||
.TP
|
||||
\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR
|
||||
\fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program
|
||||
@@ -312,14 +314,14 @@ Boolean exec = FALSE;
|
||||
Tk_ArgvInfo argTable[] = {
|
||||
{"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag,
|
||||
"Turn on debugging printfs"},
|
||||
{"\-N", TK_ARGV_INT, (char *) NULL, (char *) &numReps,
|
||||
{"\-N", TK_ARGV_INT, NULL, (char *) &numReps,
|
||||
"Number of repetitions"},
|
||||
{"\-of", TK_ARGV_STRING, (char *) NULL, (char *) &fileName,
|
||||
{"\-of", TK_ARGV_STRING, NULL, (char *) &fileName,
|
||||
"Name of file for output"},
|
||||
{"x", TK_ARGV_REST, (char *) NULL, (char *) &exec,
|
||||
{"x", TK_ARGV_REST, NULL, (char *) &exec,
|
||||
"File to exec, followed by any arguments (must be last argument)."},
|
||||
{(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
|
||||
(char *) NULL}
|
||||
{NULL, TK_ARGV_END, NULL, NULL,
|
||||
NULL}
|
||||
};
|
||||
|
||||
main(argc, argv)
|
||||
@@ -329,7 +331,7 @@ main(argc, argv)
|
||||
\&...
|
||||
|
||||
if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) {
|
||||
fprintf(stderr, "%s\en", interp->result);
|
||||
fprintf(stderr, "%s\en", Tcl_GetString(Tcl_GetObjResult(interp)));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -30,7 +30,6 @@ that all unused fields of the structure be set to zero.
|
||||
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
|
||||
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event
|
||||
@@ -47,6 +46,5 @@ returns the previous value for collapse behavior on the \fIdisplay\fR.
|
||||
The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has
|
||||
the same significance as for \fBTcl_QueueEvent\fR; see the
|
||||
documentation for \fBTcl_QueueEvent\fR for details.
|
||||
|
||||
.SH KEYWORDS
|
||||
callback, clock, handler, modal timeout, events
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,6 @@ must be \fBAbove\fR or \fBBelow\fR.
|
||||
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.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative
|
||||
@@ -42,6 +41,5 @@ just above or below \fIother\fR.
|
||||
The \fIaboveBelow\fR argument must have one of the symbolic values
|
||||
\fBAbove\fR or \fBBelow\fR.
|
||||
Both of these values are defined by the include file <X11/Xlib.h>.
|
||||
|
||||
.SH KEYWORDS
|
||||
above, below, obscure, stacking order
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -15,23 +15,22 @@ Tk_RestrictEvents \- filter and selectively delay X events
|
||||
\fB#include <tk.h>\fR
|
||||
.sp
|
||||
Tk_RestrictProc *
|
||||
\fBTk_RestrictEvents\fR(\fIproc, clientData, prevClientDataPtr\fR)
|
||||
\fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_RestrictProc **prevClientDataPtr
|
||||
.AS Tk_RestrictProc **prevArgPtr
|
||||
.AP Tk_RestrictProc *proc in
|
||||
Predicate procedure to call to filter incoming X events.
|
||||
NULL means do not restrict events at all.
|
||||
.AP ClientData clientData in
|
||||
.AP ClientData arg in
|
||||
Arbitrary argument to pass to \fIproc\fR.
|
||||
.AP ClientData *prevClientDataPtr out
|
||||
.AP ClientData *prevArgPtr out
|
||||
Pointer to place to save argument to previous restrict procedure.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure is useful in certain situations where applications
|
||||
are only prepared to receive certain X events. After
|
||||
\fBTk_RestrictEvents\fR is called, \fBTk_DoOneEvent\fR (and
|
||||
\fBTk_RestrictEvents\fR is called, \fBTcl_DoOneEvent\fR (and
|
||||
hence \fBTk_MainLoop\fR) will filter X input events through
|
||||
\fIproc\fR. \fIProc\fR indicates whether a
|
||||
given event is to be processed immediately, deferred until some
|
||||
@@ -40,23 +39,23 @@ later time (e.g. when the event restriction is lifted), or discarded.
|
||||
is a procedure with arguments and result that match
|
||||
the type \fBTk_RestrictProc\fR:
|
||||
.CS
|
||||
typedef Tk_RestrictAction Tk_RestrictProc(
|
||||
ClientData \fIclientData\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
typedef Tk_RestrictAction \fBTk_RestrictProc\fR(
|
||||
ClientData \fIarg\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fIclientData\fR argument is a copy of the \fIclientData\fR passed
|
||||
The \fIarg\fR argument is a copy of the \fIarg\fR passed
|
||||
to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with
|
||||
information it needs to filter events. The \fIeventPtr\fR points to
|
||||
an event under consideration. \fIProc\fR returns a restrict action
|
||||
(enumerated type \fBTk_RestrictAction\fR) that indicates what
|
||||
\fBTk_DoOneEvent\fR should do with the event. If the return value is
|
||||
\fBTcl_DoOneEvent\fR should do with the event. If the return value is
|
||||
\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
|
||||
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
|
||||
queue and discarded without being processed.
|
||||
.PP
|
||||
\fBTk_RestrictEvents\fR uses its return value and \fIprevClientDataPtr\fR
|
||||
\fBTk_RestrictEvents\fR uses its return value and \fIprevArgPtr\fR
|
||||
to return information about the current event restriction procedure
|
||||
(a NULL return value means there are currently no restrictions).
|
||||
These values may be used to restore the previous restriction state
|
||||
@@ -75,6 +74,6 @@ solution in these situations is to call \fBXNextEvent\fR or
|
||||
\fBXWindowEvent\fR, but these procedures cannot be used because
|
||||
Tk keeps its own event queue that is separate from the X event
|
||||
queue. Instead, call \fBTk_RestrictEvents\fR to set up a filter,
|
||||
then call \fBTk_DoOneEvent\fR to retrieve the desired event(s).
|
||||
then call \fBTcl_DoOneEvent\fR to retrieve the desired event(s).
|
||||
.SH KEYWORDS
|
||||
delay, event, filter, restriction
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -24,7 +24,6 @@ application.
|
||||
.AP "const char" *name in
|
||||
Name under which to register the application.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_SetAppName\fR associates a name with a given application and
|
||||
@@ -59,6 +58,5 @@ so applications do not normally need to call it explicitly.
|
||||
.PP
|
||||
The command \fBtk appname\fR provides Tcl-level access to the
|
||||
functionality of \fBTk_SetAppName\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
application, name, register, send command
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -25,7 +25,6 @@ Window-relative y coordinate.
|
||||
.AP int h in
|
||||
Height of the caret in the window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_SetCaretPos\fR sets the caret location for the display of the
|
||||
@@ -33,6 +32,5 @@ specified Tk_Window \fItkwin\fR. The caret is the per-display cursor
|
||||
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
|
||||
(X Input Methods) or Windows IME windows.
|
||||
|
||||
.SH KEYWORDS
|
||||
caret, cursor
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetClass 3 "" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -25,7 +25,6 @@ Token for window.
|
||||
.AP char *class in
|
||||
New class name for window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_SetClass\fR is called to associate a class with a particular
|
||||
@@ -54,6 +53,5 @@ the properties of a unique identifier (see the manual entry for
|
||||
\fBTk_GetUid\fR for details).
|
||||
If \fItkwin\fR has not yet been given a class, then
|
||||
\fBTk_Class\fR will return NULL.
|
||||
|
||||
.SH KEYWORDS
|
||||
class, unique identifier, window, window manager
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -18,14 +18,13 @@ Tk_SetClassProcs \- register widget specific procedures
|
||||
.AS Tk_ClassProc instanceData
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window to modify.
|
||||
.AP Tk_ClassProcs *procs in
|
||||
.AP "const Tk_ClassProcs" *procs in
|
||||
Pointer to data structure containing widget specific procedures.
|
||||
The data structure pointed to by \fIprocs\fR must be static:
|
||||
Tk keeps a reference to it as long as the window exists.
|
||||
.AP ClientData instanceData in
|
||||
Arbitrary one-word value to pass to widget callbacks.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_SetClassProcs\fR is called to register a set of procedures that
|
||||
@@ -38,7 +37,7 @@ typedef struct Tk_ClassProcs {
|
||||
Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
|
||||
Tk_ClassCreateProc *\fIcreateProc\fR;
|
||||
Tk_ClassModalProc *\fImodalProc\fR;
|
||||
} Tk_ClassProcs;
|
||||
} \fBTk_ClassProcs\fR;
|
||||
.CE
|
||||
The \fIsize\fR field is used to simplify future expansion of the
|
||||
structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR.
|
||||
@@ -50,21 +49,21 @@ widgets configured to use that font alias must update their display
|
||||
accordingly. \fIworldChangedProc\fR should have arguments and results
|
||||
that match the type \fBTk_ClassWorldChangedProc\fR:
|
||||
.CS
|
||||
typedef void Tk_ClassWorldChangedProc(
|
||||
ClientData \fIinstanceData\fR);
|
||||
typedef void \fBTk_ClassWorldChangedProc\fR(
|
||||
ClientData \fIinstanceData\fR);
|
||||
.CE
|
||||
The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
|
||||
will be identical to the \fIinstanceData\fR parameter passed to
|
||||
\fBTk_SetClassProcs\fR.
|
||||
.PP
|
||||
\fIcreateProc\fR is used to create platform-dependant windows. It is
|
||||
\fIcreateProc\fR is used to create platform-dependent windows. It is
|
||||
invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have
|
||||
arguments and results that match the type \fBTk_ClassCreateProc\fR:
|
||||
.CS
|
||||
typedef Window Tk_ClassCreateProc(
|
||||
Tk_Window \fItkwin\fR,
|
||||
Window \fIparent\fR,
|
||||
ClientData \fIinstanceData\fR);
|
||||
typedef Window \fBTk_ClassCreateProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
Window \fIparent\fR,
|
||||
ClientData \fIinstanceData\fR);
|
||||
.CE
|
||||
The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to
|
||||
the \fItkwin\fR and \fIinstanceData\fR parameters passed to
|
||||
@@ -76,14 +75,13 @@ created window.
|
||||
triggered in order to handle a modal loop. \fImodalProc\fR should
|
||||
have arguments and results that match the type \fBTk_ClassModalProc\fR:
|
||||
.CS
|
||||
typedef void Tk_ClassModalProc(
|
||||
Tk_Window \fItkwin\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
typedef void \fBTk_ClassModalProc\fR(
|
||||
Tk_Window \fItkwin\fR,
|
||||
XEvent *\fIeventPtr\fR);
|
||||
.CE
|
||||
The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the
|
||||
\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The
|
||||
\fIeventPtr\fR parameter will be a pointer to an XEvent structure
|
||||
describing the event being processed.
|
||||
|
||||
.SH KEYWORDS
|
||||
callback, class
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -32,7 +32,6 @@ Width of one grid unit, in pixels.
|
||||
.AP int heightInc in
|
||||
Height of one grid unit, in pixels.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's
|
||||
@@ -60,6 +59,5 @@ toplevel, the calls for the new window have no effect.
|
||||
.PP
|
||||
See the \fBwm\fR manual entry for additional information on gridded geometry
|
||||
management.
|
||||
|
||||
.SH KEYWORDS
|
||||
grid, window, window manager
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -63,7 +63,7 @@ no window-dependent options, then a NULL value may be supplied for
|
||||
this argument.
|
||||
.AP int objc in
|
||||
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.
|
||||
.AP Tk_SavedOptions *savePtr out
|
||||
If not NULL, the structure pointed to by this argument is filled
|
||||
@@ -261,7 +261,7 @@ typedef struct {
|
||||
int \fIobjOffset\fR;
|
||||
int \fIinternalOffset\fR;
|
||||
int \fIflags\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
const void *\fIclientData\fR;
|
||||
int \fItypeMask\fR;
|
||||
} \fBTk_OptionSpec\fR;
|
||||
.CE
|
||||
@@ -443,7 +443,9 @@ suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must
|
||||
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
|
||||
into the table of the matching string, like the return value
|
||||
from \fBTcl_GetStringFromObj\fR.
|
||||
from \fBTcl_GetStringFromObj\fR. This option type supports the
|
||||
\fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal
|
||||
representation is set to -1.
|
||||
.TP
|
||||
\fBTK_OPTION_SYNONYM\fR
|
||||
This type is used to provide alternative names for an option (for
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,6 @@ Number of bits per pixel desired for \fItkwin\fR.
|
||||
New colormap for \fItkwin\fR, which must be compatible with
|
||||
\fIvisual\fR and \fIdepth\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
When Tk creates a new window it assigns it the default visual
|
||||
@@ -47,6 +46,5 @@ completed successfully.
|
||||
Note: \fBTk_SetWindowVisual\fR should not be called if you just want
|
||||
to change a window's colormap without changing its visual or depth;
|
||||
call \fBTk_SetWindowColormap\fR instead.
|
||||
|
||||
.SH KEYWORDS
|
||||
colormap, depth, visual
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -20,7 +20,6 @@ int
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure returns the current value of the \fBtk_strictMotif\fR
|
||||
@@ -35,6 +34,5 @@ is good enough, and extra features are welcome.
|
||||
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
|
||||
\fBTcl_GetVar\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
Motif compliance, tk_strictMotif variable
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_ComputeTextLayout 3 8.1 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -39,7 +39,6 @@ int
|
||||
.sp
|
||||
void
|
||||
\fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR
|
||||
|
||||
.SH ARGUMENTS
|
||||
.AS Tk_TextLayout "*xPtr, *yPtr"
|
||||
.AP Tk_Font tkfont in
|
||||
@@ -49,7 +48,7 @@ have been returned by a previous call to \fBTk_GetFont\fR.
|
||||
.AP "const char" *string in
|
||||
Potentially multi-line string whose dimensions are to be computed and
|
||||
stored in the text layout. The \fIstring\fR must remain valid for the
|
||||
lifetime of the text layout.
|
||||
lifetime of the text layout.
|
||||
.AP int numChars in
|
||||
The number of characters to consider from \fIstring\fR. If
|
||||
\fInumChars\fR is less than 0, then assumes \fIstring\fR is null
|
||||
@@ -78,7 +77,7 @@ measured and displayed in a platform-dependent manner as described in
|
||||
\fBTk_MeasureChars\fR, and will not have any special behaviors.
|
||||
.AP int *widthPtr out
|
||||
If non-NULL, filled with either the width, in pixels, of the widest
|
||||
line in the text layout, or the width, in pixels, of the bounding box for the
|
||||
line in the text layout, or the width, in pixels, of the bounding box for the
|
||||
character specified by \fIindex\fR.
|
||||
.AP int *heightPtr out
|
||||
If non-NULL, filled with either the total height, in pixels, of all
|
||||
@@ -102,7 +101,7 @@ text layout when it is being drawn, or the coordinates of a point (with
|
||||
respect to the upper-left hand corner of the text layout) to check
|
||||
against the text layout.
|
||||
.AP int firstChar in
|
||||
The index of the first character to draw from the given text layout.
|
||||
The index of the first character to draw from the given text layout.
|
||||
The number 0 means to draw from the beginning.
|
||||
.AP int lastChar in
|
||||
The index of the last character up to which to draw. The character
|
||||
@@ -120,13 +119,12 @@ for the character specified by \fIindex\fR. Either or both \fIxPtr\fR
|
||||
and \fIyPtr\fR may be NULL, in which case the corresponding value
|
||||
is not calculated.
|
||||
.AP int "width, height" in
|
||||
Specifies the width and height, in pixels, of the rectangular area to
|
||||
Specifies the width and height, in pixels, of the rectangular area to
|
||||
compare for intersection against the text layout.
|
||||
.AP Tcl_Interp *interp out
|
||||
Postscript code that will print the text layout is appended to
|
||||
\fIinterp->result\fR.
|
||||
the result of interpreter \fIinterp\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These routines are for measuring and displaying single-font, multi-line,
|
||||
@@ -134,7 +132,7 @@ justified text. To measure and display simple single-font, single-line
|
||||
strings, refer to the documentation for \fBTk_MeasureChars\fR. There is
|
||||
no programming interface in the core of Tk that supports multi-font,
|
||||
multi-line text; support for that behavior must be built on top of
|
||||
simpler layers.
|
||||
simpler layers.
|
||||
Note that unlike the lower level text display routines, the functions
|
||||
described here all operate on character-oriented lengths and indices
|
||||
rather than byte-oriented values. See the description of
|
||||
@@ -152,11 +150,11 @@ returns a Tk_TextLayout token that holds this information. This token is
|
||||
used in subsequent calls to procedures such as \fBTk_DrawTextLayout\fR,
|
||||
\fBTk_DistanceToTextLayout\fR, and \fBTk_FreeTextLayout\fR. The
|
||||
\fIstring\fR and \fItkfont\fR used when computing the layout must remain
|
||||
valid for the lifetime of this token.
|
||||
valid for the lifetime of this token.
|
||||
.PP
|
||||
\fBTk_FreeTextLayout\fR is called to release the storage associated with
|
||||
\fIlayout\fR when it is no longer needed. A \fIlayout\fR should not be used
|
||||
in any other text layout procedures once it has been released.
|
||||
in any other text layout procedures once it has been released.
|
||||
.PP
|
||||
\fBTk_DrawTextLayout\fR uses the information in \fIlayout\fR to display a
|
||||
single-font, multi-line, justified string of text at the specified location.
|
||||
@@ -184,14 +182,16 @@ 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
|
||||
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
|
||||
to the point. Given a \fIlayout\fR with no characters, the value 0 will
|
||||
always be returned, referring to a hypothetical zero-width placeholder
|
||||
character.
|
||||
to the point, or one more than the index of any character (to indicate that
|
||||
the point was after the end of the string and that the corresponding caret
|
||||
would be at the end of the string). Given a \fIlayout\fR with no characters,
|
||||
the value 0 will always be returned, referring to a hypothetical zero-width
|
||||
placeholder character.
|
||||
.PP
|
||||
\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 is the advance width of the character, and does not include any
|
||||
left or right bearing. Any character that extends partially outside of
|
||||
left or right bearing. Any character that extends partially outside of
|
||||
\fIlayout\fR is considered to be truncated at the edge. Any character
|
||||
that would be located completely outside of \fIlayout\fR is considered to
|
||||
be zero-width and pegged against the edge. The height of the bounding
|
||||
@@ -231,8 +231,9 @@ array of strings that represent the individual lines in \fIlayout\fR. It
|
||||
is the responsibility of the caller to take the Postscript array of
|
||||
strings and add some Postscript function operate on the array to render
|
||||
each of the lines. The code that represents the Postscript array of
|
||||
strings is appended to \fIinterp->result\fR.
|
||||
strings is appended to interpreter \fIinterp\fR's result.
|
||||
.SH "DISPLAY MODEL"
|
||||
.PP
|
||||
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
|
||||
can be positioned amongst them, but their additional width is ignored when
|
||||
@@ -263,13 +264,13 @@ much as fits placed on the line and the rest on subsequent line(s). If
|
||||
\fIwrapLength\fR is so small that not even one character can fit on a
|
||||
given line, the \fIwrapLength\fR is ignored for that line and one
|
||||
character will be placed on the line anyhow. When wrapping is turned
|
||||
off, only newline/return characters may cause a line break.
|
||||
off, only newline/return characters may cause a line break.
|
||||
.PP
|
||||
When a text layout has been created using an underlined \fItkfont\fR,
|
||||
then any space characters that occur at the end of individual lines,
|
||||
newlines/returns, and tabs will not be displayed underlined when
|
||||
newlines/returns, and tabs will not be displayed underlined when
|
||||
\fBTk_DrawTextLayout\fR is called, because those characters are never
|
||||
actually drawn \- they are merely placeholders maintained in the
|
||||
\fIlayout\fR.
|
||||
\fIlayout\fR.
|
||||
.SH KEYWORDS
|
||||
font
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -34,7 +34,7 @@ as \fIversion\fR.
|
||||
The Tcl stubs mechanism defines a way to dynamically bind
|
||||
extensions to a particular Tcl implementation at run time.
|
||||
the stubs mechanism requires no changes to applications
|
||||
incoporating Tcl/Tk interpreters. Only developers creating
|
||||
incorporating Tcl/Tk interpreters. Only developers creating
|
||||
C-based Tcl/Tk extensions need to take steps to use the
|
||||
stubs mechanism with their extensions.
|
||||
See the \fBTcl_InitStubs\fR page for more information.
|
||||
@@ -48,15 +48,19 @@ Tcl functions.
|
||||
Call \fBTk_InitStubs\fR if the extension before calling any other
|
||||
Tk functions.
|
||||
.IP 2) 5
|
||||
Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
|
||||
\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
|
||||
Define the \fBUSE_TCL_STUBS\fR and the \fBUSE_TK_STUBS\fR
|
||||
symbols. Typically, you would include the \fB\-DUSE_TCL_STUBS\fR and
|
||||
the \fB\-DUSE_TK_STUBS\fR flags when compiling the extension.
|
||||
.IP 3) 5
|
||||
Link the extension with the Tcl and Tk stubs libraries instead of
|
||||
the standard Tcl and Tk libraries. On Unix platforms, the library
|
||||
names are \fIlibtclstub8.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows
|
||||
platforms, the library names are \fItclstub84.lib\fR and \fItkstub84.lib\fR
|
||||
(adjust names with appropriate version number).
|
||||
Link the extension with the Tcl and Tk stubs libraries instead of the
|
||||
standard Tcl and Tk libraries. On Unix platforms, the library names
|
||||
are \fIlibtclstub8.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows
|
||||
platforms, the library names are \fItclstub84.lib\fR and
|
||||
\fItkstub84.lib\fR. Adjust the library names with appropriate version
|
||||
number but note that the extension may only be used with versions of
|
||||
Tcl/Tk that have that version number or higher.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_InitStubs\fR attempts to initialize the Tk stub table pointers
|
||||
and ensure that the correct version of Tk is loaded. In addition
|
||||
to an interpreter handle, it accepts as arguments a version number
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_Init 3 8.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -23,7 +23,6 @@ int
|
||||
Interpreter in which to load Tk. Tk should not already be loaded
|
||||
in this interpreter.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_Init\fR is the package initialization procedure for Tk.
|
||||
@@ -34,7 +33,7 @@ and creates a new Tk application, including its main window.
|
||||
If the initialization is successful \fBTk_Init\fR returns
|
||||
\fBTCL_OK\fR; if there is an error it returns \fBTCL_ERROR\fR.
|
||||
\fBTk_Init\fR also leaves a result or error message
|
||||
in \fIinterp->result\fR.
|
||||
in interpreter \fIinterp\fR's result.
|
||||
.PP
|
||||
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
|
||||
@@ -82,6 +81,5 @@ from the user.
|
||||
\fBwm\fR
|
||||
If toplevels are ever allowed, wm can be used to remove decorations,
|
||||
move windows around, etc.
|
||||
|
||||
.SH KEYWORDS
|
||||
safe, application, initialization, load, main window
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_Main 3 4.0 Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -20,16 +20,16 @@ Tk_Main \- main program for Tk-based applications
|
||||
.AP int argc in
|
||||
Number of elements in \fIargv\fR.
|
||||
.AP char *argv[] in
|
||||
Array of strings containing command-line arguments.
|
||||
Array of strings containing command-line arguments. On Windows, when
|
||||
using -DUNICODE, the parameter type changes to wchar_t *.
|
||||
.AP Tcl_AppInitProc *appInitProc in
|
||||
Address of an application-specific initialization procedure.
|
||||
The value for this argument is usually \fBTcl_AppInit\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_Main\fR acts as the main program for most Tk-based applications.
|
||||
Starting with Tk 4.0 it is not called \fBmain\fR anymore because it
|
||||
Starting with Tk 4.0 it is not called \fBmain\fR anymore because it
|
||||
is part of the Tk library and having a function \fBmain\fR
|
||||
in a library (particularly a shared library) causes problems on many
|
||||
systems.
|
||||
@@ -50,11 +50,21 @@ for the application to perform its own initialization, such as defining
|
||||
application-specific commands. The procedure must have an interface
|
||||
that matches the type \fBTcl_AppInitProc\fR:
|
||||
.CS
|
||||
typedef int Tcl_AppInitProc(Tcl_Interp *\fIinterp\fR);
|
||||
typedef int \fBTcl_AppInitProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR;
|
||||
for more details on this procedure, see the documentation
|
||||
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
|
||||
application-specific initialization, command-line arguments, main program
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -102,7 +102,6 @@ Tcl_Interp *
|
||||
.AP Tk_Window tkwin in
|
||||
Token for window.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTk_WindowId\fR and the other names listed above are
|
||||
@@ -169,7 +168,7 @@ the window's minimum requested size. These values correspond to the last
|
||||
call to \fBTk_SetMinimumRequestSize\fR for \fItkwin\fR.
|
||||
.PP
|
||||
\fBTk_InternalBorderLeft\fR, \fBTk_InternalBorderRight\fR,
|
||||
\fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR
|
||||
\fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR
|
||||
return the width of one side of the internal border
|
||||
that has been requested for \fItkwin\fR, or 0 if no internal border was
|
||||
requested. The return value is simply the last value passed to
|
||||
@@ -183,7 +182,6 @@ and \fBTk_Colormap\fR returns the current
|
||||
colormap for the window. The visual characteristics are
|
||||
normally set from the defaults for the window's screen, but
|
||||
they may be overridden by calling \fBTk_SetWindowVisual\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
attributes, colormap, depth, display, height, geometry manager,
|
||||
identifier, mapped, requested size, screen, top-level,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH bell n 8.4 Tk "Tk Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -15,7 +15,6 @@ bell \- Ring a display's bell
|
||||
.SH SYNOPSIS
|
||||
\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR?
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This command rings the bell on the display for \fIwindow\fR and
|
||||
@@ -28,6 +27,8 @@ may be modified with programs such as \fBxset\fR.
|
||||
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
|
||||
so that the screen becomes visible again.
|
||||
|
||||
.SH KEYWORDS
|
||||
beep, bell, ring
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
85
doc/bind.n
85
doc/bind.n
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH bind n 8.0 Tk "Tk Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -19,9 +19,10 @@ bind \- Arrange for X events to invoke Tcl scripts
|
||||
.PP
|
||||
The \fBbind\fR command associates Tcl scripts with X events.
|
||||
If all three arguments are specified, \fBbind\fR will
|
||||
arrange for \fIscript\fR (a Tcl script) to be evaluated whenever
|
||||
the event(s) given by \fIsequence\fR occur in the window(s)
|
||||
identified by \fItag\fR.
|
||||
arrange for \fIscript\fR (a Tcl script called the
|
||||
.QW "binding script")
|
||||
to be evaluated whenever the event(s) given by \fIsequence\fR
|
||||
occur in the window(s) identified by \fItag\fR.
|
||||
If \fIscript\fR is prefixed with a
|
||||
.QW + ,
|
||||
then it is appended to
|
||||
@@ -151,7 +152,6 @@ requirement.
|
||||
The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR
|
||||
resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys.
|
||||
.PP
|
||||
.VS 8.5
|
||||
The \fBExtended\fR modifier is, at present, specific to Windows. It
|
||||
appears on events that are associated with the keys on the
|
||||
.QW "extended keyboard" .
|
||||
@@ -160,7 +160,6 @@ 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,
|
||||
the \fBBreak\fR key, the \fBPrintScreen\fR key, and the \fB/\fR and
|
||||
\fBEnter\fR keys in the numeric keypad.
|
||||
.VE 8.5
|
||||
.SS "EVENT TYPES"
|
||||
.PP
|
||||
The \fItype\fR field may be any of the standard X event types, with a
|
||||
@@ -202,16 +201,27 @@ substitutions you would make when binding to these events.
|
||||
Many contemporary mice support a mouse wheel, which is used
|
||||
for scrolling documents without using the scrollbars. By rolling the
|
||||
wheel, the system will generate \fBMouseWheel\fR events that the
|
||||
application can use to scroll. Like \fBKey\fR events the event is
|
||||
always routed to the window that currently has focus. When the event
|
||||
application can use to scroll. The event is routed to the
|
||||
window currently under the mouse pointer. When the event
|
||||
is received you can use the \fB%D\fR substitution to get the
|
||||
\fIdelta\fR field for the event, which is a integer value describing how
|
||||
\fIdelta\fR field for the event, which is an integer value describing how
|
||||
the mouse wheel has moved. The smallest value for which 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
|
||||
system will report is defined by the OS. The sign of the
|
||||
value determines which direction your widget should scroll. Positive
|
||||
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
|
||||
The \fBKeyPress\fR and \fBKeyRelease\fR events are generated
|
||||
whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR
|
||||
@@ -273,7 +283,8 @@ it is destroyed.
|
||||
When the \fBDestroy\fR event is delivered
|
||||
to a widget, it is in a
|
||||
.QW half-dead
|
||||
state: the widget still exists, but most operations on it will fail.
|
||||
state: the widget still exists, but operations that involve it
|
||||
may return invalid results, or return an error.
|
||||
.RE
|
||||
.IP "\fBFocusIn\fR, \fBFocusOut\fR" 5
|
||||
The \fBFocusIn\fR and \fBFocusOut\fR events are generated
|
||||
@@ -391,7 +402,8 @@ For example, \fB<Control\-comma>\fR is equivalent to
|
||||
\fB<Control\-KeyPress\-comma>\fR.
|
||||
.SH "BINDING SCRIPTS AND SUBSTITUTIONS"
|
||||
.PP
|
||||
The \fIscript\fR argument to \fBbind\fR is a Tcl script,
|
||||
The \fIscript\fR argument to \fBbind\fR is a Tcl script, called the
|
||||
.QW "binding script",
|
||||
which will be executed whenever the given event sequence occurs.
|
||||
\fICommand\fR will be executed in the same interpreter that the
|
||||
\fBbind\fR command was executed in, and it will run at global
|
||||
@@ -429,10 +441,7 @@ 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
|
||||
yet been delivered to the window.
|
||||
.IP \fB%d\fR 5
|
||||
The \fIdetail\fR
|
||||
.VS 8.5
|
||||
or \fIuser_data\fR
|
||||
.VE 8.5
|
||||
The \fIdetail\fR or \fIuser_data\fR
|
||||
field from the event. The \fB%d\fR is replaced by
|
||||
a string identifying the detail. For \fBEnter\fR,
|
||||
\fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events,
|
||||
@@ -452,13 +461,11 @@ For \fBConfigureRequest\fR events, the string will be one of:
|
||||
\fBBelow\fR \fBNone\fR
|
||||
\fBBottomIf\fR \fBTopIf\fR
|
||||
.DE
|
||||
.VS 8.5
|
||||
For virtual events, the string will be whatever value is stored in the
|
||||
\fIuser_data\fR field when the event was created (typically with
|
||||
\fBevent generate\fR), or the empty string if the field is NULL.
|
||||
Virtual events corresponding to key sequence presses (see \fBevent
|
||||
add\fR for details) set the \fIuser_data\fR to NULL.
|
||||
.VE 8.5
|
||||
For events other than these, the substituted string is undefined.
|
||||
.RE
|
||||
.IP \fB%f\fR 5
|
||||
@@ -517,6 +524,9 @@ For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
|
||||
\fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events,
|
||||
\fB%x\fR and \fB%y\fR indicate the position of the mouse pointer
|
||||
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
|
||||
mouse pointer crossed the window, relative to the receiving window.
|
||||
For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR
|
||||
@@ -524,19 +534,18 @@ coordinates of the window relative to its parent window.
|
||||
.IP \fB%A\fR 5
|
||||
Substitutes the UNICODE character corresponding to the event, or
|
||||
the empty string if the event does not correspond to a UNICODE character
|
||||
(e.g. the shift key was pressed). \fBXmbLookupString\fR (or
|
||||
(e.g. the shift key was pressed). On X11, \fBXmbLookupString\fR (or
|
||||
\fBXLookupString\fR when input method support is turned off) does all
|
||||
the work of translating from the event to a UNICODE character.
|
||||
Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
|
||||
On X11, valid only for \fBKeyPress\fR event. On Windows and macOS/aqua,
|
||||
valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
|
||||
.IP \fB%B\fR 5
|
||||
The \fIborder_width\fR field from the event. Valid only for
|
||||
\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
|
||||
.IP \fB%D\fR 5
|
||||
This reports the \fIdelta\fR value of a \fBMouseWheel\fR event. The
|
||||
\fIdelta\fR value represents the rotation units the mouse wheel has
|
||||
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
|
||||
been moved. The sign of the value represents the direction the mouse
|
||||
wheel was scrolled.
|
||||
.IP \fB%E\fR 5
|
||||
The \fIsend_event\fR field from the event. Valid for all event types.
|
||||
@@ -575,8 +584,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
|
||||
values are the corresponding x-coordinate and y-coordinate in the virtual root.
|
||||
Valid only for
|
||||
\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
|
||||
and \fBMotion\fR events.
|
||||
\fBButtonPress\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBKeyPress\fR,
|
||||
\fBKeyRelease\fR, \fBLeave\fR and \fBMotion\fR events.
|
||||
Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
|
||||
window.
|
||||
.LP
|
||||
@@ -617,13 +626,21 @@ the window.
|
||||
.PP
|
||||
The \fBcontinue\fR and \fBbreak\fR commands may be used inside a
|
||||
binding script to control the processing of matching scripts.
|
||||
If \fBcontinue\fR is invoked, then the current binding script
|
||||
is terminated but Tk will continue processing binding scripts
|
||||
associated with other \fItag\fR's.
|
||||
If \fBcontinue\fR is invoked within a binding script, then this
|
||||
binding script, including all other
|
||||
.QW +
|
||||
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,
|
||||
then that script terminates and no other scripts will be invoked
|
||||
for the event.
|
||||
.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
|
||||
have the same \fItag\fR, then the most specific binding
|
||||
is chosen and its script is evaluated.
|
||||
@@ -639,11 +656,11 @@ of events matched) is more specific than a shorter sequence;
|
||||
.IP (c)
|
||||
if the modifiers specified in one pattern are a subset of the
|
||||
modifiers in another pattern, then the pattern with more modifiers
|
||||
is more specific.
|
||||
is more specific;
|
||||
.IP (d)
|
||||
a virtual event whose physical pattern matches the sequence is less
|
||||
specific than the same physical pattern that is not associated with a
|
||||
virtual event.
|
||||
virtual event;
|
||||
.IP (e)
|
||||
given a sequence that matches two or more virtual events, one
|
||||
of the virtual events will be chosen, but the order is undefined.
|
||||
@@ -704,6 +721,7 @@ If an error occurs in executing the script for a binding then the
|
||||
The \fBbgerror\fR command will be executed at global level
|
||||
(outside the context of any Tcl procedure).
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
Arrange for a string describing the motion of the mouse to be printed
|
||||
out when the mouse is double-clicked:
|
||||
.CS
|
||||
@@ -725,3 +743,6 @@ pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
|
||||
bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n)
|
||||
.SH KEYWORDS
|
||||
binding, event
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH bindtags n 4.0 Tk "Tk Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -14,7 +14,6 @@ bindtags \- Determine which bindings apply to a window, and order of evaluation
|
||||
.SH SYNOPSIS
|
||||
\fBbindtags \fIwindow \fR?\fItagList\fR?
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
When a binding is created with the \fBbind\fR command, it is
|
||||
@@ -73,6 +72,7 @@ associated with the \fBButton\fR tag, will no longer apply to \fB.b\fR,
|
||||
but any bindings associated with \fBTrickyButton\fR (perhaps some
|
||||
new button behavior) will apply.
|
||||
.SH EXAMPLE
|
||||
.PP
|
||||
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
|
||||
up to the current \fBtoplevel\fR (in contrast to Tk's default
|
||||
@@ -93,9 +93,10 @@ proc setupBindtagsForTreeDelivery {widget} {
|
||||
\fBbindtags\fR $widget $tags
|
||||
}
|
||||
.CE
|
||||
|
||||
.SH "SEE ALSO"
|
||||
bind(n)
|
||||
|
||||
.SH KEYWORDS
|
||||
binding, event, tag
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
26
doc/bitmap.n
26
doc/bitmap.n
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH bitmap n 4.0 Tk "Tk Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -12,9 +12,13 @@
|
||||
.SH NAME
|
||||
bitmap \- Images that display two colors
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR?
|
||||
.BE
|
||||
|
||||
\fIimageName \fBcget\fR \fIoption\fR
|
||||
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
||||
.fi
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
A bitmap is an image whose pixels can display either of two colors
|
||||
@@ -30,7 +34,6 @@ producing a transparent effect.
|
||||
For other pixels, the image displays the foreground color if
|
||||
the source data is one and the background color if the source
|
||||
data is zero.
|
||||
|
||||
.SH "CREATING BITMAPS"
|
||||
.PP
|
||||
Like all images, bitmaps are created using the \fBimage create\fR
|
||||
@@ -38,6 +41,7 @@ command.
|
||||
Bitmaps support the following \fIoptions\fR:
|
||||
.TP
|
||||
\fB\-background \fIcolor\fR
|
||||
.
|
||||
Specifies a background color for the image in any of the standard
|
||||
ways accepted by Tk. If this option is set to an empty string
|
||||
then the background pixels will be transparent. This effect
|
||||
@@ -45,6 +49,7 @@ is achieved by using the source bitmap as the mask bitmap, ignoring
|
||||
any \fB\-maskdata\fR or \fB\-maskfile\fR options.
|
||||
.TP
|
||||
\fB\-data \fIstring\fR
|
||||
.
|
||||
Specifies the contents of the source bitmap as a string.
|
||||
The string must adhere to X11 bitmap format (e.g., as generated
|
||||
by the \fBbitmap\fR program).
|
||||
@@ -52,16 +57,19 @@ If both the \fB\-data\fR and \fB\-file\fR options are specified,
|
||||
the \fB\-data\fR option takes precedence.
|
||||
.TP
|
||||
\fB\-file \fIname\fR
|
||||
.
|
||||
\fIname\fR gives the name of a file whose contents define the
|
||||
source bitmap.
|
||||
The file must adhere to X11 bitmap format (e.g., as generated
|
||||
by the \fBbitmap\fR program).
|
||||
.TP
|
||||
\fB\-foreground \fIcolor\fR
|
||||
.
|
||||
Specifies a foreground color for the image in any of the standard
|
||||
ways accepted by Tk.
|
||||
.TP
|
||||
\fB\-maskdata \fIstring\fR
|
||||
.
|
||||
Specifies the contents of the mask as a string.
|
||||
The string must adhere to X11 bitmap format (e.g., as generated
|
||||
by the \fBbitmap\fR program).
|
||||
@@ -69,11 +77,11 @@ If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified,
|
||||
the \fB\-maskdata\fR option takes precedence.
|
||||
.TP
|
||||
\fB\-maskfile \fIname\fR
|
||||
.
|
||||
\fIname\fR gives the name of a file whose contents define the
|
||||
mask.
|
||||
The file must adhere to X11 bitmap format (e.g., as generated
|
||||
by the \fBbitmap\fR program).
|
||||
|
||||
.SH "IMAGE COMMAND"
|
||||
.PP
|
||||
When a bitmap image is created, Tk also creates a new command
|
||||
@@ -89,12 +97,14 @@ determine the exact behavior of the command. The following
|
||||
commands are possible for bitmap images:
|
||||
.TP
|
||||
\fIimageName \fBcget\fR \fIoption\fR
|
||||
.
|
||||
Returns the current value of the configuration option given
|
||||
by \fIoption\fR.
|
||||
\fIOption\fR may have any of the values accepted by the
|
||||
\fBimage create bitmap\fR command.
|
||||
\fBimage create\fR \fBbitmap\fR command.
|
||||
.TP
|
||||
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
||||
.
|
||||
Query or modify the configuration options for the image.
|
||||
If no \fIoption\fR is specified, returns a list describing all of
|
||||
the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
|
||||
@@ -106,7 +116,9 @@ one or more \fIoption\-value\fR pairs are specified, then the command
|
||||
modifies the given option(s) to have the given value(s); in
|
||||
this case the command returns an empty string.
|
||||
\fIOption\fR may have any of the values accepted by the
|
||||
\fBimage create bitmap\fR command.
|
||||
|
||||
\fBimage create\fR \fBbitmap\fR command.
|
||||
.SH KEYWORDS
|
||||
bitmap, image
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user