Compare commits

...

5 Commits

Author SHA1 Message Date
Steve Dower
070b8750b0 Import Tk 8.6.11 2021-03-30 00:54:10 +01:00
Steve Dower
42c69189d9 Import Tk 8.6.10 2020-09-24 22:55:34 +01:00
Steve Dower
5ba5cbc9af Imported Tk 8.6.9 2018-12-11 10:05:28 -08:00
Steve Dower
753ac6b037 Merge pull request #5 from csabella/8.6.8-tk
Import Tk 8.6.8
2018-02-23 08:19:42 -08:00
Cheryl Sabella
8e57feeeb9 Import Tk 8.6.8 2018-02-22 14:31:15 -05:00
548 changed files with 52932 additions and 29734 deletions

236
.travis.yml Normal file
View 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

View File

@@ -1,6 +1,6 @@
A NOTE ON THE CHANGELOG: A NOTE ON THE CHANGELOG:
Starting in early 2011, Tk source code has been under the management of Starting in early 2011, Tk source code has been under the management of
fossil, hosted at http://core.tcl.tk/tk/ . Fossil presents a "Timeline" fossil, hosted at https://core.tcl-lang.org/tk/ . Fossil presents a "Timeline"
view of changes made that is superior in every way to a hand edited log file. view of changes made that is superior in every way to a hand edited log file.
Because of this, many Tk developers are now out of the habit of maintaining Because of this, many Tk developers are now out of the habit of maintaining
this log file. You may still find useful things in it, but the Timeline is this log file. You may still find useful things in it, but the Timeline is

View File

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

41
README
View File

@@ -1,41 +0,0 @@
README: Tk
This is the Tk 8.6.6 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, an X11
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 at
http://www.tcl.tk/software/tcltk/8.6.html
or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk.
Tk is maintained, enhanced, and distributed freely by the Tcl community.
Source code development and tracking of bug reports and feature requests
takes place at:
http://core.tcl.tk/tk/
with the Tcl Developer Xchange at:
http://www.tcl.tk/
Tk is a freely available open source package. You can do virtually
anything you like with it, such as modifying it, redistributing it,
and selling it either in whole or in part. See the file
"license.terms" for complete information.
2. See Tcl README
-----------------
Please see the README file that comes with the associated Tcl release
for more information. There are pointers there to extensive
documentation. In addition, there are additional README files
in the subdirectories of this distribution.

View File

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

543
changes
View File

@@ -1315,7 +1315,7 @@ ISO Latin-1 character set.
result across the execution of binding scripts. Otherwise if an event result across the execution of binding scripts. Otherwise if an event
triggers in the middle of some other script (e.g. a destroy event during triggers in the middle of some other script (e.g. a destroy event during
window creation, because there was an error in the creation command), window creation, because there was an error in the creation command),
the intepreter's result gets lost. the interpreter's result gets lost.
2/19/94 (bug fix) Fixed bug in dealing with results of sent command 2/19/94 (bug fix) Fixed bug in dealing with results of sent command
that could cause them to get lost in some situations. that could cause them to get lost in some situations.
@@ -7072,7 +7072,7 @@ Many revisions to better support a Cygwin environment (nijtmans)
2013-08-25 (bug fix)[3016181] Cocoa: [destroy $scrollbar] => crash (goddard) 2013-08-25 (bug fix)[3016181] Cocoa: [destroy $scrollbar] => crash (goddard)
--- Released 8.6.1, September 19, 2013 --- http://core.tcl.tk/tk/ for details --- Released 8.6.1, September 19, 2013 --- https://core.tcl-lang.org/tk/ for details
2013-10-27 (bug fix) OSX drawing lags (deily,steffen,walzer) 2013-10-27 (bug fix) OSX drawing lags (deily,steffen,walzer)
@@ -7120,7 +7120,7 @@ Many revisions to better support a Cygwin environment (nijtmans)
2014-08-01 (bug fix) OSX font config crash (rob@bitkeeper) 2014-08-01 (bug fix) OSX font config crash (rob@bitkeeper)
--- Released 8.6.2, August 27, 2014 --- http://core.tcl.tk/tk/ for details --- Released 8.6.2, August 27, 2014 --- https://core.tcl-lang.org/tk/ for details
2014-08-27 (bug) Cocoa: Crash after [$button destroy] (walzer) 2014-08-27 (bug) Cocoa: Crash after [$button destroy] (walzer)
@@ -7144,7 +7144,7 @@ Many revisions to better support a Cygwin environment (nijtmans)
2014-11-07 (bug)[3529885] [scale] handling of negative resolution (vogel) 2014-11-07 (bug)[3529885] [scale] handling of negative resolution (vogel)
--- Released 8.6.3, November 12, 2014 --- http://core.tcl.tk/tk/ for details --- Released 8.6.3, November 12, 2014 --- https://core.tcl-lang.org/tk/ for details
2014-11-14 (bug)[d43a10] shimmer-related crash in [tk_getOpenFile] (nadkarni) 2014-11-14 (bug)[d43a10] shimmer-related crash in [tk_getOpenFile] (nadkarni)
@@ -7166,7 +7166,7 @@ Many revisions to better support a Cygwin environment (nijtmans)
Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke)
*** POTENTIAL INCOMPATIBILITY *** *** POTENTIAL INCOMPATIBILITY ***
--- Released 8.6.4, March 12, 2015 --- http://core.tcl.tk/tk/ for details --- Released 8.6.4, March 12, 2015 --- https://core.tcl-lang.org/tk/ for details
2015-03-10 (bug) Cocoa: premature image free crash (walzer) 2015-03-10 (bug) Cocoa: premature image free crash (walzer)
@@ -7265,7 +7265,7 @@ Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke)
Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) Tk Cocoa 2.0: More drawing internals refinements (culler,walzer)
--- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tk/ for details --- Released 8.6.5, February 29, 2016 --- https://core.tcl-lang.org/tk/ for details
2016-03-07 (bug)[3137232] spinbox teardown hygiene (vogel) 2016-03-07 (bug)[3137232] spinbox teardown hygiene (vogel)
@@ -7312,4 +7312,533 @@ Tk Cocoa 2.0: More drawing internals refinements (culler,walzer)
2016-07-21 (bug)[450bb0] Aqua: memory corruption from [tk busy] (porter) 2016-07-21 (bug)[450bb0] Aqua: memory corruption from [tk busy] (porter)
--- Released 8.6.6, July 27, 2016 --- http://core.tcl.tk/tk/ for details --- Released 8.6.6, July 27, 2016 --- https://core.tcl-lang.org/tk/ for details
2016-08-23 (bug)[a2abc4] Wrong warp cursor position on 2nd display (vogel)
2016-08-29 (bug)[fa3229] menu-38.1 (calvo,vogel)
2016-08-29 (bug)[2cf3d6] button-5.24 (vogel)
2016-09-04 (bug)[1534455,2945130] Key release events get _L vs _R right. (vogel)
2016-09-10 (bug)[8c4216] listbox-4.1 (vogel)
2016-09-10 (bug)[eb2681] listbox-13.1 (vogel)
2016-09-21 (bug)[3126428] ttk::button react to image change (thoyts)
2016-10-09 (bug)[1082213] wrapped text don't start lines with whitespace (vogel)
2016-10-12 (bug)[3217462] tri-state button on non-native theme (vogel)
2016-10-30 (bug)[3588460] Fix file dialog -typevariable (vogel)
2016-11-01 (bug)[e36963] event generate .e <diaeresis> (matthias,vogel)
2016-11-05 (bug)[6aea69] grid-23 (danckaert,vogel)
2016-11-18 (bug)[f60c54] combobox-3 (panza,vogel)
2017-01-03 (bug)[f32502] crash drawing many dashed objects (reithofer,werner)
2017-01-05 (bug)[dac92f] text-2.[89] (vogel)
2017-01-07 (bug)[3df559] OSX: Negative bbox width (vogel)
2017-01-07 (bug)[28a453] OSX: text widget index OBOE (vogel)
2017-01-07 (bug)[c12af7] OSX: text-21.1 (vogel)
2017-01-08 (bug)[7a838c] X11 ring buffer overflow (werner)
2017-01-11 (bug)[d4fb4e] imgPhoto-4.75 (nijtmans)
2017-01-18 (bug)[fab5fe] OSX: repair textDisp failures (vogel)
2017-01-23 (bug)[89a638] OSX: textDisp-15.8 (vogel)
2017-01-25 (bug)[1403ea] Limits on text line size on Windows (spjuth)
2017-02-05 (bug)[ae32eb] textDisp fails in text custom config (vogel)
2017-02-05 (bug)[7d967c] crash after IME restart (lanam,nijtmans)
2017-02-22 (bug)[c492c9] disabled combobox arrow appearance (danckaert)
2017-03-06 (bug)[6b3644] Fix -alpha for 16-bit color PNG (LemonMan)
2017-03-11 (bug)[775273] artifacts on Ubuntu 16.10+ (nemethi)
2017-03-26 (TIP 464) Win multimedia keys support (fassel,vogel)
2017-03-29 (bug)[28a3c3] test BTree memleaks plugged (anonymous)
2017-04-06 (bug)[db8c54] Stop freed mem access in warp pointer callback (porter)
2017-04-07 (bugs) Fix calculation of ttk::notebook tab widths (vogel)
2017-04-07 (bug)[291296] notebook tab management (decoster)
2017-04-08 (bug)[f0188a] Win reject invalid hex color codes (bachmann)
2017-04-10 (bug)[3f323b] variable struct size on XCode 8.3.1 (auriocus)
2017-04-20 (bug)[061bf9] OSX scrollbar draw position (reincke,walzer,joye)
2017-05-01 (bug) restore -initialfile for OSX file dialogs (reincke,gollwitzer)
2017-05-06 (bug) OSX file dialog type filters (walzer)
2017-05-10 (bug)[a5ba1c] race condition on Win clipboard cleanup (donchenko)
2017-05-18 (bug)[2433781] center image on button (cramer)
2017-05-19 (bug)[434d29] type mismatch with recent Xft (nijtmans,werner)
2017-06-02 (bug)[bc43fd] paneconfigure get pane heights right (vogel)
2017-06-21 (bug)[adc028] menu avoid unreleasable global grab (nash)
2017-06-30 (bug)[92e028,c5eb90] User switch forced theme reset (lanam)
2017-06-30 (bug)[62c5b7] segfault in [text] replace (werner)
2017-07-03 (bug)[8afc6c] OSX crash in save/open dialogs (simpson,walzer)
2017-08-02 (bug)[b601ce] Resource exhaustion processing corrupt GIF (nash)
2017-08-03 (bug)[9eab54] Fix -initialdir for OSX file dialogs (gollwitzer)
2017-08-08 (bug)[28d0b8] Follow ICCCM advice on X selection protocol (donchenko)
2017-08-08 (bug)[4966ca] Scidb race in notebook tab selection (cramer)
--- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tk/ for details
2017-08-24 (bug)[f1a3ca] Memory leak in [text] B-tree (edhume3)
2017-08-24 (bug)[ee40fd] Report [console] init errors (the)
2017-08-24 (bug)[3295446] Improve history visibility in [console] (goth)
2017-08-24 (bug) canvas closed polylines fully honor -joinstyle (vogel)
2017-08-24 (bug)[cc42cc] out of mem crash in tests imgPhoto-18.* (vogel)
2017-09-16 (bug)[3406785] fix coords rounding when drawing canvas items (vogel)
2017-09-24 (bug)[8277e1] linux fontchooser sync with available fonts (vogel)
2017-09-24 (bug)[5239fd] Segfault copying a photo image to itself (bachmann)
2017-09-24 (bug)[514ff6] canvas rotated text overlap detection (vogel)
2017-09-24 (bug)[1e0db2] canvas rchars artifacts (bruchie,vogel)
2017-10-07 (bug)[d9fdfa] display of Long non-wrapped lines in text (cramer)
2017-10-07 (bug)[dd9667] text anchor not set (vogel)
2017-10-11 (bugs) memleaks and other changes for macOS 10.13 support (culler)
2017-10-11 (bug)[111de2] macOS colorspace improvement (walzer,culler)
2017-10-13 (bug) macOS scrolling issues (culler)
2017-10-15 (bug) clipping regions in scrolling and drawing on macOS (culler)
2017-10-15 (bug) macOS redraw artifacts (culler)
2017-10-22 (bug)[bb6b40] ::tk::AmpMenuArgs and 'entryconf' (vogel)
2017-10-22 (bug)[55b95f] Crash [scale] with a bignum value (vogel)
2017-10-28 (bug)[ce62c8] text-37.1 fails (vogel)
2017-11-03 (bug)[0ef1c5] OS X - tests menu-22.[345] hang (vogel)
2017-11-04 (bug)[c8c52b] repair OBOE in menu.test on macOS (vogel)
2017-11-11 (feature) Implement [wm_iconphoto] on macOS (walzer)
2017-11-11 (bug) display of embedded toplevels (culler)
2017-11-19 (bug)[73ba07] Correct property type for MULTIPLE conversion (dpb)
2017-11-20 (bug) Memory leak in tkImgPhoto.c. (werner)
2017-11-21 (bug) Defeat zombie toplevels (culler)
2017-11-25 (bug) macOS resposive menu bar for command line apps (culler)
2017-11-25 (bug)[1c659e] support png from mac screenshots (vogel)
2017-11-25 (bug)[de4af1] macOS file selector "all types" setting (culler)
2017-11-26 (bug) [wm withdraw] on Window and Dock menus (walzer)
2017-11-27 (feature) Drop support for macOS 10.5 (culler)
2017-11-30 (bug)[164c1b] Fixes [raise] on macOS (culler)
2017-11-30 (bug)[13d63d] macOS support of menu -postcommand (culler)
2017-12-05 (bug) enable custom icon display on macOS (walzer)
2017-12-05 (bug)[1088805,0feb63] macOS bind failures (culler)
2017-12-05 (bug)[3382424] Suppress noisy messages on macOS (culler)
2017-12-08 (new)[TIP 477] nmake build system reform (nadkarni)
2017-12-18 (bug)[b77626] Make [tk busy -cursor] silent no-op on macOS (vogel)
--- Released 8.6.8, December 22, 2017 --- https://core.tcl-lang.org/tk/ for details
2017-12-31 (bug)[aa7679] crash using window after master destroyed (vogel)
2017-12-31 (bug)[6525e1] encoding leak in tkMacOSXProcessFiles (werner)
2018-01-07 (bug)[925262] New option -state for ttk::scale (vogel)
2018-01-07 (bug)[fa8de7] Crash [ttk::checkbutton .x -variable {}] (werner)
2018-01-16 (bug)[382712] Crash in [event generate . <KeyPress>] (werner)
2018-01-19 (bug)[657c38] Crash in menu destroy with checkbutton entry (werner)
2018-01-25 (bug)[de156e] Deny PRIMARY selection access in safe interps (nash)
2018-01-28 (bug)[b68710] Fixes in [text] bindings (nash)
2018-01-28 (bug)[e20d5c] Stop failures of textTag-18.1 (vogel)
2018-02-04 (bug)[5d991b] Fortify var traces against deleted vars (vogel)
2018-02-10 (bug)[1821174] Stop RenderBadPicture X error (werner)
2018-02-11 (bug)[502e74] Stop X errors on untrusted connections (werner)
2018-03-07 (bug)[71b131] Regression in Tk_DrawChars() (werner,cramer)
2018-04-03 (bug)[59fccb] menu flaws when empty menubar clicked (vogel,mcdonald)
2018-04-28 (bug)[7423f9] improved legacy support for [tk_setPalette] (bll)
2018-04-30 (bug)[6d5042] enable [tk inactive] on Mac OSX (culler)
2018-05-03 (bug)[75d38f] fix touchpad scroll of listbox on win notebook (vogel)
2018-06-16 (bug)[de01e2] Crash in [$text replace] (vogel)
2018-07-04 (bug)[6ca257] Fix [wm resizable] on Mac OSX (culler)
2018-07-04 (bug)[135696] Crash in [wm transient] (culler)
2018-07-04 (bug)[309b42] Improve ttk high-contrast-mode support (lemburg,vogel)
2018-07-17 (bug)[1088825] fix frame-2.17,3.9,3.10 on Mac (vogel)
2018-07-27 (bug)[fabed1] GIF photo support for "deferred clear code" (vogel)
2018-08-08 (feature) Modern full-screen support on Mac OSX (walzer)
2018-08-12 (bug)[1875c1] scrollbar on Mac OSX (walzer)
2018-08-14 (bug)[1ba71a] KeyRelease events on Mac OSX(walzer)
2018-09-02 (bug)[3441086] error message in layout-2 (vogel)
2018-09-07 (bug)[05bd7f] vista theme for combobox (vogel)
2018-09-08 (bug)[382712] crash in KeyPress event handling (vogel,werner)
2018-09-08 (bug)[6fcaaa] insertion cursor visibility in ttk::entry (nemethi)
2018-09-30 (bug)[822923] cascade menu indicator color (mcdonald)
2018-10-06 (bug)[9658bc] borderwidth calculations on menu items (vogel)
2018-10-17 (bug)[ca403f] treeview border drawing (vogel)
2018-10-17 (bug)[4b555a] hang in [$text search -all] (vogel,danckaert)
2018-10-30 (new platform) port to system changes in Mac OSX 10.14 (culler)
2018-11-04 (bug)[6b22d4] [treeview] binding fix (ohagan)
- Released 8.6.9, November 16, 2018 - https://core.tcl-lang.org/tk/ for details
2018-11-19 (bug)[0a9c91] crash in text-11a.22 (vogel)
2018-11-20 (bug)[9705d1] crash activating "Alt" theme (culler)
2018-11-24 (bug)[e3b954] cursor offset at full screen display (culler)
2019-01-04 (bug)[18a4ba] cross-platform [winfo containing] (culler)
2019-01-08 (feature) local grab on Mac OSX (culler)
2019-01-10 (build) 'None', 'ControlMask' symbol conflicts (nijtmans)
2019-01-20 (bug)[509caf] [treeview tag configure] regression (mcdonald,vogel)
2019-01-26 (bug)[3003895] [scale] res rounds and -from (tischler,pieper,vogel)
2019-02-02 (new)[TIP 533] [$mb post x y idx] (culler,vogel)
2019-02-08 (bug)[1529659] embed toplevel blocks outer menu (culler)
2019-02-10 (bug)[8814bd] crash in [NSMenu size] (culler)
2019-02-13 (bug)[b389df] Aqua: mouse position on dual screen (culler)
2019-02-23 (bug)[56a182] Aqua: [tk_getOpenFile] causes off-screen toplevels (culler,walzer)
2019-02-23 (bug)[9771ae] Aqua: workaround incompatible transient window models (culler,walzer)
2019-03-01 (bug)[1951ab] Prevent transient window cycles (crashed on Aqua) (culler,vogel)
*** POTENTIAL INCOMPATIBILITY ***
2019-03-04 (bug)[4da219] Incomplete read of multi-image GIF (oehlmann)
2019-03-14 (bug)[609e00] Aqua: wrong coords from MouseWheel binding (vogel,culler)
2019-03-25 (bug)[48c394] Aqua: recompute text layout for empty string (culler)
2019-03-31 (new)[TIP 535] Precision of ::scale widget tick mark values (vogel)
*** POTENTIAL INCOMPATIBILITY ***
2019-03-31 (bug)[da3914] [$treeview identify element] failure (ulfalizer,vogel)
2019-04-06 (bug)[897ffe] Prevent cross-manager loops of geom management (culler,vogel)
2019-04-11 (new) Apple Dark Mode support (culler)
2019-04-14 (new) Aqua: Use color names consistent with NSColor (culler)
*** POTENTIAL INCOMPATIBILITY ***
2019-04-14 (new) Aqua: [tk::unsupported::MacWindowStyle isdark] (culler)
2019-04-19 (bug)[368fa4] Prevent toggle of hidden treeview indicators (ulfalizer,vogel)
2019-04-24 (bug)[4d2e8d] Aqua: notebook pane redraws (culler)
2019-04-24 (bug)[928652] Apply TIP 533 for ttk::menubutton (culler,vogel)
2019-04-24 (bug)[1001070] X-platform rework of label options -highlight* (seal,culler,vogel)
2019-04-28 (bug)[6286fd] checkbutton handling of -selectcolor (ralfixx)
2019-04-30 (bug)[4f9a99] Win: crash in [style element create] (oehlman,vogel)
2019-05-08 (bug) Ttk scrolling bugs, see tests treeview-9.1, entry-3.[3-6] (vogel)
2019-05-08 (bug)[51b4b1] Aqua: combobox use native ttk scrollbar (bll,vogel)
*** POTENTIAL INCOMPATIBILITY ***
2019-05-18 (new)[eb2996] Win: support for horizontal scrolling (chavez,vogel)
2019-05-26 (new)[TIP 541] [combobox current] support "end" index (vogel)
2019-05-26 (bug)[2a6c62] <<TreeviewSelect>> trigger on item delete (vogel)
2019-06-05 (bug)[9ebc6f] Aqua: fix incorrect reports of mouse coords (chavez, culler)
2019-06-14 (bug)[436ad6] Corrected Aqua regressions in [wm manage] (walzer, culler)
2019-06-15 (bug)[75b8fb] Crash with some [event generate]d <ButtonRelease> (leunissen,vogel)
2019-06-15 (new)[TIP 536] New tk::mac::* commands for IPC on Mac OSX (walzer)
2019-07-13 (bug)[4566e2] Aqua: Make default background color of Tk and Ttk agree (walzer,culler)
*** POTENTIAL INCOMPATIBILITY ***
2019-07-16 (bug)[5ddeca] Stop app switching exposing withdrawn windows as zombies (culler)
2019-07-25 (new)[1fb7af] Win support for buttons 4 and 5 (chavez,vogel,nijtmans)
2019-08-18 (new) Refactor all MouseWheel bindings (nijtmans)
*** POTENTIAL INCOMPATIBILITY ***
2019-08-21 (bug)[c8ccd1] up array key in [text] takes to index 1.0 (ulfalizer,vogel)
2019-08-28 (new)[TIP 532] Tk event loop rewrite to prevent ring overflow (cramer)
*** POTENTIAL INCOMPATIBILITY ***
2019-08-28 (bug)[943d5e] Win: embedded widget destruction cancels window resize (nemethi,vogel,nijtmans)
2019-09-12 (bug)[2834776] Stop disabled spinbox from generating <<Increment>> & <<Decrement>> (vogel)
2019-09-24 (bug)[96bce5] Aqua: Prevent crash drawing 1x1 rounded rectangles (bll,culler)
2019-10-03 (bug)[3ed5b6] Win: root window position with highlightthickness>0 (leunissem,vogel,nijtmans)
2019-10-09 (bug)[a01b6f7] Workaround XWayland bug reporting screen width (werner,nijtmans)
2019-10-10 (bug) Aqua: Prevent crash deactivating menu during menu deletion (culler)
2019-10-21 (bug)[aea00b] Aqua: Better handling of resolution changes (chavez, culler)
2019-10-25 (bug)[b82bd4] Fix [style configure -compound] (culler,vogel)
2019-10-27 (bug)[f7a4f7] Aqua: embedded toplevel, forced focus and mouse coords (naaus,culler)
2019-11-13 (new) Win: keycodes Mail, AudioMedia, Launch0, Launch1 (nijtmans)
2019-11-15 (bug)[69b48f] failing test textTag-18.1 (vogel)
2019-11-17 (bug)[c4abd2] panic in stackorder command (culler)
2019-11-17 (bug)[53d280] [wm iconphoto] crash on empty image (culler)
2019-11-17 [90d555] workaround NSFontManager bad selections (culler)
2019-11-19 (new) Partial Emoji support in text displays (nijtmans,culler)
- Released 8.6.10, Nov 21, 2019 - https://core.tcl-lang.org/tk/ for details
2019-11-25 (bug)[a95373] TkKeyEvent platform variations (werner)
2019-11-26 (bug) workaround Win bug so test bind-34.3 passes (nijtmans)
2019-12-03 Aqua: white cursors in dark mode (culler)
2019-12-04 (bug)[749bd9] Aqua: systemControlAccentColor (bll,culler)
2019-12-14 (bug)[b3b56a] ttk respect -cursor option (vogel)
2019-12-14 (bug)[b094cb] Win: $tv -show grows widget width 1 pixel (vogel)
2019-12-14 (bug)[02a694] spinbox options used wrong db names (vogel)
2020-01-11 (bug)[2b8fa6] MouseWheel for ttk::scrollbar (oehlmann)
2020-01-18 (bug)[1771594] icursor and scrollregion, canvText-14.7 (vogel)
2020-01-18 (bug)[587937] tag list ops preserve list order (vogel)
2020-01-18 (bug)[2830360] lose invalid state at focus event, entry-10.1 (vogel)
2020-01-18 (bug)[077d49] string table options support null ok (vogel)
2020-01-18 (bug)[bf93d0] Aqua: unresponsive menubar (culler)
2020-01-31 (bug)[a196fb] restore support for unthreaded Tcl (porter,sebres)
2020-02-09 (bug)[90a4d7] fontconfig crash when no font installed (vogel)
2020-02-24 (bug) Aqua: incomplete floating window display (walzer)
2020-03-11 (bug)[fb2ec3] OSX 10.15+: full screen options (nicolas,walzer)
2020-03-12 (bug)[08e2f8] focus on unmapped windows, focus-7.1 (vogel)
2020-03-12 (bug)[2edd84] [$c postscript] result management (gavilan)
2020-03-22 (bug)[98662d] restore TK_MAC_DEBUG_DRAWING build (chavez)
2020-03-29 (bug)[655fe2] tearoff menu redraw artifacts (vogel)
2020-04-03 (bug)[efbedd] Aqua: compund button-like widget appearance (chavez)
2020-04-14 (bug)[87bade] Aqua: improved dealing with PressAndHold (culler)
2020-04-14 (bug)[376788] X: stop crash w/Noto Color Emoji font (nijtmans)
2020-04-15 (bug)[89354d] Aqua: text color w/o clipping (culler)
2020-04-15 (new) Aqua: assign Button 3 to the middle button (chavez)
2020-04-25 (bug)[3519111] treeview horizontal scroll, entry-2.1.1 (vogel)
2020-04-25 (bug)[141881] treeview vertical scroll, treeview-9.2 (vogel)
2020-05-01 (bug)[2712f4] X: crash angled text w/o Xft, canvText-20.2 (vogel)
2020-05-01 (bug)[cd8714] Win: long angled text (chavez)
2020-05-09 (bug)[88c9e0] treeview -selectmode none focus ring (gavilan)
2020-05-12 (new) Aqua: Rewrite of the Key event system (culler)
2020-05-12 (bug)[411359] Aqua: stop crashes/zombies related to TouchBar (culler)
2020-05-12 (new) Aqua: systemLinkColor (chavez)
2020-05-16 (bug)[40ada9] crash when active button is destroyed (chavez)
2020-05-28 (bug)[3c6660,601cea,4b50b7] Win10: ttk scale (nemethi,lanam)
2020-06-08 (bug)[2790615] Some callbacks not eval'd in global scope (nijtmans)
2020-06-25 Aqua: Update OSX version tests to support Big Sur (culler)
2020-06-27 (bug)[6920b2] dup in spinbox -values causes trouble (lanam)
2020-06-27 (bug)[5c51be] invalid mem read buffer in Tk_PhotoPut* (chavez)
2020-06-27 (bug)[16ef16] restore bind sequence support, bind-33.(16-21) (vogel)
2020-07-02 (bug)[2d2459] default style for combobox (bll)
2020-07-06 (bug)[40c4bf] double free, entry-19.21 (vogel)
2020-07-06 (bug)[e3888d] grab & warp, bind-36.1 (vogel)
2020-07-12 (bug)[2442314] fontchooser i18n (nijtmans)
2020-07-13 (bug)[7655f6] [*entry]: selected text drawing reform (chavez)
2020-07-14 (bug)[09abd7] workaround invalid key codes from Debian 10 (vogel)
2020-07-20 (bug)[cf3853] Aqua: improve bounds on non-Retina displays (chavez)
2020-08-01 Aqua: [winfo rgb] light and dark mode support (culler)
2020-08-15 (bug)[315104] Aqua: appearance change virtual events (culler)
2020-08-21 (bug)[291699] mouse binding for scrollbar grip (bll)
2020-09-08 (bug)[6c2425] buffer bounds violation (chavez)
2020-09-08 (bug)[2a6d63] OSX 10.6 crash (hellstrom,culler)
2020-09-08 (bug)[420feb] undefined behavior due to alignment (chavez,nijtmans)
2020-09-10 (bug)[ab1fea] Aqua init issues (culler)
2020-09-14 (bug)[71e18c] Aqua: crash in full screen toggle (culler)
2020-09-18 (bug)[4f4f03] Aqua: mouse drags across title bar (nab,culler)
2020-09-21 (bug)[d91e05] select/copy in disabled text (bll)
2020-09-27 (TIP #581) disfavor Master/Slave terminology (nijtmans)
2020-09-30 (bug)[59cba3] win: improve theme detection (bll,nijtmans)
2020-10-06 (bug)[175a6e] Aqua: support tiled windows (culler)
2020-10-07 (bug)[1fa8c3] Aqua: crash on resize during display (nab,culler)
2020-10-16 (bug)[c2483b] Aqua: consistent finalization (culler,nijtmans)
2020-11-06 (bug)[c9ebac] Aqua: use standard about dialog (culler)
2020-11-07 (bug)[4ebcc0] sticky fontchooser options (roseman,vogel)
2020-11-10 (bug)[f9fa92] Aqua: crash in color caching scheme (culler)
2020-11-20 (bug)[7185d2] Aqua: fixes to special menu support (culler)
2020-11-24 (bug)[4a40c6] Aqua: [wm manage] frame offset (chavez)
2020-12-04 (bug)[3ef77f] Aqua dark mode combobox focus ring (walzer,culler)
2020-12-15 (bug)[80e4c6] Aqua: progressbar animation (nab,culler)
2020-12-24 (bug)[6157a8] Aqua: file dialog -filetypes (davis,culler)
- Released 8.6.11, Dec 31, 2020 - https://core.tcl-lang.org/tk/ for details

View File

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

View File

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

View File

@@ -144,7 +144,7 @@ like this:
.PP .PP
.CS .CS
static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc, static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
Tk_CanvasTagsPrintProc, (ClientData) NULL Tk_CanvasTagsPrintProc, NULL
}; };
static const Tk_ConfigSpec configSpecs[] = { static const Tk_ConfigSpec configSpecs[] = {

View File

@@ -31,7 +31,7 @@ drop applications.
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
this mechanism only works in programs that dispatch events this mechanism only works in programs that dispatch events
through \fBTk_HandleEvent\fR (or through other Tk procedures that through \fBTk_HandleEvent\fR (or through other Tk procedures that
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or
\fBTk_MainLoop\fR). \fBTk_MainLoop\fR).
.PP .PP
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the

View File

@@ -38,7 +38,7 @@ use with Tk, and so on.
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
this mechanism only works in programs that dispatch events this mechanism only works in programs that dispatch events
through \fBTk_HandleEvent\fR (or through other Tk procedures that through \fBTk_HandleEvent\fR (or through other Tk procedures that
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or
\fBTk_MainLoop\fR). \fBTk_MainLoop\fR).
.PP .PP
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the

View File

@@ -9,7 +9,7 @@
.so man.macros .so man.macros
.BS .BS
.SH NAME .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 .SH SYNOPSIS
.nf .nf
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
@@ -19,6 +19,11 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind o
ClientData ClientData
\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR) \fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
.sp .sp
.VS "TIP 581"
ClientData
\fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR)
.VE "TIP 581"
.sp
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR) \fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS "const Tk_ImageType" *typePtrPtr .AS "const Tk_ImageType" *typePtrPtr
@@ -71,7 +76,7 @@ The fields of this structure will be described in later subsections
of this entry. of this entry.
.PP .PP
The second major data structure manipulated by an image manager The second major data structure manipulated by an image manager
is called an \fIimage 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 about a particular image, such as the values of the configuration
options specified in an \fBimage create\fR command. options specified in an \fBimage create\fR command.
There will usually be one of these structures for each There will usually be one of these structures for each
@@ -113,8 +118,8 @@ typedef int \fBTk_ImageCreateProc\fR(
int \fIobjc\fR, int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[], Tcl_Obj *const \fIobjv\fR[],
const Tk_ImageType *\fItypePtr\fR, const Tk_ImageType *\fItypePtr\fR,
Tk_ImageMaster \fImaster\fR, Tk_ImageMaster \fImodel\fR,
ClientData *\fImasterDataPtr\fR); ClientData *\fImodelDataPtr\fR);
.CE .CE
The \fIinterp\fR argument is the interpreter in which the \fBimage\fR The \fIinterp\fR argument is the interpreter in which the \fBimage\fR
command was invoked, and \fIname\fR is the name for the new image, command was invoked, and \fIname\fR is the name for the new image,
@@ -123,15 +128,15 @@ or generated automatically by the \fBimage\fR command.
The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration The \fIobjc\fR and \fIobjv\fR arguments describe all the configuration
options for the new image (everything after the name argument to options for the new image (everything after the name argument to
\fBimage\fR). \fBimage\fR).
The \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 about this image; the image manager must return this token to
Tk when invoking the \fBTk_ImageChanged\fR procedure. Tk when invoking the \fBTk_ImageChanged\fR procedure.
Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR Typically \fIcreateProc\fR will parse \fIobjc\fR and \fIobjv\fR
and create an image 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 \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. 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. structure for the image.
.PP .PP
If \fIcreateProc\fR encounters an error, it should leave an error If \fIcreateProc\fR encounters an error, it should leave an error
@@ -148,11 +153,11 @@ This procedure must match the following prototype:
.CS .CS
typedef ClientData \fBTk_ImageGetProc\fR( typedef ClientData \fBTk_ImageGetProc\fR(
Tk_Window \fItkwin\fR, Tk_Window \fItkwin\fR,
ClientData \fImasterData\fR); ClientData \fImodelData\fR);
.CE .CE
The \fItkwin\fR argument identifies the window in which the The \fItkwin\fR argument identifies the window in which the
image will be used and \fImasterData\fR is the value image will be used and \fImodelData\fR is the value
returned by \fIcreateProc\fR when the image master was created. returned by \fIcreateProc\fR when the image model was created.
\fIgetProc\fR will usually create a data structure for the new \fIgetProc\fR will usually create a data structure for the new
instance, including such things as the resources needed to instance, including such things as the resources needed to
display the image in the given window. display the image in the given window.
@@ -221,26 +226,30 @@ each of the image's instances.
\fIdeleteProc\fR must match the following prototype: \fIdeleteProc\fR must match the following prototype:
.CS .CS
typedef void \fBTk_ImageDeleteProc\fR( typedef void \fBTk_ImageDeleteProc\fR(
ClientData \fImasterData\fR); ClientData \fImodelData\fR);
.CE .CE
The \fImasterData\fR argument will be the same as the value The \fImodelData\fR argument will be the same as the value
stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the stored in \fI*modelDataPtr\fR by \fIcreateProc\fR when the
image was created. image was created.
\fIdeleteProc\fR should release any resources associated with \fIdeleteProc\fR should release any resources associated with
the image. the image.
.SH TK_GETIMAGEMASTERDATA .SH TK_GETIMAGEMODELDATA
.PP .PP
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
information about an image. For example, an image manager can use this information about an image. For example, an image manager can use this
procedure to locate its image master data for an image. procedure to locate its image model data for an image.
If there exists an image named \fIname\fR If there exists an image named \fIname\fR
in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is
filled in with type information for the image (the \fItypePtr\fR value filled in with type information for the image (the \fItypePtr\fR value
passed to \fBTk_CreateImageType\fR when the image type was registered) passed to \fBTk_CreateImageType\fR when the image type was registered)
and the return value is the ClientData value returned by the and the return value is the ClientData value returned by the
\fIcreateProc\fR when the image was created (this is typically a \fIcreateProc\fR when the image was created (this is typically a
pointer to the image 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. then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
.PP
.VS "TIP 581"
\fBTk_GetImageModelData\fR is synonym for \fBTk_GetImageMasterData\fR
.VE "TIP 581"
.SH "LEGACY INTERFACE SUPPORT" .SH "LEGACY INTERFACE SUPPORT"
.PP .PP
In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
@@ -252,8 +261,8 @@ typedef int \fBTk_ImageCreateProc\fR(
int \fIargc\fR, int \fIargc\fR,
char **\fIargv\fR, char **\fIargv\fR,
Tk_ImageType *\fItypePtr\fR, Tk_ImageType *\fItypePtr\fR,
Tk_ImageMaster \fImaster\fR, Tk_ImageMaster \fImodel\fR,
ClientData *\fImasterDataPtr\fR); ClientData *\fImodelDataPtr\fR);
.CE .CE
Legacy programs and libraries dating from those days may still Legacy programs and libraries dating from those days may still
contain code that defines extended Tk image types using the old contain code that defines extended Tk image types using the old
@@ -261,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 interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
defined. defined.
.PP .PP
.VS "TIP 581"
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
.VE "TIP 581"
.PP
When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may
see the routine \fBTk_InitImageArgs\fR in use. This was a migration see the routine \fBTk_InitImageArgs\fR in use. This was a migration
tool used to create stub-enabled extensions that could be loaded tool used to create stub-enabled extensions that could be loaded
@@ -280,4 +293,4 @@ interfaces. Expect their support to go away in Tk 9.
.SH "SEE ALSO" .SH "SEE ALSO"
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
.SH KEYWORDS .SH KEYWORDS
image manager, image type, instance, master image manager, image type, instance, model

View File

@@ -38,7 +38,7 @@ by \fImask\fR occurs in the window specified by \fItkwin\fR.
The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
this mechanism only works in programs that dispatch events this mechanism only works in programs that dispatch events
through \fBTk_HandleEvent\fR (or through other Tk procedures that through \fBTk_HandleEvent\fR (or through other Tk procedures that
call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or call \fBTk_HandleEvent\fR, such as \fBTcl_DoOneEvent\fR or
\fBTk_MainLoop\fR). \fBTk_MainLoop\fR).
.PP .PP
\fIProc\fR should have arguments and result that match the \fIProc\fR should have arguments and result that match the

View File

@@ -130,14 +130,23 @@ The \fIpixelPtr\fR field points to the first pixel, that is, the
top-left pixel in the block. top-left pixel in the block.
The \fIwidth\fR and \fIheight\fR fields specify the dimensions of the The \fIwidth\fR and \fIheight\fR fields specify the dimensions of the
block of pixels. The \fIpixelSize\fR field specifies the address block of pixels. The \fIpixelSize\fR field specifies the address
difference between two horizontally adjacent pixels. Often it is 3 difference between two horizontally adjacent pixels. It should be 4 for
or 4, but it can have any value. The \fIpitch\fR field specifies the 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 address difference between two vertically adjacent pixels. The
\fIoffset\fR array contains the offsets from the address of a pixel \fIoffset\fR array contains the offsets from the address of a pixel
to the addresses of the bytes containing the red, green, blue and alpha to the addresses of the bytes containing the red, green, blue and alpha
(transparency) components. These are normally 0, 1, 2 and 3, but can (transparency) components. If the offsets for red, green and blue are
have other values, e.g., for images that are stored as separate red, equal, the image is interpreted as grayscale. If they differ, RGB data
green and blue planes. 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 .PP
The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a
compositing rule that says what to do with transparent pixels. The compositing rule that says what to do with transparent pixels. The
@@ -248,6 +257,24 @@ memory was available for an image, Tk would panic. This behaviour is
still supported if you compile your extension with the additional flag still supported if you compile your extension with the additional flag
-DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against -DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against
older versions of Tk will continue to work. older versions of Tk will continue to work.
.SH BUGS
The \fBTk_PhotoImageBlock\fR structure used to provide image data to
\fBTk_PhotoPutBlock\fR promises great flexibility in the layout of the
data (e.g. separate planes for the red, green, blue and alpha
channels). Unfortunately, the implementation fails to hold this
promise. The problem is that the \fIpixelSize\fR field is
(incorrectly) used to determine whether the image has an alpha channel.
Currently, if the offset for the alpha channel is greater or equal than
\fIpixelSize\fR, \fBtk_PhotoPutblock\fR assumes no alpha data is
present and makes the image fully opaque. This means that for layouts
where the channels are separate (or any other exotic layout where
\fIpixelSize\fR has to be smaller than the alpha offset), the alpha
channel will not be read correctly. In order to be on the safe side
if this issue will be corrected in a future release, it is strongly
recommended you always provide alpha data - even if the image has no
transparency - and only use the "standard" layout with a
\fIpixelSize\fR of 2 for grayscale and 4 for RGB data with
\fIoffset\fRs of 0, 0, 0, 1 or 0, 1, 2, 3 respectively.
.SH CREDITS .SH CREDITS
.PP .PP
The code for the photo image type was developed by Paul Mackerras, The code for the photo image type was developed by Paul Mackerras,

View File

@@ -15,23 +15,23 @@ Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
int int
\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, dblPtr, intPtr\fB)\fR \fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR
.sp .sp
int int
\fBTk_GetScrollInfo(\fIinterp, argc, argv, dblPtr, intPtr\fB)\fR \fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS "Tcl_Interp" *fractionPtr .AS "Tcl_Interp" *fractionPtr
.AP Tcl_Interp *interp in .AP Tcl_Interp *interp in
Interpreter to use for error reporting. Interpreter to use for error reporting.
.AP int objc in .AP int objc in
Number of Tcl_Obj's in \fIobjv\fR array. 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 Argument objects. These represent the entire widget command, of
which the first word is typically the widget name and the second which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR. word is typically \fBxview\fR or \fByview\fR.
.AP int argc in .AP int argc in
Number of strings in \fIargv\fR array. Number of strings in \fIargv\fR array.
.AP "const char" *argv[] in .AP "const char **" argv in
Argument strings. These represent the entire widget command, of Argument strings. These represent the entire widget command, of
which the first word is typically the widget name and the second which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR. word is typically \fBxview\fR or \fByview\fR.

View File

@@ -25,7 +25,7 @@ that all unused fields of the structure be set to zero.
.PP .PP
\fBTk_HandleEvent\fR is a lower-level procedure that deals with window \fBTk_HandleEvent\fR is a lower-level procedure that deals with window
events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by
\fBTk_DoOneEvent\fR), and in a few other cases within Tk. \fBTcl_DoOneEvent\fR), and in a few other cases within Tk.
It makes callbacks to any window event It makes callbacks to any window event
handlers (created by calls to \fBTk_CreateEventHandler\fR) handlers (created by calls to \fBTk_CreateEventHandler\fR)
that match \fIeventPtr\fR and then returns. In some cases that match \fIeventPtr\fR and then returns. In some cases

View File

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

View File

@@ -14,7 +14,7 @@ Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity tim
long long
\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR \fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
.sp .sp
\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR \fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR
.SH ARGUMENTS .SH ARGUMENTS
.AS Display *display .AS Display *display
.AP Display *display in .AP Display *display in
@@ -26,8 +26,8 @@ reset.
\fBTk_GetUserInactiveTime\fR returns the number of milliseconds that \fBTk_GetUserInactiveTime\fR returns the number of milliseconds that
have passed since the last user interaction (usually via keyboard or have passed since the last user interaction (usually via keyboard or
mouse) with the respective display. On systems and displays that do not mouse) with the respective display. On systems and displays that do not
support querying the user inactiviy time, \fB\-1\fR is returned. support querying the user inactivity time, \fB\-1\fR is returned.
\fBTk_GetUserInactiveTime\fR resets the user inactivity timer of the \fBTk_ResetUserInactiveTime\fR resets the user inactivity timer of the
given display to zero. On windowing systems that do not support given display to zero. On windowing systems that do not support
multiple displays \fIdisplay\fR can be passed as \fBNULL\fR. multiple displays \fIdisplay\fR can be passed as \fBNULL\fR.
.SH KEYWORDS .SH KEYWORDS

View File

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

View File

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

View File

@@ -46,6 +46,6 @@ menus that want to appear at a particular place on the screen.
When \fBTk_MoveToplevelWindow\fR is called it does not immediately When \fBTk_MoveToplevelWindow\fR is called it does not immediately
pass on the new desired location to the window manager; it defers pass on the new desired location to the window manager; it defers
this action until all other outstanding work has been completed, this action until all other outstanding work has been completed,
using the \fBTk_DoWhenIdle\fR mechanism. using the \fBTcl_DoWhenIdle\fR mechanism.
.SH KEYWORDS .SH KEYWORDS
position, top-level window, window manager position, top-level window, window manager

View File

@@ -14,10 +14,10 @@ Tk_NameOfImage \- Return name of image.
\fB#include <tk.h>\fR \fB#include <tk.h>\fR
.sp .sp
const char * const char *
\fBTk_NameOfImage\fR(\fItypePtr\fR) \fBTk_NameOfImage\fR(\fIimageMaster\fR)
.SH ARGUMENTS .SH ARGUMENTS
.AS Tk_ImageMaster *masterPtr .AS Tk_ImageMaster imageMaster
.AP Tk_ImageMaster *masterPtr in .AP Tk_ImageMaster imageMaster in
Token for image, which was passed to image manager's \fIcreateProc\fR when Token for image, which was passed to image manager's \fIcreateProc\fR when
the image was created. the image was created.
.BE .BE
@@ -26,5 +26,9 @@ the image was created.
This procedure is invoked by image managers to find out the name This procedure is invoked by image managers to find out the name
of an image. Given the token for the image, it returns the of an image. Given the token for the image, it returns the
string name for the image. string name for the image.
.PP
.VS "TIP 581"
\fITk_ImageModel\fR is synonym for \fITk_ImageMaster\fR
.VE "TIP 581"
.SH KEYWORDS .SH KEYWORDS
image manager, image name image manager, image name

View File

@@ -314,14 +314,14 @@ Boolean exec = FALSE;
Tk_ArgvInfo argTable[] = { Tk_ArgvInfo argTable[] = {
{"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag, {"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag,
"Turn on debugging printfs"}, "Turn on debugging printfs"},
{"\-N", TK_ARGV_INT, (char *) NULL, (char *) &numReps, {"\-N", TK_ARGV_INT, NULL, (char *) &numReps,
"Number of repetitions"}, "Number of repetitions"},
{"\-of", TK_ARGV_STRING, (char *) NULL, (char *) &fileName, {"\-of", TK_ARGV_STRING, NULL, (char *) &fileName,
"Name of file for output"}, "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)."}, "File to exec, followed by any arguments (must be last argument)."},
{(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL, {NULL, TK_ARGV_END, NULL, NULL,
(char *) NULL} NULL}
}; };
main(argc, argv) main(argc, argv)

View File

@@ -30,7 +30,7 @@ Pointer to place to save argument to previous restrict procedure.
.PP .PP
This procedure is useful in certain situations where applications This procedure is useful in certain situations where applications
are only prepared to receive certain X events. After are only prepared to receive certain X events. After
\fBTk_RestrictEvents\fR is called, \fBTk_DoOneEvent\fR (and \fBTk_RestrictEvents\fR is called, \fBTcl_DoOneEvent\fR (and
hence \fBTk_MainLoop\fR) will filter X input events through hence \fBTk_MainLoop\fR) will filter X input events through
\fIproc\fR. \fIProc\fR indicates whether a \fIproc\fR. \fIProc\fR indicates whether a
given event is to be processed immediately, deferred until some given event is to be processed immediately, deferred until some
@@ -48,7 +48,7 @@ to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with
information it needs to filter events. The \fIeventPtr\fR points to information it needs to filter events. The \fIeventPtr\fR points to
an event under consideration. \fIProc\fR returns a restrict action an event under consideration. \fIProc\fR returns a restrict action
(enumerated type \fBTk_RestrictAction\fR) that indicates what (enumerated type \fBTk_RestrictAction\fR) that indicates what
\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. \fBTK_PROCESS_EVENT\fR, then the event will be handled immediately.
If the return value is \fBTK_DEFER_EVENT\fR, then the event will be If the return value is \fBTK_DEFER_EVENT\fR, then the event will be
left on the event queue for later processing. If the return value is left on the event queue for later processing. If the return value is
@@ -74,6 +74,6 @@ solution in these situations is to call \fBXNextEvent\fR or
\fBXWindowEvent\fR, but these procedures cannot be used because \fBXWindowEvent\fR, but these procedures cannot be used because
Tk keeps its own event queue that is separate from the X event Tk keeps its own event queue that is separate from the X event
queue. Instead, call \fBTk_RestrictEvents\fR to set up a filter, queue. Instead, call \fBTk_RestrictEvents\fR to set up a filter,
then call \fBTk_DoOneEvent\fR to retrieve the desired event(s). then call \fBTcl_DoOneEvent\fR to retrieve the desired event(s).
.SH KEYWORDS .SH KEYWORDS
delay, event, filter, restriction delay, event, filter, restriction

View File

@@ -56,7 +56,7 @@ The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
will be identical to the \fIinstanceData\fR parameter passed to will be identical to the \fIinstanceData\fR parameter passed to
\fBTk_SetClassProcs\fR. \fBTk_SetClassProcs\fR.
.PP .PP
\fIcreateProc\fR is used to create platform-dependant windows. It is \fIcreateProc\fR is used to create platform-dependent windows. It is
invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have
arguments and results that match the type \fBTk_ClassCreateProc\fR: arguments and results that match the type \fBTk_ClassCreateProc\fR:
.CS .CS

View File

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

View File

@@ -19,9 +19,10 @@ bind \- Arrange for X events to invoke Tcl scripts
.PP .PP
The \fBbind\fR command associates Tcl scripts with X events. The \fBbind\fR command associates Tcl scripts with X events.
If all three arguments are specified, \fBbind\fR will If all three arguments are specified, \fBbind\fR will
arrange for \fIscript\fR (a Tcl script) to be evaluated whenever arrange for \fIscript\fR (a Tcl script called the
the event(s) given by \fIsequence\fR occur in the window(s) .QW "binding script")
identified by \fItag\fR. 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 If \fIscript\fR is prefixed with a
.QW + , .QW + ,
then it is appended to then it is appended to
@@ -200,14 +201,27 @@ substitutions you would make when binding to these events.
Many contemporary mice support a mouse wheel, which is used Many contemporary mice support a mouse wheel, which is used
for scrolling documents without using the scrollbars. By rolling the for scrolling documents without using the scrollbars. By rolling the
wheel, the system will generate \fBMouseWheel\fR events that the wheel, the system will generate \fBMouseWheel\fR events that the
application can use to scroll. Like \fBKey\fR events the event is application can use to scroll. The event is routed to the
always routed to the window that currently has focus. When the event window currently under the mouse pointer. When the event
is received you can use the \fB%D\fR substitution to get the is received you can use the \fB%D\fR substitution to get the
\fIdelta\fR field for the event, which is a integer value describing how \fIdelta\fR field for the event, which is an integer value describing how
the mouse wheel has moved. The smallest value for which the the mouse wheel has moved. The smallest value for which the
system will report is defined by the OS. The sign of the system will report is defined by the OS. The sign of the
value determines which direction your widget should scroll. Positive value determines which direction your widget should scroll. Positive
values should scroll up and negative values should scroll down. values should scroll up and negative values should scroll down.
.RS
.PP
Horizontal scrolling uses \fBShift-MouseWheel\fR events, with positive
\fB%D\fR \fIdelta\fR substitution indicating left scrolling and negative
right scrolling.
Only Windows and macOS Aqua typically fire \fBMouseWheel\fR and
\fBShift-MouseWheel\fR events. On
X11 vertical scrolling is rather supported through \fBButton-4\fR and
\fBButton-5\fR events, and horizontal scrolling through \fBShift-Button-4\fR
and \fBShift-Button-5\fR events. Horizontal scrolling events may fire from
many different hardware units such as tilt wheels or touchpads. Horizontal
scrolling can also be emulated by holding Shift and scrolling vertically.
.RE
.IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5 .IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5
The \fBKeyPress\fR and \fBKeyRelease\fR events are generated The \fBKeyPress\fR and \fBKeyRelease\fR events are generated
whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR
@@ -269,7 +283,8 @@ it is destroyed.
When the \fBDestroy\fR event is delivered When the \fBDestroy\fR event is delivered
to a widget, it is in a to a widget, it is in a
.QW half-dead .QW half-dead
state: the widget still exists, but 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 .RE
.IP "\fBFocusIn\fR, \fBFocusOut\fR" 5 .IP "\fBFocusIn\fR, \fBFocusOut\fR" 5
The \fBFocusIn\fR and \fBFocusOut\fR events are generated The \fBFocusIn\fR and \fBFocusOut\fR events are generated
@@ -387,7 +402,8 @@ For example, \fB<Control\-comma>\fR is equivalent to
\fB<Control\-KeyPress\-comma>\fR. \fB<Control\-KeyPress\-comma>\fR.
.SH "BINDING SCRIPTS AND SUBSTITUTIONS" .SH "BINDING SCRIPTS AND SUBSTITUTIONS"
.PP .PP
The \fIscript\fR argument to \fBbind\fR is a Tcl script, 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. which will be executed whenever the given event sequence occurs.
\fICommand\fR will be executed in the same interpreter that the \fICommand\fR will be executed in the same interpreter that the
\fBbind\fR command was executed in, and it will run at global \fBbind\fR command was executed in, and it will run at global
@@ -508,6 +524,9 @@ For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
\fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events, \fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events,
\fB%x\fR and \fB%y\fR indicate the position of the mouse pointer \fB%x\fR and \fB%y\fR indicate the position of the mouse pointer
relative to the receiving window. relative to the receiving window.
For key events on the Macintosh these are the coordinates of the
mouse at the moment when an X11 KeyEvent is sent to Tk, which could
be slightly later than the time of the physical press or release.
For \fBEnter\fR and \fBLeave\fR events, the position where the For \fBEnter\fR and \fBLeave\fR events, the position where the
mouse pointer crossed the window, relative to the receiving window. mouse pointer crossed the window, relative to the receiving window.
For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR
@@ -515,10 +534,11 @@ coordinates of the window relative to its parent window.
.IP \fB%A\fR 5 .IP \fB%A\fR 5
Substitutes the UNICODE character corresponding to the event, or Substitutes the UNICODE character corresponding to the event, or
the empty string if the event does not correspond to a UNICODE character the empty string if the event does not correspond to a UNICODE character
(e.g. the shift key was pressed). \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 \fBXLookupString\fR when input method support is turned off) does all
the work of translating from the event to a UNICODE character. the work of translating from the event to a UNICODE character.
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 .IP \fB%B\fR 5
The \fIborder_width\fR field from the event. Valid only for The \fIborder_width\fR field from the event. Valid only for
\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events. \fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
@@ -564,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 If a virtual-root window manager is being used then the substituted
values are the corresponding x-coordinate and y-coordinate in the virtual root. values are the corresponding x-coordinate and y-coordinate in the virtual root.
Valid only for Valid only for
\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBKeyPress\fR,
and \fBMotion\fR events. \fBKeyRelease\fR, \fBLeave\fR and \fBMotion\fR events.
Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
window. window.
.LP .LP
@@ -606,13 +626,21 @@ the window.
.PP .PP
The \fBcontinue\fR and \fBbreak\fR commands may be used inside a The \fBcontinue\fR and \fBbreak\fR commands may be used inside a
binding script to control the processing of matching scripts. binding script to control the processing of matching scripts.
If \fBcontinue\fR is invoked, then the current binding script If \fBcontinue\fR is invoked within a binding script, then this
is terminated but Tk will continue processing binding scripts binding script, including all other
associated with other \fItag\fR's. .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, If the \fBbreak\fR command is invoked within a binding script,
then that script terminates and no other scripts will be invoked then that script terminates and no other scripts will be invoked
for the event. for the event.
.PP .PP
Within a script called from the binding script, \fBreturn\fR
\fB-code ok\fR may be used to continue processing (including
.QW +
appended scripts), or \fBreturn\fR \fB-code break\fR may be used to
stop processing all other binding scripts.
.PP
If more than one binding matches a particular event and they If more than one binding matches a particular event and they
have the same \fItag\fR, then the most specific binding have the same \fItag\fR, then the most specific binding
is chosen and its script is evaluated. is chosen and its script is evaluated.
@@ -628,11 +656,11 @@ of events matched) is more specific than a shorter sequence;
.IP (c) .IP (c)
if the modifiers specified in one pattern are a subset of the if the modifiers specified in one pattern are a subset of the
modifiers in another pattern, then the pattern with more modifiers modifiers in another pattern, then the pattern with more modifiers
is more specific. is more specific;
.IP (d) .IP (d)
a virtual event whose physical pattern matches the sequence is less a virtual event whose physical pattern matches the sequence is less
specific than the same physical pattern that is not associated with a specific than the same physical pattern that is not associated with a
virtual event. virtual event;
.IP (e) .IP (e)
given a sequence that matches two or more virtual events, one given a sequence that matches two or more virtual events, one
of the virtual events will be chosen, but the order is undefined. of the virtual events will be chosen, but the order is undefined.

View File

@@ -28,7 +28,7 @@
.BS .BS
'\" Note: do not modify the .SH NAME line immediately below! '\" Note: do not modify the .SH NAME line immediately below!
.SH NAME .SH NAME
busy \- confine pointer and keyboard events to a window sub-tree busy \- confine pointer events to a window sub-tree
.SH SYNOPSIS .SH SYNOPSIS
\fBtk busy\fR \fIwindow \fR?\fIoptions\fR? \fBtk busy\fR \fIwindow \fR?\fIoptions\fR?
.sp .sp
@@ -44,9 +44,10 @@ busy \- confine pointer and keyboard events to a window sub-tree
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
The \fBtk busy\fR command provides a simple means to block keyboard, button, The \fBtk busy\fR command provides a simple means to block pointer events from
and pointer events from Tk widgets, while overriding the widget's cursor with Tk widgets, while overriding the widget's cursor with a configurable busy
a configurable busy cursor. cursor. Note this command does not prevent keyboard events from being sent to
the widgets made busy.
.SH INTRODUCTION .SH INTRODUCTION
.PP .PP
There are many times in applications where you want to temporarily restrict There are many times in applications where you want to temporarily restrict
@@ -68,8 +69,8 @@ that overrides the widget's normal cursor, providing feedback that the
application (widget) is temporarily busy. application (widget) is temporarily busy.
.PP .PP
When a widget is made busy, the widget and all of its descendants will ignore When a widget is made busy, the widget and all of its descendants will ignore
events. It's easy to make an entire panel of widgets busy. You can simply make pointer events. It's easy to make an entire panel of widgets busy. You can
the toplevel widget (such as simply make the toplevel widget (such as
.QW . ) .QW . )
busy. This is easier and far much more efficient than recursively traversing busy. This is easier and far much more efficient than recursively traversing
the widget hierarchy, disabling each widget and re-configuring its cursor. the widget hierarchy, disabling each widget and re-configuring its cursor.
@@ -240,20 +241,27 @@ widgets.
.SS "KEYBOARD EVENTS" .SS "KEYBOARD EVENTS"
.PP .PP
When a widget is made busy, the widget is prevented from gaining the keyboard When a widget is made busy, the widget is prevented from gaining the keyboard
focus by the busy window. But if the widget already had focus, it still may focus by a user clicking on it by the busy window. But if the widget already had
received keyboard events. To prevent this, you must move focus to another focus, it still may receive keyboard events. The widget can also still receive
window. focus through keyboard traversal. To prevent this, you must move
focus to another window and make sure the focus can not go back to the widgets
made busy (e.g. but restricting focus to a cancel button).
.PP .PP
.CS .CS
pack [frame .frame]
pack [text .frame.text]
\fBtk busy\fR hold .frame \fBtk busy\fR hold .frame
label .dummy pack [button .cancel -text "Cancel" -command exit]
focus .dummy focus .cancel
bind .cancel <Tab> {break}
bind .cancel <Shift-Tab> {break}
update update
.CE .CE
.PP .PP
The above example moves the focus from .frame immediately after invoking the The above example moves the focus from .frame immediately after invoking the
\fBhold\fR so that no keyboard events will be sent to \fB.frame\fR or any of \fBhold\fR so that no keyboard events will be sent to \fB.frame\fR or any of
its descendants. its descendants. It also makes sure it's not possible to leave button
\fB.cancel\fR using the keyboard.
.SH PORTABILITY .SH PORTABILITY
.PP .PP
Note that the \fBtk busy\fR command does not currently have any effect on OSX Note that the \fBtk busy\fR command does not currently have any effect on OSX

View File

@@ -547,6 +547,15 @@ If coordinates are specified, then they replace the current
coordinates for the named item. coordinates for the named item.
If \fItagOrId\fR refers to multiple items, then If \fItagOrId\fR refers to multiple items, then
the first one in the display list is used. the first one in the display list is used.
.RS
.PP
Note that for rectangles, ovals and arcs the returned list of coordinates
has a fixed order, namely the left, top, right and bottom coordinates,
which may not be the order originally given. Also the coordinates are always
returned in screen units with no units (that is, in pixels). So if the
original coordinates were specified for instance in centimeters or inches,
the returned values will nevertheless be in pixels.
.RE
.TP .TP
\fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR? \fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR?
.TP .TP
@@ -744,7 +753,8 @@ This command returns an empty string.
\fIpathName \fBmoveto \fItagOrId xPos yPos\fR \fIpathName \fBmoveto \fItagOrId xPos yPos\fR
.VS 8.6 .VS 8.6
Move the items given by \fItagOrId\fR in the canvas coordinate Move the items given by \fItagOrId\fR in the canvas coordinate
space so that the first coordinate pair of the bottommost item with space so that the first coordinate pair (the upper-left corner of the
bounding box) of the first item (the lowest in the display list) with
tag \fItagOrId\fR is located at tag \fItagOrId\fR is located at
position (\fIxPos\fR,\fIyPos\fR). \fIxPos\fR and \fIyPos\fR may be position (\fIxPos\fR,\fIyPos\fR). \fIxPos\fR and \fIyPos\fR may be
the empty string, in which case the corresponding coordinate the empty string, in which case the corresponding coordinate
@@ -1113,7 +1123,7 @@ becomes visible; if it is positive then information farther to the right
becomes visible. becomes visible.
.RE .RE
.TP .TP
\fIpathName \fByview \fI?args\fR? \fIpathName \fByview ?\fIargs\fR?
. .
This command is used to query and change the vertical position of the This command is used to query and change the vertical position of the
information displayed in the canvas's window. information displayed in the canvas's window.
@@ -1210,10 +1220,10 @@ in the \fBCOORDINATES\fR section above.
Specifies the color to be used to fill item's area. Specifies the color to be used to fill item's area.
in its normal, active, and disabled states, in its normal, active, and disabled states,
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
If \fIcolor\fR is an empty string (the default),
then the item will not be filled.
For the line item, it specifies the color of the line drawn. For the line item, it specifies the color of the line drawn.
For the text item, it specifies the foreground color of the text. For the text item, it specifies the foreground color of the text.
If \fIcolor\fR is an empty string (the default for all canvas items
except line and text), then the item will not be filled.
.TP .TP
\fB\-outline \fIcolor\fR \fB\-outline \fIcolor\fR
.TP .TP
@@ -1224,8 +1234,8 @@ For the text item, it specifies the foreground color of the text.
This option specifies the color that should be used to draw the This option specifies the color that should be used to draw the
outline of the item in its normal, active and disabled states. outline of the item in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
This option defaults to \fBblack\fR. If \fIcolor\fR is specified If \fIcolor\fR is specified as an empty string then no outline is drawn
as an empty string then no outline is drawn for the item. for the item.
.TP .TP
\fB\-offset \fIoffset\fR \fB\-offset \fIoffset\fR
. .
@@ -1433,8 +1443,7 @@ disabled states.
Specifies the color to use for each of the bitmap's Specifies the color to use for each of the bitmap's
.QW 1 .QW 1
valued pixels in its normal, active and disabled states. valued pixels in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR and \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
defaults to \fBblack\fR.
.SS "IMAGE ITEMS" .SS "IMAGE ITEMS"
.PP .PP
Items of type \fBimage\fR are used to display images on a Items of type \fBimage\fR are used to display images on a
@@ -1515,6 +1524,12 @@ ends of the line.
\fBlast\fR (for an arrowhead at the last point of the line), or \fBlast\fR (for an arrowhead at the last point of the line), or
\fBboth\fR (for arrowheads at both ends). \fBboth\fR (for arrowheads at both ends).
This option defaults to \fBnone\fR. This option defaults to \fBnone\fR.
When requested to draw an arrowhead, Tk internally adjusts the corresponding
line end point so that the rendered line ends at the neck of the arrowhead
rather than at its tip so that the line doesn't extend past the edge of the
arrowhead. This may trigger a \fBLeave\fR event if the mouse is hovering this
line end. Conversely, when removing an arrowhead Tk adjusts the corresponding
line point the other way round, which may trigger an \fBEnter\fR event.
.TP .TP
\fB\-arrowshape \fIshape\fR \fB\-arrowshape \fIshape\fR
This option indicates how to draw arrowheads. This option indicates how to draw arrowheads.

View File

@@ -17,6 +17,13 @@ The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the
user to select a directory. The following \fIoption\-value\fR pairs are user to select a directory. The following \fIoption\-value\fR pairs are
possible as command line arguments: possible as command line arguments:
.TP .TP
\fB\-command\fR \fIstring\fR
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog after having selected an item. This callback is not called if the
user cancelled the dialog. The actual command consists of \fIstring\fR
followed by a space and the value selected by the user in the dialog. This
is only available on Mac OS X.
.TP
\fB\-initialdir\fR \fIdirname\fR \fB\-initialdir\fR \fIdirname\fR
Specifies that the directories in \fIdirectory\fR should be displayed Specifies that the directories in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified, when the dialog pops up. If this parameter is not specified,
@@ -27,6 +34,10 @@ user-selected directory for the application. If the
parameter specifies a relative path, the return value will convert the parameter specifies a relative path, the return value will convert the
relative path to an absolute path. relative path to an absolute path.
.TP .TP
\fB\-message\fR \fIstring\fR
Specifies a message to include in the client area of the dialog.
This is only available on Mac OS X.
.TP
\fB\-mustexist\fR \fIboolean\fR \fB\-mustexist\fR \fIboolean\fR
Specifies whether the user may specify non-existent directories. If Specifies whether the user may specify non-existent directories. If
this parameter is true, then the user may only select directories that this parameter is true, then the user may only select directories that

View File

@@ -784,29 +784,23 @@ YellowGreen 154 205 50
.TP .TP
\fBMac OS X\fR \fBMac OS X\fR
. .
On Mac OS X, the following additional system colors are available On macOS, the following additional system colors are available. This
(note that the actual color values depend on the currently active OS theme, first group contains all of the HIBrush colors available in the
and typically many of these will in fact be patterns rather than pure colors): HIToolbox library. Note that on macOS 10.14 (Mojave) and later these
colors are unlikely to match the color actually used for the purpose
suggested by the color name.
.RS .RS
.DS .DS
systemActiveAreaFill systemActiveAreaFill
systemAlertActiveText
systemAlertBackgroundActive systemAlertBackgroundActive
systemAlertBackgroundInactive systemAlertBackgroundInactive
systemAlertInactiveText
systemAlternatePrimaryHighlightColor systemAlternatePrimaryHighlightColor
systemAppleGuideCoachmark systemAppleGuideCoachmark
systemBevelActiveDark systemBevelActiveDark
systemBevelActiveLight systemBevelActiveLight
systemBevelButtonActiveText
systemBevelButtonInactiveText
systemBevelButtonPressedText
systemBevelButtonStickyActiveText
systemBevelButtonStickyInactiveText
systemBevelInactiveDark systemBevelInactiveDark
systemBevelInactiveLight systemBevelInactiveLight
systemBlack systemBlack
systemBlackText
systemButtonActiveDarkHighlight systemButtonActiveDarkHighlight
systemButtonActiveDarkShadow systemButtonActiveDarkShadow
systemButtonActiveLightHighlight systemButtonActiveLightHighlight
@@ -826,15 +820,10 @@ systemButtonPressedDarkHighlight
systemButtonPressedDarkShadow systemButtonPressedDarkShadow
systemButtonPressedLightHighlight systemButtonPressedLightHighlight
systemButtonPressedLightShadow systemButtonPressedLightShadow
systemButtonText
systemChasingArrows systemChasingArrows
systemDialogActiveText
systemDialogBackgroundActive systemDialogBackgroundActive
systemDialogBackgroundInactive systemDialogBackgroundInactive
systemDialogInactiveText
systemDocumentWindowBackground systemDocumentWindowBackground
systemDocumentWindowTitleActiveText
systemDocumentWindowTitleInactiveText
systemDragHilite systemDragHilite
systemDrawerBackground systemDrawerBackground
systemFinderWindowBackground systemFinderWindowBackground
@@ -842,90 +831,87 @@ systemFocusHighlight
systemHighlight systemHighlight
systemHighlightAlternate systemHighlightAlternate
systemHighlightSecondary systemHighlightSecondary
systemHighlightText
systemIconLabelBackground systemIconLabelBackground
systemIconLabelBackgroundSelected systemIconLabelBackgroundSelected
systemIconLabelSelectedText
systemIconLabelText
systemListViewBackground systemListViewBackground
systemListViewColumnDivider systemListViewColumnDivider
systemListViewEvenRowBackground systemListViewEvenRowBackground
systemListViewOddRowBackground systemListViewOddRowBackground
systemListViewSeparator systemListViewSeparator
systemListViewSortColumnBackground systemListViewSortColumnBackground
systemListViewText
systemListViewWindowHeaderBackground
systemMenu systemMenu
systemMenuActive systemMenuActive
systemMenuActiveText
systemMenuBackground systemMenuBackground
systemMenuBackgroundSelected systemMenuBackgroundSelected
systemMenuDisabled
systemMenuItemActiveText
systemMenuItemDisabledText
systemMenuItemSelectedText
systemMenuText
systemMetalBackground
systemModelessDialogActiveText
systemModelessDialogBackgroundActive systemModelessDialogBackgroundActive
systemModelessDialogBackgroundInactive systemModelessDialogBackgroundInactive
systemModelessDialogInactiveText
systemMovableModalBackground systemMovableModalBackground
systemMovableModalWindowTitleActiveText
systemMovableModalWindowTitleInactiveText
systemNotificationText
systemNotificationWindowBackground systemNotificationWindowBackground
systemPlacardActiveText
systemPlacardBackground
systemPlacardInactiveText
systemPlacardPressedText
systemPopupArrowActive systemPopupArrowActive
systemPopupArrowInactive systemPopupArrowInactive
systemPopupArrowPressed systemPopupArrowPressed
systemPopupButtonActiveText
systemPopupButtonInactiveText
systemPopupButtonPressedText
systemPopupLabelActiveText
systemPopupLabelInactiveText
systemPopupWindowTitleActiveText
systemPopupWindowTitleInactiveText
systemPrimaryHighlightColor systemPrimaryHighlightColor
systemPushButtonActiveText
systemPushButtonInactiveText
systemPushButtonPressedText
systemRootMenuActiveText
systemRootMenuDisabledText
systemRootMenuSelectedText
systemScrollBarDelimiterActive systemScrollBarDelimiterActive
systemScrollBarDelimiterInactive systemScrollBarDelimiterInactive
systemSecondaryGroupBoxBackground
systemSecondaryHighlightColor systemSecondaryHighlightColor
systemSelectedTabTextColor
systemSheetBackground systemSheetBackground
systemSheetBackgroundOpaque systemSheetBackgroundOpaque
systemSheetBackgroundTransparent systemSheetBackgroundTransparent
systemStaticAreaFill systemStaticAreaFill
systemSystemDetailText
systemTabFrontActiveText
systemTabFrontInactiveText
systemTabNonFrontActiveText
systemTabNonFrontInactiveText
systemTabNonFrontPressedText
systemTabPaneBackground
systemToolbarBackground systemToolbarBackground
systemTransparent systemTransparent
systemUtilityWindowBackgroundActive systemUtilityWindowBackgroundActive
systemUtilityWindowBackgroundInactive systemUtilityWindowBackgroundInactive
systemUtilityWindowTitleActiveText
systemUtilityWindowTitleInactiveText
systemWhite systemWhite
systemWhiteText
systemWindowBody systemWindowBody
systemWindowHeaderActiveText .DE
systemWindowHeaderBackground .RE
systemWindowHeaderInactiveText .
Tk supports all of the NSColors in the macOS System ColorList. The
convention for naming these colors is that the Tk name is generated by
capitalizing the macOS name and adding the prefix "system". On OSX
10.14 (Mojave) and later many of these "semantic" colors will appear
differently depending on whether the NSWindow in which they are used has
the Aqua or DarkAqua appearance. The System ColorList differs between
releases of macOS and some colors, such as systemLinkColor and
systemControlAccentColor, are simulated on older systems which did not
provide them. All of the colors below are available on all supported
macOS releases, but newer systems will support additional colors.
.RS
.DS
systemControlAccentColor
systemControlTextColor
systemDisabledControlTextColor
systemLabelColor
systemLinkColor
systemPlaceholderTextColor
systemSelectedTextBackgroundColor
systemSelectedTextColor
systemSeparatorColor
systemTextBackgroundColor
systemTextColor
.DE
.RE
.
The numbered systemWindowBackgroundColors below
are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets
to provide a contrasting background. Each numbered color constrasts
with its predecessor.
.RS
.DS
systemWindowBackgroundColor
systemWindowBackgroundColor1
systemWindowBackgroundColor2
systemWindowBackgroundColor3
systemWindowBackgroundColor4
systemWindowBackgroundColor5
systemWindowBackgroundColor6
systemWindowBackgroundColor7
.DE .DE
.RE .RE
.TP .TP
\fBWindows\fR \fBWindows\fR
. .
On Windows, the following additional system colors are available On Windows, the following additional system colors are available

View File

@@ -25,9 +25,12 @@ the Tk library. Except for TkAqua, this command is not available when
Tk is loaded into a tclsh interpreter with Tk is loaded into a tclsh interpreter with
.QW "\fBpackage require Tk\fR" , .QW "\fBpackage require Tk\fR" ,
as a conventional terminal is expected to be present in that case. as a conventional terminal is expected to be present in that case.
In TkAqua, this command is only available when stdin is \fB/dev/null\fR In TkAqua, this command is disabled when there is a startup script
(as is the case e.g. when the application embedding Tk is started and stdin is \fB/dev/null\fR (as is the case e.g. when a bundled application
from the Mac OS X Finder). embedding Tk is started by the macOS Launcher). To enable the command
in that case, define the environment variable \fBTK_CONSOLE\fR. This can be
done by modifying the Info.plist file by adding the LSEnvironment key
to the main dict and setting its value to be a dict with the key \fBTK_CONSOLE\fR.
.PP .PP
.TP .TP
\fBconsole eval \fIscript\fR \fBconsole eval \fIscript\fR

View File

@@ -448,9 +448,10 @@ insertion cursor in the entry without affecting the selection.
If any normal printing characters are typed in an entry, they are If any normal printing characters are typed in an entry, they are
inserted at the point of the insertion cursor. inserted at the point of the insertion cursor.
.IP [7] .IP [7]
The view in the entry can be adjusted by dragging with mouse button 2. The view in the entry can be adjusted by dragging with the middle
If mouse button 2 is clicked without moving the mouse, the selection mouse button (button 2, or button 3 in TkAqua). If the middle mouse
is copied into the entry at the position of the mouse cursor. button is clicked without moving the mouse, the selection is copied
into the entry at the position of the mouse cursor.
.IP [8] .IP [8]
If the mouse is dragged out of the entry on the left or right sides If the mouse is dragged out of the entry on the left or right sides
while button 1 is pressed, the entry will automatically scroll to while button 1 is pressed, the entry will automatically scroll to

View File

@@ -239,7 +239,8 @@ Similar to \fB%S\fR substitution for binding scripts.
.TP .TP
\fB\-time\fI integer\fR \fB\-time\fI integer\fR
\fIInteger\fR must be an integer value; it specifies the \fItime\fR field \fIInteger\fR must be an integer value; it specifies the \fItime\fR field
for the event. for the event. Additonally the special value \fBcurrent\fR is allowed,
this value will be substituted by the current event time.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR, Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR,
and \fBProperty\fR events. and \fBProperty\fR events.
@@ -338,7 +339,9 @@ This is sent to a text widget when the selection in the widget is
changed. changed.
.TP .TP
\fB<<ThemeChanged>>\fR \fB<<ThemeChanged>>\fR
This is sent to a text widget when the ttk (Tile) theme changed. This is sent to all widgets when the ttk theme changed. The ttk
widgets listen to this event and redisplay themselves when it fires.
The legacy widgets ignore this event.
.TP .TP
\fB<<TraverseIn>>\fR \fB<<TraverseIn>>\fR
This is sent to a widget when the focus enters the widget because of a This is sent to a widget when the focus enters the widget because of a

View File

@@ -99,21 +99,25 @@ The \fBframe\fR command creates a new Tcl command whose
name is the same as the path name of the frame's window. This name is the same as the path name of the frame's window. This
command may be used to invoke various command may be used to invoke various
operations on the widget. It has the following general form: operations on the widget. It has the following general form:
.PP
.CS .CS
\fIpathName option \fR?\fIarg arg ...\fR? \fIpathName option \fR?\fIarg arg ...\fR?
.CE .CE
.PP
\fIPathName\fR is the name of the command, which is the same as \fIPathName\fR is the name of the command, which is the same as
the frame widget's path name. \fIOption\fR and the \fIarg\fRs the frame widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following determine the exact behavior of the command. The following
commands are possible for frame widgets: commands are possible for frame widgets:
.TP .TP
\fIpathName \fBcget\fR \fIoption\fR \fIpathName \fBcget\fR \fIoption\fR
.
Returns the current value of the configuration option given Returns the current value of the configuration option given
by \fIoption\fR. by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBframe\fR \fIOption\fR may have any of the values accepted by the \fBframe\fR
command. command.
.TP .TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR? \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
Query or modify the configuration options of the widget. Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for

View File

@@ -35,6 +35,13 @@ whether the existing file should be overwritten or not.
The following \fIoption\-value\fR pairs are possible as command line The following \fIoption\-value\fR pairs are possible as command line
arguments to these two commands: arguments to these two commands:
.TP .TP
\fB\-command\fR \fIstring\fR
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog after having selected an item. This callback is not called if the
user cancelled the dialog. The actual command consists of \fIstring\fR
followed by a space and the value selected by the user in the dialog. This
is only available on Mac OS X.
.TP
\fB\-confirmoverwrite\fR \fIboolean\fR \fB\-confirmoverwrite\fR \fIboolean\fR
Configures how the Save dialog reacts when the selected file already Configures how the Save dialog reacts when the selected file already
exists, and saving would overwrite it. A true value requests a exists, and saving would overwrite it. A true value requests a

View File

@@ -61,6 +61,16 @@ The \fBfocus\fR command is still used to determine which window in the
application receives the keyboard events. application receives the keyboard events.
The keyboard grab is released when the grab is released. The keyboard grab is released when the grab is released.
.PP .PP
On macOS a global grab affects all windows created by one Tk process.
No window in that process other than the grab window can even be
focused, hence no other window receives key or mouse events. A local
grab on macOS affects all windows created by one Tcl interpreter. It
is possible to focus any window belonging to the Tk process during a
local grab but the grab window is the only window created by its
interpreter which receives key or mouse events. Windows belonging to the
same process but created by different interpreters continue to receive
key and mouse events normally.
.PP
Grabs apply to particular displays. If an application has windows Grabs apply to particular displays. If an application has windows
on multiple displays then it can establish a separate grab on each on multiple displays then it can establish a separate grab on each
display. display.

View File

@@ -17,30 +17,30 @@ grid \- Geometry manager that arranges widgets in a grid
.PP .PP
The \fBgrid\fR command is used to communicate with the grid The \fBgrid\fR command is used to communicate with the grid
geometry manager that arranges widgets in rows and columns inside geometry manager that arranges widgets in rows and columns inside
of another window, called the geometry master (or master window). of another window, called the geometry container (or container window).
The \fBgrid\fR command can have any of several forms, depending The \fBgrid\fR command can have any of several forms, depending
on the \fIoption\fR argument: on the \fIoption\fR argument:
.TP .TP
\fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? \fBgrid \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
. .
If the first argument to \fBgrid\fR is suitable as the first slave If the first argument to \fBgrid\fR is suitable as the first window
argument to \fBgrid configure\fR, either a window name (any value argument to \fBgrid configure\fR, either a window name (any value
starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR
(see the \fBRELATIVE PLACEMENT\fR section below), then the command is (see the \fBRELATIVE PLACEMENT\fR section below), then the command is
processed in the same way as \fBgrid configure\fR. processed in the same way as \fBgrid configure\fR.
.TP .TP
\fBgrid anchor \fImaster\fR ?\fIanchor\fR? \fBgrid anchor \fIwindow\fR ?\fIanchor\fR?
. .
The anchor value controls how to place the grid within the master The anchor value controls how to place the grid within the container window
when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below
for further details. The default \fIanchor\fR is \fInw\fR. for further details. The default \fIanchor\fR is \fInw\fR.
.TP .TP
\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? \fBgrid bbox \fIwindow\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
. .
With no arguments, With no arguments,
the bounding box (in pixels) of the grid is returned. the bounding box (in pixels) of the grid is returned.
The return value consists of 4 integers. The first two are the pixel The return value consists of 4 integers. The first two are the pixel
offset from the master window (x then y) of the top-left corner of the offset from the container window (x then y) of the top-left corner of the
grid, and the second two integers are the width and height of the grid, grid, and the second two integers are the width and height of the grid,
also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on
the command line, then the bounding box for that cell is returned, where the the command line, then the bounding box for that cell is returned, where the
@@ -48,18 +48,18 @@ top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR
arguments are specified, then the bounding box spanning the rows and columns arguments are specified, then the bounding box spanning the rows and columns
indicated is returned. indicated is returned.
.TP .TP
\fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR? \fBgrid columnconfigure \fIwindow index \fR?\fI\-option value...\fR?
. .
Query or set the column properties of the \fIindex\fR column of the Query or set the column properties of the \fIindex\fR column of the
geometry master, \fImaster\fR. geometry container, \fIwindow\fR.
The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR
and \fB\-pad\fR. and \fB\-pad\fR.
If one or more options are provided, then \fIindex\fR may be given as If one or more options are provided, then \fIindex\fR may be given as
a list of column indices to which the configuration options will operate on. a list of column indices to which the configuration options will operate on.
Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR
the options apply to all columns currently occupied be slave windows. For the options apply to all columns currently occupied be content windows. For
a window name, that window must be a slave of this master and the options a window name, that window must be a content of this container and the options
apply to all columns currently occupied be the slave. apply to all columns currently occupied be the content.
The \fB\-minsize\fR option sets the minimum size, in screen units, The \fB\-minsize\fR option sets the minimum size, in screen units,
that will be permitted for this column. that will be permitted for this column.
The \fB\-weight\fR option (an integer value) The \fB\-weight\fR option (an integer value)
@@ -80,169 +80,170 @@ added to the largest window contained completely in that column when the
grid geometry manager requests a size from the containing window. grid geometry manager requests a size from the containing window.
If only an option is specified, with no value, If only an option is specified, with no value,
the current value of that option is returned. the current value of that option is returned.
If only the master window and index is specified, all the current settings If only the container window and index is specified, all the current settings
are returned in a list of are returned in a list of
.QW "\-option value" .QW "\-option value"
pairs. pairs.
.TP .TP
\fBgrid configure \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? \fBgrid configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
. .
The arguments consist of the names of one or more slave windows The arguments consist of the names of one or more content windows
followed by pairs of arguments that specify how followed by pairs of arguments that specify how
to manage the slaves. to manage the content.
The characters \fB\-\fR, \fBx\fR and \fB^\fR, The characters \fB\-\fR, \fBx\fR and \fB^\fR,
can be specified instead of a window name to alter the default can be specified instead of a window name to alter the default
location of a \fIslave\fR, as described in the \fBRELATIVE PLACEMENT\fR location of a \fIwindow\fR, as described in the \fBRELATIVE PLACEMENT\fR
section, below. section, below.
The following options are supported: The following options are supported:
.RS .RS
.TP .TP
\fB\-column \fIn\fR \fB\-column \fIn\fR
. .
Insert the slave so that it occupies the \fIn\fRth column in the grid. Insert the window so that it occupies the \fIn\fRth column in the grid.
Column numbers start with 0. If this option is not supplied, then the Column numbers start with 0. If this option is not supplied, then the
slave is arranged just to the right of previous slave specified on this window is arranged just to the right of previous window specified on this
call to \fBgrid\fR, or column call to \fBgrid\fR, or column
.QW 0 .QW 0
if it is the first slave. For each if it is the first window. For each
\fBx\fR that immediately precedes the \fIslave\fR, the column position \fBx\fR that immediately precedes the \fIwindow\fR, the column position
is incremented by one. Thus the \fBx\fR represents a blank column is incremented by one. Thus the \fBx\fR represents a blank column
for this row in the grid. for this row in the grid.
.TP .TP
\fB\-columnspan \fIn\fR \fB\-columnspan \fIn\fR
. .
Insert the slave so that it occupies \fIn\fR columns in the grid. Insert the window so that it occupies \fIn\fR columns in the grid.
The default is one column, unless the window name is followed by a The default is one column, unless the window name is followed by a
\fB\-\fR, in which case the columnspan is incremented once for each immediately \fB\-\fR, in which case the columnspan is incremented once for each immediately
following \fB\-\fR. following \fB\-\fR.
.TP .TP
\fB\-in \fIother\fR \fB\-in \fIcontainer\fR
. .
Insert the slave(s) in the master Insert the window(s) in the container
window given by \fIother\fR. The default is the first slave's window given by \fIcontainer\fR. The default is the first window's
parent window. parent window.
.TP .TP
\fB\-ipadx \fIamount\fR \fB\-ipadx \fIamount\fR
. .
The \fIamount\fR specifies how much horizontal internal padding to The \fIamount\fR specifies how much horizontal internal padding to
leave on each side of the slave(s). This is space is added leave on each side of the content. This is space is added
inside the slave(s) border. inside the content border.
The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.
It defaults to 0. It defaults to 0.
.TP .TP
\fB\-ipady \fIamount\fR \fB\-ipady \fIamount\fR
. .
The \fIamount\fR specifies how much vertical internal padding to The \fIamount\fR specifies how much vertical internal padding to
leave on the top and bottom of the slave(s). leave on the top and bottom of the content.
This space is added inside the slave(s) border. This space is added inside the content border.
The \fIamount\fR defaults to 0. The \fIamount\fR defaults to 0.
.TP .TP
\fB\-padx \fIamount\fR \fB\-padx \fIamount\fR
. .
The \fIamount\fR specifies how much horizontal external padding to The \fIamount\fR specifies how much horizontal external padding to
leave on each side of the slave(s), in screen units. leave on each side of the content, in screen units.
\fIAmount\fR may be a list \fIAmount\fR may be a list
of two values to specify padding for left and right separately. of two values to specify padding for left and right separately.
The \fIamount\fR defaults to 0. The \fIamount\fR defaults to 0.
This space is added outside the slave(s) border. This space is added outside the content border.
.TP .TP
\fB\-pady \fIamount\fR \fB\-pady \fIamount\fR
. .
The \fIamount\fR specifies how much vertical external padding to The \fIamount\fR specifies how much vertical external padding to
leave on the top and bottom of the slave(s), in screen units. leave on the top and bottom of the content, in screen units.
\fIAmount\fR may be a list \fIAmount\fR may be a list
of two values to specify padding for top and bottom separately. of two values to specify padding for top and bottom separately.
The \fIamount\fR defaults to 0. The \fIamount\fR defaults to 0.
This space is added outside the slave(s) border. This space is added outside the content border.
.TP .TP
\fB\-row \fIn\fR \fB\-row \fIn\fR
. .
Insert the slave so that it occupies the \fIn\fRth row in the grid. Insert the content so that it occupies the \fIn\fRth row in the grid.
Row numbers start with 0. If this option is not supplied, then the Row numbers start with 0. If this option is not supplied, then the
slave is arranged on the same row as the previous slave specified on this content is arranged on the same row as the previous content specified on this
call to \fBgrid\fR, or the first unoccupied row if this is the first slave. call to \fBgrid\fR, or the next row after the highest occupied row
if this is the first content.
.TP .TP
\fB\-rowspan \fIn\fR \fB\-rowspan \fIn\fR
. .
Insert the slave so that it occupies \fIn\fR rows in the grid. Insert the content so that it occupies \fIn\fR rows in the grid.
The default is one row. If the next \fBgrid\fR command contains The default is one row. If the next \fBgrid\fR command contains
\fB^\fR characters instead of \fIslaves\fR that line up with the columns \fB^\fR characters instead of \fIcontent\fR that line up with the columns
of this \fIslave\fR, then the \fBrowspan\fR of this \fIslave\fR is of this \fIcontent\fR, then the \fBrowspan\fR of this \fIcontent\fR is
extended by one. extended by one.
.TP .TP
\fB\-sticky \fIstyle\fR \fB\-sticky \fIstyle\fR
. .
If a slave's cell is larger than its requested dimensions, this If a content's cell is larger than its requested dimensions, this
option may be used to position (or stretch) the slave within its cell. option may be used to position (or stretch) the content within its cell.
\fIStyle\fR is a string that contains zero or more of the characters \fIStyle\fR is a string that contains zero or more of the characters
\fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR. \fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR.
The string can optionally contains spaces or The string can optionally contains spaces or
commas, but they are ignored. Each letter refers to a side (north, south, commas, but they are ignored. Each letter refers to a side (north, south,
east, or west) that the slave will east, or west) that the content will
.QW stick .QW stick
to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are
specified, the slave will be stretched to fill the entire specified, the content will be stretched to fill the entire
height (or width) of its cavity. The \fB\-sticky\fR option subsumes the height (or width) of its cavity. The \fB\-sticky\fR option subsumes the
combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR. combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR.
The default is The default is
.QW "" , .QW "" ,
which causes the slave to be centered in its cavity, at its requested size. which causes the content to be centered in its cavity, at its requested size.
.LP .LP
If any of the slaves are already managed by the geometry manager If any of the content is already managed by the geometry manager
then any unspecified options for them retain their previous values rather then any unspecified options for them retain their previous values rather
than receiving default values. than receiving default values.
.RE .RE
.TP .TP
\fBgrid forget \fIslave \fR?\fIslave ...\fR? \fBgrid forget \fIwindow \fR?\fIwindow ...\fR?
. .
Removes each of the \fIslave\fRs from grid for its Removes each of the \fIwindow\fRs from grid for its
master and unmaps their windows. container and unmaps their windows.
The slaves will no longer be managed by the grid geometry manager. The content will no longer be managed by the grid geometry manager.
The configuration options for that window are forgotten, so that if the The configuration options for that window are forgotten, so that if the
slave is managed once more by the grid geometry manager, the initial window is managed once more by the grid geometry manager, the initial
default settings are used. default settings are used.
.TP .TP
\fBgrid info \fIslave\fR \fBgrid info \fIwindow\fR
. .
Returns a list whose elements are the current configuration state of Returns a list whose elements are the current configuration state of
the slave given by \fIslave\fR in the same option-value form that the content given by \fIwindow\fR in the same option-value form that
might be specified to \fBgrid configure\fR. might be specified to \fBgrid configure\fR.
The first two elements of the list are The first two elements of the list are
.QW "\fB\-in \fImaster\fR" .QW "\fB\-in \fIcontainer\fR"
where \fImaster\fR is the slave's master. where \fIcontainer\fR is the windows's container window.
.TP .TP
\fBgrid location \fImaster x y\fR \fBgrid location \fIwindow x y\fR
. .
Given \fIx\fR and \fIy\fR values in screen units relative to the master window, Given \fIx\fR and \fIy\fR values in screen units relative to the container window,
the column and row number at that \fIx\fR and \fIy\fR location is returned. the column and row number at that \fIx\fR and \fIy\fR location is returned.
For locations that are above or to the left of the grid, \fB\-1\fR is For locations that are above or to the left of the grid, \fB\-1\fR is
returned. returned.
.TP .TP
\fBgrid propagate \fImaster\fR ?\fIboolean\fR? \fBgrid propagate \fIwindow\fR ?\fIboolean\fR?
. .
If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR
then propagation is enabled for \fImaster\fR, which must be a window then propagation is enabled for \fIwindow\fR, which must be a window
name (see \fBGEOMETRY PROPAGATION\fR below). name (see \fBGEOMETRY PROPAGATION\fR below).
If \fIboolean\fR has a false boolean value then propagation is If \fIboolean\fR has a false boolean value then propagation is
disabled for \fImaster\fR. disabled for \fIwindow\fR.
In either of these cases an empty string is returned. In either of these cases an empty string is returned.
If \fIboolean\fR is omitted then the command returns \fB0\fR or If \fIboolean\fR is omitted then the command returns \fB0\fR or
\fB1\fR to indicate whether propagation is currently enabled \fB1\fR to indicate whether propagation is currently enabled
for \fImaster\fR. for \fIwindow\fR.
Propagation is enabled by default. Propagation is enabled by default.
.TP .TP
\fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR? \fBgrid rowconfigure \fIwindow index \fR?\fI\-option value...\fR?
. .
Query or set the row properties of the \fIindex\fR row of the Query or set the row properties of the \fIindex\fR row of the
geometry master, \fImaster\fR. geometry window, \fIwindow\fR.
The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR
and \fB\-pad\fR. and \fB\-pad\fR.
If one or more options are provided, then \fIindex\fR may be given as If one or more options are provided, then \fIindex\fR may be given as
a list of row indices to which the configuration options will operate on. a list of row indices to which the configuration options will operate on.
Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR
the options apply to all rows currently occupied be slave windows. For the options apply to all rows currently occupied by content windows. For
a window name, that window must be a slave of this master and the options a window name, that window must be a content window of this container and the options
apply to all rows currently occupied be the slave. apply to all rows currently occupied by the container window.
The \fB\-minsize\fR option sets the minimum size, in screen units, The \fB\-minsize\fR option sets the minimum size, in screen units,
that will be permitted for this row. that will be permitted for this row.
The \fB\-weight\fR option (an integer value) The \fB\-weight\fR option (an integer value)
@@ -263,91 +264,96 @@ added to the largest window contained completely in that row when the
grid geometry manager requests a size from the containing window. grid geometry manager requests a size from the containing window.
If only an option is specified, with no value, If only an option is specified, with no value,
the current value of that option is returned. the current value of that option is returned.
If only the master window and index is specified, all the current settings If only the container window and index is specified, all the current settings
are returned in a list of are returned in a list of
.QW "-option value" .QW "-option value"
pairs. pairs.
.TP .TP
\fBgrid remove \fIslave \fR?\fIslave ...\fR? \fBgrid remove \fIwindow \fR?\fIwindow ...\fR?
. .
Removes each of the \fIslave\fRs from grid for its Removes each of the \fIwindow\fRs from grid for its
master and unmaps their windows. container and unmaps their windows.
The slaves will no longer be managed by the grid geometry manager. The content will no longer be managed by the grid geometry manager.
However, the configuration options for that window are remembered, However, the configuration options for that window are remembered,
so that if the so that if the content window is managed once more by the grid
slave is managed once more by the grid geometry manager, the previous geometry manager, the previous values are retained.
values are retained.
.TP .TP
\fBgrid size \fImaster\fR \fBgrid size \fIcontainer\fR
. .
Returns the size of the grid (in columns then rows) for \fImaster\fR. Returns the size of the grid (in columns then rows) for \fIcontainer\fR.
The size is determined either by the \fIslave\fR occupying the largest The size is determined either by the \fIcontent\fR occupying the largest
row or column, or the largest column or row with a \fB\-minsize\fR, row or column, or the largest column or row with a \fB\-minsize\fR,
\fB\-weight\fR, or \fB\-pad\fR that is non-zero. \fB\-weight\fR, or \fB\-pad\fR that is non-zero.
.TP .TP
\fBgrid slaves \fImaster\fR ?\fI\-option value\fR? \fBgrid slaves \fIwindow\fR ?\fI\-option value\fR?
. .
If no options are supplied, a list of all of the slaves in \fImaster\fR If no options are supplied, a list of all of the content in \fIwindow\fR
are returned, most recently manages first. are returned, most recently managed first.
\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which \fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which
causes only the slaves in the row (or column) specified by \fIvalue\fR causes only the content in the row (or column) specified by \fIvalue\fR
to be returned. to be returned.
.VS "TIP 581"
.TP
\fBgrid content \fIwindow\fR ?\fI\-option value\fR?
.
Synonym for . \fBgrid slaves \fIwindow\fR ?\fI\-option value\fR?
.VE "TIP 581"
.SH "RELATIVE PLACEMENT" .SH "RELATIVE PLACEMENT"
.PP .PP
The \fBgrid\fR command contains a limited set of capabilities that The \fBgrid\fR command contains a limited set of capabilities that
permit layouts to be created without specifying the row and column permit layouts to be created without specifying the row and column
information for each slave. This permits slaves to be rearranged, information for each content. This permits content to be rearranged,
added, or removed without the need to explicitly specify row and added, or removed without the need to explicitly specify row and
column information. column information.
When no column or row information is specified for a \fIslave\fR, When no column or row information is specified for a \fIcontent\fR,
default values are chosen for default values are chosen for
\fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR \fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR
at the time the \fIslave\fR is managed. The values are chosen at the time the \fIcontent\fR is managed. The values are chosen
based upon the current layout of the grid, the position of the \fIslave\fR based upon the current layout of the grid, the position of the \fIcontent\fR
relative to other \fIslave\fRs in the same grid command, and the presence relative to other \fIcontent\fRs in the same grid command, and the presence
of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR
command where \fIslave\fR names are normally expected. command where \fIcontent\fR names are normally expected.
.RS .RS
.TP .TP
\fB\-\fR \fB\-\fR
. .
This increases the \fB\-columnspan\fR of the \fIslave\fR to the left. Several This increases the \fB\-columnspan\fR of the \fIcontent\fR to the left. Several
\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR \fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR
may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIslave\fR may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIcontent\fR
argument to \fBgrid configure\fR. argument to \fBgrid configure\fR.
.TP .TP
\fBx\fR \fBx\fR
. .
This leaves an empty column between the \fIslave\fR on the left and This leaves an empty column between the \fIcontent\fR on the left and
the \fIslave\fR on the right. the \fIcontent\fR on the right.
.TP .TP
\fB^\fR \fB^\fR
. .
This extends the \fB\-rowspan\fR of the \fIslave\fR above the \fB^\fR's This extends the \fB\-rowspan\fR of the \fIcontent\fR above the \fB^\fR's
in the grid. The number of \fB^\fR's in a row must match the number of in the grid. The number of \fB^\fR's in a row must match the number of
columns spanned by the \fIslave\fR above it. columns spanned by the \fIcontent\fR above it.
.RE .RE
.SH "THE GRID ALGORITHM" .SH "THE GRID ALGORITHM"
.PP .PP
The grid geometry manager lays out its slaves in three steps. The grid geometry manager lays out its content in three steps.
In the first step, the minimum size needed to fit all of the slaves In the first step, the minimum size needed to fit all of the content
is computed, then (if propagation is turned on), a request is made is computed, then (if propagation is turned on), a request is made
of the master window to become that size. of the container window to become that size.
In the second step, the requested size is compared against the actual size In the second step, the requested size is compared against the actual size
of the master. If the sizes are different, then spaces is added to or taken of the container. If the sizes are different, then spaces is added to or taken
away from the layout as needed. away from the layout as needed.
For the final step, each slave is positioned in its row(s) and column(s) For the final step, each content is positioned in its row(s) and column(s)
based on the setting of its \fIsticky\fR flag. based on the setting of its \fIsticky\fR flag.
.PP .PP
To compute the minimum size of a layout, the grid geometry manager To compute the minimum size of a layout, the grid geometry manager
first looks at all slaves whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, first looks at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one,
and computes the nominal size of each row or column to be either the and computes the nominal size of each row or column to be either the
\fIminsize\fR for that row or column, or the sum of the \fIpad\fRding \fIminsize\fR for that row or column, or the sum of the \fIpad\fRding
plus the size of the largest slave, whichever is greater. After that plus the size of the largest content, whichever is greater. After that
the rows or columns in each uniform group adapt to each other. Then the rows or columns in each uniform group adapt to each other. Then
the slaves whose row-spans or column-spans are greater than one are the content whose row-spans or column-spans are greater than one are
examined. If a group of rows or columns need to be increased in size examined. If a group of rows or columns need to be increased in size
in order to accommodate these slaves, then extra space is added to each in order to accommodate these content, then extra space is added to each
row or column in the group according to its \fIweight\fR. For each row or column in the group according to its \fIweight\fR. For each
group whose weights are all zero, the additional space is apportioned group whose weights are all zero, the additional space is apportioned
equally. equally.
@@ -368,11 +374,11 @@ minimum size. For example, if all rows or columns in a group have the
same weight, then each row or column will have the same size as the same weight, then each row or column will have the same size as the
largest row or column in the group. largest row or column in the group.
.PP .PP
For masters whose size is larger than the requested layout, the additional For containers whose size is larger than the requested layout, the additional
space is apportioned according to the row and column weights. If all of space is apportioned according to the row and column weights. If all of
the weights are zero, the layout is placed within its master according to the weights are zero, the layout is placed within its container according to
the \fIanchor\fR value. the \fIanchor\fR value.
For masters whose size is smaller than the requested layout, space is taken For containers whose size is smaller than the requested layout, space is taken
away from columns and rows according to their weights. However, once a away from columns and rows according to their weights. However, once a
column or row shrinks to its minsize, its weight is taken to be zero. column or row shrinks to its minsize, its weight is taken to be zero.
If more space needs to be removed from a layout than would be permitted, as If more space needs to be removed from a layout than would be permitted, as
@@ -380,34 +386,34 @@ when all the rows or columns are at their minimum sizes, the layout is
placed and clipped according to the \fIanchor\fR value. placed and clipped according to the \fIanchor\fR value.
.SH "GEOMETRY PROPAGATION" .SH "GEOMETRY PROPAGATION"
.PP .PP
The grid geometry manager normally computes how large a master must be to The grid geometry manager normally computes how large a container must be to
just exactly meet the needs of its slaves, and it sets the just exactly meet the needs of its content, and it sets the
requested width and height of the master to these dimensions. requested width and height of the container to these dimensions.
This causes geometry information to propagate up through a This causes geometry information to propagate up through a
window hierarchy to a top-level window so that the entire window hierarchy to a top-level window so that the entire
sub-tree sizes itself to fit the needs of the leaf windows. sub-tree sizes itself to fit the needs of the leaf windows.
However, the \fBgrid propagate\fR command may be used to However, the \fBgrid propagate\fR command may be used to
turn off propagation for one or more masters. turn off propagation for one or more containers.
If propagation is disabled then grid will not set If propagation is disabled then grid will not set
the requested width and height of the master window. the requested width and height of the container window.
This may be useful if, for example, you wish for a master This may be useful if, for example, you wish for a container
window to have a fixed size that you specify. window to have a fixed size that you specify.
.SH "RESTRICTIONS ON MASTER WINDOWS" .SH "RESTRICTIONS ON CONTAINER WINDOWS"
.PP .PP
The master for each slave must either be the slave's parent The container for each content must either be the content's parent
(the default) or a descendant of the slave's parent. (the default) or a descendant of the content's parent.
This restriction is necessary to guarantee that the This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is content can be placed over any part of its container that is
visible without danger of the slave being clipped by its parent. visible without danger of the content being clipped by its parent.
In addition, all slaves in one call to \fBgrid\fR must have the same master. In addition, all content in one call to \fBgrid\fR must have the same container.
.SH "STACKING ORDER" .SH "STACKING ORDER"
.PP .PP
If the master for a slave is not its parent then you must make sure If the container for a content is not its parent then you must make sure
that the slave is higher in the stacking order than the master. that the content is higher in the stacking order than the container.
Otherwise the master will obscure the slave and it will appear as Otherwise the container will obscure the content and it will appear as
if the slave has not been managed correctly. if the content has not been managed correctly.
The easiest way to make sure the slave is higher than the master is The easiest way to make sure the content is higher than the container is
to create the master window first: the most recently created window to create the container window first: the most recently created window
will be highest in the stacking order. will be highest in the stacking order.
.SH CREDITS .SH CREDITS
.PP .PP
@@ -440,7 +446,7 @@ widths:
.PP .PP
.CS .CS
button .b \-text "Foo" button .b \-text "Foo"
entry .e \-variable foo entry .e \-textvariable foo ; set foo "Hello World!"
label .l \-text "This is a fairly long piece of text" label .l \-text "This is a fairly long piece of text"
\fBgrid\fR .b .e .l \-sticky ew \fBgrid\fR .b .e .l \-sticky ew

File diff suppressed because it is too large Load Diff

View File

@@ -108,7 +108,7 @@ by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBlabelframe\fR \fIOption\fR may have any of the values accepted by the \fBlabelframe\fR
command. command.
.TP .TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR? \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
Query or modify the configuration options of the widget. Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for

View File

@@ -11,7 +11,7 @@
.SH NAME .SH NAME
safe::loadTk \- Load Tk into a safe interpreter. safe::loadTk \- Load Tk into a safe interpreter.
.SH SYNOPSIS .SH SYNOPSIS
\fBsafe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? \fBsafe::loadTk \fIchild\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR?
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
@@ -43,13 +43,13 @@ the \fBSECURITY ISSUES\fR section below for implementation details.
Please read the \fBsafe\fR manual page for Tcl to learn about the basic Please read the \fBsafe\fR manual page for Tcl to learn about the basic
security considerations for Safe Tcl. security considerations for Safe Tcl.
.PP .PP
\fBsafe::loadTk\fR adds the value of \fBtk_library\fR taken from the master \fBsafe::loadTk\fR adds the value of \fBtk_library\fR taken from the parent
interpreter to the virtual access path of the safe interpreter so that interpreter to the virtual access path of the safe interpreter so that
auto-loading will work in the safe interpreter. auto-loading will work in the safe interpreter.
.PP .PP
Tk initialization is now safe with respect to not trusting the slave's state Tk initialization is now safe with respect to not trusting the child's state
for startup. \fBsafe::loadTk\fR registers the slave's name so when the Tk for startup. \fBsafe::loadTk\fR registers the child's name so when the Tk
initialization (\fBTk_SafeInit\fR) is called and in turn calls the master's initialization (\fBTk_SafeInit\fR) is called and in turn calls the parent's
\fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent \fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent
(\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.) (\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.)
.PP .PP
@@ -62,8 +62,8 @@ fatal X error.
.SH "SEE ALSO" .SH "SEE ALSO"
safe(n), interp(n), library(n), load(n), package(n), source(n), unknown(n) safe(n), interp(n), library(n), load(n), package(n), source(n), unknown(n)
.SH KEYWORDS .SH KEYWORDS
alias, auto-loading, auto_mkindex, load, master interpreter, safe alias, auto-loading, auto_mkindex, load, parent interpreter, safe
interpreter, slave interpreter, source interpreter, child interpreter, source
'\" Local Variables: '\" Local Variables:
'\" mode: nroff '\" mode: nroff
'\" End: '\" End:

View File

@@ -40,7 +40,7 @@ top. If so, it will exist as entry 0 of the menu and the other
entries will number starting at 1. The default entries will number starting at 1. The default
menu bindings arrange for the menu to be torn off when the tear-off menu bindings arrange for the menu to be torn off when the tear-off
entry is invoked. entry is invoked.
This option is ignored under Aqua/Mac OS X, where menus cannot This option is ignored under Aqua/MacOS, where menus cannot
be torn off. be torn off.
.OP \-tearoffcommand tearOffCommand TearOffCommand .OP \-tearoffcommand tearOffCommand TearOffCommand
If this option has a non-empty value, then it specifies a Tcl command If this option has a non-empty value, then it specifies a Tcl command
@@ -54,7 +54,7 @@ and menu \fB.x.y\fR is torn off to
create a new menu \fB.x.tearoff1\fR, then the command create a new menu \fB.x.tearoff1\fR, then the command
.QW "\fBa b .x.y .x.tearoff1\fR" .QW "\fBa b .x.y .x.tearoff1\fR"
will be invoked. will be invoked.
This option is ignored under Aqua/Mac OS X, where menus cannot This option is ignored under Aqua/MacOS, where menus cannot
be torn off. be torn off.
.OP \-title title Title .OP \-title title Title
The string will be used to title the window created when this menu is The string will be used to title the window created when this menu is
@@ -98,8 +98,10 @@ a bitmap, or an image, controlled by the \fB\-label\fR,
\fB\-bitmap\fR, and \fB\-image\fR options for the entry. \fB\-bitmap\fR, and \fB\-image\fR options for the entry.
If the \fB\-accelerator\fR option is specified for an entry then a second If the \fB\-accelerator\fR option is specified for an entry then a second
textual field is displayed to the right of the label. The accelerator textual field is displayed to the right of the label. The accelerator
typically describes a keystroke sequence that may be typed in the typically describes a keystroke sequence that may be used in the
application to cause the same result as invoking the menu entry. application to cause the same result as invoking the menu entry.
This is a display option, it does not actually set the corresponding
binding (which can be achieved using the \fBbind\fR command).
The third field is an \fIindicator\fR. The indicator is present only for The third field is an \fIindicator\fR. The indicator is present only for
checkbutton or radiobutton entries. It indicates whether the entry checkbutton or radiobutton entries. It indicates whether the entry
is selected or not, and is displayed to the left of the entry's is selected or not, and is displayed to the left of the entry's
@@ -262,7 +264,10 @@ contents are inserted into the standard Window menu of the user's
menubar whenever the window's menubar is in front. The first items in menubar whenever the window's menubar is in front. The first items in
the menu are provided by Mac OS X, and the names of the current the menu are provided by Mac OS X, and the names of the current
toplevels are automatically appended after all the Tk-defined items and toplevels are automatically appended after all the Tk-defined items and
a separator. a separator. The Window menu on the Mac also allows toggling the
window into a fullscreen state, and managing a tabbed window interface
(multiple windows grouped into a single window) if supported by that
version of the operating system.
.PP .PP
When Tk sees a .menubar.help menu on the Macintosh, the menu's contents When Tk sees a .menubar.help menu on the Macintosh, the menu's contents
are appended to the standard Help menu of the user's menubar whenever are appended to the standard Help menu of the user's menubar whenever
@@ -465,18 +470,19 @@ a menu entry does not automatically unpost the menu; the default
bindings normally take care of this before invoking the \fBinvoke\fR bindings normally take care of this before invoking the \fBinvoke\fR
widget command. widget command.
.TP .TP
\fIpathName \fBpost \fIx y\fR \fIpathName \fBpost \fIx y\fR ?\fIindex\fR?
. .
Arrange for the menu to be displayed on the screen at the root-window Arrange for the menu to be displayed on the screen at the root-window
coordinates given by \fIx\fR and \fIy\fR. These coordinates are coordinates given by \fIx\fR and \fIy\fR. If an index is specified
adjusted if necessary to guarantee that the entire menu is visible on the menu will be located so that the entry with that index is
the screen. This command normally returns an empty string. displayed at the point. These coordinates are adjusted if necessary to
If the \fB\-postcommand\fR option has been specified, then its value is guarantee that the entire menu is visible on the screen. This command
executed as a Tcl script before posting the menu and the result of normally returns an empty string. If the \fB\-postcommand\fR option
that script is returned as the result of the \fBpost\fR widget has been specified, then its value is executed as a Tcl script before
command. posting the menu and the result of that script is returned as the
If an error returns while executing the command, then the error is result of the \fBpost\fR widget command. If an error returns while
returned without posting the menu. executing the command, then the error is returned without posting the
menu.
.TP .TP
\fIpathName \fBpostcascade \fIindex\fR \fIpathName \fBpostcascade \fIindex\fR
. .
@@ -517,8 +523,8 @@ supported by all entry types.
\fB\-activebackground \fIvalue\fR \fB\-activebackground \fIvalue\fR
. .
Specifies a background color to use for displaying this entry when it Specifies a background color to use for displaying this entry when it
is active. is active. This option is ignored on Aqua/MacOS.
If this option is specified as an empty string (the default), then the If it is specified as an empty string (the default), then the
\fB\-activebackground\fR option for the overall menu is used. \fB\-activebackground\fR option for the overall menu is used.
If the \fBtk_strictMotif\fR variable has been set to request strict If the \fBtk_strictMotif\fR variable has been set to request strict
Motif compliance, then this option is ignored and the \fB\-background\fR Motif compliance, then this option is ignored and the \fB\-background\fR
@@ -528,7 +534,7 @@ This option is not available for separator or tear-off entries.
\fB\-activeforeground \fIvalue\fR \fB\-activeforeground \fIvalue\fR
. .
Specifies a foreground color to use for displaying this entry when it Specifies a foreground color to use for displaying this entry when it
is active. is active. This option is ignored on Aqua/macOS.
If this option is specified as an empty string (the default), then the If this option is specified as an empty string (the default), then the
\fB\-activeforeground\fR option for the overall menu is used. \fB\-activeforeground\fR option for the overall menu is used.
This option is not available for separator or tear-off entries. This option is not available for separator or tear-off entries.
@@ -537,14 +543,17 @@ This option is not available for separator or tear-off entries.
. .
Specifies a string to display at the right side of the menu entry. Specifies a string to display at the right side of the menu entry.
Normally describes an accelerator keystroke sequence that may be Normally describes an accelerator keystroke sequence that may be
typed to invoke the same function as the menu entry. This option used to invoke the same function as the menu entry. This is a display
is not available for separator or tear-off entries. option, it does not actually set the corresponding binding (which can
be achieved using the \fBbind\fR command). This option is not available
for separator or tear-off entries.
.TP .TP
\fB\-background \fIvalue\fR \fB\-background \fIvalue\fR
. .
Specifies a background color to use for displaying this entry when it Specifies a background color to use for displaying this entry when it
is in the normal state (neither active nor disabled). is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the This option is ignored on Aqua/macOS.
If it is specified as an empty string (the default), then the
\fB\-background\fR option for the overall menu is used. \fB\-background\fR option for the overall menu is used.
This option is not available for separator or tear-off entries. This option is not available for separator or tear-off entries.
.TP .TP
@@ -565,7 +574,7 @@ This option is not available for separator or tear-off entries.
When this option is zero, the entry appears below the previous entry. When When this option is zero, the entry appears below the previous entry. When
this option is one, the entry appears at the top of a new column in the this option is one, the entry appears at the top of a new column in the
menu. menu.
This option is ignored on Aqua/Mac OS X, where menus are always a single This option is ignored on Aqua/macOS, where menus are always a single
column. column.
.TP .TP
\fB\-command \fIvalue\fR \fB\-command \fIvalue\fR
@@ -595,7 +604,8 @@ This option is not available for separator or tear-off entries.
. .
Specifies a foreground color to use for displaying this entry when it Specifies a foreground color to use for displaying this entry when it
is in the normal state (neither active nor disabled). is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the This option is ignored on Aqua/macOS.
If it is specified as an empty string (the default), then the
\fB\-foreground\fR option for the overall menu is used. \fB\-foreground\fR option for the overall menu is used.
This option is not available for separator or tear-off entries. This option is not available for separator or tear-off entries.
.TP .TP

View File

@@ -24,6 +24,12 @@ buttons. Then it returns the symbolic name of the selected button.
.PP .PP
The following option-value pairs are supported: The following option-value pairs are supported:
.TP .TP
\fB\-command\fR \fIstring\fR
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog. The actual command consists of \fIstring\fR followed by a space
and the name of the button clicked by the user to close the dialog. This
is only available on Mac OS X.
.TP
\fB\-default\fR \fIname\fR \fB\-default\fR \fIname\fR
. .
\fIName\fR gives the symbolic name of the default button for \fIName\fR gives the symbolic name of the default button for

View File

@@ -22,16 +22,16 @@ packing them in order around the edges of the parent.
The \fBpack\fR command can have any of several forms, depending The \fBpack\fR command can have any of several forms, depending
on the \fIoption\fR argument: on the \fIoption\fR argument:
.TP .TP
\fBpack \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? \fBpack \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
If the first argument to \fBpack\fR is a window name (any value If the first argument to \fBpack\fR is a window name (any value
starting with starting with
.QW . ), .QW . ),
then the command is processed in the same way as \fBpack configure\fR. then the command is processed in the same way as \fBpack configure\fR.
.TP .TP
\fBpack configure \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? \fBpack configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
The arguments consist of the names of one or more slave windows The arguments consist of the names of one or more content windows
followed by pairs of arguments that specify how followed by pairs of arguments that specify how
to manage the slaves. to manage the content.
See \fBTHE PACKER ALGORITHM\fR below for details on how the options See \fBTHE PACKER ALGORITHM\fR below for details on how the options
are used by the packer. are used by the packer.
The following options are supported: The following options are supported:
@@ -39,224 +39,230 @@ The following options are supported:
.TP .TP
\fB\-after \fIother\fR \fB\-after \fIother\fR
\fIOther\fR must the name of another window. \fIOther\fR must the name of another window.
Use its master as the master for the slaves, and insert Use its container as the container for the content, and insert
the slaves just after \fIother\fR in the packing order. the content just after \fIother\fR in the packing order.
.TP .TP
\fB\-anchor \fIanchor\fR \fB\-anchor \fIanchor\fR
\fIAnchor\fR must be a valid anchor position such as \fBn\fR \fIAnchor\fR must be a valid anchor position such as \fBn\fR
or \fBsw\fR; it specifies where to position each slave in its or \fBsw\fR; it specifies where to position each content in its
parcel. parcel.
Defaults to \fBcenter\fR. Defaults to \fBcenter\fR.
.TP .TP
\fB\-before \fIother\fR \fB\-before \fIother\fR
\fIOther\fR must the name of another window. \fIOther\fR must the name of another window.
Use its master as the master for the slaves, and insert Use its container as the container for the content, and insert
the slaves just before \fIother\fR in the packing order. the content just before \fIother\fR in the packing order.
.TP .TP
\fB\-expand \fIboolean\fR \fB\-expand \fIboolean\fR
Specifies whether the slaves should be expanded to consume Specifies whether the content should be expanded to consume
extra space in their master. extra space in their container.
\fIBoolean\fR may have any proper boolean value, such as \fB1\fR \fIBoolean\fR may have any proper boolean value, such as \fB1\fR
or \fBno\fR. or \fBno\fR.
Defaults to 0. Defaults to 0.
.TP .TP
\fB\-fill \fIstyle\fR \fB\-fill \fIstyle\fR
If a slave's parcel is larger than its requested dimensions, this If a content's parcel is larger than its requested dimensions, this
option may be used to stretch the slave. option may be used to stretch the content.
\fIStyle\fR must have one of the following values: \fIStyle\fR must have one of the following values:
.RS .RS
.TP .TP
\fBnone\fR \fBnone\fR
Give the slave its requested dimensions plus any internal padding Give the content its requested dimensions plus any internal padding
requested with \fB\-ipadx\fR or \fB\-ipady\fR. This is the default. requested with \fB\-ipadx\fR or \fB\-ipady\fR. This is the default.
.TP .TP
\fBx\fR \fBx\fR
Stretch the slave horizontally to fill the entire width of its Stretch the content horizontally to fill the entire width of its
parcel (except leave external padding as specified by \fB\-padx\fR). parcel (except leave external padding as specified by \fB\-padx\fR).
.TP .TP
\fBy\fR \fBy\fR
Stretch the slave vertically to fill the entire height of its Stretch the content vertically to fill the entire height of its
parcel (except leave external padding as specified by \fB\-pady\fR). parcel (except leave external padding as specified by \fB\-pady\fR).
.TP .TP
\fBboth\fR \fBboth\fR
Stretch the slave both horizontally and vertically. Stretch the content both horizontally and vertically.
.RE .RE
.TP .TP
\fB\-in \fIother\fR \fB\-in \fIcontainer\fR
Insert the slave(s) at the end of the packing order for the master Insert the window at the end of the packing order for the container
window given by \fIother\fR. window given by \fIcontainer\fR.
.TP .TP
\fB\-ipadx \fIamount\fR \fB\-ipadx \fIamount\fR
\fIAmount\fR specifies how much horizontal internal padding to \fIAmount\fR specifies how much horizontal internal padding to
leave on each side of the slave(s). leave on each side of the content.
\fIAmount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. \fIAmount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.
It defaults to 0. It defaults to 0.
.TP .TP
\fB\-ipady \fIamount\fR \fB\-ipady \fIamount\fR
\fIAmount\fR specifies how much vertical internal padding to \fIAmount\fR specifies how much vertical internal padding to
leave on each side of the slave(s). leave on each side of the content.
\fIAmount\fR defaults to 0. \fIAmount\fR defaults to 0.
.TP .TP
\fB\-padx \fIamount\fR \fB\-padx \fIamount\fR
\fIAmount\fR specifies how much horizontal external padding to \fIAmount\fR specifies how much horizontal external padding to
leave on each side of the slave(s). \fIAmount\fR may be a list leave on each side of the content. \fIAmount\fR may be a list
of two values to specify padding for left and right separately. of two values to specify padding for left and right separately.
\fIAmount\fR defaults to 0. \fIAmount\fR defaults to 0.
.TP .TP
\fB\-pady \fIamount\fR \fB\-pady \fIamount\fR
\fIAmount\fR specifies how much vertical external padding to \fIAmount\fR specifies how much vertical external padding to
leave on each side of the slave(s). \fIAmount\fR may be a list leave on each side of the content. \fIAmount\fR may be a list
of two values to specify padding for top and bottom separately. of two values to specify padding for top and bottom separately.
\fIAmount\fR defaults to 0. \fIAmount\fR defaults to 0.
.TP .TP
\fB\-side \fIside\fR \fB\-side \fIside\fR
Specifies which side of the master the slave(s) will be packed against. Specifies which side of the container the content will be packed against.
Must be \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. Must be \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR.
Defaults to \fBtop\fR. Defaults to \fBtop\fR.
.LP .LP
If no \fB\-in\fR, \fB\-after\fR or \fB\-before\fR option is specified If no \fB\-in\fR, \fB\-after\fR or \fB\-before\fR option is specified
then each of the slaves will be inserted at the end of the packing list then each of the content will be inserted at the end of the packing list
for its parent unless it is already managed by the packer (in which for its parent unless it is already managed by the packer (in which
case it will be left where it is). case it will be left where it is).
If one of these options is specified then all the slaves will be If one of these options is specified then all the content will be
inserted at the specified point. inserted at the specified point.
If any of the slaves are already managed by the geometry manager If any of the content are already managed by the geometry manager
then any unspecified options for them retain their previous values rather then any unspecified options for them retain their previous values rather
than receiving default values. than receiving default values.
.RE .RE
.TP .TP
\fBpack forget \fIslave \fR?\fIslave ...\fR? \fBpack forget \fIwindow \fR?\fIwindow ...\fR?
Removes each of the \fIslave\fRs from the packing order for its Removes each of the \fIwindow\fRs from the packing order for its
master and unmaps their windows. container and unmaps their windows.
The slaves will no longer be managed by the packer. The content will no longer be managed by the packer.
.TP .TP
\fBpack info \fIslave\fR \fBpack info \fIwindow\fR
Returns a list whose elements are the current configuration state of Returns a list whose elements are the current configuration state of
the slave given by \fIslave\fR in the same option-value form that the window given by \fIwindow\fR in the same option-value form that
might be specified to \fBpack configure\fR. might be specified to \fBpack configure\fR.
The first two elements of the list are The first two elements of the list are
.QW "\fB\-in \fImaster\fR" .QW "\fB\-in \fIcontainer\fR"
where \fImaster\fR is the slave's master. where \fIcontainer\fR is the window's container.
.TP .TP
\fBpack propagate \fImaster\fR ?\fIboolean\fR? \fBpack propagate \fIcontainer\fR ?\fIboolean\fR?
If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR
then propagation is enabled for \fImaster\fR, which must be a window then propagation is enabled for \fIcontainer\fR, which must be a window
name (see \fBGEOMETRY PROPAGATION\fR below). name (see \fBGEOMETRY PROPAGATION\fR below).
If \fIboolean\fR has a false boolean value then propagation is If \fIboolean\fR has a false boolean value then propagation is
disabled for \fImaster\fR. disabled for \fIcontainer\fR.
In either of these cases an empty string is returned. In either of these cases an empty string is returned.
If \fIboolean\fR is omitted then the command returns \fB0\fR or If \fIboolean\fR is omitted then the command returns \fB0\fR or
\fB1\fR to indicate whether propagation is currently enabled \fB1\fR to indicate whether propagation is currently enabled
for \fImaster\fR. for \fIcontainer\fR.
Propagation is enabled by default. Propagation is enabled by default.
.TP .TP
\fBpack slaves \fImaster\fR \fBpack slaves \fIwindow\fR
Returns a list of all of the slaves in the packing order for \fImaster\fR. Returns a list of all of the content windows in the packing order for \fIwindow\fR.
The order of the slaves in the list is the same as their order in The order of the content windows in the list is the same as their order in
the packing order. the packing order.
If \fImaster\fR has no slaves then an empty string is returned. If \fIwindow\fR has no content then an empty string is returned.
.VS "TIP 581"
.TP
\fBpack content \fIwindow\fR
.
Synonym for . \fBpack slaves \fIwindow\fR
.VE "TIP 581"
.SH "THE PACKER ALGORITHM" .SH "THE PACKER ALGORITHM"
.PP .PP
For each master the packer maintains an ordered list of slaves For each container the packer maintains an ordered list of content
called the \fIpacking list\fR. windows called the \fIpacking list\fR.
The \fB\-in\fR, \fB\-after\fR, and \fB\-before\fR configuration The \fB\-in\fR, \fB\-after\fR, and \fB\-before\fR configuration
options are used to specify the master for each slave and the slave's options are used to specify the container for each content and the content's
position in the packing list. position in the packing list.
If none of these options is given for a slave then the slave If none of these options is given for a content then the content
is added to the end of the packing list for its parent. is added to the end of the packing list for its parent.
.PP .PP
The packer arranges the slaves for a master by scanning the The packer arranges the content windows for a container by scanning the
packing list in order. packing list in order.
At the time it processes each slave, a rectangular area within At the time it processes each content, a rectangular area within
the master is still unallocated. the container is still unallocated.
This area is called the \fIcavity\fR; for the first slave it This area is called the \fIcavity\fR; for the first content it
is the entire area of the master. is the entire area of the container.
.PP .PP
For each slave the packer carries out the following steps: For each content the packer carries out the following steps:
.IP [1] .IP [1]
The packer allocates a rectangular \fIparcel\fR for the slave The packer allocates a rectangular \fIparcel\fR for the content
along the side of the cavity given by the slave's \fB\-side\fR option. along the side of the cavity given by the content's \fB\-side\fR option.
If the side is top or bottom then the width of the parcel is If the side is top or bottom then the width of the parcel is
the width of the cavity and its height is the requested height the width of the cavity and its height is the requested height
of the slave plus the \fB\-ipady\fR and \fB\-pady\fR options. of the content plus the \fB\-ipady\fR and \fB\-pady\fR options.
For the left or right side the height of the parcel is For the left or right side the height of the parcel is
the height of the cavity and the width is the requested width the height of the cavity and the width is the requested width
of the slave plus the \fB\-ipadx\fR and \fB\-padx\fR options. of the content plus the \fB\-ipadx\fR and \fB\-padx\fR options.
The parcel may be enlarged further because of the \fB\-expand\fR The parcel may be enlarged further because of the \fB\-expand\fR
option (see \fBEXPANSION\fR below) option (see \fBEXPANSION\fR below)
.IP [2] .IP [2]
The packer chooses the dimensions of the slave. The packer chooses the dimensions of the content.
The width will normally be the slave's requested width plus The width will normally be the content's requested width plus
twice its \fB\-ipadx\fR option and the height will normally be twice its \fB\-ipadx\fR option and the height will normally be
the slave's requested height plus twice its \fB\-ipady\fR the content's requested height plus twice its \fB\-ipady\fR
option. option.
However, if the \fB\-fill\fR option is \fBx\fR or \fBboth\fR However, if the \fB\-fill\fR option is \fBx\fR or \fBboth\fR
then the width of the slave is expanded to fill the width of the parcel, then the width of the content is expanded to fill the width of the parcel,
minus twice the \fB\-padx\fR option. minus twice the \fB\-padx\fR option.
If the \fB\-fill\fR option is \fBy\fR or \fBboth\fR If the \fB\-fill\fR option is \fBy\fR or \fBboth\fR
then the height of the slave is expanded to fill the width of the parcel, then the height of the content is expanded to fill the width of the parcel,
minus twice the \fB\-pady\fR option. minus twice the \fB\-pady\fR option.
.IP [3] .IP [3]
The packer positions the slave over its parcel. The packer positions the content over its parcel.
If the slave is smaller than the parcel then the \fB\-anchor\fR If the content is smaller than the parcel then the \fB\-anchor\fR
option determines where in the parcel the slave will be placed. option determines where in the parcel the content will be placed.
If \fB\-padx\fR or \fB\-pady\fR is non-zero, then the given If \fB\-padx\fR or \fB\-pady\fR is non-zero, then the given
amount of external padding will always be left between the amount of external padding will always be left between the
slave and the edges of the parcel. content and the edges of the parcel.
.PP .PP
Once a given slave has been packed, the area of its parcel Once a given content has been packed, the area of its parcel
is subtracted from the cavity, leaving a smaller rectangular is subtracted from the cavity, leaving a smaller rectangular
cavity for the next slave. cavity for the next content.
If a slave does not use all of its parcel, the unused space If a content does not use all of its parcel, the unused space
in the parcel will not be used by subsequent slaves. in the parcel will not be used by subsequent content.
If the cavity should become too small to meet the needs of If the cavity should become too small to meet the needs of
a slave then the slave will be given whatever space is a content then the content will be given whatever space is
left in the cavity. left in the cavity.
If the cavity shrinks to zero size, then all remaining slaves If the cavity shrinks to zero size, then all remaining content
on the packing list will be unmapped from the screen until on the packing list will be unmapped from the screen until
the master window becomes large enough to hold them again. the container window becomes large enough to hold them again.
.SS "EXPANSION" .SS "EXPANSION"
.PP .PP
If a master window is so large that there will be extra space If a container window is so large that there will be extra space
left over after all of its slaves have been packed, then the left over after all of its content have been packed, then the
extra space is distributed uniformly among all of the slaves extra space is distributed uniformly among all of the content
for which the \fB\-expand\fR option is set. for which the \fB\-expand\fR option is set.
Extra horizontal space is distributed among the expandable Extra horizontal space is distributed among the expandable
slaves whose \fB\-side\fR is \fBleft\fR or \fBright\fR, content whose \fB\-side\fR is \fBleft\fR or \fBright\fR,
and extra vertical space is distributed among the expandable and extra vertical space is distributed among the expandable
slaves whose \fB\-side\fR is \fBtop\fR or \fBbottom\fR. content whose \fB\-side\fR is \fBtop\fR or \fBbottom\fR.
.SS "GEOMETRY PROPAGATION" .SS "GEOMETRY PROPAGATION"
.PP .PP
The packer normally computes how large a master must be to The packer normally computes how large a container must be to
just exactly meet the needs of its slaves, and it sets the just exactly meet the needs of its content, and it sets the
requested width and height of the master to these dimensions. requested width and height of the container to these dimensions.
This causes geometry information to propagate up through a This causes geometry information to propagate up through a
window hierarchy to a top-level window so that the entire window hierarchy to a top-level window so that the entire
sub-tree sizes itself to fit the needs of the leaf windows. sub-tree sizes itself to fit the needs of the leaf windows.
However, the \fBpack propagate\fR command may be used to However, the \fBpack propagate\fR command may be used to
turn off propagation for one or more masters. turn off propagation for one or more containers.
If propagation is disabled then the packer will not set If propagation is disabled then the packer will not set
the requested width and height of the packer. the requested width and height of the packer.
This may be useful if, for example, you wish for a master This may be useful if, for example, you wish for a container
window to have a fixed size that you specify. window to have a fixed size that you specify.
.SH "RESTRICTIONS ON MASTER WINDOWS" .SH "RESTRICTIONS ON CONTAINER WINDOWS"
.PP .PP
The master for each slave must either be the slave's parent The container for each content must either be the content's parent
(the default) or a descendant of the slave's parent. (the default) or a descendant of the content's parent.
This restriction is necessary to guarantee that the This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is content can be placed over any part of its container that is
visible without danger of the slave being clipped by its parent. visible without danger of the content being clipped by its parent.
.SH "PACKING ORDER" .SH "PACKING ORDER"
.PP .PP
If the master for a slave is not its parent then you must make sure If the container for a content is not its parent then you must make sure
that the slave is higher in the stacking order than the master. that the content is higher in the stacking order than the container.
Otherwise the master will obscure the slave and it will appear as Otherwise the container will obscure the content and it will appear as
if the slave has not been packed correctly. if the content has not been packed correctly.
The easiest way to make sure the slave is higher than the master is The easiest way to make sure the content is higher than the container is
to create the master window first: the most recently created window to create the container window first: the most recently created window
will be highest in the stacking order. will be highest in the stacking order.
Or, you can use the \fBraise\fR and \fBlower\fR commands to change Or, you can use the \fBraise\fR and \fBlower\fR commands to change
the stacking order of either the master or the slave. the stacking order of either the container or the content.
.SH EXAMPLE .SH EXAMPLE
.PP .PP
.CS .CS

View File

@@ -29,6 +29,17 @@ drawn as squares. May be any value accepted by \fBTk_GetPixels\fR.
Specifies a desired height for the overall panedwindow widget. May be any Specifies a desired height for the overall panedwindow widget. May be any
value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be
made high enough to allow all contained widgets to have their natural height. made high enough to allow all contained widgets to have their natural height.
.OP \-opaqueresize opaqueResize OpaqueResize
Specifies whether panes should be resized as a sash is moved (true),
or if resizing should be deferred until the sash is placed (false).
In the latter case, a
.QW ghost
version of the sash is displayed during the resizing to show where the
panes will be resized to when releasing the mouse button. This
.QW ghost
version of the sash is the proxy. It's rendering can be configured
using the \fB-proxybackground\fR, \fB-proxyborderwidth\fR and
\fB-proxyrelief\fR options.
.OP \-proxybackground proxyBackground ProxyBackground .OP \-proxybackground proxyBackground ProxyBackground
Background color to use when drawing the proxy. If an empty string, the Background color to use when drawing the proxy. If an empty string, the
value of the \fB-background\fR option will be used. value of the \fB-background\fR option will be used.
@@ -39,9 +50,6 @@ Specifies the borderwidth of the proxy. May be any value accepted by
Relief to use when drawing the proxy. May be any of the standard Tk Relief to use when drawing the proxy. May be any of the standard Tk
relief values. If an empty string, the value of the \fB-sashrelief\fR relief values. If an empty string, the value of the \fB-sashrelief\fR
option will be used. option will be used.
.OP \-opaqueresize opaqueResize OpaqueResize
Specifies whether panes should be resized as a sash is moved (true),
or if resizing should be deferred until the sash is placed (false).
.OP \-sashcursor sashCursor SashCursor .OP \-sashcursor sashCursor SashCursor
Mouse cursor to use when over a sash. If null, Mouse cursor to use when over a sash. If null,
\fBsb_h_double_arrow\fR will be used for horizontal panedwindows, and \fBsb_h_double_arrow\fR will be used for horizontal panedwindows, and
@@ -133,56 +141,6 @@ index of the sash or handle, and a word indicating whether it is over
a sash or a handle, such as {0 sash} or {2 handle}. If the point is a sash or a handle, such as {0 sash} or {2 handle}. If the point is
over any other part of the panedwindow, the result is an empty list. over any other part of the panedwindow, the result is an empty list.
.TP .TP
\fIpathName \fBproxy \fR?\fIargs\fR?
.
This command is used to query and change the position of the sash
proxy, used for rubberband-style pane resizing. It can take any of
the following forms:
.RS
.TP
\fIpathName \fBproxy coord\fR
.
Return a list containing the x and y coordinates of the most recent
proxy location.
.TP
\fIpathName \fBproxy forget\fR
.
Remove the proxy from the display.
.TP
\fIpathName \fBproxy place \fIx y\fR
.
Place the proxy at the given \fIx\fR and \fIy\fR coordinates.
.RE
.TP
\fIpathName \fBsash \fR?\fIargs\fR?
This command is used to query and change the position of sashes in the
panedwindow. It can take any of the following forms:
.RS
.TP
\fIpathName \fBsash coord \fIindex\fR
.
Return the current x and y coordinate pair for the sash given by
\fIindex\fR. \fIIndex\fR must be an integer between 0 and 1 less than
the number of panes in the panedwindow. The coordinates given are
those of the top left corner of the region containing the sash.
.TP
\fIpathName \fBsash dragto \fIindex x y\fR
.
This command computes the difference between the given coordinates and the
coordinates given to the last \fBsash mark\fR command for the given
sash. It then moves that sash the computed difference. The return
value is the empty string.
.TP
\fIpathName \fBsash mark \fIindex x y\fR
.
Records \fIx\fR and \fIy\fR for the sash given by \fIindex\fR; used in
conjunction with later \fBsash dragto\fR commands to move the sash.
.TP
\fIpathName \fBsash place \fIindex x y\fR
.
Place the sash given by \fIindex\fR at the given coordinates.
.RE
.TP
\fIpathName \fBpanecget \fIwindow option\fR \fIpathName \fBpanecget \fIwindow option\fR
. .
Query a management option for \fIwindow\fR. \fIOption\fR may be any Query a management option for \fIwindow\fR. \fIOption\fR may be any
@@ -310,6 +268,56 @@ panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR.
\fIpathName \fBpanes\fR \fIpathName \fBpanes\fR
. .
Returns an ordered list of the widgets managed by \fIpathName\fR. Returns an ordered list of the widgets managed by \fIpathName\fR.
.TP
\fIpathName \fBproxy \fR?\fIargs\fR?
.
This command is used to query and change the position of the sash
proxy, used for rubberband-style pane resizing. It can take any of
the following forms:
.RS
.TP
\fIpathName \fBproxy coord\fR
.
Return a list containing the x and y coordinates of the most recent
proxy location.
.TP
\fIpathName \fBproxy forget\fR
.
Remove the proxy from the display.
.TP
\fIpathName \fBproxy place \fIx y\fR
.
Place the proxy at the given \fIx\fR and \fIy\fR coordinates.
.RE
.TP
\fIpathName \fBsash \fR?\fIargs\fR?
This command is used to query and change the position of sashes in the
panedwindow. It can take any of the following forms:
.RS
.TP
\fIpathName \fBsash coord \fIindex\fR
.
Return the current x and y coordinate pair for the sash given by
\fIindex\fR. \fIIndex\fR must be an integer between 0 and 1 less than
the number of panes in the panedwindow. The coordinates given are
those of the top left corner of the region containing the sash.
.TP
\fIpathName \fBsash dragto \fIindex x y\fR
.
This command computes the difference between the given coordinates and the
coordinates given to the last \fBsash mark\fR command for the given
sash. It then moves that sash the computed difference. The return
value is the empty string.
.TP
\fIpathName \fBsash mark \fIindex x y\fR
.
Records \fIx\fR and \fIy\fR for the sash given by \fIindex\fR; used in
conjunction with later \fBsash dragto\fR commands to move the sash.
.TP
\fIpathName \fBsash place \fIindex x y\fR
.
Place the sash given by \fIindex\fR at the given coordinates.
.RE
.SH "RESIZING PANES" .SH "RESIZING PANES"
.PP .PP
A pane is resized by grabbing the sash (or sash handle if present) and A pane is resized by grabbing the sash (or sash handle if present) and
@@ -322,8 +330,8 @@ When a pane is resized from outside (e.g. it is packed to expand and
fill, and the containing toplevel is resized), space is added to the final fill, and the containing toplevel is resized), space is added to the final
(rightmost or bottommost) pane in the window. (rightmost or bottommost) pane in the window.
.PP .PP
Unlike slave windows managed by e.g. pack or grid, the panes managed by a Unlike child windows managed by e.g. pack or grid, the panes managed by a
panedwindow do not change width or height to accomodate changes in the panedwindow do not change width or height to accommodate changes in the
requested widths or heights of the panes, once these have become mapped. requested widths or heights of the panes, once these have become mapped.
Therefore it may be advisable, particularly when creating layouts Therefore it may be advisable, particularly when creating layouts
interactively, to not add a pane to the panedwindow widget until after the interactively, to not add a pane to the panedwindow widget until after the

View File

@@ -18,26 +18,26 @@ place \- Geometry manager for fixed or rubber-sheet placement
.PP .PP
The placer is a geometry manager for Tk. The placer is a geometry manager for Tk.
It provides simple fixed placement of windows, where you specify It provides simple fixed placement of windows, where you specify
the exact size and location of one window, called the \fIslave\fR, the exact size and location of one window, called the \fIcontent\fR,
within another window, called the \fImaster\fR. within another window, called the \fIcontainer\fR.
The placer also provides rubber-sheet placement, where you specify the The placer also provides rubber-sheet placement, where you specify the
size and location of the slave in terms of the dimensions of size and location of the content in terms of the dimensions of
the master, so that the slave changes size and location the container, so that the content changes size and location
in response to changes in the size of the master. in response to changes in the size of the container.
Lastly, the placer allows you to mix these styles of placement so Lastly, the placer allows you to mix these styles of placement so
that, for example, the slave has a fixed width and height but is that, for example, the content has a fixed width and height but is
centered inside the master. centered inside the container.
.PP .PP
.TP .TP
\fBplace \fIwindow option value \fR?\fIoption value ...\fR? \fBplace \fIwindow option value \fR?\fIoption value ...\fR?
Arrange for the placer to manage the geometry of a slave whose Arrange for the placer to manage the geometry of a content whose
pathName is \fIwindow\fR. The remaining arguments consist of one or pathName is \fIwindow\fR. The remaining arguments consist of one or
more \fIoption\-value\fR pairs that specify the way in which more \fIoption\-value\fR pairs that specify the way in which
\fIwindow\fR's geometry is managed. \fIOption\fR may have any of the \fIwindow\fR's geometry is managed. \fIOption\fR may have any of the
values accepted by the \fBplace configure\fR command. values accepted by the \fBplace configure\fR command.
.TP .TP
\fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? \fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR?
Query or modify the geometry options of the slave given by Query or modify the geometry options of the content given by
\fIwindow\fR. If no \fIoption\fR is specified, this command returns a \fIwindow\fR. If no \fIoption\fR is specified, this command returns a
list describing the available options (see \fBTk_ConfigureInfo\fR for list describing the available options (see \fBTk_ConfigureInfo\fR for
information on the format of this list). If \fIoption\fR is specified information on the format of this list). If \fIoption\fR is specified
@@ -59,27 +59,27 @@ The anchor point is in terms of the outer area of \fIwindow\fR
including its border, if any. including its border, if any.
Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
\fIwindow\fR's border will appear at the given (x,y) location \fIwindow\fR's border will appear at the given (x,y) location
in the master. in the container.
The anchor position defaults to \fBnw\fR. The anchor position defaults to \fBnw\fR.
.TP .TP
\fB\-bordermode \fImode\fR \fB\-bordermode \fImode\fR
\fIMode\fR determines the degree to which borders within the \fIMode\fR determines the degree to which borders within the
master are used in determining the placement of the slave. container are used in determining the placement of the content.
The default and most common value is \fBinside\fR. The default and most common value is \fBinside\fR.
In this case the placer considers the area of the master to In this case the placer considers the area of the container to
be the innermost area of the master, inside any border: be the innermost area of the container, inside any border:
an option of \fB\-x 0\fR corresponds to an x-coordinate just an option of \fB\-x 0\fR corresponds to an x-coordinate just
inside the border and an option of \fB\-relwidth 1.0\fR inside the border and an option of \fB\-relwidth 1.0\fR
means \fIwindow\fR will fill the area inside the master's means \fIwindow\fR will fill the area inside the container's
border. border.
.RS .RS
.PP .PP
If \fImode\fR is \fBoutside\fR then the placer considers If \fImode\fR is \fBoutside\fR then the placer considers
the area of the master to include its border; the area of the container to include its border;
this mode is typically used when placing \fIwindow\fR this mode is typically used when placing \fIwindow\fR
outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR. outside its container, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR.
Lastly, \fImode\fR may be specified as \fBignore\fR, in which Lastly, \fImode\fR may be specified as \fBignore\fR, in which
case borders are ignored: the area of the master is considered case borders are ignored: the area of the container is considered
to be its official X area, which includes any internal border but to be its official X area, which includes any internal border but
no external border. A bordermode of \fBignore\fR is probably no external border. A bordermode of \fBignore\fR is probably
not very useful. not very useful.
@@ -94,61 +94,61 @@ If \fIsize\fR is an empty string, or if no \fB\-height\fR or
\fB\-relheight\fR option is specified, then the height requested \fB\-relheight\fR option is specified, then the height requested
internally by the window will be used. internally by the window will be used.
.TP .TP
\fB\-in \fImaster\fR \fB\-in \fIcontainer\fR
\fIMaster\fR specifies the path name of the window relative \fIContainer\fR specifies the path name of the window relative
to which \fIwindow\fR is to be placed. to which \fIwindow\fR is to be placed.
\fIMaster\fR must either be \fIwindow\fR's parent or a descendant \fIContainer\fR must either be \fIwindow\fR's parent or a descendant
of \fIwindow\fR's parent. of \fIwindow\fR's parent.
In addition, \fImaster\fR and \fIwindow\fR must both be descendants In addition, \fIcontainer\fR and \fIwindow\fR must both be descendants
of the same top-level window. of the same top-level window.
These restrictions are necessary to guarantee These restrictions are necessary to guarantee
that \fIwindow\fR is visible whenever \fImaster\fR is visible. that \fIwindow\fR is visible whenever \fIcontainer\fR is visible.
If this option is not specified then the master defaults to If this option is not specified then the other window defaults to
\fIwindow\fR's parent. \fIwindow\fR's parent.
.TP .TP
\fB\-relheight \fIsize\fR \fB\-relheight \fIsize\fR
\fISize\fR specifies the height for \fIwindow\fR. \fISize\fR specifies the height for \fIwindow\fR.
In this case the height is specified as a floating-point number In this case the height is specified as a floating-point number
relative to the height of the master: 0.5 means \fIwindow\fR will relative to the height of the container: 0.5 means \fIwindow\fR will
be half as high as the master, 1.0 means \fIwindow\fR will have be half as high as the container, 1.0 means \fIwindow\fR will have
the same height as the master, and so on. the same height as the container, and so on.
If both \fB\-height\fR and \fB\-relheight\fR are specified for a slave, If both \fB\-height\fR and \fB\-relheight\fR are specified for a content,
their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR
makes the slave 2 pixels shorter than the master. makes the content 2 pixels shorter than the container.
.TP .TP
\fB\-relwidth \fIsize\fR \fB\-relwidth \fIsize\fR
\fISize\fR specifies the width for \fIwindow\fR. \fISize\fR specifies the width for \fIwindow\fR.
In this case the width is specified as a floating-point number In this case the width is specified as a floating-point number
relative to the width of the master: 0.5 means \fIwindow\fR will relative to the width of the container: 0.5 means \fIwindow\fR will
be half as wide as the master, 1.0 means \fIwindow\fR will have be half as wide as the container, 1.0 means \fIwindow\fR will have
the same width as the master, and so on. the same width as the container, and so on.
If both \fB\-width\fR and \fB\-relwidth\fR are specified for a slave, If both \fB\-width\fR and \fB\-relwidth\fR are specified for a content,
their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR
makes the slave 5 pixels wider than the master. makes the content 5 pixels wider than the container.
.TP .TP
\fB\-relx \fIlocation\fR \fB\-relx \fIlocation\fR
\fILocation\fR specifies the x-coordinate within the master window \fILocation\fR specifies the x-coordinate within the container window
of the anchor point for \fIwindow\fR. of the anchor point for \fIwindow\fR.
In this case the location is specified in a relative fashion In this case the location is specified in a relative fashion
as a floating-point number: 0.0 corresponds to the left edge as a floating-point number: 0.0 corresponds to the left edge
of the master and 1.0 corresponds to the right edge of the master. of the container and 1.0 corresponds to the right edge of the container.
\fILocation\fR need not be in the range 0.0\-1.0. \fILocation\fR need not be in the range 0.0\-1.0.
If both \fB\-x\fR and \fB\-relx\fR are specified for a slave If both \fB\-x\fR and \fB\-relx\fR are specified for a content
then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR
positions the left edge of the slave 2 pixels to the left of the positions the left edge of the content 2 pixels to the left of the
center of its master. center of its container.
.TP .TP
\fB\-rely \fIlocation\fR \fB\-rely \fIlocation\fR
\fILocation\fR specifies the y-coordinate within the master window \fILocation\fR specifies the y-coordinate within the container window
of the anchor point for \fIwindow\fR. of the anchor point for \fIwindow\fR.
In this case the value is specified in a relative fashion In this case the value is specified in a relative fashion
as a floating-point number: 0.0 corresponds to the top edge as a floating-point number: 0.0 corresponds to the top edge
of the master and 1.0 corresponds to the bottom edge of the master. of the container and 1.0 corresponds to the bottom edge of the container.
\fILocation\fR need not be in the range 0.0\-1.0. \fILocation\fR need not be in the range 0.0\-1.0.
If both \fB\-y\fR and \fB\-rely\fR are specified for a slave If both \fB\-y\fR and \fB\-rely\fR are specified for a content
then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR
positions the top edge of the slave 3 pixels below the positions the top edge of the content 3 pixels below the
center of its master. center of its container.
.TP .TP
\fB\-width \fIsize\fR \fB\-width \fIsize\fR
\fISize\fR specifies the width for \fIwindow\fR in screen units \fISize\fR specifies the width for \fIwindow\fR in screen units
@@ -160,18 +160,18 @@ or \fB\-relwidth\fR option is specified, then the width requested
internally by the window will be used. internally by the window will be used.
.TP .TP
\fB\-x \fIlocation\fR \fB\-x \fIlocation\fR
\fILocation\fR specifies the x-coordinate within the master window \fILocation\fR specifies the x-coordinate within the container window
of the anchor point for \fIwindow\fR. of the anchor point for \fIwindow\fR.
The location is specified in screen units (i.e. any of the forms The location is specified in screen units (i.e. any of the forms
accepted by \fBTk_GetPixels\fR) and need not lie within the bounds accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
of the master window. of the container window.
.TP .TP
\fB\-y \fIlocation\fR \fB\-y \fIlocation\fR
\fILocation\fR specifies the y-coordinate within the master window \fILocation\fR specifies the y-coordinate within the container window
of the anchor point for \fIwindow\fR. of the anchor point for \fIwindow\fR.
The location is specified in screen units (i.e. any of the forms The location is specified in screen units (i.e. any of the forms
accepted by \fBTk_GetPixels\fR) and need not lie within the bounds accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
of the master window. of the container window.
.PP .PP
If the same value is specified separately with If the same value is specified separately with
two different options, such as \fB\-x\fR and \fB\-relx\fR, then two different options, such as \fB\-x\fR and \fB\-relx\fR, then
@@ -192,8 +192,14 @@ same form as might be specified to the \fBplace configure\fR
command. command.
.TP .TP
\fBplace slaves \fIwindow\fR \fBplace slaves \fIwindow\fR
Returns a list of all the slave windows for which \fIwindow\fR is the master. Returns a list of all the content windows for which \fIwindow\fR is the container.
If there are no slaves for \fIwindow\fR then an empty string is returned. If there is no content for \fIwindow\fR then an empty string is returned.
.VS "TIP 581"
.TP
\fBplace content \fIwindow\fR
.
Synonym for . \fBplace slaves \fIwindow\fR
.VE "TIP 581"
.PP .PP
If the configuration of a window has been retrieved with If the configuration of a window has been retrieved with
\fBplace info\fR, that configuration can be restored later by \fBplace info\fR, that configuration can be restored later by
@@ -202,8 +208,8 @@ for the window and then invoking \fBplace configure\fR with
the saved information. the saved information.
.SH "FINE POINTS" .SH "FINE POINTS"
.PP .PP
It is not necessary for the master window to be the parent It is not necessary for the container window to be the parent
of the slave window. of the content window.
This feature is useful in at least two situations. This feature is useful in at least two situations.
First, for complex window layouts it means you can create a First, for complex window layouts it means you can create a
hierarchy of subwindows whose only purpose hierarchy of subwindows whose only purpose
@@ -221,7 +227,7 @@ can specify options for the real children
without being aware of the structure of the geometry-management without being aware of the structure of the geometry-management
hierarchy. hierarchy.
.PP .PP
A second reason for having a master different than the slave's A second reason for having a container different than the content's
parent is to tie two siblings together. parent is to tie two siblings together.
For example, the placer can be used to force a window always to For example, the placer can be used to force a window always to
be positioned centered just below one of its be positioned centered just below one of its
@@ -229,12 +235,12 @@ siblings by specifying the configuration
.CS .CS
\fB\-in \fIsibling\fB \-relx 0.5 \-rely 1.0 \-anchor n \-bordermode outside\fR \fB\-in \fIsibling\fB \-relx 0.5 \-rely 1.0 \-anchor n \-bordermode outside\fR
.CE .CE
Whenever the sibling is repositioned in the future, the slave Whenever the sibling is repositioned in the future, the content
will be repositioned as well. will be repositioned as well.
.PP .PP
Unlike many other geometry managers (such as the packer) Unlike many other geometry managers (such as the packer)
the placer does not make any attempt to manipulate the geometry of the placer does not make any attempt to manipulate the geometry of
the master windows or the parents of slave windows (i.e. it does not the container windows or the parents of content windows (i.e. it does not
set their requested sizes). set their requested sizes).
To control the sizes of these windows, make them windows like To control the sizes of these windows, make them windows like
frames and canvases that provide configuration options for this purpose. frames and canvases that provide configuration options for this purpose.
@@ -249,7 +255,7 @@ label .l \-text "In the\enMiddle!" \-bg black \-fg white
.SH "SEE ALSO" .SH "SEE ALSO"
grid(n), pack(n) grid(n), pack(n)
.SH KEYWORDS .SH KEYWORDS
geometry manager, height, location, master, place, rubber sheet, slave, width geometry manager, height, location, container, place, rubber sheet, content, width
'\" Local Variables: '\" Local Variables:
'\" mode: nroff '\" mode: nroff
'\" End: '\" End:

View File

@@ -41,16 +41,6 @@ Specifies whether or not the indicator should be drawn. Must be a
proper boolean value. If false, the \fB\-relief\fR option is proper boolean value. If false, the \fB\-relief\fR option is
ignored and the widget's relief is always sunken if the widget is ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise. selected and raised otherwise.
.OP \-selectcolor selectColor Background
Specifies a background color to use when the button is selected.
If \fB\-indicatoron\fR is true then the color applies to the indicator.
Under Windows, this color is used as the background for the indicator
regardless of the select state.
If \fB\-indicatoron\fR is false, this color is used as the background
for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR,
whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
.OP \-offrelief offRelief OffRelief .OP \-offrelief offRelief OffRelief
Specifies the relief for the checkbutton when the indicator is not drawn and Specifies the relief for the checkbutton when the indicator is not drawn and
the checkbutton is off. The default value is the checkbutton is off. The default value is
@@ -71,6 +61,15 @@ toolbar buttons, by configuring \fB\-relief flat \-overrelief
raised\fR. If the value of this option is the empty string, then no raised\fR. If the value of this option is the empty string, then no
alternative relief is used when the mouse cursor is over the radiobutton. alternative relief is used when the mouse cursor is over the radiobutton.
The empty string is the default value. The empty string is the default value.
.OP \-selectcolor selectColor Background
Specifies a background color to use when the button is selected.
If \fBindicatorOn\fR is true then the color is used as the background for
the indicator regardless of the select state.
If \fB\-indicatoron\fR is false, this color is used as the background
for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR,
whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
.OP \-selectimage selectImage SelectImage .OP \-selectimage selectImage SelectImage
Specifies an image to display (in place of the \fB\-image\fR option) Specifies an image to display (in place of the \fB\-image\fR option)
when the radiobutton is selected. when the radiobutton is selected.

View File

@@ -31,6 +31,9 @@ this could end up either raising or lowering \fIwindow\fR.
All \fBtoplevel\fR windows may be restacked with respect to each All \fBtoplevel\fR windows may be restacked with respect to each
other, whatever their relative path names, but the window manager is other, whatever their relative path names, but the window manager is
not obligated to strictly honor requests to restack. not obligated to strictly honor requests to restack.
.PP
On macOS raising an iconified \fBtoplevel\fR window causes it to be
deiconified.
.SH EXAMPLE .SH EXAMPLE
.PP .PP
Make a button appear to be in a sibling frame that was created after Make a button appear to be in a sibling frame that was created after

View File

@@ -55,7 +55,7 @@ it is the scale's width.
.OP \-resolution resolution Resolution .OP \-resolution resolution Resolution
A real value specifying the resolution for the scale. A real value specifying the resolution for the scale.
If this value is greater than zero then the scale's value will always be If this value is greater than zero then the scale's value will always be
rounded to an even multiple of this value, as will tick marks and rounded to an even multiple of this value, as will
the endpoints of the scale. If the value is less than zero then no the endpoints of the scale. If the value is less than zero then no
rounding occurs. Defaults to 1 (i.e., the value will be integral). rounding occurs. Defaults to 1 (i.e., the value will be integral).
.OP \-showvalue showValue ShowValue .OP \-showvalue showValue ShowValue
@@ -78,7 +78,7 @@ specified by the \fB\-activebackground\fR option.
.OP \-tickinterval tickInterval TickInterval .OP \-tickinterval tickInterval TickInterval
Must be a real value. Must be a real value.
Determines the spacing between numerical Determines the spacing between numerical
tick marks displayed below or to the left of the slider. tick marks displayed below or to the left of the slider. The values will all be displayed with the same number of decimal places, which will be enough to ensure they are all accurate to within 20% of a tick interval.
If 0, no tick marks will be displayed. If 0, no tick marks will be displayed.
.OP \-to to To .OP \-to to To
Specifies a real value corresponding Specifies a real value corresponding
@@ -91,10 +91,10 @@ value.
Whenever the scale is manipulated interactively, the variable Whenever the scale is manipulated interactively, the variable
will be modified to reflect the scale's new value. will be modified to reflect the scale's new value.
.OP \-width width Width .OP \-width width Width
Specifies the desired narrow dimension of the trough in screen units Specifies the desired narrow dimension of the scale in screen units
(i.e. any of the forms acceptable to \fBTk_GetPixels\fR). (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
For vertical scales this is the trough's width; for horizontal scales For vertical scales this is the scale's width; for horizontal scales
this is the trough's height. this is the scale's height.
.BE .BE
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP

View File

@@ -140,6 +140,26 @@ If \fIcommand\fR is specified, it is a Tcl script to execute when
some other window claims ownership of the selection away from some other window claims ownership of the selection away from
\fIwindow\fR. \fISelection\fR defaults to PRIMARY. \fIwindow\fR. \fISelection\fR defaults to PRIMARY.
.RE .RE
.SH WIDGET FACILITIES
.PP
The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a widget has this option set to boolean \fBtrue\fR, then (in an unsafe interpreter) a selection made in the widget is automatically written to the \fBPRIMARY\fR selection.
.PP
A GUI event, for example \fB<<PasteSelection>>\fR, can copy the \fBPRIMARY\fR selection to certain widgets. This copy is implemented by a widget binding to the event. The binding script makes appropriate calls to the \fBselection\fR command.
.PP
.SH PORTABILITY ISSUES
.PP
On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, allowing communication between different processes that are X11 clients.
.PP
On Windows, the \fBPRIMARY\fR selection is not provided by the system, but only by Tk, and so it is shared only between windows of a parent interpreter and its child interpreters. It is not shared between interpreters in different processes or different threads. Each parent interpreter has a separate \fBPRIMARY\fR selection that is shared only with its child interpreters which are not safe interpreters.
.PP
.SH SECURITY
.PP
A safe interpreter cannot read from the \fBPRIMARY\fR selection because its \fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR selection cannot be written to the Tk widgets of a safe interpreter.
.PP
A Tk widget can have its option \fB\-exportselection\fR set to boolean \fBtrue\fR, but in a safe interpreter this option has no effect: writing from the widget to the \fBPRIMARY\fR selection is disabled.
.PP
These are security features. A safe interpreter may run untrusted code, and it is a security risk if this untrusted code can read or write the \fBPRIMARY\fR selection used by other interpreters.
.PP
.SH EXAMPLES .SH EXAMPLES
.PP .PP
On X11 platforms, one of the standard selections available is the On X11 platforms, one of the standard selections available is the

View File

@@ -217,15 +217,19 @@ were editing the spinbox widget from). It is also recommended to not set an
associated \fB\-textvariable\fR during validation, as that can cause the associated \fB\-textvariable\fR during validation, as that can cause the
spinbox widget to become out of sync with the \fB\-textvariable\fR. spinbox widget to become out of sync with the \fB\-textvariable\fR.
.PP .PP
Also, the \fBvalidate\fR option will set itself to \fBnone\fR when the Also, the \fB-validate\fR option will set itself to \fBnone\fR when the
spinbox value gets changed because of adjustment of \fBfrom\fR or \fBto\fR spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR
and the \fBvalidateCommand\fR returns false. For instance and the \fB-validatecommand\fR returns false. For instance
.CS .CS
\fIspinbox pathName \-from 1 \-to 10 \-validate all \-vcmd {return 0}\fR \fIspinbox pathName \-from 1 \-to 10 \-validate all \-vcmd {return 0}\fR
.CE .CE
will in fact set the \fBvalidate\fR option to \fBnone\fR because the default will in fact set the \fB-validate\fR option to \fBnone\fR because the default
value for the spinbox gets changed (due to the \fBfrom\fR and \fBto\fR value for the spinbox gets changed (due to the \fB-from\fR and \fB-to\fR
options) to a value not accepted by the validation script. options) to a value not accepted by the validation script.
.PP
Moreover, forced validation is performed when invoking any spinbutton of
the spinbox. If the validation script returns false in this situation,
then the \fB-validate\fR option will be automatically set to \fBnone\fR.
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
.PP .PP
The \fBspinbox\fR command creates a new Tcl command whose The \fBspinbox\fR command creates a new Tcl command whose
@@ -510,9 +514,10 @@ insertion cursor in the spinbox without affecting the selection.
If any normal printing characters are typed in a spinbox, they are If any normal printing characters are typed in a spinbox, they are
inserted at the point of the insertion cursor. inserted at the point of the insertion cursor.
.IP [7] .IP [7]
The view in the spinbox can be adjusted by dragging with mouse button 2. The view in the spinbox can be adjusted by dragging with the middle
If mouse button 2 is clicked without moving the mouse, the selection mouse button (button 2, or button 3 in TkAqua). If the middle mouse
is copied into the spinbox at the position of the mouse cursor. button is clicked without moving the mouse, the selection is copied
into the spinbox at the position of the mouse cursor.
.IP [8] .IP [8]
If the mouse is dragged out of the spinbox on the left or right sides If the mouse is dragged out of the spinbox on the left or right sides
while button 1 is pressed, the spinbox will automatically scroll to while button 1 is pressed, the spinbox will automatically scroll to

View File

@@ -491,9 +491,10 @@ second and later display lines for a text line.
\fIColor\fR specifies the background color to use in regions that do not \fIColor\fR specifies the background color to use in regions that do not
contain characters because they are indented by \fB\-lmargin1\fR or contain characters because they are indented by \fB\-lmargin1\fR or
\fB\-lmargin2\fR. It may have any of the forms accepted by \fB\-lmargin2\fR. It may have any of the forms accepted by
\fBTk_GetColor\fR.If \fIcolor\fR has not been specified, or if it is \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is
specified as an empty string, then the color specified by the specified as an empty string, then the color used is specified by the
\fB-background\fR widget option is used. \fB-background\fR tag option (or, if this is also unspecified, by the
\fB-background\fR widget option).
.TP .TP
\fB\-offset \fIpixels\fR \fB\-offset \fIpixels\fR
. .
@@ -536,10 +537,11 @@ character of that display line.
\fB\-rmargincolor \fIcolor\fR \fB\-rmargincolor \fIcolor\fR
. .
\fIColor\fR specifies the background color to use in regions that do not \fIColor\fR specifies the background color to use in regions that do not
contain characters because they are indented by \fB\-rmargin1\fR. It may contain characters because they are indented by \fB\-rmargin\fR. It may
have any of the forms accepted by \fBTk_GetColor\fR.If \fIcolor\fR has not have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not
been specified, or if it is specified as an empty string, then the color been specified, or if it is specified as an empty string, then the color
specified by the \fB-background\fR widget option is used. used is specified by the \fB-background\fR tag option (or, if this is also
unspecified, by the \fB-background\fR widget option).
.TP .TP
\fB\-selectbackground \fIcolor\fR \fB\-selectbackground \fIcolor\fR
\fIColor\fR specifies the background color to use when displaying selected \fIColor\fR specifies the background color to use when displaying selected
@@ -607,9 +609,11 @@ specified by the \fB\-foreground\fR tag option is used.
\fB\-wrap \fImode\fR \fB\-wrap \fImode\fR
. .
\fIMode\fR specifies how to handle lines that are wider than the text's \fIMode\fR specifies how to handle lines that are wider than the text's
window. It has the same legal values as the \fB\-wrap\fR option for the text window. This option only applies to a display line if it applies to the
widget: \fBnone\fR, \fBchar\fR, or \fBword\fR. If this tag option is first non-elided character on that display line. It has the same legal
specified, it overrides the \fB\-wrap\fR option for the text widget. values as the \fB\-wrap\fR option for the text widget: \fBnone\fR,
\fBchar\fR, or \fBword\fR. If this tag option is specified, it
overrides the \fB\-wrap\fR option for the text widget.
.PP .PP
If a character has several tags associated with it, and if their display If a character has several tags associated with it, and if their display
options conflict, then the options of the highest priority tag are used. If a options conflict, then the options of the highest priority tag are used. If a
@@ -1078,7 +1082,7 @@ satisfied and 0 if it is not. \fIOp\fR must be one of the operators <, <=, ==,
the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR refers the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR refers
to an earlier character in the text than \fIindex2\fR, and so on. to an earlier character in the text than \fIindex2\fR, and so on.
.TP .TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR? \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
. .
Query or modify the configuration options of the widget. If no \fIoption\fR is Query or modify the configuration options of the widget. If no \fIoption\fR is
specified, returns a list describing all of the available options for specified, returns a list describing all of the available options for
@@ -1091,7 +1095,7 @@ command modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string. \fIOption\fR may have any of this case the command returns an empty string. \fIOption\fR may have any of
the values accepted by the \fBtext\fR command. the values accepted by the \fBtext\fR command.
.TP .TP
\fIpathName \fBcount\fR \fI?options\fR? \fIindex1 index2\fR \fIpathName \fBcount\fR ?\fIoptions\fR? \fIindex1 index2\fR
. .
Counts the number of relevant things between the two indices. If \fIindex1\fR Counts the number of relevant things between the two indices. If \fIindex1\fR
is after \fIindex2\fR, the result will be a negative number (and this holds is after \fIindex2\fR, the result will be a negative number (and this holds
@@ -2021,10 +2025,11 @@ integer. This command used to be used for scrolling, but now it is obsolete.
.SH BINDINGS .SH BINDINGS
.PP .PP
Tk automatically creates class bindings for texts that give them the following Tk automatically creates class bindings for texts that give them the following
default behavior. In the descriptions below, default behavior.
In the descriptions below,
.QW word .QW word
is dependent on the value of the \fBtcl_wordchars\fR variable. See is dependent on the value of
\fBtclvars\fR(n). the \fBtcl_wordchars\fR variable. See \fBtclvars\fR(n).
.IP [1] .IP [1]
Clicking mouse button 1 positions the insertion cursor just before the Clicking mouse button 1 positions the insertion cursor just before the
character underneath the mouse cursor, sets the input focus to this widget, character underneath the mouse cursor, sets the input focus to this widget,
@@ -2053,10 +2058,11 @@ insertion cursor without affecting the selection.
If any normal printing characters are typed, they are inserted at the point of If any normal printing characters are typed, they are inserted at the point of
the insertion cursor. the insertion cursor.
.IP [7] .IP [7]
The view in the widget can be adjusted by dragging with mouse button 2. If The view in the widget can be adjusted by dragging with the middle mouse
mouse button 2 is clicked without moving the mouse, the selection is copied button (button 2, or button 3 in TkAqua). If the middle mouse button is
into the text at the position of the mouse cursor. The Insert key also inserts clicked without moving the mouse, the selection is copied into the text at the
the selection, but at the position of the insertion cursor. position of the mouse cursor. The Insert key also inserts the selection,
but at the position of the insertion cursor.
.IP [8] .IP [8]
If the mouse is dragged out of the widget while button 1 is pressed, the entry If the mouse is dragged out of the widget while button 1 is pressed, the entry
will automatically scroll to make more text visible (if there is more text will automatically scroll to make more text visible (if there is more text

View File

@@ -13,6 +13,8 @@
tk::mac \- Access Mac-Specific Functionality on OS X from Tk tk::mac \- Access Mac-Specific Functionality on OS X from Tk
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
\fB::tk::mac::DoScriptFile\fR
\fB::tk::mac::DoScriptText\fR
\fB::tk::mac::ShowPreferences\fR \fB::tk::mac::ShowPreferences\fR
\fB::tk::mac::OpenApplication\fR \fB::tk::mac::OpenApplication\fR
\fB::tk::mac::ReopenApplication\fR \fB::tk::mac::ReopenApplication\fR
@@ -22,6 +24,9 @@ tk::mac \- Access Mac-Specific Functionality on OS X from Tk
\fB::tk::mac::OnHide\fR \fB::tk::mac::OnHide\fR
\fB::tk::mac::OnShow\fR \fB::tk::mac::OnShow\fR
\fB::tk::mac::ShowHelp\fR \fB::tk::mac::ShowHelp\fR
\fB::tk::mac::PerformService\fR
\fB::tk::mac::LaunchURL \fIURL...\fR
\fB::tk::mac::GetAppPath\fR
\fB::tk::mac::standardAboutPanel\fR \fB::tk::mac::standardAboutPanel\fR
@@ -30,6 +35,7 @@ tk::mac \- Access Mac-Specific Functionality on OS X from Tk
\fB::tk::mac::antialiasedtext \fInumber\fR \fB::tk::mac::antialiasedtext \fInumber\fR
\fB::tk::mac::useThemedToplevel \fIboolean\fR \fB::tk::mac::useThemedToplevel \fIboolean\fR
\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR
.fi .fi
.BE .BE
@@ -40,6 +46,20 @@ events that applications should respond to. These events are mapped by Tk to
calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if
the command is absent, no action will be taken. the command is absent, no action will be taken.
.TP .TP
\fB::tk::mac::DoScriptFile\fR
.
The default Apple Event handler for AEDoScriptHandler. This command
executes a Tcl file when an AppleScript sends a
.QW "do script"
command to Wish with a file path as a parameter.
.TP
\fB::tk::mac::DoScriptText\fR
.
The default Apple Event handler for AEDoScriptHandler. This command
executes Tcl code when an AppleScript sends a
.QW "do script"
command to Wish with Tcl code or a Tcl procedure as a parameter.
.TP
\fB::tk::mac::ShowPreferences\fR \fB::tk::mac::ShowPreferences\fR
. .
The default Apple Event handler for kAEShowPreferences, The default Apple Event handler for kAEShowPreferences,
@@ -61,7 +81,7 @@ proc ::tk::mac::ShowPreferences {} {
\fB::tk::mac::OpenApplication\fR \fB::tk::mac::OpenApplication\fR
. .
If a proc of this name is defined, this proc fill fire when your application If a proc of this name is defined, this proc fill fire when your application
is intially opened. It is the default Apple Event handler for is initially opened. It is the default Apple Event handler for
kAEOpenApplication, kAEOpenApplication,
.QW oapp . .QW oapp .
.TP .TP
@@ -110,9 +130,8 @@ proc ::tk::mac::OpenDocument {args} {
If a proc of this name is defined it is the default Apple Event handler for If a proc of this name is defined it is the default Apple Event handler for
kAEPrintDocuments, kAEPrintDocuments,
.QW pdoc , .QW pdoc ,
the Apple Event sent when your application is asked to print one or more the Apple Event sent when your application is asked to print a
documents (e.g., via the Print menu item in the Finder). It works the same document. It takes a single absolute file path as an argument.
way as \fBtk::mac::OpenDocument\fR in terms of arguments.
.TP .TP
\fB::tk::mac::Quit\fR \fB::tk::mac::Quit\fR
. .
@@ -141,7 +160,57 @@ Customizes behavior of Apple Help menu; if this procedure is not defined, the
platform-specific standard Help menu item platform-specific standard Help menu item
.QW "YourApp Help" .QW "YourApp Help"
performs the default Cocoa action of showing the Help Book configured in the performs the default Cocoa action of showing the Help Book configured in the
application's Info.plist (or displaying an alert if no Help Book is set). application's Info.plist (or displaying an alert if no Help Book is
set).
.TP
\fB::tk::mac::PerformService\fR
.
Executes a Tcl procedure called from the macOS
.QW Services
menu in the Application menu item. The
.QW Services
menu item allows for inter-application communication; data from one
application, such as selected text, can be sent to another application
for processing, for example to Safari as a search item for Google, or
to TextEdit to be appended to a file. An example of the proc is below,
and should be rewritten in an application script for customization:
.RS
.PP
.CS
proc ::tk::mac::PerformService {} {
set data [clipboard get]
$w insert end $data
}
.CE
.RE
Note that the mechanism for retrieving the data is from the clipboard;
there is no other supported way to obtain the data. If the Services
process is not desired, the NSServices keys can be deleted from
the application's Info.plist file. The underlying code supporting this
command also allows the text, entry and ttk::entry widgets to access
services from other applications via the Services menu. The NSPortName
key in Wish's Info.plist file is currently set as
.QW "Wish"
; if a developer changes the name of the Wish executable to something
else, this key should be modified with the same name.
.TP
\fB::tk::mac::LaunchURL \fIURL...\fR
.
If defined, launches a URL within Tk. This would be used if a Tk
application wants to handle a URL itself, such as displaying data from
an RSS feed, rather than launching a default application to handle the
URL, although it can defined as such. Wish includes a stub URL scheme
of
.QW foo://
in the CFBundleURLSchemes key of its Info.plist file; this should be customized for the specific URL
scheme the developer wants to support.
.TP
\fB::tk::mac::GetAppPath\fR
.
Returns the current applications's file path.
.TP
.SH "ADDITIONAL DIALOGS" .SH "ADDITIONAL DIALOGS"
.PP .PP
The Aqua/Mac OS X defines additional dialogs that applications should The Aqua/Mac OS X defines additional dialogs that applications should
@@ -149,11 +218,17 @@ support.
.TP .TP
\fB::tk::mac::standardAboutPanel\fR \fB::tk::mac::standardAboutPanel\fR
. .
Brings the standard Cocoa about panel to the front, with all its information Brings the standard Cocoa about panel to the front with information filled in
filled in from your application bundle files (standard about panel with no from the application bundle files. The panel displays the application icon and
options specified). See Apple Technote TN2179 and the AppKit documentation for the values associated to the info.plist keys named CFBundleName,
-[NSApplication orderFrontStandardAboutPanelWithOptions:] for details on the CFBundleShortVersionString, NSAboutPanelOptionVersion and
Info.plist keys and app bundle files used by the about panel. NSHumanReadableCopyright. If a file named \fICredits.html\fR or
\fICredits.rtf\fR exists in the bundle's Resources directory then its contents
will be displayed in a scrolling text box at the bottom of the dialog. See the
documentation for -[NSApplication orderFrontStandardAboutPanelWithOptions:]
for more details. A hook is also provided for a custom About dialog. If a Tcl
proc named tkAboutDialog is defined in the main interpreter then that
procedure will be called instead of opening the standardAboutPanel.
.SH "SYSTEM CONFIGURATION" .SH "SYSTEM CONFIGURATION"
.PP .PP
There are a number of additional global configuration options that control the There are a number of additional global configuration options that control the

View File

@@ -104,9 +104,9 @@ to configure aspects of the toplevel such as its background color
and relief. The \fBtoplevel\fR command returns the and relief. The \fBtoplevel\fR command returns the
path name of the new window. path name of the new window.
.PP .PP
A toplevel is similar to a frame except that it is created as a A toplevel is similar to a \fBframe\fR except that it is created as a
top-level window: its X parent is the root window of a screen top-level window: its X parent is the root window of a screen
rather than the logical parent from its path name. The primary rather than the logical parent from its Tk path name. The primary
purpose of a toplevel is to serve as a container for dialog boxes purpose of a toplevel is to serve as a container for dialog boxes
and other collections of widgets. The only visible features and other collections of widgets. The only visible features
of a toplevel are its background color and an optional 3-D border of a toplevel are its background color and an optional 3-D border
@@ -117,21 +117,25 @@ The \fBtoplevel\fR command creates a new Tcl command whose
name is the same as the path name of the toplevel's window. This name is the same as the path name of the toplevel's window. This
command may be used to invoke various command may be used to invoke various
operations on the widget. It has the following general form: operations on the widget. It has the following general form:
.PP
.CS .CS
\fIpathName option \fR?\fIarg arg ...\fR? \fIpathName option \fR?\fIarg arg ...\fR?
.CE .CE
.PP
\fIPathName\fR is the name of the command, which is the same as \fIPathName\fR is the name of the command, which is the same as
the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following determine the exact behavior of the command. The following
commands are possible for toplevel widgets: commands are possible for toplevel widgets:
.TP .TP
\fIpathName \fBcget \fIoption\fR \fIpathName \fBcget \fIoption\fR
.
Returns the current value of the configuration option given Returns the current value of the configuration option given
by \fIoption\fR. by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBtoplevel\fR \fIOption\fR may have any of the values accepted by the \fBtoplevel\fR
command. command.
.TP .TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
Query or modify the configuration options of the widget. Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
@@ -148,8 +152,10 @@ command.
.PP .PP
When a new toplevel is created, it has no default event bindings: When a new toplevel is created, it has no default event bindings:
toplevels are not intended to be interactive. toplevels are not intended to be interactive.
.PP
Be aware that bindings on toplevels may receive events from subwidgets.
.SH "SEE ALSO" .SH "SEE ALSO"
frame(n) bind(n), bindtags(n), frame(n), wm(n)
.SH KEYWORDS .SH KEYWORDS
toplevel, widget toplevel, widget
'\" Local Variables: '\" Local Variables:

View File

@@ -66,8 +66,9 @@ Extra padding (in pixels) to add uniformly to each side of a region.
.AP short bottom in .AP short bottom in
Extra padding (in pixels) to add to the bottom of a region. Extra padding (in pixels) to add to the bottom of a region.
.AP Ttk_Box box in .AP Ttk_Box box in
.AP "Ttk_Box *" box_rtn out
Specifies a rectangular region. Specifies a rectangular region.
.AP "Ttk_Box *" box_rtn out
A rectangular region.
.AP int height in .AP int height in
The height in pixels of a region. The height in pixels of a region.
.AP "Tcl_Interp *" interp in .AP "Tcl_Interp *" interp in
@@ -79,13 +80,14 @@ String value contains a symbolic name
to be converted to an enumerated value or bitmask. to be converted to an enumerated value or bitmask.
Internal rep may be be modified to cache corresponding value. Internal rep may be be modified to cache corresponding value.
.AP Ttk_Padding padding in .AP Ttk_Padding padding in
.AP "Ttk_Padding *" padding_rtn out
Extra padding to add on the inside of a region. Extra padding to add on the inside of a region.
.AP "Ttk_Padding *" padding_rtn out
Padding present in the inside of a region.
.AP Ttk_Box parcel in .AP Ttk_Box parcel in
A rectangular region, allocated from a cavity. A rectangular region, allocated from a cavity.
.AP int relief in .AP int relief in
One of the standard Tk relief options One of the standard Tk relief options
(TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.). (\fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, etc.).
See \fBTk_GetReliefFromObj\fR. See \fBTk_GetReliefFromObj\fR.
.AP short right in .AP short right in
Extra padding (in pixels) to add to the right side of a region. Extra padding (in pixels) to add to the right side of a region.
@@ -95,13 +97,13 @@ One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR,
.AP unsigned sticky in .AP unsigned sticky in
A bitmask containing one or more of the bits A bitmask containing one or more of the bits
\fBTTK_STICK_W\fR (west, or left), \fBTTK_STICK_W\fR (west, or left),
\fBTTK_STICK_E\fR (east, or right, \fBTTK_STICK_E\fR (east, or right),
\fBTTK_STICK_N\fR (north, or top), and \fBTTK_STICK_N\fR (north, or top), and
\fBTTK_STICK_S\fR (south, or bottom). \fBTTK_STICK_S\fR (south, or bottom).
\fBTTK_FILL_X\fR is defined as a synonym for (TTK_STICK_W|TTK_STICK_E), \fBTTK_FILL_X\fR is defined as a synonym for (\fBTTK_STICK_W\fR|\fBTTK_STICK_E\fR),
\fBTTK_FILL_Y\fR is a synonym for (TTK_STICK_N|TTK_STICK_S), \fBTTK_FILL_Y\fR is a synonym for (\fBTTK_STICK_N\fR|\fBTTK_STICK_S\fR),
and \fBTTK_FILL_BOTH\fR and \fBTTK_STICK_ALL\fR and \fBTTK_FILL_BOTH\fR
are synonyms for (TTK_FILL_X|TTK_FILL_Y). is a synonym for (\fBTTK_FILL_X\fR|\fBTTK_FILL_Y\fR).
See also: \fIgrid(n)\fR. See also: \fIgrid(n)\fR.
.AP Tk_Window tkwin in .AP Tk_Window tkwin in
Window whose screen geometry determines Window whose screen geometry determines
@@ -212,7 +214,7 @@ See \fBTk_GetPixelsFromObj(3)\fR for the syntax of length specifications.
.PP .PP
\fBTtk_GetBorderFromObj\fR is the same as \fBTtk_GetPaddingFromObj\fR \fBTtk_GetBorderFromObj\fR is the same as \fBTtk_GetPaddingFromObj\fR
except that the lengths are specified as integers except that the lengths are specified as integers
(i.e., resolution-dependant values like \fI3m\fR are not allowed). (i.e., resolution-dependent values like \fI3m\fR are not allowed).
.PP .PP
\fBTtk_GetStickyFromObj\fR converts the string in \fIobjPtr\fR \fBTtk_GetStickyFromObj\fR converts the string in \fIobjPtr\fR
to a \fIsticky\fR bitmask. The string contains zero or more to a \fIsticky\fR bitmask. The string contains zero or more

View File

@@ -39,19 +39,11 @@ The default is \fBnormal\fR.
Depending on the theme, the default button may be displayed Depending on the theme, the default button may be displayed
with an extra highlight ring, or with a different border color. with an extra highlight ring, or with a different border color.
.RE .RE
.OP \-width width Width
If greater than zero, specifies how much space, in character widths,
to allocate for the text label.
If less than zero, specifies a minimum width.
If zero or unspecified, the natural width of the text label is used.
Note that some themes may specify a non-zero \fB\-width\fR
in the style.
.\" Not documented -- may go away .\" Not documented -- may go away
.\" .OP \-padding padding Padding .\" .OP \-padding padding Padding
.\" .OP \-foreground foreground Foreground .\" .OP \-foreground foreground Foreground
.\" .OP \-font font Font .\" .OP \-font font Font
.\" .OP \-anchor anchor Anchor .\" .OP \-anchor anchor Anchor
.\" .OP \-padding padding Padding
.\" .OP \-relief relief Relief .\" .OP \-relief relief Relief
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
.PP .PP
@@ -65,13 +57,51 @@ Invokes the command associated with the button.
.PP .PP
\fBTtk::button\fR widgets support the \fBToolbutton\fR style in all standard \fBTtk::button\fR widgets support the \fBToolbutton\fR style in all standard
themes, which is useful for creating widgets for toolbars. themes, which is useful for creating widgets for toolbars.
.SH "COMPATIBILITY OPTIONS" .SH "STYLING OPTIONS"
.OP \-state state State .PP
May be set to \fBnormal\fR or \fBdisabled\fR to control the The class name for a \fBttk::button\fP is \fBTButton\fP.
\fBdisabled\fR state bit. This is a .PP
.QW write-only Dynamic states: \fBactive\fP, \fBdisabled\fP, \fBpressed\fP, \fBreadonly\fP.
option: setting it changes the widget state, but the \fBstate\fR .PP
widget command does not affect the state option. \fBTButton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-anchor\fP \fIanchor\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-highlightcolor\fP \fIcolor\fP
.br
\fB\-highlightthickness\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-relief\fP \fIrelief\fP
.br
\fB\-shiftrelief\fP \fIamount\fP
.RS
\fB\-shiftrelief\fP specifies how far the button contents are
shifted down and right in the \fIpressed\fP state.
This action provides additional skeumorphic feedback.
.RE
\fB\-width\fP \fIamount\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), button(n) ttk::widget(n), button(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -68,6 +68,36 @@ selection.)
.PP .PP
\fBTtk::checkbutton\fR widgets support the \fBToolbutton\fR style in all \fBTtk::checkbutton\fR widgets support the \fBToolbutton\fR style in all
standard themes, which is useful for creating widgets for toolbars. standard themes, which is useful for creating widgets for toolbars.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::checkbutton\fP is \fBTCheckbutton\fP.
.PP
Dynamic states: \fBactive\fP, \fBalternate\fP, \fBdisabled\fP,
\fBpressed\fP, \fBselected\fP, \fBreadonly\fP.
.PP
\fBTCheckbutton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-indicatorbackground\fP \fIcolor\fP
.br
\fB\-indicatorcolor\fP \fIcolor\fP
.br
\fB\-indicatormargin\fP \fIpadding\fP
.br
\fB\-indicatorrelief\fP \fIrelief\fP
.br
\fB\-padding\fP \fIpadding\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::radiobutton(n), checkbutton(n) ttk::widget(n), ttk::radiobutton(n), checkbutton(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -67,7 +67,9 @@ The following subcommands are possible for combobox widgets:
.TP .TP
\fIpathName \fBcurrent\fR ?\fInewIndex\fR? \fIpathName \fBcurrent\fR ?\fInewIndex\fR?
If \fInewIndex\fR is supplied, sets the combobox value If \fInewIndex\fR is supplied, sets the combobox value
to the element at position \fInewIndex\fR in the list of \fB\-values\fR. to the element at position \fInewIndex\fR in the list of \fB\-values\fR
(in addition to integers, the \fBend\fR index is supported and indicates
the last element of the list).
Otherwise, returns the index of the current value in the list of Otherwise, returns the index of the current value in the list of
\fB\-values\fR or \fB\-1\fR if the current value does not appear in the list. \fB\-values\fR or \fB\-1\fR if the current value does not appear in the list.
.TP .TP
@@ -110,6 +112,87 @@ The combobox widget generates a \fB<<ComboboxSelected>>\fR virtual event
when the user selects an element from the list of values. when the user selects an element from the list of values.
If the selection action unposts the listbox, If the selection action unposts the listbox,
this event is delivered after the listbox is unposted. this event is delivered after the listbox is unposted.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::combobox\fP is \fBTCombobox\fP.
The \fBttk::combobox\fP uses the \fBentry\fP and
\fBlistbox\fP widgets internally.
The listbox frame has a class name of \fBComboboxPopdownFrame\fP.
.PP
Dynamic states: \fBdisabled\fP, \fBfocus\fP, \fBpressed\fP, \fBreadonly\fP.
.PP
\fBTCombobox\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-arrowcolor\fP \fIcolor\fP
.br
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-focusfill\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.RS
Can only be changed when using non-native and non-graphical themes.
.RE
\fB\-insertcolor\fP \fIcolor\fP
.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-postoffset\fP \fIpadding\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
.RS
Text entry select background.
.RE
\fB\-selectforeground\fP \fIcolor\fP
.RS
Text entry select foreground.
.RE
.PP
The \fBttk::combobox\fP popdown listbox cannot be configured using
\fBttk::style\fP nor via the widget \fBconfigure\fP command. The listbox
can be configured using the option database.
.PP
option add *TCombobox*Listbox.background \fIcolor\fP
.br
option add *TCombobox*Listbox.font \fIfont\fP
.br
option add *TCombobox*Listbox.foreground \fIcolor\fP
.br
option add *TCombobox*Listbox.selectBackground \fIcolor\fP
.br
option add *TCombobox*Listbox.selectForeground \fIcolor\fP
.PP
To configure a specific listbox (subject to future change):
.CS
set popdown [ttk::combobox::PopdownWindow .mycombobox]
$popdown.f.l configure \-font \fIfont\fP
.CE
.PP
\fBComboboxPopdownFrame\fP
styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-borderwidth\fP \fIamount\fP
.br
\fB\-relief\fP \fIrelief\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::entry(n) ttk::widget(n), ttk::entry(n)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -23,7 +23,9 @@ with the \fB\-textvariable\fR option.
Entry widgets support horizontal scrolling with the Entry widgets support horizontal scrolling with the
standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command. standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-style \-class \-cursor
\-font \-foreground
\-style
\-takefocus \-xscrollcommand \-takefocus \-xscrollcommand
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
@@ -34,8 +36,6 @@ If the selection is exported, then selecting in the widget deselects
the current X selection, selecting outside the widget deselects any the current X selection, selecting outside the widget deselects any
widget selection, and the widget will respond to selection retrieval widget selection, and the widget will respond to selection retrieval
requests when it has a selection. requests when it has a selection.
.\" MAYBE: .OP \-font font Font
.\" MAYBE: .OP \-foreground foreground Foreground
.\" MAYBE: .OP \-insertbackground insertBackground Foreground .\" MAYBE: .OP \-insertbackground insertBackground Foreground
.\" MAYBE: .OP \-insertwidth insertWidth InsertWidth .\" MAYBE: .OP \-insertwidth insertWidth InsertWidth
.OP \-invalidcommand invalidCommand InvalidCommand .OP \-invalidcommand invalidCommand InvalidCommand
@@ -222,52 +222,13 @@ by the \fB\-validate\fR option.
Returns 0 if validation fails, 1 if it succeeds. Returns 0 if validation fails, 1 if it succeeds.
Sets or clears the \fBinvalid\fR state accordingly. Sets or clears the \fBinvalid\fR state accordingly.
See \fBVALIDATION\fR below for more details. See \fBVALIDATION\fR below for more details.
.TP
\fIpathName \fBxview \fIargs\fR
This command is used to query and change the horizontal position of the
text in the widget's window. It can take any of the following
forms:
.RS
.TP
\fIpathName \fBxview\fR
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
For example, if the first element is .2 and the second element is .6,
20% of the entry's text is off-screen to the left, the middle 40% is visible
in the window, and 40% of the text is off-screen to the right.
These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.TP
\fIpathName \fBxview\fR \fIindex\fR
Adjusts the view in the window so that the character given by \fIindex\fR
is displayed at the left edge of the window.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
Adjusts the view in the window so that the character \fIfraction\fR of the
way through the text appears at the left edge of the window.
\fIFraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
'\" or an abbreviation of one of these, but we don't document that.
If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
\fInumber\fR average-width characters on the display; if it is
\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
If \fInumber\fR is negative then characters farther to the left
become visible; if it is positive then characters farther to the right
become visible.
.RE
.PP .PP
The entry widget also supports the following generic \fBttk::widget\fR The entry widget also supports the following generic \fBttk::widget\fR
widget subcommands (see \fIttk::widget(n)\fR for details): widget subcommands (see \fIttk::widget(n)\fR for details):
.DS .DS
.ta 5.5c 11c .ta 5.5c 11c
\fBcget\fR \fBconfigure\fR \fBidentify\fR \fBcget\fR \fBconfigure\fR \fBidentify\fR
\fBinstate\fR \fBstate\fR \fBinstate\fR \fBstate\fR \fBxview\fR
.DE .DE
.SH VALIDATION .SH VALIDATION
.PP .PP
@@ -392,9 +353,10 @@ insert cursor in the entry without affecting the selection.
If any normal printing characters are typed in an entry, they are If any normal printing characters are typed in an entry, they are
inserted at the point of the insert cursor. inserted at the point of the insert cursor.
.IP \0\(bu 4 .IP \0\(bu 4
The view in the entry can be adjusted by dragging with mouse button 2. The view in the entry can be adjusted by dragging with the middle
If mouse button 2 is clicked without moving the mouse, the selection mouse button (button 2, or button 3 in TkAqua). If the middle mouse
is copied into the entry at the position of the mouse cursor. button is clicked without moving the mouse, the selection is copied
into the entry at the position of the mouse cursor.
.IP \0\(bu 4 .IP \0\(bu 4
If the mouse is dragged out of the entry on the left or right sides If the mouse is dragged out of the entry on the left or right sides
while button 1 is pressed, the entry will automatically scroll to while button 1 is pressed, the entry will automatically scroll to
@@ -461,6 +423,49 @@ and a different background is used in the \fBreadonly\fR state.
.PP .PP
The entry widget sets the \fBinvalid\fR state if revalidation fails, The entry widget sets the \fBinvalid\fR state if revalidation fails,
and clears it whenever validation succeeds. and clears it whenever validation succeeds.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::entry\fP is \fBTEntry\fP.
.PP
Dynamic states: \fBdisabled\fP, \fBfocus\fP, \fBreadonly\fP.
.PP
\fBTEntry\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.RS
For backwards compatibility, when using the aqua theme (for macOS), this
option behaves as an alias for the \fB\-fieldbackground\fP provided that no
value is specified for \fB\-fieldbackground\fP. Otherwise it is ignored.
.RE
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.RS
Some themes use a graphical background and their field background colors cannot be changed.
.RE
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-insertcolor\fP \fIcolor\fP
.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-relief\fP \fIrelief\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
.br
\fB\-selectborderwidth\fP \fIamount\fP
.br
\fB\-selectforeground\fP \fIcolor\fP
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), entry(n) ttk::widget(n), entry(n)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -17,19 +17,18 @@ ttk::frame \- Simple container widget
A \fBttk::frame\fR widget is a container, used to group other widgets A \fBttk::frame\fR widget is a container, used to group other widgets
together. together.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-takefocus \-class \-cursor \-padding \-style
\-style \-takefocus
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
.OP \-borderwidth borderWidth BorderWidth .OP \-borderwidth borderWidth BorderWidth
The desired width of the widget border. Defaults to 0. The desired width of the widget border. Defaults to 0.
May be ignored depending on the theme used.
.OP \-relief relief Relief .OP \-relief relief Relief
One of the standard Tk border styles: One of the standard Tk border styles:
\fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR,
\fBsolid\fR, or \fBsunken\fR. \fBsolid\fR, or \fBsunken\fR.
Defaults to \fBflat\fR. Defaults to \fBflat\fR.
.OP \-padding padding Padding
Additional padding to include inside the border.
.OP \-width width Width .OP \-width width Width
If specified, the widget's requested width in pixels. If specified, the widget's requested width in pixels.
.OP \-height height Height .OP \-height height Height
@@ -47,6 +46,25 @@ by the GM's requested size will normally take precedence
over the \fBframe\fR widget's \fB\-width\fR and \fB\-height\fR options. over the \fBframe\fR widget's \fB\-width\fR and \fB\-height\fR options.
\fBpack propagate\fR and \fBgrid propagate\fR can be used \fBpack propagate\fR and \fBgrid propagate\fR can be used
to change this. to change this.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::frame\fP is \fBTFrame\fP.
.PP
\fBTFrame\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-relief\fP \fIrelief\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH BINDINGS
.PP
When a new \fBttk::frame\fR is created, it has no default event bindings;
\fBttk::frame\fRs are not intended to be interactive.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::labelframe(n), frame(n) ttk::widget(n), ttk::labelframe(n), frame(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -29,6 +29,13 @@ Valid \fIoptions\fR are:
\fB\-border\fR \fIpadding\fR \fB\-border\fR \fIpadding\fR
\fIpadding\fR is a list of up to four integers, specifying \fIpadding\fR is a list of up to four integers, specifying
the left, top, right, and bottom borders, respectively. the left, top, right, and bottom borders, respectively.
If fewer than four elements are specified,
\fIbottom\fR defaults to \fItop\fR,
\fIright\fR defaults to \fIleft\fR, and
\fItop\fR defaults to \fIleft\fR.
In other words, a list of three numbers specify the left, vertical, and right border;
a list of two numbers specify the horizontal and the vertical border;
a single number specifies the same border all the way around the element.
See \fBIMAGE STRETCHING\fR, below. See \fBIMAGE STRETCHING\fR, below.
.TP .TP
\fB\-height \fIheight\fR \fB\-height \fIheight\fR
@@ -36,8 +43,17 @@ Specifies a minimum height for the element.
If less than zero, the base image's height is used as a default. If less than zero, the base image's height is used as a default.
.TP .TP
\fB\-padding\fR \fIpadding\fR \fB\-padding\fR \fIpadding\fR
Specifies the element's interior padding. Defaults to Specifies the element's interior padding.
\fB\-border\fR if not specified. The padding is a list of up to four length specifications
\fIleft top right bottom\fR.
If fewer than four elements are specified,
\fIbottom\fR defaults to \fItop\fR,
\fIright\fR defaults to \fIleft\fR, and
\fItop\fR defaults to \fIleft\fR.
In other words, a list of three numbers specify the left, vertical, and right padding;
a list of two numbers specify the horizontal and the vertical padding;
a single number specifies the same padding all the way around the widget.
Defaults to \fB\-border\fR if not specified.
.TP .TP
\fB\-sticky\fR \fIspec\fR \fB\-sticky\fR \fIspec\fR
Specifies how the image is placed within the final parcel. Specifies how the image is placed within the final parcel.

View File

@@ -13,7 +13,7 @@ ttk::intro \- Introduction to the Tk theme engine
.SH "OVERVIEW" .SH "OVERVIEW"
.PP .PP
The Tk themed widget set is based on a revised and enhanced version The Tk themed widget set is based on a revised and enhanced version
of TIP #48 (http://tip.tcl.tk/48) specified style engine. of TIP #48 (https://tip.tcl-lang.org/48) specified style engine.
The main concepts are described below. The main concepts are described below.
The basic idea is to separate, to the extent possible, The basic idea is to separate, to the extent possible,
the code implementing a widget's behavior from the code implementing a widget's behavior from
@@ -60,7 +60,7 @@ For example, the \fBtext\fR element
(which displays a text string) has (which displays a text string) has
\fB\-text\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-background\fR, \fB\-text\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-background\fR,
\fB\-underline\fR, and \fB\-width\fR options. \fB\-underline\fR, and \fB\-width\fR options.
The value of an element option is taken from: The value of an element option is taken from (in precedence order):
.IP \(bu .IP \(bu
an option of the same name and type in the widget containing the element; an option of the same name and type in the widget containing the element;
.IP \(bu .IP \(bu
@@ -86,7 +86,7 @@ ttk::\fBstyle layout\fR Horizontal.TScrollbar {
Scrollbar.trough \-children { Scrollbar.trough \-children {
Scrollbar.leftarrow \-side left \-sticky w Scrollbar.leftarrow \-side left \-sticky w
Scrollbar.rightarrow \-side right \-sticky e Scrollbar.rightarrow \-side right \-sticky e
Scrollbar.thumb \-side left \-expand true \-sticky ew Scrollbar.thumb \-sticky ew
} }
} }
.CE .CE

View File

@@ -19,7 +19,7 @@ The label may be linked to a Tcl variable
to automatically change the displayed text. to automatically change the displayed text.
.SO ttk_widget .SO ttk_widget
\-class \-compound \-cursor \-class \-compound \-cursor
\-image \-style \-takefocus \-image \-padding \-state \-style \-takefocus
\-text \-textvariable \-underline \-text \-textvariable \-underline
\-width \-width
.SE .SE
@@ -43,23 +43,12 @@ If there are multiple lines of text, specifies how
the lines are laid out relative to one another. the lines are laid out relative to one another.
One of \fBleft\fR, \fBcenter\fR, or \fBright\fR. One of \fBleft\fR, \fBcenter\fR, or \fBright\fR.
See also \fB\-anchor\fR. See also \fB\-anchor\fR.
.OP \-padding padding Padding
Specifies the amount of extra space to allocate for the widget.
The padding is a list of up to four length specifications
\fIleft top right bottom\fR.
If fewer than four elements are specified,
\fIbottom\fR defaults to \fItop\fR,
\fIright\fR defaults to \fIleft\fR, and
\fItop\fR defaults to \fIleft\fR.
.OP \-relief relief Relief .OP \-relief relief Relief
.\" Rewrite this: .\" Rewrite this:
Specifies the 3-D effect desired for the widget border. Specifies the 3-D effect desired for the widget border.
Valid values are Valid values are
\fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR, \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR,
and \fBsunken\fR. and \fBsunken\fR.
.OP \-text text Text
Specifies a text string to be displayed inside the widget
(unless overridden by \fB\-textvariable\fR).
.OP \-wraplength wrapLength WrapLength .OP \-wraplength wrapLength WrapLength
Specifies the maximum line length (in pixels). Specifies the maximum line length (in pixels).
If this option is less than or equal to zero, If this option is less than or equal to zero,
@@ -71,6 +60,27 @@ than the specified value.
Supports the standard widget commands Supports the standard widget commands
\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; \fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR;
see \fIttk::widget(n)\fR. see \fIttk::widget(n)\fR.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::label\fP is \fBTLabel\fP.
.PP
Dynamic states: \fBdisabled\fP, \fBreadonly\fP.
.PP
\fBTLabel\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), label(n) ttk::widget(n), label(n)
'\" Local Variables: '\" Local Variables:

View File

@@ -18,8 +18,8 @@ A \fBttk::labelframe\fR widget is a container used to group other widgets
together. It has an optional label, which may be a plain text string or together. It has an optional label, which may be a plain text string or
another widget. another widget.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-takefocus \-class \-cursor \-padding \-style
\-style \-takefocus
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
.\" XXX: Currently included, but may go away: .\" XXX: Currently included, but may go away:
@@ -30,6 +30,10 @@ another widget.
.\" XXX: \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, .\" XXX: \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR,
.\" XXX: \fBsolid\fR, or \fBsunken\fR. .\" XXX: \fBsolid\fR, or \fBsunken\fR.
.\" XXX: Default is theme-dependent. .\" XXX: Default is theme-dependent.
.OP \-height height Height
If specified, the widget's requested height in pixels.
(See \fIttk::frame(n)\fR for further notes on \fB\-width\fR and
\fB\-height\fR).
.OP \-labelanchor labelAnchor LabelAnchor .OP \-labelanchor labelAnchor LabelAnchor
Specifies where to place the label. Specifies where to place the label.
Allowed values are (clockwise from the top upper left corner): Allowed values are (clockwise from the top upper left corner):
@@ -40,6 +44,12 @@ The default value is theme-dependent.
.\" and specifies which side the label should be placed on; .\" and specifies which side the label should be placed on;
.\" the remaining characters specify how the label is aligned on that side. .\" the remaining characters specify how the label is aligned on that side.
.\" NOTE: Now allows other values as well; leave this undocumented for now .\" NOTE: Now allows other values as well; leave this undocumented for now
.OP \-labelwidget labelWidget LabelWidget
The name of a widget to use for the label.
If set, overrides the \fB\-text\fR option.
The \fB\-labelwidget\fR must be a child of the \fBlabelframe\fR widget
or one of the \fBlabelframe\fR's ancestors, and must belong to the
same top-level widget as the \fBlabelframe\fR.
.OP \-text text Text .OP \-text text Text
Specifies the text of the label. Specifies the text of the label.
.OP \-underline underline Underline .OP \-underline underline Underline
@@ -48,25 +58,53 @@ underline in the text string.
The underlined character is used for mnemonic activation. The underlined character is used for mnemonic activation.
Mnemonic activation for a \fBttk::labelframe\fR Mnemonic activation for a \fBttk::labelframe\fR
sets the keyboard focus to the first child of the \fBttk::labelframe\fR widget. sets the keyboard focus to the first child of the \fBttk::labelframe\fR widget.
.OP \-padding padding Padding
Additional padding to include inside the border.
.OP \-labelwidget labelWidget LabelWidget
The name of a widget to use for the label.
If set, overrides the \fB\-text\fR option.
The \fB\-labelwidget\fR must be a child of the \fBlabelframe\fR widget
or one of the \fBlabelframe\fR's ancestors, and must belong to the
same top-level widget as the \fBlabelframe\fR.
.OP \-width width Width .OP \-width width Width
If specified, the widget's requested width in pixels. If specified, the widget's requested width in pixels.
.OP \-height height Height
If specified, the widget's requested height in pixels.
(See \fIttk::frame(n)\fR for further notes on \fB\-width\fR and
\fB\-height\fR).
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
.PP .PP
Supports the standard widget commands Supports the standard widget commands
\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; \fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR;
see \fIttk::widget(n)\fR. see \fIttk::widget(n)\fR.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::labelframe\fP is \fBTLabelframe\fP.
The text label
has a class of \fBTLabelframe.Label\fP.
.PP
Dynamic states: \fBdisabled\fP, \fBreadonly\fP.
.PP
\fBTLabelframe\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-borderwidth\fP \fIamount\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-labelmargins\fP \fIamount\fP
.br
\fB\-labeloutside\fP \fIboolean\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-relief\fP \fIrelief\fP
.PP
\fBTLabelframe.Label\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-foreground\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::frame(n), labelframe(n) ttk::widget(n), ttk::frame(n), labelframe(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -45,6 +45,35 @@ methods. No other widget methods are used.
.PP .PP
\fBTtk::menubutton\fR widgets support the \fBToolbutton\fR style in all \fBTtk::menubutton\fR widgets support the \fBToolbutton\fR style in all
standard themes, which is useful for creating widgets for toolbars. standard themes, which is useful for creating widgets for toolbars.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::menubutton\fP is \fBTMenubutton\fP.
.PP
Dynamic states: \fBactive\fP, \fBdisabled\fP, \fBreadonly\fP.
.PP
\fBTMenubutton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-relief\fP \fIrelief\fP
.br
\fB\-width\fP \fIamount\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), menu(n), menubutton(n) ttk::widget(n), menu(n), menubutton(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -20,7 +20,7 @@ ttk::notebook \- Multi-paned container widget
.SH DESCRIPTION .SH DESCRIPTION
A \fBttk::notebook\fR widget manages a collection of windows A \fBttk::notebook\fR widget manages a collection of windows
and displays a single one at a time. and displays a single one at a time.
Each slave window is associated with a \fItab\fR, Each content window is associated with a \fItab\fR,
which the user may select to change the currently-displayed window. which the user may select to change the currently-displayed window.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-takefocus \-class \-cursor \-takefocus
@@ -41,6 +41,9 @@ If fewer than four elements are specified,
\fIbottom\fR defaults to \fItop\fR, \fIbottom\fR defaults to \fItop\fR,
\fIright\fR defaults to \fIleft\fR, and \fIright\fR defaults to \fIleft\fR, and
\fItop\fR defaults to \fIleft\fR. \fItop\fR defaults to \fIleft\fR.
In other words, a list of three numbers specify the left, vertical, and right padding;
a list of two numbers specify the horizontal and the vertical padding;
a single number specifies the same padding all the way around the widget.
.OP \-width width Width .OP \-width width Width
If present and greater than zero, If present and greater than zero,
specifies the desired width of the pane area specifies the desired width of the pane area
@@ -53,11 +56,11 @@ Either \fBnormal\fR, \fBdisabled\fR or \fBhidden\fR.
If \fBdisabled\fR, then the tab is not selectable. If \fBdisabled\fR, then the tab is not selectable.
If \fBhidden\fR, then the tab is not shown. If \fBhidden\fR, then the tab is not shown.
.OP \-sticky sticky Sticky .OP \-sticky sticky Sticky
Specifies how the slave window is positioned within the pane area. Specifies how the content window is positioned within the pane area.
Value is a string containing zero or more of the characters Value is a string containing zero or more of the characters
\fBn, s, e,\fR or \fBw\fR. \fBn, s, e,\fR or \fBw\fR.
Each letter refers to a side (north, south, east, or west) Each letter refers to a side (north, south, east, or west)
that the slave window will that the content window will
.QW stick .QW stick
to, as per the \fBgrid\fR geometry manager. to, as per the \fBgrid\fR geometry manager.
.OP \-padding padding Padding .OP \-padding padding Padding
@@ -83,7 +86,7 @@ any of the following forms:
.IP \(bu .IP \(bu
An integer between zero and the number of tabs; An integer between zero and the number of tabs;
.IP \(bu .IP \(bu
The name of a slave window; The name of a content window;
.IP \(bu .IP \(bu
A positional specification of the form A positional specification of the form
.QW @\fIx\fR,\fIy\fR , .QW @\fIx\fR,\fIy\fR ,
@@ -153,7 +156,7 @@ See \fIttk::widget(n)\fR.
.TP .TP
\fIpathname \fBselect\fR ?\fItabid\fR? \fIpathname \fBselect\fR ?\fItabid\fR?
Selects the specified tab. Selects the specified tab.
The associated slave window will be displayed, The associated content window will be displayed,
and the previously-selected window (if different) is unmapped. and the previously-selected window (if different) is unmapped.
If \fItabid\fR is omitted, returns the widget name of the If \fItabid\fR is omitted, returns the widget name of the
currently selected pane. currently selected pane.
@@ -171,7 +174,8 @@ Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs.
See \fBTAB OPTIONS\fR for the available options. See \fBTAB OPTIONS\fR for the available options.
.TP .TP
\fIpathname \fBtabs\fR \fIpathname \fBtabs\fR
Returns the list of windows managed by the notebook. Returns the list of windows managed by the notebook, in the index order of
their associated tabs.
.SH "KEYBOARD TRAVERSAL" .SH "KEYBOARD TRAVERSAL"
To enable keyboard traversal for a toplevel window To enable keyboard traversal for a toplevel window
containing a notebook widget \fI$nb\fR, call: containing a notebook widget \fI$nb\fR, call:
@@ -204,6 +208,58 @@ pack [\fBttk::notebook\fR .nb]
\&.nb select .nb.f2 \&.nb select .nb.f2
ttk::notebook::enableTraversal .nb ttk::notebook::enableTraversal .nb
.CE .CE
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::notebook\fP is \fBTNotebook\fP. The tab has
a class name of \fBTNotebook.Tab\fP
.PP
Dynamic states: \fBactive\fP, \fBdisabled\fP, \fBselected\fP.
.PP
\fBTNotebook\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-tabmargins\fP \fIpadding\fP
.br
\fB\-tabposition\fP \fIside\fP
.br
.PP
\fBTNotebook.Tab\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-expand\fP \fIpadding\fP
.RS
Defines how much the tab grows in size. Usually used with the
\fBselected\fP dynamic state. \fB\-tabmargins\fP should be
set appropriately so that there is room for the tab growth.
.RE
\fB\-font\fP \fIfont\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), grid(n) ttk::widget(n), grid(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -91,7 +91,8 @@ If one \fI\-option\fR is specified, returns the value of that \fIoption\fR.
Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs. Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs.
.TP .TP
\fIpathname \fBpanes\fR \fIpathname \fBpanes\fR
Returns the list of all windows managed by the widget. Returns the list of all windows managed by the widget, in the index order of
their associated panes.
.TP .TP
\fIpathname \fBsashpos \fIindex\fR ?\fInewpos\fR? \fIpathname \fBsashpos \fIindex\fR ?\fInewpos\fR?
If \fInewpos\fR is specified, sets the position If \fInewpos\fR is specified, sets the position
@@ -105,12 +106,55 @@ and the total size of the widget.
.\" depending on which changed most recently. .\" depending on which changed most recently.
Returns the new position of sash number \fIindex\fR. Returns the new position of sash number \fIindex\fR.
.\" Full story: new position may be different than the requested position. .\" Full story: new position may be different than the requested position.
.PP
The panedwindow widget also supports the following generic \fBttk::widget\fR
widget subcommands (see \fIttk::widget(n)\fR for details):
.DS
.ta 5.5c 11c
\fBcget\fR \fBconfigure\fR
\fBinstate\fR \fBstate\fR
.DE
.SH "VIRTUAL EVENTS" .SH "VIRTUAL EVENTS"
.PP .PP
The panedwindow widget generates an \fB<<EnteredChild>>\fR virtual event on The panedwindow widget generates an \fB<<EnteredChild>>\fR virtual event on
LeaveNotify/NotifyInferior events, because Tk does not execute binding scripts LeaveNotify/NotifyInferior events, because Tk does not execute binding scripts
for <Leave> events when the pointer crosses from a parent to a child. The for <Leave> events when the pointer crosses from a parent to a child. The
panedwindow widget needs to know when that happens. panedwindow widget needs to know when that happens.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::panedwindow\fP is \fBTPanedwindow\fP. The
sash has a class name of \fBSash\fP.
.PP
\fBTPanedwindow\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.PP
\fBSash\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-gripcount\fP \fIcount\fP
.br
\fB\-handlepad\fP \fIamount\fP
.br
\fB\-handlesize\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-sashpad\fP \fIamount\fP
.br
\fB\-sashrelief\fP \fIrelief\fP
.br
\fB\-sashthickness\fP \fIamount\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::notebook(n), panedwindow(n) ttk::widget(n), ttk::notebook(n), panedwindow(n)
'\" Local Variables: '\" Local Variables:

View File

@@ -24,29 +24,17 @@ that something is happening.
\-style \-style
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
.OP \-orient orient Orient
One of \fBhorizontal\fR or \fBvertical\fR.
Specifies the orientation of the progress bar.
.OP \-length length Length .OP \-length length Length
Specifies the length of the long axis of the progress bar Specifies the length of the long axis of the progress bar
(width if horizontal, height if vertical). (width if horizontal, height if vertical).
.OP \-mode mode Mode
One of \fBdeterminate\fR or \fBindeterminate\fR.
.OP \-maximum maximum Maximum .OP \-maximum maximum Maximum
A floating point number specifying the maximum \fB\-value\fR. A floating point number specifying the maximum \fB\-value\fR.
Defaults to 100. Defaults to 100.
.OP \-value value Value .OP \-mode mode Mode
The current value of the progress bar. One of \fBdeterminate\fR or \fBindeterminate\fR.
In \fIdeterminate\fR mode, this represents the amount of work completed. .OP \-orient orient Orient
In \fIindeterminate\fR mode, it is interpreted modulo \fB\-maximum\fR; One of \fBhorizontal\fR or \fBvertical\fR.
that is, the progress bar completes one Specifies the orientation of the progress bar.
.QW cycle
when the \fB\-value\fR increases by \fB\-maximum\fR.
.OP \-variable variable Variable
The name of a global Tcl variable which is linked to the \fB\-value\fR.
If specified, the \fB\-value\fR of the progress bar is
automatically set to the value of the variable whenever
the latter is modified.
.OP \-phase phase Phase .OP \-phase phase Phase
Read-only option. Read-only option.
The widget periodically increments the value of this option The widget periodically increments the value of this option
@@ -54,6 +42,20 @@ whenever the \fB\-value\fR is greater than 0 and,
in \fIdeterminate\fR mode, less than \fB\-maximum\fR. in \fIdeterminate\fR mode, less than \fB\-maximum\fR.
This option may be used by the current theme This option may be used by the current theme
to provide additional animation effects. to provide additional animation effects.
.OP \-value value Value
The current value of the progress bar.
In \fIdeterminate\fR mode, this represents the amount of work completed.
In \fIindeterminate\fR mode, it is interpreted modulo \fB\-maximum\fR;
that is, the progress bar completes one
.QW cycle
when the \fB\-value\fR increases by \fB\-maximum\fR.
If \fB\-variable\fR is set to an existing variable, specifying \fB\-value\fR
has no effect (the variable value takes precedence).
.OP \-variable variable Variable
The name of a global Tcl variable which is linked to the \fB\-value\fR.
If specified to an existing variable, the \fB\-value\fR of the progress bar is
automatically set to the value of the variable whenever
the latter is modified.
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
.PP .PP
.TP .TP
@@ -86,6 +88,35 @@ Increments the \fB\-value\fR by \fIamount\fR.
\fIpathName \fBstop\fR \fIpathName \fBstop\fR
Stop autoincrement mode: Stop autoincrement mode:
cancels any recurring timer event initiated by \fIpathName \fBstart\fR. cancels any recurring timer event initiated by \fIpathName \fBstart\fR.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::progressbar\fP is \fBTProgressbar\fP.
.PP
\fBTProgressbar\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-maxphase\fP
.RS
For the aqua theme.
.RE
\fB\-period\fP
.RS
For the aqua theme.
.RE
\fB\-troughcolor\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n) ttk::widget(n)
'\" Local Variables: '\" Local Variables:

View File

@@ -65,6 +65,36 @@ selection.)
.PP .PP
\fBTtk::radiobutton\fR widgets support the \fBToolbutton\fR style in all \fBTtk::radiobutton\fR widgets support the \fBToolbutton\fR style in all
standard themes, which is useful for creating widgets for toolbars. standard themes, which is useful for creating widgets for toolbars.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::radiobutton\fP is \fBTRadiobutton\fP.
.PP
Dynamic states: \fBactive\fP, \fBalternate\fP, \fBdisabled\fP,
\fBpressed\fP, \fBreadonly\fP, \fBselected\fP.
.PP
\fBTRadiobutton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-indicatorbackground\fP \fIcolor\fP
.br
\fB\-indicatorcolor\fP \fIcolor\fP
.br
\fB\-indicatormargin\fP \fIpadding\fP
.br
\fB\-indicatorrelief\fP \fIrelief\fP
.br
\fB\-padding\fP \fIpadding\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::checkbutton(n), radiobutton(n) ttk::widget(n), ttk::checkbutton(n), radiobutton(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -42,6 +42,8 @@ Specifies a real value corresponding to the right or bottom end of the scale.
This value may be either less than or greater than the \fB\-from\fR option. This value may be either less than or greater than the \fB\-from\fR option.
.OP \-value value Value .OP \-value value Value
Specifies the current floating-point value of the variable. Specifies the current floating-point value of the variable.
If \fB\-variable\fR is set to an existing variable, specifying \fB\-value\fR
has no effect (the variable value takes precedence).
.OP \-variable variable Variable .OP \-variable variable Variable
Specifies the name of a global variable to link to the scale. Whenever the Specifies the name of a global variable to link to the scale. Whenever the
value of the variable changes, the scale will update to reflect this value. value of the variable changes, the scale will update to reflect this value.
@@ -91,6 +93,35 @@ Modify or query the widget state; see \fIttk::widget(n)\fR.
Get the coordinates corresponding to \fIvalue\fR, or the coordinates Get the coordinates corresponding to \fIvalue\fR, or the coordinates
corresponding to the current value of the \fB\-value\fR option if \fIvalue\fR corresponding to the current value of the \fB\-value\fR option if \fIvalue\fR
is omitted. is omitted.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::scale\fP is \fBTScale\fP.
.PP
Dynamic states: \fBactive\fP.
.PP
\fBTProgressbar\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-borderwidth\fP \fIamount\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-groovewidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-sliderwidth\fP \fIamount\fP
.br
\fB\-troughcolor\fP \fIcolor\fP
.br
\fB\-troughrelief\fP \fIrelief\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), scale(n) ttk::widget(n), scale(n)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -76,7 +76,7 @@ Modify or query the widget state; see \fIttk::widget(n)\fR.
.SH "INTERNAL COMMANDS" .SH "INTERNAL COMMANDS"
.PP .PP
The following widget commands are used internally The following widget commands are used internally
by the TScrollbar widget class bindings. by the \fBTScrollbar\fP widget class bindings.
.TP .TP
\fIpathName \fBdelta \fIdeltaX deltaY\fR \fIpathName \fBdelta \fIdeltaX deltaY\fR
Returns a real number indicating the fractional change in Returns a real number indicating the fractional change in
@@ -153,7 +153,40 @@ grid $f.vsb \-row 0 \-column 1 \-sticky nsew
grid $f.hsb \-row 1 \-column 0 \-sticky nsew grid $f.hsb \-row 1 \-column 0 \-sticky nsew
grid columnconfigure $f 0 \-weight 1 grid columnconfigure $f 0 \-weight 1
grid rowconfigure $f 0 \-weight 1 grid rowconfigure $f 0 \-weight 1
pack $f
.CE .CE
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::scrollbar\fP is \fBTScrollbar\fP.
.PP
Dynamic states: \fBactive\fP, \fBdisabled\fP.
.PP
\fBTScrollbar\fP (or more specifically \fBVertical.TScrollbar\fP and
\fBHorizontal.TScrollbar\fP) styling options that are configurable with
\fBttk::style\fP are:
.PP
\fB\-arrowcolor\fP \fIcolor\fP
.br
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP (color of the dark part of the 3D relief)
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-gripcount\fP \fIcount\fP (number of lines on the thumb)
.br
\fB\-lightcolor\fP \fIcolor\fP (color of the light part of the 3D relief)
.br
\fB\-troughcolor\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), scrollbar(n) ttk::widget(n), scrollbar(n)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -17,7 +17,7 @@ ttk::separator \- Separator bar
A \fBttk::separator\fR widget displays a horizontal or vertical separator A \fBttk::separator\fR widget displays a horizontal or vertical separator
bar. bar.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-state \-class \-cursor
\-style \-takefocus \-style \-takefocus
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
@@ -29,6 +29,20 @@ Specifies the orientation of the separator.
Separator widgets support the standard Separator widgets support the standard
\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
methods. No other widget methods are used. methods. No other widget methods are used.
.PP
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::separator\fP is \fBTSeparator\fP.
.PP
\fBTSeparator\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n) ttk::widget(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -18,7 +18,7 @@ A \fBttk::sizegrip\fR widget (also known as a \fIgrow box\fR)
allows the user to resize the containing toplevel window allows the user to resize the containing toplevel window
by pressing and dragging the grip. by pressing and dragging the grip.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-state \-class \-cursor
\-style \-takefocus \-style \-takefocus
.SE .SE
.SH "WIDGET COMMAND" .SH "WIDGET COMMAND"
@@ -60,6 +60,19 @@ the sizegrip widget will not resize the window.
\fBttk::sizegrip\fR widgets only support \fBttk::sizegrip\fR widgets only support
.QW southeast .QW southeast
resizing. resizing.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::sizegrip\fP is \fBTSizegrip\fP.
.PP
\fBTSizegrip\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n) ttk::widget(n)
.SH "KEYWORDS" .SH "KEYWORDS"

View File

@@ -21,25 +21,32 @@ of the \fBttk::entry\fR widget including support of the
\fB\-textvariable\fR option to link the value displayed by the widget \fB\-textvariable\fR option to link the value displayed by the widget
to a Tcl variable. to a Tcl variable.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-style \-class \-cursor \-state \-style
\-takefocus \-xscrollcommand \-takefocus \-xscrollcommand
.SE .SE
.SO ttk_entry .SO ttk_entry
\-validate \-validatecommand \-validate \-validatecommand
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
Specifies a Tcl command to be invoked whenever a spinbutton is invoked.
.OP \-format format Format
Specifies an alternate format to use when setting the string value
when using the \fB\-from\fR and \fB\-to\fR range.
This must be a format specifier of the form \fB%<pad>.<pad>f\fR,
as it will format a floating-point number.
.OP \-from from From .OP \-from from From
A floating\-point value specifying the lowest value for the spinbox. This is A floating\-point value specifying the lowest value for the spinbox. This is
used in conjunction with \fB\-to\fR and \fB\-increment\fR to set a numerical used in conjunction with \fB\-to\fR and \fB\-increment\fR to set a numerical
range. range.
.OP \-to to To
A floating\-point value specifying the highest permissible value for the
widget. See also \fB\-from\fR and \fB\-increment\fR.
range.
.OP \-increment increment Increment .OP \-increment increment Increment
A floating\-point value specifying the change in value to be applied each A floating\-point value specifying the change in value to be applied each
time one of the widget spin buttons is pressed. The up button applies a time one of the widget spin buttons is pressed. The up button applies a
positive increment, the down button applies a negative increment. positive increment, the down button applies a negative increment.
.OP \-to to To
A floating\-point value specifying the highest permissible value for the
widget. See also \fB\-from\fR and \fB\-increment\fR.
range.
.OP \-values values Values .OP \-values values Values
This must be a Tcl list of values. If this option is set then this will This must be a Tcl list of values. If this option is set then this will
override any range set using the \fB\-from\fR, \fB\-to\fR and override any range set using the \fB\-from\fR, \fB\-to\fR and
@@ -48,13 +55,6 @@ specified beginning with the first value.
.OP \-wrap wrap Wrap .OP \-wrap wrap Wrap
Must be a proper boolean value. If on, the spinbox will wrap around the Must be a proper boolean value. If on, the spinbox will wrap around the
values of data in the widget. values of data in the widget.
.OP \-format format Format
Specifies an alternate format to use when setting the string value
when using the \fB\-from\fR and \fB\-to\fR range.
This must be a format specifier of the form \fB%<pad>.<pad>f\fR,
as it will format a floating-point number.
.OP \-command command Command
Specifies a Tcl command to be invoked whenever a spinbutton is invoked.
.SH "INDICES" .SH "INDICES"
.PP .PP
See the \fBttk::entry\fR manual for information about indexing characters. See the \fBttk::entry\fR manual for information about indexing characters.
@@ -67,8 +67,6 @@ See the \fBttk::entry\fR manual for information about using the
The following subcommands are possible for spinbox widgets in addition to The following subcommands are possible for spinbox widgets in addition to
the commands described for the \fBttk::entry\fR widget: the commands described for the \fBttk::entry\fR widget:
.TP .TP
\fIpathName \fBcurrent \fIindex\fR
.TP
\fIpathName \fBget\fR \fIpathName \fBget\fR
Returns the spinbox's current value. Returns the spinbox's current value.
.TP .TP
@@ -82,6 +80,49 @@ is set directly.
The spinbox widget generates a \fB<<Increment>>\fR virtual event when The spinbox widget generates a \fB<<Increment>>\fR virtual event when
the user presses <Up>, and a \fB<<Decrement>>\fR virtual event when the the user presses <Up>, and a \fB<<Decrement>>\fR virtual event when the
user presses <Down>. user presses <Down>.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::spinbox\fP is \fBTSpinbox\fP.
.PP
Dynamic states: \fBactive\fP, \fBdisabled\fP, \fBfocus\fP, \fBreadonly\fP.
.PP
\fBTSpinbox\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-arrowcolor\fP \fIcolor\fP
.br
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.RS
For backwards compatibility, when using the aqua theme (for macOS), this
option behaves as an alias for the \fB\-fieldbackground\fP provided that no
value is specified for \fB\-fieldbackground\fP. Otherwise it is ignored.
.RE
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-insertcolor\fP \fIcolor\fP
.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
.br
\fB\-selectforeground\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), ttk::entry(n), spinbox(n) ttk::widget(n), ttk::entry(n), spinbox(n)
.SH KEYWORDS .SH KEYWORDS

View File

@@ -15,7 +15,7 @@ ttk::style \- Manipulate style database
.SH NOTES .SH NOTES
.PP .PP
See also the Tcl'2004 conference presentation, See also the Tcl'2004 conference presentation,
available at http://tktable.sourceforge.net/tile/tile-tcl2004.pdf available at https://tktable.sourceforge.net/tile/tile-tcl2004.pdf
.SH DEFINITIONS .SH DEFINITIONS
.PP .PP
Each widget is assigned a \fIstyle\fR, Each widget is assigned a \fIstyle\fR,
@@ -34,28 +34,8 @@ The \fBttk::style\fR command takes the following arguments:
\fBttk::style configure \fIstyle\fR ?\fI\-option\fR ?\fIvalue option value...\fR? ? \fBttk::style configure \fIstyle\fR ?\fI\-option\fR ?\fIvalue option value...\fR? ?
Sets the default value of the specified option(s) in \fIstyle\fR. Sets the default value of the specified option(s) in \fIstyle\fR.
.TP .TP
\fBttk::style map \fIstyle\fR ?\fI\-option\fB { \fIstatespec value...\fB }\fR? \fBttk::style element\fR \fIargs\fR
Sets dynamic values of the specified option(s) in \fIstyle\fR. .RS
Each \fIstatespec / value\fR pair is examined in order;
the value corresponding to the first matching \fIstatespec\fR
is used.
.TP
\fBttk::style lookup \fIstyle\fR \fI\-option \fR?\fIstate \fR?\fIdefault\fR??
Returns the value specified for \fI\-option\fR in style \fIstyle\fR
in state \fIstate\fR, using the standard lookup rules for element options.
\fIstate\fR is a list of state names; if omitted,
it defaults to all bits off (the
.QW normal
state).
If the \fIdefault\fR argument is present, it is used as a fallback
value in case no specification for \fI\-option\fR is found.
.\" Otherwise -- signal error? return empty string? Leave unspecified for now.
.TP
\fBttk::style layout \fIstyle\fR ?\fIlayoutSpec\fR?
Define the widget layout for style \fIstyle\fR.
See \fBLAYOUTS\fR below for the format of \fIlayoutSpec\fR.
If \fIlayoutSpec\fR is omitted, return the layout specification
for style \fIstyle\fR.
.TP .TP
\fBttk::style element create\fR \fIelementName\fR \fItype\fR ?\fIargs...\fR? \fBttk::style element create\fR \fIelementName\fR \fItype\fR ?\fIargs...\fR?
Creates a new element in the current theme of type \fItype\fR. Creates a new element in the current theme of type \fItype\fR.
@@ -70,6 +50,33 @@ Returns the list of elements defined in the current theme.
.TP .TP
\fBttk::style element options \fIelement\fR \fBttk::style element options \fIelement\fR
Returns the list of \fIelement\fR's options. Returns the list of \fIelement\fR's options.
.RE
.TP
\fBttk::style layout \fIstyle\fR ?\fIlayoutSpec\fR?
Define the widget layout for style \fIstyle\fR.
See \fBLAYOUTS\fR below for the format of \fIlayoutSpec\fR.
If \fIlayoutSpec\fR is omitted, return the layout specification
for style \fIstyle\fR.
.TP
\fBttk::style lookup \fIstyle\fR \fI\-option \fR?\fIstate \fR?\fIdefault\fR??
Returns the value specified for \fI\-option\fR in style \fIstyle\fR
in state \fIstate\fR, using the standard lookup rules for element options.
\fIstate\fR is a list of state names; if omitted,
it defaults to all bits off (the
.QW normal
state).
If the \fIdefault\fR argument is present, it is used as a fallback
value in case no specification for \fI\-option\fR is found.
.\" Otherwise -- signal error? return empty string? Leave unspecified for now.
.TP
\fBttk::style map \fIstyle\fR ?\fI\-option\fB { \fIstatespec value...\fB }\fR?
Sets dynamic values of the specified option(s) in \fIstyle\fR.
Each \fIstatespec / value\fR pair is examined in order;
the value corresponding to the first matching \fIstatespec\fR
is used.
.TP
\fBttk::style theme\fR \fIargs\fR
.RS
.TP .TP
\fBttk::style theme create\fR \fIthemeName\fR ?\fB\-parent \fIbasedon\fR? ?\fB\-settings \fIscript...\fR ? \fBttk::style theme create\fR \fIthemeName\fR ?\fB\-parent \fIbasedon\fR? ?\fB\-settings \fIscript...\fR ?
Creates a new theme. It is an error if \fIthemeName\fR already exists. Creates a new theme. It is an error if \fIthemeName\fR already exists.
@@ -78,19 +85,20 @@ styles, elements, and layouts from the parent theme \fIbasedon\fR.
If \fB\-settings\fR is present, \fIscript\fR is evaluated in the If \fB\-settings\fR is present, \fIscript\fR is evaluated in the
context of the new theme as per \fBttk::style theme settings\fR. context of the new theme as per \fBttk::style theme settings\fR.
.TP .TP
\fBttk::style theme names\fR
Returns a list of all known themes.
.TP
\fBttk::style theme settings \fIthemeName\fR \fIscript\fR \fBttk::style theme settings \fIthemeName\fR \fIscript\fR
Temporarily sets the current theme to \fIthemeName\fR, Temporarily sets the current theme to \fIthemeName\fR,
evaluate \fIscript\fR, then restore the previous theme. evaluate \fIscript\fR, then restore the previous theme.
Typically \fIscript\fR simply defines styles and elements, Typically \fIscript\fR simply defines styles and elements,
though arbitrary Tcl code may appear. though arbitrary Tcl code may appear.
.TP .TP
\fBttk::style theme names\fR
Returns a list of all known themes.
.TP
\fBttk::style theme use\fR ?\fIthemeName\fR? \fBttk::style theme use\fR ?\fIthemeName\fR?
Without an argument the result is the name of the current theme. Without an argument the result is the name of the current theme.
Otherwise this command sets the current theme to \fIthemeName\fR, Otherwise this command sets the current theme to \fIthemeName\fR,
and refreshes all widgets. and refreshes all widgets.
.RE
.SH LAYOUTS .SH LAYOUTS
.PP .PP
A \fIlayout\fR specifies a list of elements, each followed A \fIlayout\fR specifies a list of elements, each followed
@@ -98,19 +106,40 @@ by one or more options specifying how to arrange the element.
The layout mechanism uses a simplified version of the \fBpack\fR The layout mechanism uses a simplified version of the \fBpack\fR
geometry manager: given an initial cavity, geometry manager: given an initial cavity,
each element is allocated a parcel. each element is allocated a parcel.
Then the parcel actually used by the element is adjusted within
the allocated parcel.
Valid options are: Valid options are:
.\" -border should remain undocumented for now (dubious usefulness)
.\" .TP
.\" \fB\-border\fR \fIboolean\fR
.\" Specifies whether the element is drawn after its children. Defaults to 0.
.TP
\fB\-children { \fIsublayout...\fB }\fR
Specifies a list of elements to place inside the element.
.TP
\fB\-expand\fR \fIboolean\fR
Specifies whether the allocated parcel is the entire cavity. If so,
simultaneous specification of \fB\-side\fR is ignored.
Defaults to 0.
.TP .TP
\fB\-side \fIside\fR \fB\-side \fIside\fR
Specifies which side of the cavity to place the element; Specifies which side of the cavity to place the element;
one of \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. one of \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR.
If omitted, the element occupies the entire cavity. For instance, \fB\-side top\fR allocates the parcel along the top of
the cavity having width and height respectively the width of the cavity
and the height of the element.
If omitted, the allocated parcel is the entire cavity (same effect
as \fB\-expand\fR 1).
.TP .TP
\fB\-sticky\fR \fB[\fInswe\fB]\fR \fB\-sticky\fR \fB[\fInswe\fB]\fR
Specifies where the element is placed inside its allocated parcel. Specifies the actual parcel position and size inside the allocated parcel.
.TP If specified as an empty string then the actual parcel is centered in
\fB\-children { \fIsublayout... \fB}\fR the allocated parcel. Default is \fBnswe\fR.
Specifies a list of elements to place inside the element. .\" -unit should remain undocumented for now (dubious usefulness)
.\" Also: -border, -unit, -expand: may go away. .\" .TP
.\" \fB\-unit\fR \fIboolean\fR
.\" Specifies whether the element propagates its state to its children.
.\" Defaults to 0.
.PP .PP
For example: For example:
.CS .CS

View File

@@ -45,6 +45,7 @@ and [\fBxy\fR]\fBview\fR widget commands.
.SO ttk_widget .SO ttk_widget
\-class \-cursor \-takefocus \-class \-cursor \-takefocus
\-style \-xscrollcommand \-yscrollcommand \-style \-xscrollcommand \-yscrollcommand
\-padding
.SE .SE
.SH "WIDGET-SPECIFIC OPTIONS" .SH "WIDGET-SPECIFIC OPTIONS"
.OP \-columns columns Columns .OP \-columns columns Columns
@@ -63,10 +64,6 @@ all columns are shown in the order given.
Specifies the number of rows which should be visible. Specifies the number of rows which should be visible.
Note: Note:
the requested width is determined from the sum of the column widths. the requested width is determined from the sum of the column widths.
.OP \-padding padding Padding
Specifies the internal padding for the widget.
The padding is a list of up to four length specifications;
see \fBTtk_GetPaddingFromObj()\fR for details.
.OP \-selectmode selectMode SelectMode .OP \-selectmode selectMode SelectMode
Controls how the built-in class bindings manage the selection. Controls how the built-in class bindings manage the selection.
One of \fBextended\fR, \fBbrowse\fR, or \fBnone\fR. One of \fBextended\fR, \fBbrowse\fR, or \fBnone\fR.
@@ -136,25 +133,29 @@ The column name. This is a read-only option.
For example, [\fI$pathname \fBcolumn #\fIn \fB\-id\fR] For example, [\fI$pathname \fBcolumn #\fIn \fB\-id\fR]
returns the data column associated with display column #\fIn\fR. returns the data column associated with display column #\fIn\fR.
.TP .TP
\fB\-anchor\fR \fB\-anchor \fIanchor\fR
Specifies how the text in this column should be aligned Specifies how the text in this column should be aligned
with respect to the cell. One of with respect to the cell. \fIAnchor\fR is one of
\fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR,
\fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR.
.TP .TP
\fB\-minwidth\fR \fB\-minwidth \fIminwidth\fR
The minimum width of the column in pixels. The minimum width of the column in pixels.
The treeview widget will not make the column any smaller than The treeview widget will not make the column any smaller than
\fB\-minwidth\fR when the widget is resized or the user drags a \fB\-minwidth\fR when the widget is resized or the user drags a
column separator. Default is 20 pixels.
.TP
\fB\-stretch \fIboolean\fR
Specifies whether or not the column width should be adjusted
when the widget is resized or the user drags a column separator.
\fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR.
By default columns are stretchable.
.TP
\fB\-width \fIwidth\fR
The width of the column in pixels. Default is 200 pixels. The specified
column width may be changed by Tk in order to honor \fB\-stretch\fR
and/or \fB\-minwidth\fR, or when the widget is resized or the user drags a
column separator. column separator.
.TP
\fB\-stretch\fR
Specifies whether or not the column's width should be adjusted
when the widget is resized.
.TP
\fB\-width \fIw\fR
The width of the column in pixels. Default is something reasonable,
probably 200 or so.
.PP .PP
Use \fIpathname column #0\fR to configure the tree column. Use \fIpathname column #0\fR to configure the tree column.
.RE .RE
@@ -234,7 +235,7 @@ A data cell.
Returns the item ID of the item at position \fIy\fR. Returns the item ID of the item at position \fIy\fR.
.TP .TP
\fIpathname \fBidentify column \fIx y\fR \fIpathname \fBidentify column \fIx y\fR
Returns the data column identifier of the cell at position \fIx\fR. Returns the display column identifier of the cell at position \fIx\fR.
The tree column has ID \fB#0\fR. The tree column has ID \fB#0\fR.
.TP .TP
\fIpathname \fBidentify element \fIx y\fR \fIpathname \fBidentify element \fIx y\fR
@@ -391,12 +392,13 @@ If \fIitems\fR is omitted, removes \fItag\fR from each item in the tree.
If \fItag\fR is not present for a particular item, If \fItag\fR is not present for a particular item,
then the \fB\-tags\fR for that item are unchanged. then the \fB\-tags\fR for that item are unchanged.
.RE .RE
.TP .PP
\fIpathName \fBxview \fIargs\fR The treeview widget also supports the following generic \fBttk::widget\fR
Standard command for horizontal scrolling; see \fIwidget(n)\fR. widget subcommands (see \fIttk::widget(n)\fR for details):
.TP .DS
\fIpathName \fByview \fIargs\fR .ta 5.5c 11c
Standard command for vertical scrolling; see \fIttk::widget(n)\fR. \fBxview\fR \fByview\fR
.DE
.SH "ITEM OPTIONS" .SH "ITEM OPTIONS"
.PP .PP
The following item options may be specified for items The following item options may be specified for items
@@ -437,6 +439,9 @@ Specifies the font to use when drawing text.
Specifies the item image, in case the item's \fB\-image\fR option is empty. Specifies the item image, in case the item's \fB\-image\fR option is empty.
.\" .PP .\" .PP
.\" \fI(@@@ TODO: sort out order of precedence for options)\fR .\" \fI(@@@ TODO: sort out order of precedence for options)\fR
.PP
Tag priority is decided by the creation order: tags created first receive
higher priority.
.SH "COLUMN IDENTIFIERS" .SH "COLUMN IDENTIFIERS"
.PP .PP
Column identifiers take any of the following forms: Column identifiers take any of the following forms:
@@ -477,6 +482,72 @@ to determine the affected item or items.
'\" Not yet: '\" Not yet:
'\" In Tk 8.5, the affected item is also passed as the \fB\-detail\fR field '\" In Tk 8.5, the affected item is also passed as the \fB\-detail\fR field
'\" of the virtual event. '\" of the virtual event.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::treeview\fP is \fBTreeview\fP.
The treeview header class name is \fBHeading\fP.
The treeview item class name is \fBItem\fP.
The treeview cell class name is \fBCell\fP.
.PP
Dynamic states: \fBdisabled\fP, \fBselected\fP.
.PP
\fBTreeview\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-rowheight\fP \fIamount\fP
.RS
The \fB\-rowheight\fP value is not corrected by the \fBtk scaling\fP
value or by the configured font size and must always be set. Also make
sure that the \fB\-rowheight\fP is large enough to contain any images.
.PP
To adjust the \fB\-rowheight\fP for the Treeview style, use the following code
after \fBtk scaling\fP has been applied.
Note that even if you do not support or change \fBtk scaling\fP
in your program, your users may have it set in their .wishrc.
.RE
.PP
.CS
ttk::style configure Treeview \\
\-rowheight [expr {[font metrics \fIfont\fP \-linespace] + 2}]
.CE
.PP
\fBHeading\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-relief\fP \fIrelief\fP
.PP
\fBItem\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-indicatormargins\fP \fIpadding\fP
.br
\fB\-indicatorsize\fP \fIamount\fP
.br
\fB\-padding\fP \fIpadding\fP
.PP
\fBCell\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-padding\fP \fIpadding\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO" .SH "SEE ALSO"
ttk::widget(n), listbox(n), image(n), bind(n) ttk::widget(n), listbox(n), image(n), bind(n)
'\" Local Variables: '\" Local Variables:

View File

@@ -34,6 +34,13 @@ Valid \fIoptions\fR are:
Specify the element's interior padding. Specify the element's interior padding.
\fIpadding\fR is a list of up to four integers specifying \fIpadding\fR is a list of up to four integers specifying
the left, top, right and bottom padding quantities respectively. the left, top, right and bottom padding quantities respectively.
If fewer than four elements are specified,
\fIbottom\fR defaults to \fItop\fR,
\fIright\fR defaults to \fIleft\fR, and
\fItop\fR defaults to \fIleft\fR.
In other words, a list of three numbers specify the left, vertical, and right padding;
a list of two numbers specify the horizontal and the vertical padding;
a single number specifies the same padding all the way around the widget.
This option may not be mixed with any other options. This option may not be mixed with any other options.
.TP .TP
\fB\-margins \fIpadding\fR \fB\-margins \fIpadding\fR
@@ -61,7 +68,7 @@ corresponding Visual Styles API state value.
This permits the element appearance to respond to changes in the This permits the element appearance to respond to changes in the
widget state such as becoming active or being pressed. The list should widget state such as becoming active or being pressed. The list should
be as described for the \fBttk::style map\fR command but note that the be as described for the \fBttk::style map\fR command but note that the
last pair in the list should be the default state and is typically and last pair in the list should be the default state and is typically an
empty list and 1. Unfortunately all the Visual Styles parts have empty list and 1. Unfortunately all the Visual Styles parts have
different state values and these must be looked up either in the different state values and these must be looked up either in the
Microsoft documentation or more likely in the header files. The Microsoft documentation or more likely in the header files. The

View File

@@ -71,27 +71,12 @@ See the description of \fB\-xscrollcommand\fR above for details.
.SH "LABEL OPTIONS" .SH "LABEL OPTIONS"
The following options are supported by labels, buttons, The following options are supported by labels, buttons,
and other button-like widgets: and other button-like widgets:
.OP \-text text Text
Specifies a text string to be displayed inside the widget
(unless overridden by \fB\-textvariable\fR).
.OP \-textvariable textVariable Variable
Specifies the name of a global variable whose value will be used
in place of the \fB\-text\fR resource.
.OP \-underline underline Underline
If set, specifies the integer index (0-based) of a character to underline
in the text string.
The underlined character is used for mnemonic activation.
.OP \-image image Image
Specifies an image to display.
This is a list of 1 or more elements.
The first element is the default image name.
The rest of the list is a sequence of \fIstatespec / value\fR pairs
as per \fBstyle map\fR, specifying different images to use when
the widget is in a particular state or combination of states.
All images in the list should have the same size.
.OP \-compound compound Compound .OP \-compound compound Compound
Specifies how to display the image relative to the text, Specifies how to display the image relative to the text,
in the case both \fB\-text\fR and \fB\-image\fR are present. in the case both \fB\-text\fR and \fB\-image\fR are present.
If set to the empty string (the default), the rules described in the
"Elements" section of \fIttk::intro(n)\fR explain which value is actually
used.
Valid values are: Valid values are:
.RS .RS
.IP text .IP text
@@ -106,14 +91,51 @@ Display text centered on top of image.
.IP right .IP right
Display image above, below, left of, or right of the text, respectively. Display image above, below, left of, or right of the text, respectively.
.IP none .IP none
The default; display the image if present, otherwise the text. Display the image if present, otherwise the text.
.RE .RE
.OP \-font font Font
Font to use for the text displayed by the widget.
.OP \-foreground textColor TextColor
The widget's foreground color.
If unspecified, the theme default is used.
.OP \-image image Image
Specifies an image to display.
This is a list of 1 or more elements.
The first element is the default image name.
The rest of the list is a sequence of \fIstatespec / value\fR pairs
as per \fBstyle map\fR, specifying different images to use when
the widget is in a particular state or combination of states.
All images in the list should have the same size.
.OP \-padding padding Padding
Specifies the internal padding for the widget.
The padding is a list of up to four length specifications
\fIleft top right bottom\fR.
If fewer than four elements are specified,
\fIbottom\fR defaults to \fItop\fR,
\fIright\fR defaults to \fIleft\fR, and
\fItop\fR defaults to \fIleft\fR.
In other words, a list of three numbers specify the left, vertical, and right padding;
a list of two numbers specify the horizontal and the vertical padding;
a single number specifies the same padding all the way around the widget.
.OP \-text text Text
Specifies a text string to be displayed inside the widget
(unless overridden by \fB\-textvariable\fR).
.OP \-textvariable textVariable Variable
Specifies the name of a global variable whose value will be used
in place of the \fB\-text\fR resource.
.OP \-underline underline Underline
If set, specifies the integer index (0-based) of a character to underline
in the text string.
The underlined character is used for mnemonic activation.
.OP \-width width Width .OP \-width width Width
If greater than zero, specifies how much space, in character widths, If greater than zero, specifies how much space, in character widths,
to allocate for the text label. to allocate for the text label.
If less than zero, specifies a minimum width. If less than zero, specifies a minimum width.
If zero or unspecified, the natural width of the text label is used. If zero or unspecified, the natural width of the text label is used.
.SH "COMPATIBILITY OPTIONS" .SH "COMPATIBILITY OPTIONS"
This option is only available for themed widgets that have
.QW corresponding
traditional Tk widgets.
.OP \-state state State .OP \-state state State
May be set to \fBnormal\fR or \fBdisabled\fR May be set to \fBnormal\fR or \fBdisabled\fR
to control the \fBdisabled\fR state bit. to control the \fBdisabled\fR state bit.
@@ -178,6 +200,84 @@ will restore \fIpathName\fR to the original state.
If \fIstateSpec\fR is not specified, If \fIstateSpec\fR is not specified,
returns a list of the currently-enabled state flags. returns a list of the currently-enabled state flags.
.RE .RE
.TP
\fIpathName \fBxview \fIargs\fR
This command is used to query and change the horizontal position of the
content in the widget's window. It can take any of the following
forms:
.RS
.TP
\fIpathName \fBxview\fR
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
For example, if the first element is .2 and the second element is .6,
20% of the widget's content is off-screen to the left, the middle 40% is visible
in the window, and 40% of the content is off-screen to the right.
These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.TP
\fIpathName \fBxview\fR \fIindex\fR
Adjusts the view in the window so that the content given by \fIindex\fR
is displayed at the left edge of the window.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
Adjusts the view in the window so that the character \fIfraction\fR of the
way through the content appears at the left edge of the window.
\fIFraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
'\" or an abbreviation of one of these, but we don't document that.
If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
\fInumber\fR average-width characters on the display; if it is
\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
If \fInumber\fR is negative then characters farther to the left
become visible; if it is positive then characters farther to the right
become visible.
.RE
.TP
\fIpathName \fByview \fIargs\fR
This command is used to query and change the vertical position of the
content in the widget's window. It can take any of the following
forms:
.RS
.TP
\fIpathName \fByview\fR
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the vertical span that is visible in the window.
For example, if the first element is .2 and the second element is .6,
20% of the widget's content is off-screen to the top, the middle 40% is visible
in the window, and 40% of the content is off-screen to the bottom.
These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
option.
.TP
\fIpathName \fByview\fR \fIindex\fR
Adjusts the view in the window so that the content given by \fIindex\fR
is displayed at the top edge of the window.
.TP
\fIpathName \fByview moveto\fI fraction\fR
Adjusts the view in the window so that the item \fIfraction\fR of the
way through the content appears at the top edge of the window.
\fIFraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fByview scroll \fInumber what\fR
This command shifts the view in the window up or down according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
'\" or an abbreviation of one of these, but we don't document that.
If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
\fInumber\fR average-width characters on the display; if it is
\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
If \fInumber\fR is negative then items farther to the top
become visible; if it is positive then items farther to the bottom
become visible.
.RE
.SH "WIDGET STATES" .SH "WIDGET STATES"
The widget state is a bitmap of independent state flags. The widget state is a bitmap of independent state flags.
Widget state flags include: Widget state flags include:

View File

@@ -73,6 +73,9 @@ to the screen containing \fIwindow\fR; otherwise they refer to the
screen of the application's main window. screen of the application's main window.
If no window in this application contains the point then an empty If no window in this application contains the point then an empty
string is returned. string is returned.
An empty string is also returned if the point lies in the title bar
or border of its highest containing toplevel in this application.
(Note that with some window managers the borders may be invisible.)
In selecting the containing window, children are given higher priority In selecting the containing window, children are given higher priority
than parents and among siblings the highest one in the stacking order is than parents and among siblings the highest one in the stacking order is
chosen. chosen.

View File

@@ -488,7 +488,13 @@ most modern window managers support. A \fBwm iconbitmap\fR may exist
simultaneously. It is recommended to use not more than 2 icons, placing simultaneously. It is recommended to use not more than 2 icons, placing
the larger icon first. the larger icon first.
.PP .PP
On Macintosh, this currently does nothing. On Macintosh, the first image called is loaded into an OSX-native icon
format, and becomes the application icon in dialogs, the Dock, and
other contexts. At the
script level the command will accept only the first image passed in the
parameters as support for multiple sizes/resolutions on macOS is outside Tk's
scope. Developers should use the largest icon they can support
(preferably 512 pixels) to ensure smooth rendering on the Mac.
.RE .RE
.TP .TP
\fBwm iconposition \fIwindow\fR ?\fIx y\fR? \fBwm iconposition \fIwindow\fR ?\fIx y\fR?
@@ -702,22 +708,23 @@ case the command returns an empty string. If \fIstring\fR is not
specified then the command returns the current title for the specified then the command returns the current title for the
\fIwindow\fR. The title for a window defaults to its name. \fIwindow\fR. The title for a window defaults to its name.
.TP .TP
\fBwm transient \fIwindow\fR ?\fImaster\fR? \fBwm transient \fIwindow\fR ?\fIcontainer\fR?
. .
If \fImaster\fR is specified, then the window manager is informed If \fIcontainer\fR is specified, then the window manager is informed that
that \fIwindow\fR is a transient window (e.g. pull-down menu) working \fIwindow\fR is a transient window (e.g. pull-down menu) working on
on behalf of \fImaster\fR (where \fImaster\fR is the behalf of \fIcontainer\fR (where \fIcontainer\fR is the path name for a
path name for a top-level window). If \fImaster\fR top-level window). If \fIcontainer\fR is specified as an empty string
is specified as an empty string then \fIwindow\fR is marked as not then \fIwindow\fR is marked as not being a transient window any more.
being a transient window any more. Otherwise the command Otherwise the command returns the path name of \fIwindow\fR's current
returns the path name of \fIwindow\fR's current master, or an container, or an empty string if \fIwindow\fR is not currently a
empty string if \fIwindow\fR is not currently a transient window. transient window. A transient window will mirror state changes in the
A transient window will mirror state changes in the master and container and inherit the state of the container when initially mapped. The
inherit the state of the master when initially mapped. It is an directed graph with an edge from each transient to its container must be
error to attempt to make a window a transient of itself. acyclic. In particular, it is an error to attempt to make a window a
The window manager may also decorate a transient window differently, removing transient of itself. The window manager may also decorate a transient
some features normally present (e.g., minimize and maximize buttons) though window differently, removing some features normally present (e.g.,
this is entirely at the discretion of the window manager. minimize and maximize buttons) though this is entirely at the
discretion of the window manager.
.TP .TP
\fBwm withdraw \fIwindow\fR \fBwm withdraw \fIwindow\fR
. .

File diff suppressed because it is too large Load Diff

View File

@@ -472,7 +472,7 @@ declare 116 {
Tk_Window Tk_IdToWindow(Display *display, Window window) Tk_Window Tk_IdToWindow(Display *display, Window window)
} }
declare 117 { declare 117 {
void Tk_ImageChanged(Tk_ImageMaster master, int x, int y, void Tk_ImageChanged(Tk_ImageMaster model, int x, int y,
int width, int height, int imageWidth, int imageHeight) int width, int height, int imageWidth, int imageHeight)
} }
declare 118 { declare 118 {
@@ -486,8 +486,8 @@ declare 120 {
int width, int height) int width, int height)
} }
declare 121 { declare 121 {
void Tk_MaintainGeometry(Tk_Window slave, void Tk_MaintainGeometry(Tk_Window window,
Tk_Window master, int x, int y, int width, int height) Tk_Window container, int x, int y, int width, int height)
} }
declare 122 { declare 122 {
Tk_Window Tk_MainWindow(Tcl_Interp *interp) Tk_Window Tk_MainWindow(Tcl_Interp *interp)
@@ -539,7 +539,7 @@ declare 136 {
CONST84_RETURN char *Tk_NameOfFont(Tk_Font font) CONST84_RETURN char *Tk_NameOfFont(Tk_Font font)
} }
declare 137 { declare 137 {
CONST84_RETURN char *Tk_NameOfImage(Tk_ImageMaster imageMaster) CONST84_RETURN char *Tk_NameOfImage(Tk_ImageMaster model)
} }
declare 138 { declare 138 {
CONST84_RETURN char *Tk_NameOfJoinStyle(int join) CONST84_RETURN char *Tk_NameOfJoinStyle(int join)
@@ -692,7 +692,7 @@ declare 180 {
void Tk_Ungrab(Tk_Window tkwin) void Tk_Ungrab(Tk_Window tkwin)
} }
declare 181 { declare 181 {
void Tk_UnmaintainGeometry(Tk_Window slave, Tk_Window master) void Tk_UnmaintainGeometry(Tk_Window window, Tk_Window container)
} }
declare 182 { declare 182 {
void Tk_UnmapWindow(Tk_Window tkwin) void Tk_UnmapWindow(Tk_Window tkwin)
@@ -1068,6 +1068,9 @@ declare 272 {
declare 273 { declare 273 {
void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr)
} }
declare 280 {
void TkUnusedStubEntry(void)
}
# Define the platform specific public Tk interface. These functions are # Define the platform specific public Tk interface. These functions are
# only available on the designated platform. # only available on the designated platform.
@@ -1139,6 +1142,20 @@ declare 9 aqua {
declare 10 aqua { declare 10 aqua {
int Tk_MacOSXIsAppInFront(void) int Tk_MacOSXIsAppInFront(void)
} }
declare 11 aqua {
Tk_Window Tk_MacOSXGetTkWindow(void *w)
}
declare 12 aqua {
void *Tk_MacOSXGetCGContextForDrawable(Drawable drawable)
}
# Replaces TkMacOSXDrawable
declare 13 aqua {
void *Tk_MacOSXGetNSWindowForDrawable(Drawable drawable)
}
declare 16 aqua {
void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width,
int height, int flags)
}
############################################################################## ##############################################################################

View File

@@ -75,10 +75,10 @@ extern "C" {
#define TK_MAJOR_VERSION 8 #define TK_MAJOR_VERSION 8
#define TK_MINOR_VERSION 6 #define TK_MINOR_VERSION 6
#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
#define TK_RELEASE_SERIAL 6 #define TK_RELEASE_SERIAL 11
#define TK_VERSION "8.6" #define TK_VERSION "8.6"
#define TK_PATCH_LEVEL "8.6.6" #define TK_PATCH_LEVEL "8.6.11"
/* /*
* A special definition used to allow this header file to be included from * A special definition used to allow this header file to be included from
@@ -92,13 +92,14 @@ extern "C" {
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifndef _XLIB_H #if !defined(_XLIB_H) && !defined(_X11_XLIB_H_)
# include <X11/Xlib.h> # include <X11/Xlib.h>
# ifdef MAC_OSX_TK # ifdef MAC_OSX_TK
# include <X11/X.h> # include <X11/X.h>
# endif # endif
#endif #endif
#ifdef __STDC__ #if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \
|| defined(__cplusplus) || defined(_MSC_VER) || defined(__ICC)
# include <stddef.h> # include <stddef.h>
#endif #endif
@@ -121,6 +122,7 @@ extern "C" {
* Dummy types that are used by clients: * Dummy types that are used by clients:
*/ */
#define Tk_ImageModel Tk_ImageMaster
typedef struct Tk_BindingTable_ *Tk_BindingTable; typedef struct Tk_BindingTable_ *Tk_BindingTable;
typedef struct Tk_Canvas_ *Tk_Canvas; typedef struct Tk_Canvas_ *Tk_Canvas;
typedef struct Tk_Cursor_ *Tk_Cursor; typedef struct Tk_Cursor_ *Tk_Cursor;
@@ -266,10 +268,10 @@ typedef struct Tk_ObjCustomOption {
* Computes number of bytes from beginning of structure to a given field. * Computes number of bytes from beginning of structure to a given field.
*/ */
#ifdef offsetof
#define Tk_Offset(type, field) ((int) offsetof(type, field)) #define Tk_Offset(type, field) ((int) offsetof(type, field))
#else /* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
#define Tk_Offset(type, field) ((int) ((char *) &((type *) 0)->field)) #ifndef offsetof
# define offsetof(type, field) ((size_t) ((char *) &((type *) 0)->field))
#endif #endif
/* /*
@@ -613,21 +615,22 @@ typedef struct Tk_ClassProcs {
* the geometry manager to carry out certain functions. * the geometry manager to carry out certain functions.
*/ */
#define Tk_GeomLostContentProc Tk_GeomLostSlaveProc
typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin); typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin);
typedef void (Tk_GeomLostSlaveProc) (ClientData clientData, Tk_Window tkwin); typedef void (Tk_GeomLostContentProc) (ClientData clientData, Tk_Window tkwin);
typedef struct Tk_GeomMgr { typedef struct Tk_GeomMgr {
const char *name; /* Name of the geometry manager (command used const char *name; /* Name of the geometry manager (command used
* to invoke it, or name of widget class that * to invoke it, or name of widget class that
* allows embedded widgets). */ * allows embedded widgets). */
Tk_GeomRequestProc *requestProc; Tk_GeomRequestProc *requestProc;
/* Procedure to invoke when a slave's /* Procedure to invoke when a content's
* requested geometry changes. */ * requested geometry changes. */
Tk_GeomLostSlaveProc *lostSlaveProc; Tk_GeomLostContentProc *lostSlaveProc;
/* Procedure to invoke when a slave is taken /* Procedure to invoke when content is taken
* away from one geometry manager by another. * away from one geometry manager by another.
* NULL means geometry manager doesn't care * NULL means geometry manager doesn't care
* when slaves are lost. */ * when content lost. */
} Tk_GeomMgr; } Tk_GeomMgr;
/* /*
@@ -676,7 +679,7 @@ typedef struct {
* request. */ * request. */
Display *display; /* Display the event was read from. */ Display *display; /* Display the event was read from. */
Window event; /* Window on which event was requested. */ Window event; /* Window on which event was requested. */
Window root; /* Root window that the event occured on. */ Window root; /* Root window that the event occurred on. */
Window subwindow; /* Child window. */ Window subwindow; /* Child window. */
Time time; /* Milliseconds. */ Time time; /* Milliseconds. */
int x, y; /* Pointer x, y coordinates in event int x, y; /* Pointer x, y coordinates in event
@@ -813,7 +816,11 @@ typedef struct Tk_FakeWin {
int internalBorderBottom; int internalBorderBottom;
int minReqWidth; int minReqWidth;
int minReqHeight; int minReqHeight;
char *dummy20; /* geometryMaster */ #ifdef TK_USE_INPUT_METHODS
int dummy20;
#endif /* TK_USE_INPUT_METHODS */
char *dummy21; /* geomMgrName */
Tk_Window dummy22; /* maintainerPtr */
} Tk_FakeWin; } Tk_FakeWin;
/* /*
@@ -879,6 +886,10 @@ typedef struct Tk_FakeWin {
* window. * window.
* TK_WM_MANAGEABLE 1 marks a window as capable of being converted * TK_WM_MANAGEABLE 1 marks a window as capable of being converted
* into a toplevel using [wm manage]. * into a toplevel using [wm manage].
* TK_CAN_INPUT_TEXT 1 means that this window accepts text input.
* Used on macOS to indicate that key events can be
* processed with the NSTextInputClient protocol.
* Not currently accessible through the public API.
*/ */
#define TK_MAPPED 1 #define TK_MAPPED 1
@@ -892,6 +903,7 @@ typedef struct Tk_FakeWin {
#define TK_EMBEDDED 0x100 #define TK_EMBEDDED 0x100
#define TK_CONTAINER 0x200 #define TK_CONTAINER 0x200
#define TK_BOTH_HALVES 0x400 #define TK_BOTH_HALVES 0x400
#define TK_WRAPPER 0x1000 #define TK_WRAPPER 0x1000
#define TK_REPARENTED 0x2000 #define TK_REPARENTED 0x2000
#define TK_ANONYMOUS_WINDOW 0x4000 #define TK_ANONYMOUS_WINDOW 0x4000
@@ -900,6 +912,7 @@ typedef struct Tk_FakeWin {
#define TK_TOP_HIERARCHY 0x20000 #define TK_TOP_HIERARCHY 0x20000
#define TK_PROP_PROPCHANGE 0x40000 #define TK_PROP_PROPCHANGE 0x40000
#define TK_WM_MANAGEABLE 0x80000 #define TK_WM_MANAGEABLE 0x80000
#define TK_CAN_INPUT_TEXT 0x100000
/* /*
*---------------------------------------------------------------------- *----------------------------------------------------------------------
@@ -1171,7 +1184,7 @@ typedef struct Tk_TSOffset {
} Tk_TSOffset; } Tk_TSOffset;
/* /*
* Bit fields in Tk_Offset->flags: * Bit fields in Tk_TSOffset->flags:
*/ */
#define TK_OFFSET_INDEX 1 #define TK_OFFSET_INDEX 1
@@ -1217,19 +1230,19 @@ typedef struct Tk_Outline {
typedef struct Tk_ImageType Tk_ImageType; typedef struct Tk_ImageType Tk_ImageType;
#ifdef USE_OLD_IMAGE #ifdef USE_OLD_IMAGE
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc, typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
char **argv, Tk_ImageType *typePtr, Tk_ImageMaster master, char **argv, Tk_ImageType *typePtr, Tk_ImageMaster model,
ClientData *masterDataPtr); ClientData *clientDataPtr);
#else #else
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc, typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc,
Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster master, Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster model,
ClientData *masterDataPtr); ClientData *clientDataPtr);
#endif /* USE_OLD_IMAGE */ #endif /* USE_OLD_IMAGE */
typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData masterData); typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData clientData);
typedef void (Tk_ImageDisplayProc) (ClientData instanceData, Display *display, typedef void (Tk_ImageDisplayProc) (ClientData clientData, Display *display,
Drawable drawable, int imageX, int imageY, int width, int height, Drawable drawable, int imageX, int imageY, int width, int height,
int drawableX, int drawableY); int drawableX, int drawableY);
typedef void (Tk_ImageFreeProc) (ClientData instanceData, Display *display); typedef void (Tk_ImageFreeProc) (ClientData clientData, Display *display);
typedef void (Tk_ImageDeleteProc) (ClientData masterData); typedef void (Tk_ImageDeleteProc) (ClientData clientData);
typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y, typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y,
int width, int height, int imageWidth, int imageHeight); int width, int height, int imageWidth, int imageHeight);
typedef int (Tk_ImagePostscriptProc) (ClientData clientData, typedef int (Tk_ImagePostscriptProc) (ClientData clientData,

View File

@@ -90,7 +90,7 @@ Tk_Alloc3DBorderFromObj(
if (objPtr->typePtr != &tkBorderObjType) { if (objPtr->typePtr != &tkBorderObjType) {
InitBorderObj(objPtr); InitBorderObj(objPtr);
} }
borderPtr = objPtr->internalRep.twoPtrValue.ptr1; borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1;
/* /*
* If the object currently points to a TkBorder, see if it's the one we * If the object currently points to a TkBorder, see if it's the one we
@@ -127,7 +127,7 @@ Tk_Alloc3DBorderFromObj(
*/ */
if (borderPtr != NULL) { if (borderPtr != NULL) {
TkBorder *firstBorderPtr = Tcl_GetHashValue(borderPtr->hashPtr); TkBorder *firstBorderPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr);
FreeBorderObj(objPtr); FreeBorderObj(objPtr);
for (borderPtr = firstBorderPtr ; borderPtr != NULL; for (borderPtr = firstBorderPtr ; borderPtr != NULL;
@@ -200,7 +200,7 @@ Tk_Get3DBorder(
hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &isNew); hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &isNew);
if (!isNew) { if (!isNew) {
existingBorderPtr = Tcl_GetHashValue(hashPtr); existingBorderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr);
for (borderPtr = existingBorderPtr; borderPtr != NULL; for (borderPtr = existingBorderPtr; borderPtr != NULL;
borderPtr = borderPtr->nextPtr) { borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen) if ((Tk_Screen(tkwin) == borderPtr->screen)
@@ -236,9 +236,9 @@ Tk_Get3DBorder(
borderPtr->darkColorPtr = NULL; borderPtr->darkColorPtr = NULL;
borderPtr->lightColorPtr = NULL; borderPtr->lightColorPtr = NULL;
borderPtr->shadow = None; borderPtr->shadow = None;
borderPtr->bgGC = None; borderPtr->bgGC = NULL;
borderPtr->darkGC = None; borderPtr->darkGC = NULL;
borderPtr->lightGC = None; borderPtr->lightGC = NULL;
borderPtr->hashPtr = hashPtr; borderPtr->hashPtr = hashPtr;
borderPtr->nextPtr = existingBorderPtr; borderPtr->nextPtr = existingBorderPtr;
Tcl_SetHashValue(hashPtr, borderPtr); Tcl_SetHashValue(hashPtr, borderPtr);
@@ -374,7 +374,7 @@ Tk_3DBorderGC(
{ {
TkBorder * borderPtr = (TkBorder *) border; TkBorder * borderPtr = (TkBorder *) border;
if ((borderPtr->lightGC == None) && (which != TK_3D_FLAT_GC)) { if ((borderPtr->lightGC == NULL) && (which != TK_3D_FLAT_GC)) {
TkpGetShadows(borderPtr, tkwin); TkpGetShadows(borderPtr, tkwin);
} }
if (which == TK_3D_FLAT_GC) { if (which == TK_3D_FLAT_GC) {
@@ -391,7 +391,7 @@ Tk_3DBorderGC(
* compilers happy. * compilers happy.
*/ */
return (GC) None; return NULL;
} }
/* /*
@@ -420,12 +420,11 @@ Tk_Free3DBorder(
Display *display = DisplayOfScreen(borderPtr->screen); Display *display = DisplayOfScreen(borderPtr->screen);
TkBorder *prevPtr; TkBorder *prevPtr;
borderPtr->resourceRefCount--; if (borderPtr->resourceRefCount-- > 1) {
if (borderPtr->resourceRefCount > 0) {
return; return;
} }
prevPtr = Tcl_GetHashValue(borderPtr->hashPtr); prevPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr);
TkpFreeBorder(borderPtr); TkpFreeBorder(borderPtr);
if (borderPtr->bgColorPtr != NULL) { if (borderPtr->bgColorPtr != NULL) {
Tk_FreeColor(borderPtr->bgColorPtr); Tk_FreeColor(borderPtr->bgColorPtr);
@@ -439,13 +438,13 @@ Tk_Free3DBorder(
if (borderPtr->shadow != None) { if (borderPtr->shadow != None) {
Tk_FreeBitmap(display, borderPtr->shadow); Tk_FreeBitmap(display, borderPtr->shadow);
} }
if (borderPtr->bgGC != None) { if (borderPtr->bgGC != NULL) {
Tk_FreeGC(display, borderPtr->bgGC); Tk_FreeGC(display, borderPtr->bgGC);
} }
if (borderPtr->darkGC != None) { if (borderPtr->darkGC != NULL) {
Tk_FreeGC(display, borderPtr->darkGC); Tk_FreeGC(display, borderPtr->darkGC);
} }
if (borderPtr->lightGC != None) { if (borderPtr->lightGC != NULL) {
Tk_FreeGC(display, borderPtr->lightGC); Tk_FreeGC(display, borderPtr->lightGC);
} }
if (prevPtr == borderPtr) { if (prevPtr == borderPtr) {
@@ -527,7 +526,7 @@ static void
FreeBorderObj( FreeBorderObj(
Tcl_Obj *objPtr) /* The object we are releasing. */ Tcl_Obj *objPtr) /* The object we are releasing. */
{ {
TkBorder *borderPtr = objPtr->internalRep.twoPtrValue.ptr1; TkBorder *borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1;
if (borderPtr != NULL) { if (borderPtr != NULL) {
borderPtr->objRefCount--; borderPtr->objRefCount--;
@@ -562,7 +561,7 @@ DupBorderObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */ Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */ Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{ {
TkBorder *borderPtr = srcObjPtr->internalRep.twoPtrValue.ptr1; TkBorder *borderPtr = (TkBorder *)srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr; dupObjPtr->typePtr = srcObjPtr->typePtr;
dupObjPtr->internalRep.twoPtrValue.ptr1 = borderPtr; dupObjPtr->internalRep.twoPtrValue.ptr1 = borderPtr;
@@ -594,7 +593,7 @@ Tk_SetBackgroundFromBorder(
Tk_Window tkwin, /* Window whose background is to be set. */ Tk_Window tkwin, /* Window whose background is to be set. */
Tk_3DBorder border) /* Token for border. */ Tk_3DBorder border) /* Token for border. */
{ {
register TkBorder *borderPtr = (TkBorder *) border; TkBorder *borderPtr = (TkBorder *) border;
Tk_SetWindowBackground(tkwin, borderPtr->bgColorPtr->pixel); Tk_SetWindowBackground(tkwin, borderPtr->bgColorPtr->pixel);
} }
@@ -759,13 +758,13 @@ Tk_Draw3DPolygon(
{ {
XPoint poly[4], b1, b2, newB1, newB2; XPoint poly[4], b1, b2, newB1, newB2;
XPoint perp, c, shift1, shift2; /* Used for handling parallel lines. */ XPoint perp, c, shift1, shift2; /* Used for handling parallel lines. */
register XPoint *p1Ptr, *p2Ptr; XPoint *p1Ptr, *p2Ptr;
TkBorder *borderPtr = (TkBorder *) border; TkBorder *borderPtr = (TkBorder *) border;
GC gc; GC gc;
int i, lightOnLeft, dx, dy, parallel, pointsSeen; int i, lightOnLeft, dx, dy, parallel, pointsSeen;
Display *display = Tk_Display(tkwin); Display *display = Tk_Display(tkwin);
if (borderPtr->lightGC == None) { if (borderPtr->lightGC == NULL) {
TkpGetShadows(borderPtr, tkwin); TkpGetShadows(borderPtr, tkwin);
} }
@@ -956,7 +955,7 @@ Tk_Fill3DRectangle(
int relief) /* Indicates 3D effect: TK_RELIEF_FLAT, int relief) /* Indicates 3D effect: TK_RELIEF_FLAT,
* TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */ * TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */
{ {
register TkBorder *borderPtr = (TkBorder *) border; TkBorder *borderPtr = (TkBorder *) border;
int doubleBorder; int doubleBorder;
/* /*
@@ -1027,7 +1026,7 @@ Tk_Fill3DPolygon(
* TK_RELIEF_FLAT, TK_RELIEF_RAISED, or * TK_RELIEF_FLAT, TK_RELIEF_RAISED, or
* TK_RELIEF_SUNKEN. */ * TK_RELIEF_SUNKEN. */
{ {
register TkBorder *borderPtr = (TkBorder *) border; TkBorder *borderPtr = (TkBorder *) border;
XFillPolygon(Tk_Display(tkwin), drawable, borderPtr->bgGC, XFillPolygon(Tk_Display(tkwin), drawable, borderPtr->bgGC,
pointPtr, numPoints, Complex, CoordModeOrigin); pointPtr, numPoints, Complex, CoordModeOrigin);
@@ -1253,7 +1252,7 @@ Tk_Get3DBorderFromObj(
* cached in the internal representation of the Tcl_Obj. Check it out... * cached in the internal representation of the Tcl_Obj. Check it out...
*/ */
borderPtr = objPtr->internalRep.twoPtrValue.ptr1; borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1;
if ((borderPtr != NULL) if ((borderPtr != NULL)
&& (borderPtr->resourceRefCount > 0) && (borderPtr->resourceRefCount > 0)
&& (Tk_Screen(tkwin) == borderPtr->screen) && (Tk_Screen(tkwin) == borderPtr->screen)
@@ -1281,7 +1280,7 @@ Tk_Get3DBorderFromObj(
if (hashPtr == NULL) { if (hashPtr == NULL) {
goto error; goto error;
} }
for (borderPtr = Tcl_GetHashValue(hashPtr); borderPtr != NULL; for (borderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr); borderPtr != NULL;
borderPtr = borderPtr->nextPtr) { borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen) if ((Tk_Screen(tkwin) == borderPtr->screen)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) { && (Tk_Colormap(tkwin) == borderPtr->colormap)) {
@@ -1315,7 +1314,7 @@ Tk_Get3DBorderFromObj(
* *
* Side effects: * Side effects:
* If no error occurs, a blank internal format for a border value is * If no error occurs, a blank internal format for a border value is
* intialized. The final form cannot be done without a Tk_Window. * initialized. The final form cannot be done without a Tk_Window.
* *
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
@@ -1371,7 +1370,7 @@ TkDebugBorder(
resultPtr = Tcl_NewObj(); resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->borderTable, name); hashPtr = Tcl_FindHashEntry(&dispPtr->borderTable, name);
if (hashPtr != NULL) { if (hashPtr != NULL) {
TkBorder *borderPtr = Tcl_GetHashValue(hashPtr); TkBorder *borderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr);
if (borderPtr == NULL) { if (borderPtr == NULL) {
Tcl_Panic("TkDebugBorder found empty hash table entry"); Tcl_Panic("TkDebugBorder found empty hash table entry");

View File

@@ -54,10 +54,10 @@ typedef struct TkBorder {
GC bgGC; /* Used (if necessary) to draw areas in the GC bgGC; /* Used (if necessary) to draw areas in the
* background color. */ * background color. */
GC darkGC; /* Used to draw darker parts of the border. GC darkGC; /* Used to draw darker parts of the border.
* None means the shadow colors haven't been * NULL means the shadow colors haven't been
* allocated yet.*/ * allocated yet.*/
GC lightGC; /* Used to draw lighter parts of the border. GC lightGC; /* Used to draw lighter parts of the border.
* None means the shadow colors haven't been * NULL means the shadow colors haven't been
* allocated yet. */ * allocated yet. */
Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to
* delete structure). */ * delete structure). */

610
generic/tkArray.h Normal file
View File

@@ -0,0 +1,610 @@
/*
* tkArray.h --
*
* An array is a sequence of items, stored in a contiguous memory region.
* Random access to any item is very fast. New items can be either appended
* or prepended. An array may be traversed in the forward or backward direction.
*
* Copyright (c) 2018-2019 by Gregor Cramer.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
/*
* Note that this file will not be included in header files, it is the purpose
* of this file to be included in source files only. Thus we are not using the
* prefix "Tk_" here for functions, because all the functions have private scope.
*/
/*
* -------------------------------------------------------------------------------
* Use the array in the following way:
* -------------------------------------------------------------------------------
* typedef struct { int key, value; } Pair;
* TK_PTR_ARRAY_DEFINE(MyArray, Pair);
* MyArray *arr = NULL;
* if (MyArray_IsEmpty(arr)) {
* MyArray_Append(&arr, MakePair(1, 2));
* MyArray_Append(&arr, MakePair(2, 3));
* for (i = 0; i < MyArray_Size(arr); ++i) {
* Pair *p = MyArray_Get(arr, i);
* printf("%d -> %d\n", p->key, p->value);
* ckfree(p);
* }
* MyArray_Free(&arr);
* assert(arr == NULL);
* }
* -------------------------------------------------------------------------------
* Or with aggregated elements:
* -------------------------------------------------------------------------------
* typedef struct { int key, value; } Pair;
* TK_ARRAY_DEFINE(MyArray, Pair);
* Pair p1 = { 1, 2 };
* Pair p2 = { 2, 3 };
* MyArray *arr = NULL;
* if (MyArray_IsEmpty(arr)) {
* MyArray_Append(&arr, p1);
* MyArray_Append(&arr, p2);
* for (i = 0; i < MyArray_Size(arr); ++i) {
* const Pair *p = MyArray_Get(arr, i);
* printf("%d -> %d\n", p->key, p->value);
* }
* MyArray_Free(&arr);
* assert(arr == NULL);
* }
* -------------------------------------------------------------------------------
*/
/*************************************************************************/
/*
* Two array types will be provided:
* Use TK_ARRAY_DEFINE if your array is aggregating the elements. Use
* TK_PTR_ARRAY_DEFINE if your array contains pointers to elements. But
* in latter case the array is not responsible for the lifetime of the
* elements.
*/
/*************************************************************************/
/*
* Array_ElemSize: Returns the memory size for one array element.
*/
/*************************************************************************/
/*
* Array_BufferSize: Returns the memory size for given number of elements.
*/
/*************************************************************************/
/*
* Array_IsEmpty: Array is empty?
*/
/*************************************************************************/
/*
* Array_Size: Number of elements in array.
*/
/*************************************************************************/
/*
* Array_Capacity: Capacity of given array. This is the maximal number of
* elements fitting into current array memory without resizing the buffer.
*/
/*************************************************************************/
/*
* Array_SetSize: Set array size, new size must not exceed the capacity of
* the array. This function has to be used with care when increasing the
* array size.
*/
/*************************************************************************/
/*
* Array_First: Returns position of first element in array. Given array
* may be NULL.
*/
/*************************************************************************/
/*
* Array_Last: Returns position after last element in array. Given array
* may be empty.
*/
/*************************************************************************/
/*
* Array_Front: Returns first element in array. Given array must not be
* empty.
*/
/*************************************************************************/
/*
* Array_Back: Returns last element in array. Given array must not be
* empty.
*/
/*************************************************************************/
/*
* Array_Resize: Resize buffer of array for given number of elements. The
* array may grow or shrink. Note that this function is not initializing
* the increased buffer.
*/
/*************************************************************************/
/*
* Array_ResizeAndClear: Resize buffer of array for given number of
* elements. The array may grow or shrink. The increased memory will be
* filled with zeroes.
*/
/*************************************************************************/
/*
* Array_Clear: Fill specified range with zeroes.
*/
/*************************************************************************/
/*
* Array_Free: Resize array to size zero. This function will release the
* array buffer.
*/
/*************************************************************************/
/*
* Array_Append: Insert given element after end of array.
*/
/*************************************************************************/
/*
* Array_PopBack: Shrink array by one element. Given array must not be
* empty.
*/
/*************************************************************************/
/*
* Array_Get: Random access to array element at given position. The given
* index must not exceed current array size.
*/
/*************************************************************************/
/*
* Array_Set: Replace array element at given position with new value. The
* given index must not exceed current array size.
*/
/*************************************************************************/
/*
* Array_Find: Return index position of element which matches given
* argument. If not found then -1 will be returned.
*/
/*************************************************************************/
#ifndef TK_ARRAY_DEFINED
#define TK_ARRAY_DEFINED
#include "tkInt.h"
#if defined(__GNUC__) || defined(__clang__)
# define __TK_ARRAY_UNUSED __attribute__((unused))
#else
# define __TK_ARRAY_UNUSED
#endif
#define TK_ARRAY_DEFINE(AT, ElemType) /* AT = type of array */ \
/* ------------------------------------------------------------------------- */ \
typedef struct AT { \
size_t size; \
size_t capacity; \
ElemType buf[1]; \
} AT; \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Init(AT *arr) \
{ \
assert(arr); \
arr->size = 0; \
arr->capacity = 0; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_ElemSize() \
{ \
return sizeof(ElemType); \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_BufferSize(size_t numElems) \
{ \
return numElems*sizeof(ElemType); \
} \
\
__TK_ARRAY_UNUSED \
static int \
AT##_IsEmpty(const AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return !arr || arr->size == 0u; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_Size(const AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->size : 0u; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_Capacity(const AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->capacity : 0u; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_First(AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->buf : NULL; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Last(AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->buf + arr->size : NULL; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Front(AT *arr) \
{ \
assert(arr); \
assert(arr->size != 0xdeadbeef); \
assert(!AT##_IsEmpty(arr)); \
return &arr->buf[0]; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Back(AT *arr) \
{ \
assert(arr); \
assert(arr->size != 0xdeadbeef); \
assert(!AT##_IsEmpty(arr)); \
return &arr->buf[arr->size - 1]; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Resize(AT **arrp, size_t newSize) \
{ \
assert(arrp); \
assert(!*arrp || (*arrp)->size != 0xdeadbeef); \
if (newSize == 0) { \
assert(!*arrp || ((*arrp)->size = 0xdeadbeef)); \
ckfree(*arrp); \
*arrp = NULL; \
} else { \
int init = *arrp == NULL; \
size_t memSize = AT##_BufferSize(newSize - 1) + sizeof(AT); \
*arrp = ckrealloc(*arrp, memSize); \
if (init) { \
(*arrp)->size = 0; \
} else if (newSize < (*arrp)->size) { \
(*arrp)->size = newSize; \
} \
(*arrp)->capacity = newSize; \
} \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Clear(AT *arr, size_t from, size_t to) \
{ \
assert(arr); \
assert(arr->size != 0xdeadbeef); \
assert(to <= AT##_Capacity(arr)); \
assert(from <= to); \
memset(arr->buf + from, 0, AT##_BufferSize(to - from)); \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_ResizeAndClear(AT **arrp, size_t newSize) \
{ \
size_t oldCapacity; \
assert(arrp); \
oldCapacity = *arrp ? (*arrp)->capacity : 0; \
AT##_Resize(arrp, newSize); \
if (newSize > oldCapacity) { \
AT##_Clear(*arrp, oldCapacity, newSize); \
} \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_SetSize(AT *arr, size_t newSize) \
{ \
assert(newSize <= AT##_Capacity(arr)); \
assert(!arr || arr->size != 0xdeadbeef); \
if (arr) { \
arr->size = newSize; \
} \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Append(AT **arrp, ElemType *elem) \
{ \
assert(arrp); \
if (!*arrp) { \
AT##_Resize(arrp, 1); \
} else if ((*arrp)->size == (*arrp)->capacity) { \
AT##_Resize(arrp, (*arrp)->capacity + ((*arrp)->capacity + 1)/2); \
} \
(*arrp)->buf[(*arrp)->size++] = *elem; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_PopBack(AT *arr) \
{ \
assert(!AT##_IsEmpty(arr)); \
return arr->size -= 1; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Get(const AT *arr, size_t at) \
{ \
assert(arr); \
assert(at < AT##_Size(arr)); \
return (ElemType *) &arr->buf[at]; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Set(AT *arr, size_t at, ElemType *elem) \
{ \
assert(arr); \
assert(at < AT##_Size(arr)); \
arr->buf[at] = *elem; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Free(AT **arrp) \
{ \
AT##_Resize(arrp, 0); \
} \
\
__TK_ARRAY_UNUSED \
static int \
AT##_Find(const AT *arr, const ElemType *elem) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
if (arr) { \
const ElemType *buf = arr->buf; \
size_t i; \
for (i = 0; i < arr->size; ++i) { \
if (memcmp(&buf[i], elem, sizeof(ElemType)) == 0) { \
return (int) i; \
} \
} \
} \
return -1; \
} \
\
__TK_ARRAY_UNUSED \
static int \
AT##_Contains(const AT *arr, const ElemType *elem) \
{ \
return AT##_Find(arr, elem) != -1; \
} \
/* ------------------------------------------------------------------------- */
#define TK_PTR_ARRAY_DEFINE(AT, ElemType) /* AT = type of array */ \
/* ------------------------------------------------------------------------- */ \
typedef struct AT { \
size_t size; \
size_t capacity; \
ElemType *buf[1]; \
} AT; \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_ElemSize() \
{ \
return sizeof(ElemType); \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_BufferSize(size_t numElems) \
{ \
return numElems*sizeof(ElemType *); \
} \
\
__TK_ARRAY_UNUSED \
static int \
AT##_IsEmpty(const AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return !arr || arr->size == 0; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType ** \
AT##_First(AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->buf : NULL; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType ** \
AT##_Last(AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->buf + arr->size : NULL; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Front(AT *arr) \
{ \
assert(arr); \
assert(arr->size != 0xdeadbeef); \
assert(!AT##_IsEmpty(arr)); \
return arr->buf[0]; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Back(AT *arr) \
{ \
assert(arr); \
assert(arr->size != 0xdeadbeef); \
assert(!AT##_IsEmpty(arr)); \
return arr->buf[arr->size - 1]; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_Size(const AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->size : 0; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_Capacity(const AT *arr) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
return arr ? arr->capacity : 0; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Resize(AT **arrp, size_t newCapacity) \
{ \
assert(arrp); \
assert(!*arrp || (*arrp)->size != 0xdeadbeef); \
if (newCapacity == 0) { \
assert(!*arrp || ((*arrp)->size = 0xdeadbeef)); \
ckfree(*arrp); \
*arrp = NULL; \
} else { \
int init = *arrp == NULL; \
size_t memSize = AT##_BufferSize(newCapacity - 1) + sizeof(AT); \
*arrp = ckrealloc(*arrp, memSize); \
if (init) { \
(*arrp)->size = 0; \
} else if (newCapacity < (*arrp)->size) { \
(*arrp)->size = newCapacity; \
} \
(*arrp)->capacity = newCapacity; \
} \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Clear(AT *arr, size_t from, size_t to) \
{ \
assert(arr); \
assert(arr->size != 0xdeadbeef); \
assert(to <= AT##_Capacity(arr)); \
assert(from <= to); \
memset(arr->buf + from, 0, AT##_BufferSize(to - from)); \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_ResizeAndClear(AT **arrp, size_t newCapacity) \
{ \
size_t oldCapacity; \
assert(arrp); \
oldCapacity = *arrp ? (*arrp)->capacity : 0; \
AT##_Resize(arrp, newCapacity); \
if (newCapacity > oldCapacity) { \
AT##_Clear(*arrp, oldCapacity, newCapacity); \
} \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_SetSize(AT *arr, size_t newSize) \
{ \
assert(arr); \
assert(newSize <= AT##_Capacity(arr)); \
arr->size = newSize; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Append(AT **arrp, ElemType *elem) \
{ \
assert(arrp); \
if (!*arrp) { \
AT##_Resize(arrp, 1); \
} else if ((*arrp)->size == (*arrp)->capacity) { \
AT##_Resize(arrp, (*arrp)->capacity + ((*arrp)->capacity + 1)/2); \
} \
(*arrp)->buf[(*arrp)->size++] = elem; \
} \
\
__TK_ARRAY_UNUSED \
static size_t \
AT##_PopBack(AT *arr) \
{ \
assert(!AT##_IsEmpty(arr)); \
return arr->size -= 1; \
} \
\
__TK_ARRAY_UNUSED \
static ElemType * \
AT##_Get(const AT *arr, size_t at) \
{ \
assert(arr); \
assert(at < AT##_Size(arr)); \
return arr->buf[at]; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Set(AT *arr, size_t at, ElemType *elem) \
{ \
assert(arr); \
assert(at < AT##_Size(arr)); \
arr->buf[at] = elem; \
} \
\
__TK_ARRAY_UNUSED \
static void \
AT##_Free(AT **arrp) \
{ \
AT##_Resize(arrp, 0); \
} \
\
__TK_ARRAY_UNUSED \
static int \
AT##_Find(const AT *arr, const ElemType *elem) \
{ \
assert(!arr || arr->size != 0xdeadbeef); \
if (arr) { \
ElemType *const *buf = arr->buf; \
size_t i; \
for (i = 0; i < arr->size; ++i) { \
if (buf[i] == elem) { \
return (int) i; \
} \
} \
} \
return -1; \
} \
\
__TK_ARRAY_UNUSED \
static int \
AT##_Contains(const AT *arr, const ElemType *elem) \
{ \
return AT##_Find(arr, elem) != -1; \
} \
/* ------------------------------------------------------------------------- */
#endif /* TK_ARRAY_DEFINED */
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 105
* End:
* vi:set ts=8 sw=4:
*/

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,7 @@ typedef struct {
int width, height; /* Dimensions of bitmap. */ int width, height; /* Dimensions of bitmap. */
} DataKey; } DataKey;
typedef struct ThreadSpecificData { typedef struct {
int initialized; /* 0 means table below needs initializing. */ int initialized; /* 0 means table below needs initializing. */
Tcl_HashTable predefBitmapTable; Tcl_HashTable predefBitmapTable;
/* Hash table created by Tk_DefineBitmap to /* Hash table created by Tk_DefineBitmap to

View File

@@ -17,16 +17,14 @@
#include "default.h" #include "default.h"
/* /*
* Things about the busy system that may be configured. Note that currently on * Things about the busy system that may be configured. Note that on some
* OSX/Aqua, that's nothing at all. * platforms this may or may not have an effect.
*/ */
static const Tk_OptionSpec busyOptionSpecs[] = { static const Tk_OptionSpec busyOptionSpecs[] = {
#ifndef MAC_OSX_TK
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_BUSY_CURSOR, -1, Tk_Offset(Busy, cursor), DEF_BUSY_CURSOR, -1, Tk_Offset(Busy, cursor),
TK_OPTION_NULL_OK, 0, 0}, TK_OPTION_NULL_OK, 0, 0},
#endif
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
}; };
@@ -56,7 +54,7 @@ static void MakeTransparentWindowExist(Tk_Window tkwin,
Window parent); Window parent);
static inline Tk_Window NextChild(Tk_Window tkwin); static inline Tk_Window NextChild(Tk_Window tkwin);
static void RefWinEventProc(ClientData clientData, static void RefWinEventProc(ClientData clientData,
register XEvent *eventPtr); XEvent *eventPtr);
static inline void SetWindowInstanceData(Tk_Window tkwin, static inline void SetWindowInstanceData(Tk_Window tkwin,
ClientData instanceData); ClientData instanceData);
@@ -124,13 +122,12 @@ SetWindowInstanceData(
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
/* ARGSUSED */
static void static void
BusyCustodyProc( BusyCustodyProc(
ClientData clientData, /* Information about the busy window. */ ClientData clientData, /* Information about the busy window. */
Tk_Window tkwin) /* Not used. */ TCL_UNUSED(Tk_Window)) /* Not used. */
{ {
Busy *busyPtr = clientData; Busy *busyPtr = (Busy *)clientData;
Tk_DeleteEventHandler(busyPtr->tkBusy, StructureNotifyMask, BusyEventProc, Tk_DeleteEventHandler(busyPtr->tkBusy, StructureNotifyMask, BusyEventProc,
busyPtr); busyPtr);
@@ -158,12 +155,11 @@ BusyCustodyProc(
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
/* ARGSUSED */
static void static void
BusyGeometryProc( BusyGeometryProc(
ClientData clientData, /* Information about window that got new TCL_UNUSED(void *), /* Information about window that got new
* preferred geometry. */ * preferred geometry. */
Tk_Window tkwin) /* Other Tk-related information about the TCL_UNUSED(Tk_Window)) /* Other Tk-related information about the
* window. */ * window. */
{ {
/* Should never get here */ /* Should never get here */
@@ -251,9 +247,9 @@ DoConfigureNotify(
static void static void
RefWinEventProc( RefWinEventProc(
ClientData clientData, /* Busy window record */ ClientData clientData, /* Busy window record */
register XEvent *eventPtr) /* Event which triggered call to routine */ XEvent *eventPtr) /* Event which triggered call to routine */
{ {
register Busy *busyPtr = clientData; Busy *busyPtr = (Busy *)clientData;
switch (eventPtr->type) { switch (eventPtr->type) {
case ReparentNotify: case ReparentNotify:
@@ -335,7 +331,7 @@ static void
DestroyBusy( DestroyBusy(
void *data) /* Busy window structure record */ void *data) /* Busy window structure record */
{ {
register Busy *busyPtr = data; Busy *busyPtr = (Busy *)data;
if (busyPtr->hashPtr != NULL) { if (busyPtr->hashPtr != NULL) {
Tcl_DeleteHashEntry(busyPtr->hashPtr); Tcl_DeleteHashEntry(busyPtr->hashPtr);
@@ -379,7 +375,7 @@ BusyEventProc(
ClientData clientData, /* Busy window record */ ClientData clientData, /* Busy window record */
XEvent *eventPtr) /* Event which triggered call to routine */ XEvent *eventPtr) /* Event which triggered call to routine */
{ {
Busy *busyPtr = clientData; Busy *busyPtr = (Busy *)clientData;
if (eventPtr->type == DestroyNotify) { if (eventPtr->type == DestroyNotify) {
busyPtr->tkBusy = NULL; busyPtr->tkBusy = NULL;
@@ -521,17 +517,18 @@ CreateBusy(
Tk_Window tkRef) /* Window hosting the busy window */ Tk_Window tkRef) /* Window hosting the busy window */
{ {
Busy *busyPtr; Busy *busyPtr;
int length, x, y; size_t length;
int x, y;
const char *fmt; const char *fmt;
char *name; char *name;
Tk_Window tkBusy, tkChild, tkParent; Tk_Window tkBusy, tkChild, tkParent;
Window parent; Window parent;
Tk_FakeWin *winPtr; Tk_FakeWin *winPtr;
busyPtr = ckalloc(sizeof(Busy)); busyPtr = (Busy *)ckalloc(sizeof(Busy));
x = y = 0; x = y = 0;
length = strlen(Tk_Name(tkRef)); length = strlen(Tk_Name(tkRef));
name = ckalloc(length + 6); name = (char *)ckalloc(length + 6);
if (Tk_IsTopLevel(tkRef)) { if (Tk_IsTopLevel(tkRef)) {
fmt = "_Busy"; /* Child */ fmt = "_Busy"; /* Child */
tkParent = tkRef; tkParent = tkRef;
@@ -570,7 +567,7 @@ CreateBusy(
busyPtr->height = Tk_Height(tkRef); busyPtr->height = Tk_Height(tkRef);
busyPtr->x = Tk_X(tkRef); busyPtr->x = Tk_X(tkRef);
busyPtr->y = Tk_Y(tkRef); busyPtr->y = Tk_Y(tkRef);
busyPtr->cursor = None; busyPtr->cursor = NULL;
Tk_SetClass(tkBusy, "Busy"); Tk_SetClass(tkBusy, "Busy");
busyPtr->optionTable = Tk_CreateOptionTable(interp, busyOptionSpecs); busyPtr->optionTable = Tk_CreateOptionTable(interp, busyOptionSpecs);
if (Tk_InitOptions(interp, (char *) busyPtr, busyPtr->optionTable, if (Tk_InitOptions(interp, (char *) busyPtr, busyPtr->optionTable,
@@ -600,7 +597,7 @@ CreateBusy(
*/ */
Tk_ManageGeometry(tkBusy, &busyMgrInfo, busyPtr); Tk_ManageGeometry(tkBusy, &busyMgrInfo, busyPtr);
if (busyPtr->cursor != None) { if (busyPtr->cursor != NULL) {
Tk_DefineCursor(tkBusy, busyPtr->cursor); Tk_DefineCursor(tkBusy, busyPtr->cursor);
} }
@@ -645,7 +642,7 @@ ConfigureBusy(
return TCL_ERROR; return TCL_ERROR;
} }
if (busyPtr->cursor != oldCursor) { if (busyPtr->cursor != oldCursor) {
if (busyPtr->cursor == None) { if (busyPtr->cursor == NULL) {
Tk_UndefineCursor(busyPtr->tkBusy); Tk_UndefineCursor(busyPtr->tkBusy);
} else { } else {
Tk_DefineCursor(busyPtr->tkBusy, busyPtr->cursor); Tk_DefineCursor(busyPtr->tkBusy, busyPtr->cursor);
@@ -697,7 +694,7 @@ GetBusy(
Tcl_GetString(windowObj), NULL); Tcl_GetString(windowObj), NULL);
return NULL; return NULL;
} }
return Tcl_GetHashValue(hPtr); return (Busy *)Tcl_GetHashValue(hPtr);
} }
/* /*
@@ -747,7 +744,7 @@ HoldBusy(
Tcl_SetHashValue(hPtr, busyPtr); Tcl_SetHashValue(hPtr, busyPtr);
busyPtr->hashPtr = hPtr; busyPtr->hashPtr = hPtr;
} else { } else {
busyPtr = Tcl_GetHashValue(hPtr); busyPtr = (Busy *)Tcl_GetHashValue(hPtr);
} }
busyPtr->tablePtr = busyTablePtr; busyPtr->tablePtr = busyTablePtr;
@@ -790,7 +787,7 @@ Tk_BusyObjCmd(
int objc, /* Number of arguments. */ int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */ Tcl_Obj *const objv[]) /* Argument objects. */
{ {
Tk_Window tkwin = clientData; Tk_Window tkwin = (Tk_Window)clientData;
Tcl_HashTable *busyTablePtr = &((TkWindow *) tkwin)->mainPtr->busyTable; Tcl_HashTable *busyTablePtr = &((TkWindow *) tkwin)->mainPtr->busyTable;
Busy *busyPtr; Busy *busyPtr;
Tcl_Obj *objPtr; Tcl_Obj *objPtr;
@@ -856,7 +853,7 @@ Tk_BusyObjCmd(
} }
Tcl_Preserve(busyPtr); Tcl_Preserve(busyPtr);
if (objc <= 4) { if (objc <= 4) {
objPtr = Tk_GetOptionInfo(interp, (char *) busyPtr, objPtr = Tk_GetOptionInfo(interp, (char *)busyPtr,
busyPtr->optionTable, (objc == 4) ? objv[3] : NULL, busyPtr->optionTable, (objc == 4) ? objv[3] : NULL,
busyPtr->tkBusy); busyPtr->tkBusy);
if (objPtr == NULL) { if (objPtr == NULL) {
@@ -878,9 +875,9 @@ Tk_BusyObjCmd(
objPtr = Tcl_NewObj(); objPtr = Tcl_NewObj();
for (hPtr = Tcl_FirstHashEntry(busyTablePtr, &cursor); hPtr != NULL; for (hPtr = Tcl_FirstHashEntry(busyTablePtr, &cursor); hPtr != NULL;
hPtr = Tcl_NextHashEntry(&cursor)) { hPtr = Tcl_NextHashEntry(&cursor)) {
busyPtr = Tcl_GetHashValue(hPtr); busyPtr = (Busy *)Tcl_GetHashValue(hPtr);
if (pattern == NULL || if (pattern == NULL ||
Tcl_StringMatch(Tk_PathName(busyPtr->tkRef), pattern)) { Tcl_StringCaseMatch(Tk_PathName(busyPtr->tkRef), pattern, 0)) {
Tcl_ListObjAppendElement(interp, objPtr, Tcl_ListObjAppendElement(interp, objPtr,
TkNewWindowObj(busyPtr->tkRef)); TkNewWindowObj(busyPtr->tkRef));
} }

View File

@@ -16,7 +16,7 @@
#include "tkButton.h" #include "tkButton.h"
#include "default.h" #include "default.h"
typedef struct ThreadSpecificData { typedef struct {
int defaultsInitialized; int defaultsInitialized;
} ThreadSpecificData; } ThreadSpecificData;
static Tcl_ThreadDataKey dataKey; static Tcl_ThreadDataKey dataKey;
@@ -710,12 +710,12 @@ ButtonCreate(
butPtr->normalFg = NULL; butPtr->normalFg = NULL;
butPtr->activeFg = NULL; butPtr->activeFg = NULL;
butPtr->disabledFg = NULL; butPtr->disabledFg = NULL;
butPtr->normalTextGC = None; butPtr->normalTextGC = NULL;
butPtr->activeTextGC = None; butPtr->activeTextGC = NULL;
butPtr->disabledGC = None; butPtr->disabledGC = NULL;
butPtr->stippleGC = None; butPtr->stippleGC = NULL;
butPtr->gray = None; butPtr->gray = None;
butPtr->copyGC = None; butPtr->copyGC = NULL;
butPtr->widthPtr = NULL; butPtr->widthPtr = NULL;
butPtr->width = 0; butPtr->width = 0;
butPtr->heightPtr = NULL; butPtr->heightPtr = NULL;
@@ -740,7 +740,7 @@ ButtonCreate(
butPtr->onValuePtr = NULL; butPtr->onValuePtr = NULL;
butPtr->offValuePtr = NULL; butPtr->offValuePtr = NULL;
butPtr->tristateValuePtr = NULL; butPtr->tristateValuePtr = NULL;
butPtr->cursor = None; butPtr->cursor = NULL;
butPtr->takeFocusPtr = NULL; butPtr->takeFocusPtr = NULL;
butPtr->commandPtr = NULL; butPtr->commandPtr = NULL;
butPtr->flags = 0; butPtr->flags = 0;
@@ -878,8 +878,14 @@ ButtonWidgetObjCmd(
*/ */
Tcl_CancelIdleCall(TkpDisplayButton, butPtr); Tcl_CancelIdleCall(TkpDisplayButton, butPtr);
XFlush(butPtr->display); (void)XFlush(butPtr->display);
#ifndef MAC_OSX_TK
/*
* On the mac you can not sleep in a display proc, and the
* flash command doesn't do anything anyway.
*/
Tcl_Sleep(50); Tcl_Sleep(50);
#endif
} }
} }
break; break;
@@ -975,22 +981,22 @@ DestroyButton(
if (butPtr->tristateImage != NULL) { if (butPtr->tristateImage != NULL) {
Tk_FreeImage(butPtr->tristateImage); Tk_FreeImage(butPtr->tristateImage);
} }
if (butPtr->normalTextGC != None) { if (butPtr->normalTextGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->normalTextGC); Tk_FreeGC(butPtr->display, butPtr->normalTextGC);
} }
if (butPtr->activeTextGC != None) { if (butPtr->activeTextGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->activeTextGC); Tk_FreeGC(butPtr->display, butPtr->activeTextGC);
} }
if (butPtr->disabledGC != None) { if (butPtr->disabledGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->disabledGC); Tk_FreeGC(butPtr->display, butPtr->disabledGC);
} }
if (butPtr->stippleGC != None) { if (butPtr->stippleGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->stippleGC); Tk_FreeGC(butPtr->display, butPtr->stippleGC);
} }
if (butPtr->gray != None) { if (butPtr->gray != None) {
Tk_FreeBitmap(butPtr->display, butPtr->gray); Tk_FreeBitmap(butPtr->display, butPtr->gray);
} }
if (butPtr->copyGC != None) { if (butPtr->copyGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->copyGC); Tk_FreeGC(butPtr->display, butPtr->copyGC);
} }
if (butPtr->textLayout != NULL) { if (butPtr->textLayout != NULL) {
@@ -1169,7 +1175,7 @@ ConfigureButton(
*/ */
if ((butPtr->type == TYPE_RADIO_BUTTON) && if ((butPtr->type == TYPE_RADIO_BUTTON) &&
(*Tcl_GetString(butPtr->onValuePtr) == 0)) { (*Tcl_GetString(butPtr->onValuePtr) == '\0')) {
butPtr->flags |= SELECTED; butPtr->flags |= SELECTED;
} }
} }
@@ -1361,7 +1367,7 @@ TkButtonWorldChanged(
gcValues.graphics_exposures = False; gcValues.graphics_exposures = False;
mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues); newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues);
if (butPtr->normalTextGC != None) { if (butPtr->normalTextGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->normalTextGC); Tk_FreeGC(butPtr->display, butPtr->normalTextGC);
} }
butPtr->normalTextGC = newGC; butPtr->normalTextGC = newGC;
@@ -1371,7 +1377,7 @@ TkButtonWorldChanged(
gcValues.background = Tk_3DBorderColor(butPtr->activeBorder)->pixel; gcValues.background = Tk_3DBorderColor(butPtr->activeBorder)->pixel;
mask = GCForeground | GCBackground | GCFont; mask = GCForeground | GCBackground | GCFont;
newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues); newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues);
if (butPtr->activeTextGC != None) { if (butPtr->activeTextGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->activeTextGC); Tk_FreeGC(butPtr->display, butPtr->activeTextGC);
} }
butPtr->activeTextGC = newGC; butPtr->activeTextGC = newGC;
@@ -1383,7 +1389,7 @@ TkButtonWorldChanged(
* Create the GC that can be used for stippling * Create the GC that can be used for stippling
*/ */
if (butPtr->stippleGC == None) { if (butPtr->stippleGC == NULL) {
gcValues.foreground = gcValues.background; gcValues.foreground = gcValues.background;
mask = GCForeground; mask = GCForeground;
if (butPtr->gray == None) { if (butPtr->gray == None) {
@@ -1409,12 +1415,12 @@ TkButtonWorldChanged(
gcValues.foreground = gcValues.background; gcValues.foreground = gcValues.background;
} }
newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues); newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues);
if (butPtr->disabledGC != None) { if (butPtr->disabledGC != NULL) {
Tk_FreeGC(butPtr->display, butPtr->disabledGC); Tk_FreeGC(butPtr->display, butPtr->disabledGC);
} }
butPtr->disabledGC = newGC; butPtr->disabledGC = newGC;
if (butPtr->copyGC == None) { if (butPtr->copyGC == NULL) {
butPtr->copyGC = Tk_GetGC(butPtr->tkwin, 0, &gcValues); butPtr->copyGC = Tk_GetGC(butPtr->tkwin, 0, &gcValues);
} }
@@ -1617,7 +1623,27 @@ ButtonVarProc(
if (flags & TCL_TRACE_UNSETS) { if (flags & TCL_TRACE_UNSETS) {
butPtr->flags &= ~(SELECTED | TRISTATED); butPtr->flags &= ~(SELECTED | TRISTATED);
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { if (!Tcl_InterpDeleted(interp)) {
ClientData probe = NULL;
do {
probe = Tcl_VarTraceInfo(interp,
Tcl_GetString(butPtr->selVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonVarProc, probe);
if (probe == (ClientData)butPtr) {
break;
}
} while (probe);
if (probe) {
/*
* We were able to fetch the unset trace for our
* selVarNamePtr, which means it is not unset and not
* the cause of this unset trace. Instead some outdated
* former variable must be, and we should ignore it.
*/
goto redisplay;
}
Tcl_TraceVar2(interp, Tcl_GetString(butPtr->selVarNamePtr), Tcl_TraceVar2(interp, Tcl_GetString(butPtr->selVarNamePtr),
NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonVarProc, clientData); ButtonVarProc, clientData);
@@ -1709,7 +1735,34 @@ ButtonTextVarProc(
*/ */
if (flags & TCL_TRACE_UNSETS) { if (flags & TCL_TRACE_UNSETS) {
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { if (!Tcl_InterpDeleted(interp) && butPtr->textVarNamePtr != NULL) {
/*
* An unset trace on some variable brought us here, but is it
* the variable we have stored in butPtr->textVarNamePtr ?
*/
ClientData probe = NULL;
do {
probe = Tcl_VarTraceInfo(interp,
Tcl_GetString(butPtr->textVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonTextVarProc, probe);
if (probe == (ClientData)butPtr) {
break;
}
} while (probe);
if (probe) {
/*
* We were able to fetch the unset trace for our
* textVarNamePtr, which means it is not unset and not
* the cause of this unset trace. Instead some outdated
* former textvariable must be, and we should ignore it.
*/
return NULL;
}
Tcl_ObjSetVar2(interp, butPtr->textVarNamePtr, NULL, Tcl_ObjSetVar2(interp, butPtr->textVarNamePtr, NULL,
butPtr->textPtr, TCL_GLOBAL_ONLY); butPtr->textPtr, TCL_GLOBAL_ONLY);
Tcl_TraceVar2(interp, Tcl_GetString(butPtr->textVarNamePtr), Tcl_TraceVar2(interp, Tcl_GetString(butPtr->textVarNamePtr),

View File

@@ -235,7 +235,7 @@ typedef struct {
* Miscellaneous information: * Miscellaneous information:
*/ */
Tk_Cursor cursor; /* Value of -cursor option: if not None, Tk_Cursor cursor; /* Value of -cursor option: if not NULL,
* specifies current cursor for window. */ * specifies current cursor for window. */
Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal * C code, but used by keyboard traversal
@@ -306,7 +306,7 @@ MODULE_SCOPE char tkDefLabelPady[TCL_INTEGER_SPACE];
*/ */
#ifndef TkpButtonSetDefaults #ifndef TkpButtonSetDefaults
MODULE_SCOPE void TkpButtonSetDefaults(); MODULE_SCOPE void TkpButtonSetDefaults(void);
#endif #endif
MODULE_SCOPE void TkButtonWorldChanged(ClientData instanceData); MODULE_SCOPE void TkButtonWorldChanged(ClientData instanceData);
MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr); MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr);

View File

@@ -12,6 +12,7 @@
#include "tkInt.h" #include "tkInt.h"
#include "tkCanvas.h" #include "tkCanvas.h"
#include "default.h"
/* /*
* The structure below defines the record for each arc item. * The structure below defines the record for each arc item.
@@ -144,7 +145,7 @@ static const Tk_ConfigSpec configSpecs[] = {
"0,0", Tk_Offset(ArcItem, tsoffset), "0,0", Tk_Offset(ArcItem, tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
{TK_CONFIG_COLOR, "-outline", NULL, NULL, {TK_CONFIG_COLOR, "-outline", NULL, NULL,
"black", Tk_Offset(ArcItem, outline.color), TK_CONFIG_NULL_OK, NULL}, DEF_CANVITEM_OUTLINE, Tk_Offset(ArcItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL, {TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(ArcItem, outline.tsoffset), "0,0", Tk_Offset(ArcItem, outline.tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
@@ -290,7 +291,7 @@ CreateArc(
arcPtr->activeFillStipple = None; arcPtr->activeFillStipple = None;
arcPtr->disabledFillStipple = None; arcPtr->disabledFillStipple = None;
arcPtr->style = PIESLICE_STYLE; arcPtr->style = PIESLICE_STYLE;
arcPtr->fillGC = None; arcPtr->fillGC = NULL;
/* /*
* Process the arguments to fill in the item record. * Process the arguments to fill in the item record.
@@ -351,8 +352,8 @@ ArcCoords(
objs[2] = Tcl_NewDoubleObj(arcPtr->bbox[2]); objs[2] = Tcl_NewDoubleObj(arcPtr->bbox[2]);
objs[3] = Tcl_NewDoubleObj(arcPtr->bbox[3]); objs[3] = Tcl_NewDoubleObj(arcPtr->bbox[3]);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, objs)); Tcl_SetObjResult(interp, Tcl_NewListObj(4, objs));
} else if ((objc == 1)||(objc == 4)) { } else if ((objc == 1) || (objc == 4)) {
if (objc==1) { if (objc == 1) {
if (Tcl_ListObjGetElements(interp, objv[0], &objc, if (Tcl_ListObjGetElements(interp, objv[0], &objc,
(Tcl_Obj ***) &objv) != TCL_OK) { (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR; return TCL_ERROR;
@@ -478,9 +479,9 @@ ConfigureArc(
mask |= GCCapStyle; mask |= GCCapStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues); newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else { } else {
newGC = None; newGC = NULL;
} }
if (arcPtr->outline.gc != None) { if (arcPtr->outline.gc != NULL) {
Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc); Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc);
} }
arcPtr->outline.gc = newGC; arcPtr->outline.gc = newGC;
@@ -512,9 +513,9 @@ ConfigureArc(
} }
if (arcPtr->style == ARC_STYLE) { if (arcPtr->style == ARC_STYLE) {
newGC = None; newGC = NULL;
} else if (color == NULL) { } else if (color == NULL) {
newGC = None; newGC = NULL;
} else { } else {
gcValues.foreground = color->pixel; gcValues.foreground = color->pixel;
if (arcPtr->style == CHORD_STYLE) { if (arcPtr->style == CHORD_STYLE) {
@@ -530,7 +531,7 @@ ConfigureArc(
} }
newGC = Tk_GetGC(tkwin, mask, &gcValues); newGC = Tk_GetGC(tkwin, mask, &gcValues);
} }
if (arcPtr->fillGC != None) { if (arcPtr->fillGC != NULL) {
Tk_FreeGC(Tk_Display(tkwin), arcPtr->fillGC); Tk_FreeGC(Tk_Display(tkwin), arcPtr->fillGC);
} }
arcPtr->fillGC = newGC; arcPtr->fillGC = newGC;
@@ -575,11 +576,11 @@ ConfigureArc(
static void static void
DeleteArc( DeleteArc(
Tk_Canvas canvas, /* Info about overall canvas. */ TCL_UNUSED(Tk_Canvas), /* Info about overall canvas. */
Tk_Item *itemPtr, /* Item that is being deleted. */ Tk_Item *itemPtr, /* Item that is being deleted. */
Display *display) /* Display containing window for canvas. */ Display *display) /* Display containing window for canvas. */
{ {
ArcItem *arcPtr = (ArcItem *) itemPtr; ArcItem *arcPtr = (ArcItem *)itemPtr;
Tk_DeleteOutline(display, &(arcPtr->outline)); Tk_DeleteOutline(display, &(arcPtr->outline));
if (arcPtr->numOutlinePoints != 0) { if (arcPtr->numOutlinePoints != 0) {
@@ -603,7 +604,7 @@ DeleteArc(
if (arcPtr->disabledFillStipple != None) { if (arcPtr->disabledFillStipple != None) {
Tk_FreeBitmap(display, arcPtr->disabledFillStipple); Tk_FreeBitmap(display, arcPtr->disabledFillStipple);
} }
if (arcPtr->fillGC != None) { if (arcPtr->fillGC != NULL) {
Tk_FreeGC(display, arcPtr->fillGC); Tk_FreeGC(display, arcPtr->fillGC);
} }
} }
@@ -625,7 +626,6 @@ DeleteArc(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static void static void
ComputeArcBbox( ComputeArcBbox(
Tk_Canvas canvas, /* Canvas that contains item. */ Tk_Canvas canvas, /* Canvas that contains item. */
@@ -662,13 +662,13 @@ ComputeArcBbox(
*/ */
if (arcPtr->bbox[1] > arcPtr->bbox[3]) { if (arcPtr->bbox[1] > arcPtr->bbox[3]) {
double tmp = arcPtr->bbox[3]; tmp = arcPtr->bbox[3];
arcPtr->bbox[3] = arcPtr->bbox[1]; arcPtr->bbox[3] = arcPtr->bbox[1];
arcPtr->bbox[1] = tmp; arcPtr->bbox[1] = tmp;
} }
if (arcPtr->bbox[0] > arcPtr->bbox[2]) { if (arcPtr->bbox[0] > arcPtr->bbox[2]) {
double tmp = arcPtr->bbox[2]; tmp = arcPtr->bbox[2];
arcPtr->bbox[2] = arcPtr->bbox[0]; arcPtr->bbox[2] = arcPtr->bbox[0];
arcPtr->bbox[0] = tmp; arcPtr->bbox[0] = tmp;
@@ -677,7 +677,7 @@ ComputeArcBbox(
ComputeArcOutline(canvas,arcPtr); ComputeArcOutline(canvas,arcPtr);
/* /*
* To compute the bounding box, start with the the bbox formed by the two * To compute the bounding box, start with the bbox formed by the two
* endpoints of the arc. Then add in the center of the arc's oval (if * endpoints of the arc. Then add in the center of the arc's oval (if
* relevant) and the 3-o'clock, 6-o'clock, 9-o'clock, and 12-o'clock * relevant) and the 3-o'clock, 6-o'clock, 9-o'clock, and 12-o'clock
* positions, if they are relevant. * positions, if they are relevant.
@@ -734,7 +734,7 @@ ComputeArcBbox(
* drawn) and add one extra pixel just for safety. * drawn) and add one extra pixel just for safety.
*/ */
if (arcPtr->outline.gc == None) { if (arcPtr->outline.gc == NULL) {
tmp = 1; tmp = 1;
} else { } else {
tmp = (int) ((width + 1.0)/2.0 + 1); tmp = (int) ((width + 1.0)/2.0 + 1);
@@ -768,8 +768,10 @@ DisplayArc(
Tk_Item *itemPtr, /* Item to be displayed. */ Tk_Item *itemPtr, /* Item to be displayed. */
Display *display, /* Display on which to draw item. */ Display *display, /* Display on which to draw item. */
Drawable drawable, /* Pixmap or window in which to draw item. */ Drawable drawable, /* Pixmap or window in which to draw item. */
int x, int y, /* Describes region of canvas that must be */ TCL_UNUSED(int), /* Describes region of canvas that must be */
int width, int height) /* redisplayed (not used). */ TCL_UNUSED(int), /* redisplayed (not used). */
TCL_UNUSED(int),
TCL_UNUSED(int))
{ {
ArcItem *arcPtr = (ArcItem *) itemPtr; ArcItem *arcPtr = (ArcItem *) itemPtr;
short x1, y1, x2, y2; short x1, y1, x2, y2;
@@ -833,7 +835,7 @@ DisplayArc(
* window servers to crash and should be a no-op anyway. * window servers to crash and should be a no-op anyway.
*/ */
if ((arcPtr->fillGC != None) && (extent != 0)) { if ((arcPtr->fillGC != NULL) && (extent != 0)) {
if (stipple != None) { if (stipple != None) {
int w = 0; int w = 0;
int h = 0; int h = 0;
@@ -867,7 +869,7 @@ DisplayArc(
XSetTSOrigin(display, arcPtr->fillGC, 0, 0); XSetTSOrigin(display, arcPtr->fillGC, 0, 0);
} }
} }
if (arcPtr->outline.gc != None) { if (arcPtr->outline.gc != NULL) {
Tk_ChangeOutlineGC(canvas, itemPtr, &(arcPtr->outline)); Tk_ChangeOutlineGC(canvas, itemPtr, &(arcPtr->outline));
if (extent != 0) { if (extent != 0) {
@@ -905,13 +907,13 @@ DisplayArc(
} else { } else {
if (arcPtr->style == CHORD_STYLE) { if (arcPtr->style == CHORD_STYLE) {
TkFillPolygon(canvas, arcPtr->outlinePtr, CHORD_OUTLINE_PTS, TkFillPolygon(canvas, arcPtr->outlinePtr, CHORD_OUTLINE_PTS,
display, drawable, arcPtr->outline.gc, None); display, drawable, arcPtr->outline.gc, NULL);
} else if (arcPtr->style == PIESLICE_STYLE) { } else if (arcPtr->style == PIESLICE_STYLE) {
TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS, TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS,
display, drawable, arcPtr->outline.gc, None); display, drawable, arcPtr->outline.gc, NULL);
TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS, TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
PIE_OUTLINE2_PTS, display, drawable, PIE_OUTLINE2_PTS, display, drawable,
arcPtr->outline.gc, None); arcPtr->outline.gc, NULL);
} }
} }
@@ -941,7 +943,6 @@ DisplayArc(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static double static double
ArcToPoint( ArcToPoint(
Tk_Canvas canvas, /* Canvas containing item. */ Tk_Canvas canvas, /* Canvas containing item. */
@@ -1017,12 +1018,12 @@ ArcToPoint(
return dist; return dist;
} }
if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) { if ((arcPtr->fillGC != NULL) || (arcPtr->outline.gc == NULL)) {
filled = 1; filled = 1;
} else { } else {
filled = 0; filled = 0;
} }
if (arcPtr->outline.gc == None) { if (arcPtr->outline.gc == NULL) {
width = 0.0; width = 0.0;
} }
@@ -1106,7 +1107,6 @@ ArcToPoint(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static int static int
ArcToArea( ArcToArea(
Tk_Canvas canvas, /* Canvas containing item. */ Tk_Canvas canvas, /* Canvas containing item. */
@@ -1144,12 +1144,12 @@ ArcToArea(
} }
} }
if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) { if ((arcPtr->fillGC != NULL) || (arcPtr->outline.gc == NULL)) {
filled = 1; filled = 1;
} else { } else {
filled = 0; filled = 0;
} }
if (arcPtr->outline.gc == None) { if (arcPtr->outline.gc == NULL) {
width = 0.0; width = 0.0;
} }
@@ -1446,7 +1446,7 @@ ComputeArcOutline(
*/ */
if (arcPtr->numOutlinePoints == 0) { if (arcPtr->numOutlinePoints == 0) {
arcPtr->outlinePtr = ckalloc(26 * sizeof(double)); arcPtr->outlinePtr = (double *)ckalloc(26 * sizeof(double));
arcPtr->numOutlinePoints = 22; arcPtr->numOutlinePoints = 22;
} }
outlinePtr = arcPtr->outlinePtr; outlinePtr = arcPtr->outlinePtr;
@@ -1813,7 +1813,7 @@ ArcToPostscript(
Tcl_Interp *interp, /* Leave Postscript or error message here. */ Tcl_Interp *interp, /* Leave Postscript or error message here. */
Tk_Canvas canvas, /* Information about overall canvas. */ Tk_Canvas canvas, /* Information about overall canvas. */
Tk_Item *itemPtr, /* Item for which Postscript is wanted. */ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
int prepass) /* 1 means this is a prepass to collect font TCL_UNUSED(int)) /* 1 means this is a prepass to collect font
* information; 0 means final Postscript is * information; 0 means final Postscript is
* being created. */ * being created. */
{ {
@@ -1883,7 +1883,7 @@ ArcToPostscript(
* arc. * arc.
*/ */
if (arcPtr->fillGC != None) { if (arcPtr->fillGC != NULL) {
Tcl_AppendPrintfToObj(psObj, Tcl_AppendPrintfToObj(psObj,
"matrix currentmatrix\n" "matrix currentmatrix\n"
"%.15g %.15g translate %.15g %.15g scale\n", "%.15g %.15g translate %.15g %.15g scale\n",
@@ -1912,7 +1912,7 @@ ArcToPostscript(
} }
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
if (arcPtr->outline.gc != None) { if (arcPtr->outline.gc != NULL) {
Tcl_AppendToObj(psObj, "grestore gsave\n", -1); Tcl_AppendToObj(psObj, "grestore gsave\n", -1);
} }
} else { } else {
@@ -1924,7 +1924,7 @@ ArcToPostscript(
* If there's an outline for the arc, draw it. * If there's an outline for the arc, draw it.
*/ */
if (arcPtr->outline.gc != None) { if (arcPtr->outline.gc != NULL) {
Tcl_AppendPrintfToObj(psObj, Tcl_AppendPrintfToObj(psObj,
"matrix currentmatrix\n" "matrix currentmatrix\n"
"%.15g %.15g translate %.15g %.15g scale\n", "%.15g %.15g translate %.15g %.15g scale\n",
@@ -2027,17 +2027,16 @@ ArcToPostscript(
static int static int
StyleParseProc( StyleParseProc(
ClientData clientData, /* some flags.*/ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for reporting errors. */ Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
const char *value, /* Value of option. */ const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */ char *widgRec, /* Pointer to record for item. */
int offset) /* Offset into item. */ int offset) /* Offset into item. */
{ {
int c; int c;
size_t length; size_t length;
Style *stylePtr = (Style *) (widgRec + offset);
register Style *stylePtr = (Style *) (widgRec + offset);
if (value == NULL || *value == 0) { if (value == NULL || *value == 0) {
*stylePtr = PIESLICE_STYLE; *stylePtr = PIESLICE_STYLE;
@@ -2091,15 +2090,15 @@ StyleParseProc(
static const char * static const char *
StylePrintProc( StylePrintProc(
ClientData clientData, /* Ignored. */ TCL_UNUSED(void *), /* Ignored. */
Tk_Window tkwin, /* Ignored. */ TCL_UNUSED(Tk_Window), /* Ignored. */
char *widgRec, /* Pointer to record for item. */ char *widgRec, /* Pointer to record for item. */
int offset, /* Offset into item. */ int offset, /* Offset into item. */
Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with
* information about how to reclaim storage * information about how to reclaim storage
* for return string. */ * for return string. */
{ {
register Style *stylePtr = (Style *) (widgRec + offset); Style *stylePtr = (Style *) (widgRec + offset);
if (*stylePtr == ARC_STYLE) { if (*stylePtr == ARC_STYLE) {
return "arc"; return "arc";

View File

@@ -12,6 +12,7 @@
#include "tkInt.h" #include "tkInt.h"
#include "tkCanvas.h" #include "tkCanvas.h"
#include "default.h"
/* /*
* The structure below defines the record for each bitmap item. * The structure below defines the record for each bitmap item.
@@ -70,7 +71,7 @@ static const Tk_ConfigSpec configSpecs[] = {
NULL, Tk_Offset(BitmapItem, disabledFgColor), NULL, Tk_Offset(BitmapItem, disabledFgColor),
TK_CONFIG_NULL_OK, NULL}, TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-foreground", NULL, NULL, {TK_CONFIG_COLOR, "-foreground", NULL, NULL,
"black", Tk_Offset(BitmapItem, fgColor), 0, NULL}, DEF_CANVBMAP_FG, Tk_Offset(BitmapItem, fgColor), 0, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL, {TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
&stateOption}, &stateOption},
@@ -189,7 +190,7 @@ TkcCreateBitmap(
bmapPtr->bgColor = NULL; bmapPtr->bgColor = NULL;
bmapPtr->activeBgColor = NULL; bmapPtr->activeBgColor = NULL;
bmapPtr->disabledBgColor = NULL; bmapPtr->disabledBgColor = NULL;
bmapPtr->gc = None; bmapPtr->gc = NULL;
/* /*
* Process the arguments to fill in the item record. Only 1 (list) or 2 (x * Process the arguments to fill in the item record. Only 1 (list) or 2 (x
@@ -372,7 +373,7 @@ ConfigureBitmap(
} }
if (bitmap == None) { if (bitmap == None) {
newGC = None; newGC = NULL;
} else { } else {
gcValues.foreground = fgColor->pixel; gcValues.foreground = fgColor->pixel;
mask = GCForeground; mask = GCForeground;
@@ -385,7 +386,7 @@ ConfigureBitmap(
} }
newGC = Tk_GetGC(tkwin, mask, &gcValues); newGC = Tk_GetGC(tkwin, mask, &gcValues);
} }
if (bmapPtr->gc != None) { if (bmapPtr->gc != NULL) {
Tk_FreeGC(Tk_Display(tkwin), bmapPtr->gc); Tk_FreeGC(Tk_Display(tkwin), bmapPtr->gc);
} }
bmapPtr->gc = newGC; bmapPtr->gc = newGC;

View File

@@ -449,7 +449,7 @@ ComputeImageBbox(
x = (int) (imgPtr->x + ((imgPtr->x >= 0) ? 0.5 : - 0.5)); x = (int) (imgPtr->x + ((imgPtr->x >= 0) ? 0.5 : - 0.5));
y = (int) (imgPtr->y + ((imgPtr->y >= 0) ? 0.5 : - 0.5)); y = (int) (imgPtr->y + ((imgPtr->y >= 0) ? 0.5 : - 0.5));
if ((state == TK_STATE_HIDDEN) || (image == None)) { if ((state == TK_STATE_HIDDEN) || (image == NULL)) {
imgPtr->header.x1 = imgPtr->header.x2 = x; imgPtr->header.x1 = imgPtr->header.x2 = x;
imgPtr->header.y1 = imgPtr->header.y2 = y; imgPtr->header.y1 = imgPtr->header.y2 = y;
return; return;

View File

@@ -13,6 +13,7 @@
#include "tkInt.h" #include "tkInt.h"
#include "tkCanvas.h" #include "tkCanvas.h"
#include "default.h"
/* /*
* The structure below defines the record for each line item. * The structure below defines the record for each line item.
@@ -175,7 +176,7 @@ static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CAP_STYLE, "-capstyle", NULL, NULL, {TK_CONFIG_CAP_STYLE, "-capstyle", NULL, NULL,
"butt", Tk_Offset(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, "butt", Tk_Offset(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_COLOR, "-fill", NULL, NULL, {TK_CONFIG_COLOR, "-fill", NULL, NULL,
"black", Tk_Offset(LineItem, outline.color), TK_CONFIG_NULL_OK, NULL}, DEF_CANVITEM_OUTLINE, Tk_Offset(LineItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-dash", NULL, NULL, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL,
NULL, Tk_Offset(LineItem, outline.dash), NULL, Tk_Offset(LineItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption}, TK_CONFIG_NULL_OK, &dashOption},
@@ -296,7 +297,7 @@ CreateLine(
linePtr->coordPtr = NULL; linePtr->coordPtr = NULL;
linePtr->capStyle = CapButt; linePtr->capStyle = CapButt;
linePtr->joinStyle = JoinRound; linePtr->joinStyle = JoinRound;
linePtr->arrowGC = None; linePtr->arrowGC = NULL;
linePtr->arrow = ARROWS_NONE; linePtr->arrow = ARROWS_NONE;
linePtr->arrowShapeA = (float)8.0; linePtr->arrowShapeA = (float)8.0;
linePtr->arrowShapeB = (float)10.0; linePtr->arrowShapeB = (float)10.0;
@@ -405,7 +406,7 @@ LineCoords(
numPoints = objc/2; numPoints = objc/2;
if (linePtr->numPoints != numPoints) { if (linePtr->numPoints != numPoints) {
coordPtr = ckalloc(sizeof(double) * objc); coordPtr = (double *)ckalloc(sizeof(double) * objc);
if (linePtr->coordPtr != NULL) { if (linePtr->coordPtr != NULL) {
ckfree(linePtr->coordPtr); ckfree(linePtr->coordPtr);
} }
@@ -521,12 +522,12 @@ ConfigureLine(
#endif #endif
arrowGC = Tk_GetGC(tkwin, mask, &gcValues); arrowGC = Tk_GetGC(tkwin, mask, &gcValues);
} else { } else {
newGC = arrowGC = None; newGC = arrowGC = NULL;
} }
if (linePtr->outline.gc != None) { if (linePtr->outline.gc != NULL) {
Tk_FreeGC(Tk_Display(tkwin), linePtr->outline.gc); Tk_FreeGC(Tk_Display(tkwin), linePtr->outline.gc);
} }
if (linePtr->arrowGC != None) { if (linePtr->arrowGC != NULL) {
Tk_FreeGC(Tk_Display(tkwin), linePtr->arrowGC); Tk_FreeGC(Tk_Display(tkwin), linePtr->arrowGC);
} }
linePtr->outline.gc = newGC; linePtr->outline.gc = newGC;
@@ -601,7 +602,7 @@ ConfigureLine(
static void static void
DeleteLine( DeleteLine(
Tk_Canvas canvas, /* Info about overall canvas widget. */ TCL_UNUSED(Tk_Canvas), /* Info about overall canvas widget. */
Tk_Item *itemPtr, /* Item that is being deleted. */ Tk_Item *itemPtr, /* Item that is being deleted. */
Display *display) /* Display containing window for canvas. */ Display *display) /* Display containing window for canvas. */
{ {
@@ -611,7 +612,7 @@ DeleteLine(
if (linePtr->coordPtr != NULL) { if (linePtr->coordPtr != NULL) {
ckfree(linePtr->coordPtr); ckfree(linePtr->coordPtr);
} }
if (linePtr->arrowGC != None) { if (linePtr->arrowGC != NULL) {
Tk_FreeGC(display, linePtr->arrowGC); Tk_FreeGC(display, linePtr->arrowGC);
} }
if (linePtr->firstArrowPtr != NULL) { if (linePtr->firstArrowPtr != NULL) {
@@ -705,7 +706,7 @@ ComputeLineBbox(
tsoffset = &linePtr->outline.tsoffset; tsoffset = &linePtr->outline.tsoffset;
if (tsoffset->flags & TK_OFFSET_INDEX) { if (tsoffset->flags & TK_OFFSET_INDEX) {
double *coordPtr = linePtr->coordPtr coordPtr = linePtr->coordPtr
+ (tsoffset->flags & ~TK_OFFSET_INDEX); + (tsoffset->flags & ~TK_OFFSET_INDEX);
if (tsoffset->flags <= 0) { if (tsoffset->flags <= 0) {
@@ -829,9 +830,10 @@ DisplayLine(
Tk_Item *itemPtr, /* Item to be displayed. */ Tk_Item *itemPtr, /* Item to be displayed. */
Display *display, /* Display on which to draw item. */ Display *display, /* Display on which to draw item. */
Drawable drawable, /* Pixmap or window in which to draw item. */ Drawable drawable, /* Pixmap or window in which to draw item. */
int x, int y, int width, int height) TCL_UNUSED(int), /* Describes region of canvas that must be */
/* Describes region of canvas that must be TCL_UNUSED(int), /* redisplayed (not used). */
* redisplayed (not used). */ TCL_UNUSED(int),
TCL_UNUSED(int))
{ {
LineItem *linePtr = (LineItem *) itemPtr; LineItem *linePtr = (LineItem *) itemPtr;
XPoint staticPoints[MAX_STATIC_POINTS*3]; XPoint staticPoints[MAX_STATIC_POINTS*3];
@@ -840,7 +842,7 @@ DisplayLine(
int numPoints; int numPoints;
Tk_State state = itemPtr->state; Tk_State state = itemPtr->state;
if ((!linePtr->numPoints) || (linePtr->outline.gc == None)) { if (!linePtr->numPoints || (linePtr->outline.gc == NULL)) {
return; return;
} }
@@ -874,7 +876,7 @@ DisplayLine(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints; pointPtr = staticPoints;
} else { } else {
pointPtr = ckalloc(numPoints * 3 * sizeof(XPoint)); pointPtr = (XPoint *)ckalloc(numPoints * 3 * sizeof(XPoint));
} }
if ((linePtr->smooth) && (linePtr->numPoints > 2)) { if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
@@ -983,7 +985,7 @@ LineInsert(
linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0]; linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1]; linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1];
} }
newCoordPtr = ckalloc(sizeof(double) * (length + objc)); newCoordPtr = (double *)ckalloc(sizeof(double) * (length + objc));
for (i=0; i<beforeThis; i++) { for (i=0; i<beforeThis; i++) {
newCoordPtr[i] = linePtr->coordPtr[i]; newCoordPtr[i] = linePtr->coordPtr[i];
} }
@@ -1318,7 +1320,6 @@ LineDeleteCoords(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static double static double
LineToPoint( LineToPoint(
Tk_Canvas canvas, /* Canvas containing item. */ Tk_Canvas canvas, /* Canvas containing item. */
@@ -1364,7 +1365,7 @@ LineToPoint(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
linePoints = staticSpace; linePoints = staticSpace;
} else { } else {
linePoints = ckalloc(2 * numPoints * sizeof(double)); linePoints = (double *)ckalloc(2 * numPoints * sizeof(double));
} }
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr, numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps, NULL, linePoints); linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
@@ -1546,7 +1547,6 @@ LineToPoint(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static int static int
LineToArea( LineToArea(
Tk_Canvas canvas, /* Canvas containing item. */ Tk_Canvas canvas, /* Canvas containing item. */
@@ -1599,7 +1599,7 @@ LineToArea(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
linePoints = staticSpace; linePoints = staticSpace;
} else { } else {
linePoints = ckalloc(2 * numPoints * sizeof(double)); linePoints = (double *)ckalloc(2 * numPoints * sizeof(double));
} }
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr, numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps, NULL, linePoints); linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
@@ -1694,8 +1694,6 @@ ScaleLine(
linePtr->firstArrowPtr = NULL; linePtr->firstArrowPtr = NULL;
} }
if (linePtr->lastArrowPtr != NULL) { if (linePtr->lastArrowPtr != NULL) {
int i;
i = 2*(linePtr->numPoints-1); i = 2*(linePtr->numPoints-1);
linePtr->coordPtr[i] = linePtr->lastArrowPtr[0]; linePtr->coordPtr[i] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[i+1] = linePtr->lastArrowPtr[1]; linePtr->coordPtr[i+1] = linePtr->lastArrowPtr[1];
@@ -1872,12 +1870,11 @@ TranslateLine(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static int static int
ParseArrowShape( ParseArrowShape(
ClientData clientData, /* Not used. */ TCL_UNUSED(void *), /* Not used. */
Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Interp *interp, /* Used for error reporting. */
Tk_Window tkwin, /* Not used. */ TCL_UNUSED(Tk_Window), /* Not used. */
const char *value, /* Textual specification of arrow shape. */ const char *value, /* Textual specification of arrow shape. */
char *recordPtr, /* Pointer to item record in which to store char *recordPtr, /* Pointer to item record in which to store
* arrow information. */ * arrow information. */
@@ -1941,19 +1938,18 @@ ParseArrowShape(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static const char * static const char *
PrintArrowShape( PrintArrowShape(
ClientData clientData, /* Not used. */ TCL_UNUSED(void *), /* Not used. */
Tk_Window tkwin, /* Window associated with linePtr's widget. */ TCL_UNUSED(Tk_Window), /* Window associated with linePtr's widget. */
char *recordPtr, /* Pointer to item record containing current char *recordPtr, /* Pointer to item record containing current
* shape information. */ * shape information. */
int offset, /* Offset of arrow information in record. */ TCL_UNUSED(int), /* Offset of arrow information in record. */
Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free
* string here. */ * string here. */
{ {
LineItem *linePtr = (LineItem *) recordPtr; LineItem *linePtr = (LineItem *) recordPtr;
char *buffer = ckalloc(120); char *buffer = (char *)ckalloc(120);
sprintf(buffer, "%.5g %.5g %.5g", linePtr->arrowShapeA, sprintf(buffer, "%.5g %.5g %.5g", linePtr->arrowShapeA,
linePtr->arrowShapeB, linePtr->arrowShapeC); linePtr->arrowShapeB, linePtr->arrowShapeC);
@@ -1981,17 +1977,16 @@ PrintArrowShape(
static int static int
ArrowParseProc( ArrowParseProc(
ClientData clientData, /* some flags.*/ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for reporting errors. */ Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
const char *value, /* Value of option. */ const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */ char *widgRec, /* Pointer to record for item. */
int offset) /* Offset into item. */ int offset) /* Offset into item. */
{ {
int c; int c;
size_t length; size_t length;
Arrows *arrowPtr = (Arrows *) (widgRec + offset);
register Arrows *arrowPtr = (Arrows *) (widgRec + offset);
if (value == NULL || *value == 0) { if (value == NULL || *value == 0) {
*arrowPtr = ARROWS_NONE; *arrowPtr = ARROWS_NONE;
@@ -2049,15 +2044,15 @@ ArrowParseProc(
static const char * static const char *
ArrowPrintProc( ArrowPrintProc(
ClientData clientData, /* Ignored. */ TCL_UNUSED(void *), /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
char *widgRec, /* Pointer to record for item. */ char *widgRec, /* Pointer to record for item. */
int offset, /* Offset into item. */ int offset, /* Offset into item. */
Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with
* information about how to reclaim storage * information about how to reclaim storage
* for return string. */ * for return string. */
{ {
register Arrows *arrowPtr = (Arrows *) (widgRec + offset); Arrows *arrowPtr = (Arrows *) (widgRec + offset);
switch (*arrowPtr) { switch (*arrowPtr) {
case ARROWS_FIRST: case ARROWS_FIRST:
@@ -2091,7 +2086,6 @@ ArrowPrintProc(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static int static int
ConfigureArrows( ConfigureArrows(
Tk_Canvas canvas, /* Canvas in which arrows will be displayed Tk_Canvas canvas, /* Canvas in which arrows will be displayed
@@ -2152,7 +2146,7 @@ ConfigureArrows(
if (linePtr->arrow != ARROWS_LAST) { if (linePtr->arrow != ARROWS_LAST) {
poly = linePtr->firstArrowPtr; poly = linePtr->firstArrowPtr;
if (poly == NULL) { if (poly == NULL) {
poly = ckalloc(2 * PTS_IN_ARROW * sizeof(double)); poly = (double *)ckalloc(2 * PTS_IN_ARROW * sizeof(double));
poly[0] = poly[10] = linePtr->coordPtr[0]; poly[0] = poly[10] = linePtr->coordPtr[0];
poly[1] = poly[11] = linePtr->coordPtr[1]; poly[1] = poly[11] = linePtr->coordPtr[1];
linePtr->firstArrowPtr = poly; linePtr->firstArrowPtr = poly;
@@ -2196,7 +2190,7 @@ ConfigureArrows(
coordPtr = linePtr->coordPtr + 2*(linePtr->numPoints-2); coordPtr = linePtr->coordPtr + 2*(linePtr->numPoints-2);
poly = linePtr->lastArrowPtr; poly = linePtr->lastArrowPtr;
if (poly == NULL) { if (poly == NULL) {
poly = ckalloc(2 * PTS_IN_ARROW * sizeof(double)); poly = (double *)ckalloc(2 * PTS_IN_ARROW * sizeof(double));
poly[0] = poly[10] = coordPtr[2]; poly[0] = poly[10] = coordPtr[2];
poly[1] = poly[11] = coordPtr[3]; poly[1] = poly[11] = coordPtr[3];
linePtr->lastArrowPtr = poly; linePtr->lastArrowPtr = poly;
@@ -2253,7 +2247,7 @@ LineToPostscript(
Tcl_Interp *interp, /* Leave Postscript or error message here. */ Tcl_Interp *interp, /* Leave Postscript or error message here. */
Tk_Canvas canvas, /* Information about overall canvas. */ Tk_Canvas canvas, /* Information about overall canvas. */
Tk_Item *itemPtr, /* Item for which Postscript is wanted. */ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
int prepass) /* 1 means this is a prepass to collect font TCL_UNUSED(int)) /* 1 means this is a prepass to collect font
* information; 0 means final Postscript is * information; 0 means final Postscript is
* being created. */ * being created. */
{ {
@@ -2365,7 +2359,7 @@ LineToPostscript(
linePtr->numPoints, linePtr->splineSteps, NULL, NULL); linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
pointPtr = staticPoints; pointPtr = staticPoints;
if (numPoints > MAX_STATIC_POINTS) { if (numPoints > MAX_STATIC_POINTS) {
pointPtr = ckalloc(numPoints * 2 * sizeof(double)); pointPtr = (double *)ckalloc(numPoints * 2 * sizeof(double));
} }
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr, numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps, NULL, pointPtr); linePtr->numPoints, linePtr->splineSteps, NULL, pointPtr);

View File

@@ -13,6 +13,7 @@
#include "tkInt.h" #include "tkInt.h"
#include "tkCanvas.h" #include "tkCanvas.h"
#include "default.h"
/* /*
* The structure below defines the record for each polygon item. * The structure below defines the record for each polygon item.
@@ -112,8 +113,9 @@ static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL, {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(PolygonItem, outline.disabledWidth), "0.0", Tk_Offset(PolygonItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
/* Remark: Default for -fill should be NULL, see [2860519]. Will be fixed in Tk 8.7 */
{TK_CONFIG_COLOR, "-fill", NULL, NULL, {TK_CONFIG_COLOR, "-fill", NULL, NULL,
"black", Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL}, DEF_CANVITEM_OUTLINE, Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL, {TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL,
"round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, "round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL, {TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
@@ -273,7 +275,7 @@ CreatePolygon(
polyPtr->fillStipple = None; polyPtr->fillStipple = None;
polyPtr->activeFillStipple = None; polyPtr->activeFillStipple = None;
polyPtr->disabledFillStipple = None; polyPtr->disabledFillStipple = None;
polyPtr->fillGC = None; polyPtr->fillGC = NULL;
polyPtr->smooth = NULL; polyPtr->smooth = NULL;
polyPtr->splineSteps = 12; polyPtr->splineSteps = 12;
polyPtr->autoClosed = 0; polyPtr->autoClosed = 0;
@@ -374,7 +376,7 @@ PolygonCoords(
* another point to close the polygon. * another point to close the polygon.
*/ */
polyPtr->coordPtr = ckalloc(sizeof(double) * (objc+2)); polyPtr->coordPtr = (double *)ckalloc(sizeof(double) * (objc+2));
polyPtr->pointsAllocated = numPoints+1; polyPtr->pointsAllocated = numPoints+1;
} }
for (i = objc-1; i >= 0; i--) { for (i = objc-1; i >= 0; i--) {
@@ -478,9 +480,9 @@ ConfigurePolygon(
mask |= GCCapStyle|GCJoinStyle; mask |= GCCapStyle|GCJoinStyle;
newGC = Tk_GetGC(tkwin, mask, &gcValues); newGC = Tk_GetGC(tkwin, mask, &gcValues);
} else { } else {
newGC = None; newGC = NULL;
} }
if (polyPtr->outline.gc != None) { if (polyPtr->outline.gc != NULL) {
Tk_FreeGC(Tk_Display(tkwin), polyPtr->outline.gc); Tk_FreeGC(Tk_Display(tkwin), polyPtr->outline.gc);
} }
polyPtr->outline.gc = newGC; polyPtr->outline.gc = newGC;
@@ -504,7 +506,7 @@ ConfigurePolygon(
} }
if (color == NULL) { if (color == NULL) {
newGC = None; newGC = NULL;
} else { } else {
gcValues.foreground = color->pixel; gcValues.foreground = color->pixel;
mask = GCForeground; mask = GCForeground;
@@ -518,13 +520,13 @@ ConfigurePolygon(
* Mac OS X CG drawing needs access to the outline linewidth * Mac OS X CG drawing needs access to the outline linewidth
* even for fills (as linewidth controls antialiasing). * even for fills (as linewidth controls antialiasing).
*/ */
gcValues.line_width = polyPtr->outline.gc != None ? gcValues.line_width = polyPtr->outline.gc != NULL ?
polyPtr->outline.gc->line_width : 0; polyPtr->outline.gc->line_width : 0;
mask |= GCLineWidth; mask |= GCLineWidth;
#endif #endif
newGC = Tk_GetGC(tkwin, mask, &gcValues); newGC = Tk_GetGC(tkwin, mask, &gcValues);
} }
if (polyPtr->fillGC != None) { if (polyPtr->fillGC != NULL) {
Tk_FreeGC(Tk_Display(tkwin), polyPtr->fillGC); Tk_FreeGC(Tk_Display(tkwin), polyPtr->fillGC);
} }
polyPtr->fillGC = newGC; polyPtr->fillGC = newGC;
@@ -562,7 +564,7 @@ ConfigurePolygon(
static void static void
DeletePolygon( DeletePolygon(
Tk_Canvas canvas, /* Info about overall canvas widget. */ TCL_UNUSED(Tk_Canvas), /* Info about overall canvas widget. */
Tk_Item *itemPtr, /* Item that is being deleted. */ Tk_Item *itemPtr, /* Item that is being deleted. */
Display *display) /* Display containing window for canvas. */ Display *display) /* Display containing window for canvas. */
{ {
@@ -590,7 +592,7 @@ DeletePolygon(
if (polyPtr->disabledFillStipple != None) { if (polyPtr->disabledFillStipple != None) {
Tk_FreeBitmap(display, polyPtr->disabledFillStipple); Tk_FreeBitmap(display, polyPtr->disabledFillStipple);
} }
if (polyPtr->fillGC != None) { if (polyPtr->fillGC != NULL) {
Tk_FreeGC(display, polyPtr->fillGC); Tk_FreeGC(display, polyPtr->fillGC);
} }
} }
@@ -694,7 +696,7 @@ ComputePolygonBbox(
} }
} }
if (polyPtr->outline.gc != None) { if (polyPtr->outline.gc != NULL) {
tsoffset = &polyPtr->outline.tsoffset; tsoffset = &polyPtr->outline.tsoffset;
if (tsoffset) { if (tsoffset) {
if (tsoffset->flags & TK_OFFSET_INDEX) { if (tsoffset->flags & TK_OFFSET_INDEX) {
@@ -823,7 +825,7 @@ TkFillPolygon(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints; pointPtr = staticPoints;
} else { } else {
pointPtr = ckalloc(numPoints * sizeof(XPoint)); pointPtr = (XPoint *)ckalloc(numPoints * sizeof(XPoint));
} }
for (i=0, pPtr=pointPtr ; i<numPoints; i+=1, coordPtr+=2, pPtr++) { for (i=0, pPtr=pointPtr ; i<numPoints; i+=1, coordPtr+=2, pPtr++) {
@@ -836,11 +838,11 @@ TkFillPolygon(
* allocated. * allocated.
*/ */
if (gc != None && numPoints > 3) { if (gc != NULL && numPoints > 3) {
XFillPolygon(display, drawable, gc, pointPtr, numPoints, Complex, XFillPolygon(display, drawable, gc, pointPtr, numPoints, Complex,
CoordModeOrigin); CoordModeOrigin);
} }
if (outlineGC != None) { if (outlineGC != NULL) {
XDrawLines(display, drawable, outlineGC, pointPtr, numPoints, XDrawLines(display, drawable, outlineGC, pointPtr, numPoints,
CoordModeOrigin); CoordModeOrigin);
} }
@@ -872,18 +874,19 @@ DisplayPolygon(
Tk_Item *itemPtr, /* Item to be displayed. */ Tk_Item *itemPtr, /* Item to be displayed. */
Display *display, /* Display on which to draw item. */ Display *display, /* Display on which to draw item. */
Drawable drawable, /* Pixmap or window in which to draw item. */ Drawable drawable, /* Pixmap or window in which to draw item. */
int x, int y, int width, int height) TCL_UNUSED(int), /* Describes region of canvas that must be */
/* Describes region of canvas that must be TCL_UNUSED(int), /* redisplayed (not used). */
* redisplayed (not used). */ TCL_UNUSED(int),
TCL_UNUSED(int))
{ {
PolygonItem *polyPtr = (PolygonItem *) itemPtr; PolygonItem *polyPtr = (PolygonItem *) itemPtr;
Tk_State state = itemPtr->state; Tk_State state = itemPtr->state;
Pixmap stipple = polyPtr->fillStipple; Pixmap stipple = polyPtr->fillStipple;
double linewidth = polyPtr->outline.width; double linewidth = polyPtr->outline.width;
if (((polyPtr->fillGC == None) && (polyPtr->outline.gc == None)) || if (((polyPtr->fillGC == NULL) && (polyPtr->outline.gc == NULL)) ||
(polyPtr->numPoints < 1) || (polyPtr->numPoints < 1) ||
(polyPtr->numPoints < 3 && polyPtr->outline.gc == None)) { (polyPtr->numPoints < 3 && polyPtr->outline.gc == NULL)) {
return; return;
} }
@@ -911,7 +914,7 @@ DisplayPolygon(
* reset the offset when done, since the GC is supposed to be read-only. * reset the offset when done, since the GC is supposed to be read-only.
*/ */
if ((stipple != None) && (polyPtr->fillGC != None)) { if ((stipple != None) && (polyPtr->fillGC != NULL)) {
Tk_TSOffset *tsoffset = &polyPtr->tsoffset; Tk_TSOffset *tsoffset = &polyPtr->tsoffset;
int w = 0, h = 0; int w = 0, h = 0;
int flags = tsoffset->flags; int flags = tsoffset->flags;
@@ -969,15 +972,15 @@ DisplayPolygon(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints; pointPtr = staticPoints;
} else { } else {
pointPtr = ckalloc(numPoints * sizeof(XPoint)); pointPtr = (XPoint *)ckalloc(numPoints * sizeof(XPoint));
} }
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr, numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
polyPtr->numPoints, polyPtr->splineSteps, pointPtr, NULL); polyPtr->numPoints, polyPtr->splineSteps, pointPtr, NULL);
if (polyPtr->fillGC != None) { if (polyPtr->fillGC != NULL) {
XFillPolygon(display, drawable, polyPtr->fillGC, pointPtr, XFillPolygon(display, drawable, polyPtr->fillGC, pointPtr,
numPoints, Complex, CoordModeOrigin); numPoints, Complex, CoordModeOrigin);
} }
if (polyPtr->outline.gc != None) { if (polyPtr->outline.gc != NULL) {
XDrawLines(display, drawable, polyPtr->outline.gc, pointPtr, XDrawLines(display, drawable, polyPtr->outline.gc, pointPtr,
numPoints, CoordModeOrigin); numPoints, CoordModeOrigin);
} }
@@ -986,7 +989,7 @@ DisplayPolygon(
} }
} }
Tk_ResetOutlineGC(canvas, itemPtr, &polyPtr->outline); Tk_ResetOutlineGC(canvas, itemPtr, &polyPtr->outline);
if ((stipple != None) && (polyPtr->fillGC != None)) { if ((stipple != None) && (polyPtr->fillGC != NULL)) {
XSetTSOrigin(display, polyPtr->fillGC, 0, 0); XSetTSOrigin(display, polyPtr->fillGC, 0, 0);
} }
} }
@@ -996,7 +999,7 @@ DisplayPolygon(
* *
* PolygonInsert -- * PolygonInsert --
* *
* Insert coords into a polugon item at a given index. * Insert coords into a polygon item at a given index.
* *
* Results: * Results:
* None. * None.
@@ -1036,7 +1039,7 @@ PolygonInsert(
while (beforeThis < 0) { while (beforeThis < 0) {
beforeThis += length; beforeThis += length;
} }
newCoordPtr = ckalloc(sizeof(double) * (length + 2 + objc)); newCoordPtr = (double *)ckalloc(sizeof(double) * (length + 2 + objc));
for (i=0; i<beforeThis; i++) { for (i=0; i<beforeThis; i++) {
newCoordPtr[i] = polyPtr->coordPtr[i]; newCoordPtr[i] = polyPtr->coordPtr[i];
} }
@@ -1238,7 +1241,6 @@ PolygonDeleteCoords(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static double static double
PolygonToPoint( PolygonToPoint(
Tk_Canvas canvas, /* Canvas containing item. */ Tk_Canvas canvas, /* Canvas containing item. */
@@ -1286,7 +1288,7 @@ PolygonToPoint(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
polyPoints = staticSpace; polyPoints = staticSpace;
} else { } else {
polyPoints = ckalloc(2 * numPoints * sizeof(double)); polyPoints = (double *)ckalloc(2 * numPoints * sizeof(double));
} }
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr, numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints); polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints);
@@ -1299,7 +1301,7 @@ PolygonToPoint(
if (bestDist <= 0.0) { if (bestDist <= 0.0) {
goto donepoint; goto donepoint;
} }
if ((polyPtr->outline.gc != None) && (polyPtr->joinStyle == JoinRound)) { if ((polyPtr->outline.gc != NULL) && (polyPtr->joinStyle == JoinRound)) {
dist = bestDist - radius; dist = bestDist - radius;
if (dist <= 0.0) { if (dist <= 0.0) {
bestDist = 0.0; bestDist = 0.0;
@@ -1309,7 +1311,7 @@ PolygonToPoint(
} }
} }
if ((polyPtr->outline.gc == None) || (width <= 1)) { if ((polyPtr->outline.gc == NULL) || (width <= 1)) {
goto donepoint; goto donepoint;
} }
@@ -1428,7 +1430,6 @@ PolygonToPoint(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static int static int
PolygonToArea( PolygonToArea(
Tk_Canvas canvas, /* Canvas containing item. */ Tk_Canvas canvas, /* Canvas containing item. */
@@ -1495,7 +1496,7 @@ PolygonToArea(
if (numPoints <= MAX_STATIC_POINTS) { if (numPoints <= MAX_STATIC_POINTS) {
polyPoints = staticSpace; polyPoints = staticSpace;
} else { } else {
polyPoints = ckalloc(2 * numPoints * sizeof(double)); polyPoints = (double *)ckalloc(2 * numPoints * sizeof(double));
} }
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr, numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints); polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints);
@@ -1515,7 +1516,7 @@ PolygonToArea(
goto donearea; goto donearea;
} }
if (polyPtr->outline.gc == None) { if (polyPtr->outline.gc == NULL) {
goto donearea; goto donearea;
} }
@@ -1665,7 +1666,7 @@ ScalePolygon(
static int static int
GetPolygonIndex( GetPolygonIndex(
Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Interp *interp, /* Used for error reporting. */
Tk_Canvas canvas, /* Canvas containing item. */ TCL_UNUSED(Tk_Canvas), /* Canvas containing item. */
Tk_Item *itemPtr, /* Item for which the index is being Tk_Item *itemPtr, /* Item for which the index is being
* specified. */ * specified. */
Tcl_Obj *obj, /* Specification of a particular coord in Tcl_Obj *obj, /* Specification of a particular coord in
@@ -1795,7 +1796,7 @@ PolygonToPostscript(
Tcl_Interp *interp, /* Leave Postscript or error message here. */ Tcl_Interp *interp, /* Leave Postscript or error message here. */
Tk_Canvas canvas, /* Information about overall canvas. */ Tk_Canvas canvas, /* Information about overall canvas. */
Tk_Item *itemPtr, /* Item for which Postscript is wanted. */ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
int prepass) /* 1 means this is a prepass to collect font TCL_UNUSED(int)) /* 1 means this is a prepass to collect font
* information; 0 means final Postscript is * information; 0 means final Postscript is
* being created. */ * being created. */
{ {

View File

@@ -193,7 +193,7 @@ TkCanvPostscriptCmd(
* such. * such.
*/ */
result = Tcl_EvalEx(interp, "::tk::ensure_psenc_is_loaded", -1, 0); result = Tcl_EvalEx(interp, "::tk::ensure_psenc_is_loaded", -1, TCL_EVAL_GLOBAL);
if (result != TCL_OK) { if (result != TCL_OK) {
return result; return result;
} }
@@ -381,7 +381,7 @@ TkCanvPostscriptCmd(
*/ */
psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName, &mode); psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName, &mode);
if (psInfo.chan == (Tcl_Channel) NULL) { if (psInfo.chan == NULL) {
result = TCL_ERROR; result = TCL_ERROR;
goto cleanup; goto cleanup;
} }
@@ -572,7 +572,6 @@ TkCanvPostscriptCmd(
continue; continue;
} }
Tcl_ResetResult(interp);
result = itemPtr->typePtr->postscriptProc(interp, result = itemPtr->typePtr->postscriptProc(interp,
(Tk_Canvas) canvasPtr, itemPtr, 0); (Tk_Canvas) canvasPtr, itemPtr, 0);
if (result != TCL_OK) { if (result != TCL_OK) {
@@ -585,6 +584,7 @@ TkCanvPostscriptCmd(
Tcl_AppendToObj(psObj, "gsave\n", -1); Tcl_AppendToObj(psObj, "gsave\n", -1);
Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
Tcl_AppendToObj(psObj, "grestore\n", -1); Tcl_AppendToObj(psObj, "grestore\n", -1);
Tcl_ResetResult(interp);
if (psInfo.chan != NULL) { if (psInfo.chan != NULL) {
if (Tcl_WriteObj(psInfo.chan, psObj) == -1) { if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {
@@ -825,7 +825,7 @@ Tk_PostscriptFont(
fontname = Tcl_DStringValue(&ds); fontname = Tcl_DStringValue(&ds);
Tcl_AppendPrintfToObj(GetPostscriptBuffer(interp), Tcl_AppendPrintfToObj(GetPostscriptBuffer(interp),
"/%s findfont %d scalefont%s setfont\n", "/%s findfont %d scalefont%s setfont\n",
fontname, TkFontGetPoints(psInfoPtr->tkwin, points), fontname, (int)(TkFontGetPoints(psInfoPtr->tkwin, points) + 0.5),
strncasecmp(fontname, "Symbol", 7) ? " ISOEncode" : ""); strncasecmp(fontname, "Symbol", 7) ? " ISOEncode" : "");
Tcl_CreateHashEntry(&psInfoPtr->fontTable, Tcl_DStringValue(&ds), &i); Tcl_CreateHashEntry(&psInfoPtr->fontTable, Tcl_DStringValue(&ds), &i);
Tcl_DStringFree(&ds); Tcl_DStringFree(&ds);
@@ -1279,7 +1279,7 @@ TkPostscriptImage(
cdata.colors = ckalloc(sizeof(XColor) * ncolors); cdata.colors = ckalloc(sizeof(XColor) * ncolors);
cdata.ncolors = ncolors; cdata.ncolors = ncolors;
if (visual->class == DirectColor || visual->class == TrueColor) { if (visual->c_class == DirectColor || visual->c_class == TrueColor) {
cdata.separated = 1; cdata.separated = 1;
cdata.red_mask = visual->red_mask; cdata.red_mask = visual->red_mask;
cdata.green_mask = visual->green_mask; cdata.green_mask = visual->green_mask;
@@ -1311,7 +1311,7 @@ TkPostscriptImage(
} }
} }
if (visual->class == StaticGray || visual->class == GrayScale) { if (visual->c_class == StaticGray || visual->c_class == GrayScale) {
cdata.color = 0; cdata.color = 0;
} else { } else {
cdata.color = 1; cdata.color = 1;
@@ -1601,7 +1601,7 @@ Tk_PostscriptPhoto(
/* /*
* Generate data for image in monochrome mode. No attempt at * Generate data for image in monochrome mode. No attempt at
* dithering is made--instead, just set a threshold. To handle * dithering is made--instead, just set a threshold. To handle
* transparecies we need to output two lines: one for the black * transparencies we need to output two lines: one for the black
* pixels, one for the white ones. * pixels, one for the white ones.
*/ */

View File

@@ -107,7 +107,7 @@ static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK, NULL}, NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-fill", NULL, NULL, {TK_CONFIG_COLOR, "-fill", NULL, NULL,
"black", Tk_Offset(TextItem, color), TK_CONFIG_NULL_OK, NULL}, DEF_CANVITEM_OUTLINE, Tk_Offset(TextItem, color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_FONT, "-font", NULL, NULL, {TK_CONFIG_FONT, "-font", NULL, NULL,
DEF_CANVTEXT_FONT, Tk_Offset(TextItem, tkfont), 0, NULL}, DEF_CANVTEXT_FONT, Tk_Offset(TextItem, tkfont), 0, NULL},
{TK_CONFIG_JUSTIFY, "-justify", NULL, NULL, {TK_CONFIG_JUSTIFY, "-justify", NULL, NULL,
@@ -269,9 +269,9 @@ CreateText(
textPtr->textLayout = NULL; textPtr->textLayout = NULL;
textPtr->actualWidth = 0; textPtr->actualWidth = 0;
textPtr->drawOrigin[0] = textPtr->drawOrigin[1] = 0.0; textPtr->drawOrigin[0] = textPtr->drawOrigin[1] = 0.0;
textPtr->gc = None; textPtr->gc = NULL;
textPtr->selTextGC = None; textPtr->selTextGC = NULL;
textPtr->cursorOffGC = None; textPtr->cursorOffGC = NULL;
textPtr->sine = 0.0; textPtr->sine = 0.0;
textPtr->cosine = 1.0; textPtr->cosine = 1.0;
@@ -447,7 +447,7 @@ ConfigureText(
} }
} }
newGC = newSelGC = None; newGC = newSelGC = NULL;
if (textPtr->tkfont != NULL) { if (textPtr->tkfont != NULL) {
gcValues.font = Tk_FontId(textPtr->tkfont); gcValues.font = Tk_FontId(textPtr->tkfont);
mask = GCFont; mask = GCFont;
@@ -472,11 +472,11 @@ ConfigureText(
} }
newSelGC = Tk_GetGC(tkwin, mask|GCForeground, &gcValues); newSelGC = Tk_GetGC(tkwin, mask|GCForeground, &gcValues);
} }
if (textPtr->gc != None) { if (textPtr->gc != NULL) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->gc); Tk_FreeGC(Tk_Display(tkwin), textPtr->gc);
} }
textPtr->gc = newGC; textPtr->gc = newGC;
if (textPtr->selTextGC != None) { if (textPtr->selTextGC != NULL) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->selTextGC); Tk_FreeGC(Tk_Display(tkwin), textPtr->selTextGC);
} }
textPtr->selTextGC = newSelGC; textPtr->selTextGC = newSelGC;
@@ -491,9 +491,9 @@ ConfigureText(
} }
newGC = Tk_GetGC(tkwin, GCForeground, &gcValues); newGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
} else { } else {
newGC = None; newGC = NULL;
} }
if (textPtr->cursorOffGC != None) { if (textPtr->cursorOffGC != NULL) {
Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC); Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC);
} }
textPtr->cursorOffGC = newGC; textPtr->cursorOffGC = newGC;
@@ -592,13 +592,13 @@ DeleteText(
} }
Tk_FreeTextLayout(textPtr->textLayout); Tk_FreeTextLayout(textPtr->textLayout);
if (textPtr->gc != None) { if (textPtr->gc != NULL) {
Tk_FreeGC(display, textPtr->gc); Tk_FreeGC(display, textPtr->gc);
} }
if (textPtr->selTextGC != None) { if (textPtr->selTextGC != NULL) {
Tk_FreeGC(display, textPtr->selTextGC); Tk_FreeGC(display, textPtr->selTextGC);
} }
if (textPtr->cursorOffGC != None) { if (textPtr->cursorOffGC != NULL) {
Tk_FreeGC(display, textPtr->cursorOffGC); Tk_FreeGC(display, textPtr->cursorOffGC);
} }
} }
@@ -820,7 +820,7 @@ DisplayCanvText(
} }
} }
if (textPtr->gc == None) { if (textPtr->gc == NULL) {
return; return;
} }
@@ -932,7 +932,7 @@ DisplayCanvText(
Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable, Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable,
textInfoPtr->insertBorder, points, 4, textInfoPtr->insertBorder, points, 4,
textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED); textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED);
} else if (textPtr->cursorOffGC != None) { } else if (textPtr->cursorOffGC != NULL) {
/* /*
* Redraw the background over the area of the cursor, even * Redraw the background over the area of the cursor, even
* though the cursor is turned off. This guarantees that the * though the cursor is turned off. This guarantees that the
@@ -957,19 +957,23 @@ DisplayCanvText(
*/ */
if ((selFirstChar >= 0) && (textPtr->selTextGC != textPtr->gc)) { if ((selFirstChar >= 0) && (textPtr->selTextGC != textPtr->gc)) {
if (0 < selFirstChar) {
TkDrawAngledTextLayout(display, drawable, textPtr->gc, TkDrawAngledTextLayout(display, drawable, textPtr->gc,
textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->textLayout, drawableX, drawableY, textPtr->angle,
0, selFirstChar); 0, selFirstChar);
}
TkDrawAngledTextLayout(display, drawable, textPtr->selTextGC, TkDrawAngledTextLayout(display, drawable, textPtr->selTextGC,
textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->textLayout, drawableX, drawableY, textPtr->angle,
selFirstChar, selLastChar + 1); selFirstChar, selLastChar + 1);
if (selLastChar + 1 < textPtr->numChars) {
TkDrawAngledTextLayout(display, drawable, textPtr->gc, TkDrawAngledTextLayout(display, drawable, textPtr->gc,
textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->textLayout, drawableX, drawableY, textPtr->angle,
selLastChar + 1, -1); selLastChar + 1, textPtr->numChars);
}
} else { } else {
TkDrawAngledTextLayout(display, drawable, textPtr->gc, TkDrawAngledTextLayout(display, drawable, textPtr->gc,
textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->textLayout, drawableX, drawableY, textPtr->angle,
0, -1); 0, textPtr->numChars);
} }
TkUnderlineAngledTextLayout(display, drawable, textPtr->gc, TkUnderlineAngledTextLayout(display, drawable, textPtr->gc,
textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->textLayout, drawableX, drawableY, textPtr->angle,
@@ -1021,14 +1025,14 @@ TextInsert(
if (index > textPtr->numChars) { if (index > textPtr->numChars) {
index = textPtr->numChars; index = textPtr->numChars;
} }
byteIndex = Tcl_UtfAtIndex(text, index) - text; byteIndex = TkUtfAtIndex(text, index) - text;
byteCount = strlen(string); byteCount = strlen(string);
if (byteCount == 0) { if (byteCount == 0) {
return; return;
} }
newStr = ckalloc(textPtr->numBytes + byteCount + 1); newStr = (char *)ckalloc(textPtr->numBytes + byteCount + 1);
memcpy(newStr, text, (size_t) byteIndex); memcpy(newStr, text, byteIndex);
strcpy(newStr + byteIndex, string); strcpy(newStr + byteIndex, string);
strcpy(newStr + byteIndex + byteCount, text + byteIndex); strcpy(newStr + byteIndex + byteCount, text + byteIndex);
@@ -1104,12 +1108,12 @@ TextDeleteChars(
} }
charsRemoved = last + 1 - first; charsRemoved = last + 1 - first;
byteIndex = Tcl_UtfAtIndex(text, first) - text; byteIndex = TkUtfAtIndex(text, first) - text;
byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved) byteCount = TkUtfAtIndex(text + byteIndex, charsRemoved)
- (text + byteIndex); - (text + byteIndex);
newStr = ckalloc(textPtr->numBytes + 1 - byteCount); newStr = (char *)ckalloc(textPtr->numBytes + 1 - byteCount);
memcpy(newStr, text, (size_t) byteIndex); memcpy(newStr, text, byteIndex);
strcpy(newStr + byteIndex, text + byteIndex + byteCount); strcpy(newStr + byteIndex, text + byteIndex + byteCount);
ckfree(text); ckfree(text);
@@ -1263,7 +1267,6 @@ TextToArea(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static void static void
ScaleText( ScaleText(
Tk_Canvas canvas, /* Canvas containing rectangle. */ Tk_Canvas canvas, /* Canvas containing rectangle. */
@@ -1334,7 +1337,7 @@ TranslateText(
static int static int
GetTextIndex( GetTextIndex(
Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Interp *interp, /* Used for error reporting. */
Tk_Canvas canvas, /* Canvas containing item. */ TCL_UNUSED(Tk_Canvas), /* Canvas containing item. */
Tk_Item *itemPtr, /* Item for which the index is being Tk_Item *itemPtr, /* Item for which the index is being
* specified. */ * specified. */
Tcl_Obj *obj, /* Specification of a particular character in Tcl_Obj *obj, /* Specification of a particular character in
@@ -1345,19 +1348,18 @@ GetTextIndex(
TextItem *textPtr = (TextItem *) itemPtr; TextItem *textPtr = (TextItem *) itemPtr;
int length; int length;
int c; int c;
TkCanvas *canvasPtr = (TkCanvas *) canvas;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
const char *string = Tcl_GetStringFromObj(obj, &length); const char *string = Tcl_GetStringFromObj(obj, &length);
c = string[0]; c = string[0];
if ((c == 'e') && (strncmp(string, "end", (unsigned) length) == 0)) { if ((c == 'e') && (strncmp(string, "end", length) == 0)) {
*indexPtr = textPtr->numChars; *indexPtr = textPtr->numChars;
} else if ((c == 'i') } else if ((c == 'i')
&& (strncmp(string, "insert", (unsigned) length) == 0)) { && (strncmp(string, "insert", length) == 0)) {
*indexPtr = textPtr->insertPos; *indexPtr = textPtr->insertPos;
} else if ((c == 's') && (length >= 5) } else if ((c == 's') && (length >= 5)
&& (strncmp(string, "sel.first", (unsigned) length) == 0)) { && (strncmp(string, "sel.first", length) == 0)) {
if (textInfoPtr->selItemPtr != itemPtr) { if (textInfoPtr->selItemPtr != itemPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj( Tcl_SetObjResult(interp, Tcl_NewStringObj(
"selection isn't in item", -1)); "selection isn't in item", -1));
@@ -1366,7 +1368,7 @@ GetTextIndex(
} }
*indexPtr = textInfoPtr->selectFirst; *indexPtr = textInfoPtr->selectFirst;
} else if ((c == 's') && (length >= 5) } else if ((c == 's') && (length >= 5)
&& (strncmp(string, "sel.last", (unsigned) length) == 0)) { && (strncmp(string, "sel.last", length) == 0)) {
if (textInfoPtr->selItemPtr != itemPtr) { if (textInfoPtr->selItemPtr != itemPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj( Tcl_SetObjResult(interp, Tcl_NewStringObj(
"selection isn't in item", -1)); "selection isn't in item", -1));
@@ -1376,7 +1378,7 @@ GetTextIndex(
*indexPtr = textInfoPtr->selectLast; *indexPtr = textInfoPtr->selectLast;
} else if (c == '@') { } else if (c == '@') {
int x, y; int x, y;
double tmp, c = textPtr->cosine, s = textPtr->sine; double tmp, cs = textPtr->cosine, s = textPtr->sine;
char *end; char *end;
const char *p; const char *p;
@@ -1392,10 +1394,10 @@ GetTextIndex(
goto badIndex; goto badIndex;
} }
y = (int) ((tmp < 0) ? tmp - 0.5 : tmp + 0.5); y = (int) ((tmp < 0) ? tmp - 0.5 : tmp + 0.5);
x += canvasPtr->scrollX1 - (int) textPtr->drawOrigin[0]; x -= (int) textPtr->drawOrigin[0];
y += canvasPtr->scrollY1 - (int) textPtr->drawOrigin[1]; y -= (int) textPtr->drawOrigin[1];
*indexPtr = Tk_PointToChar(textPtr->textLayout, *indexPtr = Tk_PointToChar(textPtr->textLayout,
(int) (x*c - y*s), (int) (y*c + x*s)); (int) (x*cs - y*s), (int) (y*cs + x*s));
} else if (Tcl_GetIntFromObj(NULL, obj, indexPtr) == TCL_OK) { } else if (Tcl_GetIntFromObj(NULL, obj, indexPtr) == TCL_OK) {
if (*indexPtr < 0) { if (*indexPtr < 0) {
*indexPtr = 0; *indexPtr = 0;
@@ -1432,10 +1434,9 @@ GetTextIndex(
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */
static void static void
SetTextCursor( SetTextCursor(
Tk_Canvas canvas, /* Record describing canvas widget. */ TCL_UNUSED(Tk_Canvas), /* Record describing canvas widget. */
Tk_Item *itemPtr, /* Text item in which cursor position is to be Tk_Item *itemPtr, /* Text item in which cursor position is to be
* set. */ * set. */
int index) /* Character index of character just before int index) /* Character index of character just before
@@ -1474,7 +1475,7 @@ SetTextCursor(
static int static int
GetSelText( GetSelText(
Tk_Canvas canvas, /* Canvas containing selection. */ TCL_UNUSED(Tk_Canvas), /* Canvas containing selection. */
Tk_Item *itemPtr, /* Text item containing selection. */ Tk_Item *itemPtr, /* Text item containing selection. */
int offset, /* Byte offset within selection of first int offset, /* Byte offset within selection of first
* character to be returned. */ * character to be returned. */
@@ -1494,8 +1495,8 @@ GetSelText(
return 0; return 0;
} }
text = textPtr->text; text = textPtr->text;
selStart = Tcl_UtfAtIndex(text, textInfoPtr->selectFirst); selStart = TkUtfAtIndex(text, textInfoPtr->selectFirst);
selEnd = Tcl_UtfAtIndex(selStart, selEnd = TkUtfAtIndex(selStart,
textInfoPtr->selectLast + 1 - textInfoPtr->selectFirst); textInfoPtr->selectLast + 1 - textInfoPtr->selectFirst);
byteCount = selEnd - selStart - offset; byteCount = selEnd - selStart - offset;
if (byteCount > maxBytes) { if (byteCount > maxBytes) {
@@ -1605,7 +1606,7 @@ TextToPostscript(
Tcl_GetString(Tcl_GetObjResult(interp))); Tcl_GetString(Tcl_GetObjResult(interp)));
} }
x = 0; y = 0; justify = NULL; /* lint. */ x = 0; y = 0; justify = NULL;
switch (textPtr->anchor) { switch (textPtr->anchor) {
case TK_ANCHOR_NW: x = 0; y = 0; break; case TK_ANCHOR_NW: x = 0; y = 0; break;
case TK_ANCHOR_N: x = 1; y = 0; break; case TK_ANCHOR_N: x = 1; y = 0; break;

View File

@@ -12,7 +12,6 @@
#include "tkInt.h" #include "tkInt.h"
#include "tkCanvas.h" #include "tkCanvas.h"
#include <assert.h>
/* /*
* Structures defined only in this file. * Structures defined only in this file.
@@ -29,15 +28,16 @@ const Tk_SmoothMethod tkBezierSmoothMethod = {
"true", "true",
TkMakeBezierCurve, TkMakeBezierCurve,
(void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, (void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr,
int numPoints, int numSteps)) TkMakeBezierPostscript, int numPoints, int numSteps))(void *)TkMakeBezierPostscript,
}; };
static const Tk_SmoothMethod tkRawSmoothMethod = { static const Tk_SmoothMethod tkRawSmoothMethod = {
"raw", "raw",
TkMakeRawCurve, TkMakeRawCurve,
(void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, (void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr,
int numPoints, int numSteps)) TkMakeRawCurvePostscript, int numPoints, int numSteps))(void *)TkMakeRawCurvePostscript,
}; };
/* /*
* Function forward-declarations. * Function forward-declarations.
*/ */
@@ -756,7 +756,7 @@ TkSmoothParseProc(
} }
/* /*
* Backward compatability hack. * Backward compatibility hack.
*/ */
if (strncmp(value, "bezier", length) == 0) { if (strncmp(value, "bezier", length) == 0) {
@@ -961,7 +961,7 @@ void
Tk_CreateOutline( Tk_CreateOutline(
Tk_Outline *outline) /* Outline structure to be filled in. */ Tk_Outline *outline) /* Outline structure to be filled in. */
{ {
outline->gc = None; outline->gc = NULL;
outline->width = 1.0; outline->width = 1.0;
outline->activeWidth = 0.0; outline->activeWidth = 0.0;
outline->disabledWidth = 0.0; outline->disabledWidth = 0.0;
@@ -1002,7 +1002,7 @@ Tk_DeleteOutline(
Display *display, /* Display containing window. */ Display *display, /* Display containing window. */
Tk_Outline *outline) Tk_Outline *outline)
{ {
if (outline->gc != None) { if (outline->gc != NULL) {
Tk_FreeGC(display, outline->gc); Tk_FreeGC(display, outline->gc);
} }
if ((unsigned) ABS(outline->dash.number) > sizeof(char *)) { if ((unsigned) ABS(outline->dash.number) > sizeof(char *)) {
@@ -1136,7 +1136,9 @@ Tk_ConfigOutlineGC(
if (mask && (dash->number != 0)) { if (mask && (dash->number != 0)) {
gcValues->line_style = LineOnOffDash; gcValues->line_style = LineOnOffDash;
gcValues->dash_offset = outline->offset; gcValues->dash_offset = outline->offset;
if (dash->number > 0) { if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
gcValues->dashes = dash->pattern.pt[0];
} else if (dash->number != 0) {
gcValues->dashes = dash->pattern.array[0]; gcValues->dashes = dash->pattern.array[0];
} else { } else {
gcValues->dashes = (char) (4 * width + 0.5); gcValues->dashes = (char) (4 * width + 0.5);
@@ -1340,7 +1342,9 @@ Tk_ResetOutlineGC(
if ((dash->number > 2) || (dash->number < -1) || (dash->number==2 && if ((dash->number > 2) || (dash->number < -1) || (dash->number==2 &&
(dash->pattern.array[0] != dash->pattern.array[1])) || (dash->pattern.array[0] != dash->pattern.array[1])) ||
((dash->number == -1) && (dash->pattern.array[0] != ','))) { ((dash->number == -1) && (dash->pattern.array[0] != ','))) {
if (dash->number > 0) { if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
dashList = dash->pattern.pt[0];
} else if (dash->number != 0) {
dashList = dash->pattern.array[0]; dashList = dash->pattern.array[0];
} else { } else {
dashList = (char) (4 * width + 0.5); dashList = (char) (4 * width + 0.5);

View File

@@ -85,7 +85,7 @@ static void TranslateWinItem(Tk_Canvas canvas,
static int WinItemCoords(Tcl_Interp *interp, static int WinItemCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
Tcl_Obj *const objv[]); Tcl_Obj *const objv[]);
static void WinItemLostSlaveProc(ClientData clientData, static void WinItemLostContentProc(ClientData clientData,
Tk_Window tkwin); Tk_Window tkwin);
static void WinItemRequestProc(ClientData clientData, static void WinItemRequestProc(ClientData clientData,
Tk_Window tkwin); Tk_Window tkwin);
@@ -141,7 +141,7 @@ Tk_ItemType tkWindowType = {
static const Tk_GeomMgr canvasGeomType = { static const Tk_GeomMgr canvasGeomType = {
"canvas", /* name */ "canvas", /* name */
WinItemRequestProc, /* requestProc */ WinItemRequestProc, /* requestProc */
WinItemLostSlaveProc, /* lostSlaveProc */ WinItemLostContentProc, /* lostSlaveProc */
}; };
/* /*
@@ -1053,26 +1053,26 @@ WinItemRequestProc(
/* /*
*-------------------------------------------------------------- *--------------------------------------------------------------
* *
* WinItemLostSlaveProc -- * WinItemLostContentProc --
* *
* This function is invoked by Tk whenever some other geometry claims * This function is invoked by Tk whenever some other geometry claims
* control over a slave that used to be managed by us. * control over a content window that used to be managed by us.
* *
* Results: * Results:
* None. * None.
* *
* Side effects: * Side effects:
* Forgets all canvas-related information about the slave. * Forgets all canvas-related information about the content window.
* *
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* ARGSUSED */ /* ARGSUSED */
static void static void
WinItemLostSlaveProc( WinItemLostContentProc(
ClientData clientData, /* WindowItem structure for slave window that ClientData clientData, /* WindowItem structure for content window that
* was stolen away. */ * was stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */ Tk_Window tkwin) /* Tk's handle for the content window. */
{ {
WindowItem *winItemPtr = clientData; WindowItem *winItemPtr = clientData;
Tk_Window canvasTkwin = Tk_CanvasTkwin(winItemPtr->canvas); Tk_Window canvasTkwin = Tk_CanvasTkwin(winItemPtr->canvas);

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