Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch core-8-branch Excluding Merge-Ins
This is equivalent to a diff from 32adda38dc to 309bdcc6d8
2024-07-23
| ||
16:10 | Merge core-8-branch check-in: ea7e91293d user: culler tags: trunk, main | |
16:08 | Merge core-8-6-branch. Leaf check-in: 309bdcc6d8 user: culler tags: core-8-branch | |
16:07 | 25.4 / 72.0 - the last and final word! Leaf check-in: 4461d86f3b user: culler tags: core-8-6-branch | |
01:48 | Merge core-8-6-branch check-in: fef11befa1 user: culler tags: core-8-branch | |
2024-06-03
| ||
06:09 | Fix [e64820c1de]: The -justify configure option is duplicated for ttk::label check-in: c57ea83e71 user: fvogel tags: trunk, main | |
2024-06-02
| ||
13:59 | Fix [e64820c1de]: The -justify configure option is duplicated for ttk::label Closed-Leaf check-in: ca68e2948e user: fvogel tags: bug-e64820c1de | |
07:15 | Fix [0fb337ea84]: ttk::combobox selection overruns downarrow element. Thanks to Emiliano Gavilan. check-in: 32adda38dc user: fvogel tags: trunk, main | |
07:15 | Fix [0fb337ea84]: ttk::combobox selection overruns downarrow element. Thanks to Emiliano Gavilan. check-in: ceab69adfa user: fvogel tags: core-8-6-branch | |
2024-05-29
| ||
20:16 | Merge-mark check-in: 045281bc1e user: jan.nijtmans tags: trunk, main | |
Changes to .github/workflows/linux-build.yml.
︙ | ︙ | |||
35 36 37 38 39 40 41 | uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl 8.6 uses: actions/checkout@v4 with: repository: tcltk/tcl | | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl 8.6 uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV |
︙ | ︙ | |||
139 140 141 142 143 144 145 | uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV |
︙ | ︙ |
Deleted .github/workflows/linux-with-tcl8-build.yml.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added .github/workflows/linux-with-tcl86-build.yml.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | name: Linux (with Tcl 8.6) on: push: branches: - "main" - "core-8-branch" - "core-8-6-branch" tags: - "core-**" permissions: contents: read defaults: run: shell: bash working-directory: tk/unix env: ERROR_ON_FAILURES: 1 jobs: build: runs-on: ubuntu-22.04 strategy: matrix: compiler: - "gcc" - "clang" cfgopt: - "" - "CFLAGS=-DTK_NO_DEPRECATED=1" - "--disable-xft" - "--disable-xss" - "--enable-symbols" steps: - name: Checkout uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-6-branch path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV echo "CC=$COMPILER" >> $GITHUB_ENV echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV working-directory: "." env: CFGOPT: ${{ matrix.cfgopt }} COMPILER: ${{ matrix.compiler }} OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - name: Configure and Build Tcl run: | ./configure $CFGOPT "--prefix=$HOME/install dir" || { cat config.log echo "::warning::Failure during Tcl Configure" exit 1 } make all install || { echo "::warning::Failure during Tcl Build" exit 1 } echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV working-directory: tcl/unix - name: Configure (opts=${{ matrix.cfgopt }}) run: | ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH --disable-zipfs "--prefix=$HOME/install dir" || { cat config.log echo "::error::Failure during Configure" exit 1 } - name: Build run: | make binaries libraries || { echo "::error::Failure during Build" exit 1 } - name: Build Test Harness run: | make tktest || { echo "::error::Failure during Build" exit 1 } - name: Test-Drive Installation run: | make install || { echo "::error::Failure during Install" exit 1 } - name: Create Distribution Package run: | make dist || { echo "::error::Failure during Distribute" exit 1 } - name: Convert Documentation to HTML run: | make html-tk TOOL_DIR=$TOOL_DIR || { echo "::error::Failure during Distribute" exit 1 } test: runs-on: ubuntu-22.04 strategy: matrix: compiler: - "gcc" cfgopt: - "" - "--disable-xft" - "--enable-symbols" steps: - name: Checkout uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-6-branch path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV echo "CC=$COMPILER" >> $GITHUB_ENV working-directory: "." env: CFGOPT: ${{ matrix.cfgopt }} COMPILER: ${{ matrix.compiler }} - name: Configure and Build Tcl run: | ./configure $CFGOPT "--prefix=$HOME/install dir" || { cat config.log echo "::warning::Failure during Tcl Configure" exit 1 } make all install || { echo "::warning::Failure during Tcl Build" exit 1 } echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV working-directory: tcl/unix - name: Configure ${{ matrix.cfgopt }} run: | ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { cat config.log echo "::error::Failure during Configure" exit 1 } - name: Build run: | make binaries libraries tktest || { echo "::error::Failure during Build" exit 1 } - name: Run Tests run: | xvfb-run --auto-servernum make test-classic | tee out-classic.txt xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt grep -q "Failed 0" out-classic.txt || { echo "::error::Failure during Test" exit 1 } grep -q "Failed 0" out-ttk.txt || { echo "::error::Failure during Test" exit 1 } timeout-minutes: 15 |
Added .github/workflows/linux-with-tcl9-build.yml.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | name: Linux (with Tcl 9.0) on: push: branches: - "main" - "core-8-branch" - "core-8-6-branch" tags: - "core-**" permissions: contents: read defaults: run: shell: bash working-directory: tk/unix env: ERROR_ON_FAILURES: 1 jobs: build: runs-on: ubuntu-22.04 strategy: matrix: compiler: - "gcc" - "clang" cfgopt: - "" - "CFLAGS=-DTK_NO_DEPRECATED=1" - "--disable-xft" - "--disable-xss" - "--enable-symbols" steps: - name: Checkout uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: main path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV echo "CC=$COMPILER" >> $GITHUB_ENV echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV working-directory: "." env: CFGOPT: ${{ matrix.cfgopt }} COMPILER: ${{ matrix.compiler }} OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - name: Configure and Build Tcl run: | ./configure $CFGOPT "--prefix=$HOME/install dir" || { cat config.log echo "::warning::Failure during Tcl Configure" exit 1 } make all install || { echo "::warning::Failure during Tcl Build" exit 1 } echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV working-directory: tcl/unix - name: Configure (opts=${{ matrix.cfgopt }}) run: | ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { cat config.log echo "::error::Failure during Configure" exit 1 } - name: Build run: | make binaries libraries || { echo "::error::Failure during Build" exit 1 } - name: Build Test Harness run: | make tktest || { echo "::error::Failure during Build" exit 1 } - name: Test-Drive Installation run: | make install || { echo "::error::Failure during Install" exit 1 } - name: Create Distribution Package run: | make dist || { echo "::error::Failure during Distribute" exit 1 } - name: Convert Documentation to HTML run: | make html-tk TOOL_DIR=$TOOL_DIR || { echo "::error::Failure during Distribute" exit 1 } test: runs-on: ubuntu-22.04 strategy: matrix: compiler: - "gcc" cfgopt: - "" - "--disable-xft" - "--enable-symbols" steps: - name: Checkout uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: main path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev mkdir "$HOME/install dir" touch tk/doc/man.macros tk/generic/tkStubInit.c echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV echo "CC=$COMPILER" >> $GITHUB_ENV working-directory: "." env: CFGOPT: ${{ matrix.cfgopt }} COMPILER: ${{ matrix.compiler }} - name: Configure and Build Tcl run: | ./configure $CFGOPT "--prefix=$HOME/install dir" || { cat config.log echo "::warning::Failure during Tcl Configure" exit 1 } make all install || { echo "::warning::Failure during Tcl Build" exit 1 } echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV working-directory: tcl/unix - name: Configure ${{ matrix.cfgopt }} run: | ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { cat config.log echo "::error::Failure during Configure" exit 1 } - name: Build run: | make binaries libraries tktest || { echo "::error::Failure during Build" exit 1 } - name: Run Tests run: | xvfb-run --auto-servernum make test-classic | tee out-classic.txt xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt grep -q "Failed 0" out-classic.txt || { echo "::error::Failure during Test" exit 1 } grep -q "Failed 0" out-ttk.txt || { echo "::error::Failure during Test" exit 1 } timeout-minutes: 15 |
Deleted .github/workflows/linux-with-tcl91-build.yml.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to .github/workflows/mac-build.yml.
︙ | ︙ | |||
9 10 11 12 13 14 15 | - "core-**" permissions: contents: read env: ERROR_ON_FAILURES: 1 jobs: xcode: | | | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - "core-**" permissions: contents: read env: ERROR_ON_FAILURES: 1 jobs: xcode: runs-on: macos-14 defaults: run: shell: bash working-directory: tk/macosx steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Prepare checked out repositories run: | touch tk/generic/tkStubInit.c mkdir build echo "BUILD_DIR=`cd build && pwd`" >> $GITHUB_ENV echo "DESTDIR=`cd build && pwd`" >> $GITHUB_ENV |
︙ | ︙ | |||
53 54 55 56 57 58 59 | if [ $nmatches -lt 4 ] then echo "::error::Failure during Test" exit 1 fi timeout-minutes: 30 clang: | | | | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | if [ $nmatches -lt 4 ] then echo "::error::Failure during Test" exit 1 fi timeout-minutes: 30 clang: runs-on: macos-14 strategy: matrix: symbols: - 'no' - 'mem' options: - '--enable-aqua' # - '--disable-aqua' defaults: run: shell: bash working-directory: tk/unix steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Prepare checked out repositories env: SET_DISPLAY: ${{ contains(matrix.options, '--disable-aqua') }} run: | touch tkStubInit.c mkdir "$HOME/install dir" |
︙ | ︙ |
Changes to .github/workflows/onefiledist.yml.
︙ | ︙ | |||
20 21 22 23 24 25 26 | CC: gcc CFGOPT: --disable-symbols --disable-shared steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk | | | | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | CC: gcc CFGOPT: --disable-symbols --disable-shared steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Setup Environment run: | sudo apt-get install libxss-dev libxft-dev touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c touch tk/generic/tkStubInit.c echo "INST_DIR=$(cd install;pwd)" >> $GITHUB_ENV |
︙ | ︙ | |||
54 55 56 57 58 59 60 | - name: Build & Install Tk run: | make binaries libraries install working-directory: tk/unix # TODO: need the Tk version separately for distro naming below - name: Package run: | | | | | | | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | - name: Build & Install Tk run: | make binaries libraries install working-directory: tk/unix # TODO: need the Tk version separately for distro naming below - name: Package run: | cp bin/wish8.7 ${BUILD_NAME} chmod +x ${BUILD_NAME} tar -cf ${BUILD_NAME}.tar ${BUILD_NAME} working-directory: ${{ env.INST_DIR }} env: BUILD_NAME: wish${{ env.TCL_PATCHLEVEL }}_snapshot - name: Upload uses: actions/upload-artifact@v4 with: name: Wish ${{ env.TCL_PATCHLEVEL }} Linux single-file build (snapshot) path: ${{ env.INST_DIR }}/*.tar - name: Describe Installation Zip Contents if: ${{ always() }} run: | unzip -l wish${{ env.TCL_PATCHLEVEL }}_snapshot || true working-directory: ${{ env.INST_DIR }} macos: name: macOS runs-on: macos-12 defaults: run: shell: bash env: CC: gcc CFGOPT: --disable-symbols --disable-shared steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Checkout create-dmg uses: actions/checkout@v4 with: repository: create-dmg/create-dmg ref: v1.0.8 path: create-dmg |
︙ | ︙ | |||
172 173 174 175 176 177 178 | with: msystem: MINGW64 install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 with: path: tk | | | | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | with: msystem: MINGW64 install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Setup Environment run: | mkdir -p install/combined touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c touch tk/generic/tkStubInit.c echo "INST_DIR=$(cd install;pwd)" >> $GITHUB_ENV |
︙ | ︙ |
Changes to .github/workflows/win-build.yml.
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 | working-directory: tk/win # Using powershell means we need to explicitly stop on failure strategy: matrix: config: - "" - "OPTS=symbols" - "OPTS=static" steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk | > | | | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | working-directory: tk/win # Using powershell means we need to explicitly stop on failure strategy: matrix: config: - "" - "OPTS=symbols" - "OPTS=symbols STATS=compdbg,memdbg" - "OPTS=static" steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Init MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Make Install Location working-directory: tcl run: | echo "TCLDIR=`pwd`" >> $GITHUB_ENV |
︙ | ︙ | |||
116 117 118 119 120 121 122 | - name: Install MSYS2 uses: msys2/setup-msys2@v2 with: msystem: MINGW64 install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 | | | | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - name: Install MSYS2 uses: msys2/setup-msys2@v2 with: msystem: MINGW64 install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl ref: core-8-branch path: tcl - name: Prepare run: | touch tkStubInit.c touch "${HOME}/forWinDialog-5.12.7" mkdir "${HOME}/install_dir" echo "INSTALL_DIR=${HOME}/install_dir" >> $GITHUB_ENV |
︙ | ︙ |
Changes to .project.
1 2 | <?xml version="1.0" encoding="UTF-8"?> <projectDescription> | | | 1 2 3 4 5 6 7 8 9 10 | <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>tk8.7</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> |
︙ | ︙ |
Changes to README.md.
1 2 | # README: Tk | | | 1 2 3 4 5 6 7 8 9 10 | # README: Tk This is the **Tk 8.7b1** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). 8.6 (production release, daily build) [![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) |
︙ | ︙ | |||
21 22 23 24 25 26 27 | ## <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 | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## <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.7 Web page](https://www.tcl-lang.org/software/tcltk/8.7.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 |
︙ | ︙ |
Changes to changes.md.
1 2 3 4 5 6 | The source code for Tk is managed by fossil. Tk developers coordinate all changes to the Tk source code at > [Tk Source Code](https://core.tcl-lang.org/tk/) | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | The source code for Tk is managed by fossil. Tk developers coordinate all changes to the Tk source code at > [Tk Source Code](https://core.tcl-lang.org/tk/) Release Tk 8.7b1 arises from the check-in with tag core-8-7-b1. Highlighted differences between Tk 8.7 and Tk 8.6 are summarized below, with focus on changes important to programmers using the Tk library and writing Tcl scripts containing Tk commands. ## Many improvements to use of platform features and conventions. - Built-in widgets and themes are scaling-aware. - Improved support of two-finger gestures, where available - The `tk windowingsystem` "aqua" needs macOS 10.10 or later |
︙ | ︙ |
Changes to doc/3DBorder.3.
︙ | ︙ | |||
9 10 11 12 13 14 15 | .so man.macros .BS .SH NAME Tk_Alloc3DBorderFromObj, Tk_ClipDrawableToRect, Tk_DrawHighlightBorder, Tk_Get3DBorder, Tk_Get3DBorderColors, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance .SH SYNOPSIS .nf \fB#include <tk.h>\fR | | | > | > | | > | | > | > | > | > | > | > | > | | | | | | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | .so man.macros .BS .SH NAME Tk_Alloc3DBorderFromObj, Tk_ClipDrawableToRect, Tk_DrawHighlightBorder, Tk_Get3DBorder, Tk_Get3DBorderColors, Tk_Get3DBorderFromObj, Tk_Draw3DRectangle, Tk_Fill3DRectangle, Tk_Draw3DPolygon, Tk_Fill3DPolygon, Tk_3DVerticalBevel, Tk_3DHorizontalBevel, Tk_SetBackgroundFromBorder, Tk_NameOf3DBorder, Tk_3DBorderColor, Tk_3DBorderGC, Tk_Free3DBorderFromObj, Tk_Free3DBorder \- draw borders with three-dimensional appearance .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_3DBorder \fBTk_Alloc3DBorderFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp void \fBTk_ClipDrawableToRect(\fIdisplay, drawable, x, y, width, height\fB)\fR .sp void \fBTk_DrawHighlightBorder(\fItkwin, fgGC, bgGC, highlightWidth, drawable\fB)\fR .sp Tk_3DBorder \fBTk_Get3DBorder(\fIinterp, tkwin, colorName\fB)\fR .sp void \fBTk_Get3DBorderColors(\fIborder, bgColorPtr, darkColorPtr, lightColorPtr\fB)\fR .sp Tk_3DBorder \fBTk_Get3DBorderFromObj(\fItkwin, objPtr\fB)\fR .sp void \fBTk_Draw3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR .sp void \fBTk_Fill3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR .sp void \fBTk_Draw3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR .sp void \fBTk_Fill3DPolygon(\fItkwin, drawable, border, pointPtr, numPoints, polyBorderWidth, leftRelief\fB)\fR .sp void \fBTk_3DVerticalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftBevel, relief\fB)\fR .sp void \fBTk_3DHorizontalBevel\fR(\fItkwin, drawable, border, x, y, width, height, leftIn, rightIn, topBevel, relief\fB)\fR .sp void \fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR .sp const char * \fBTk_NameOf3DBorder(\fIborder\fB)\fR .sp XColor * \fBTk_3DBorderColor(\fIborder\fB)\fR .sp GC * \fBTk_3DBorderGC(\fItkwin, border, which\fB)\fR .sp \fBTk_Free3DBorderFromObj(\fItkwin, objPtr\fB)\fR .sp \fBTk_Free3DBorder(\fIborder\fB)\fR .SH ARGUMENTS .AS "Tk_3DBorder" borderWidth .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window (for all procedures except \fBTk_Get3DBorder\fR, must be the window for which the border was allocated). |
︙ | ︙ | |||
87 88 89 90 91 92 93 | .AP int height in Height of rectangle describing border or bevel, in pixels. .AP int borderWidth in Width of border in pixels. Positive means border is inside rectangle given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means border is outside rectangle. .AP int highlightWidth in | | < | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | .AP int height in Height of rectangle describing border or bevel, in pixels. .AP int borderWidth in Width of border in pixels. Positive means border is inside rectangle given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means border is outside rectangle. .AP int highlightWidth in Width of ring around the outside of the widget if the widget has received the input focus. .AP int relief in Indicates 3-D position of interior of value relative to exterior; should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR, \fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR (may also be \fBTK_RELIEF_FLAT\fR for \fBTk_Fill3DRectangle\fR). .AP XPoint *pointPtr in Pointer to array of points describing the set of vertices in a polygon. |
︙ | ︙ | |||
135 136 137 138 139 140 141 | it forms the bottom side. .AP int which in Specifies which of the border's graphics contexts is desired. Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR. .AP XColor *bgColorPtr out Pointer to location in which to store the background color of the given border. .AP XColor *darkColorPtr out | | < | < | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | it forms the bottom side. .AP int which in Specifies which of the border's graphics contexts is desired. Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR. .AP XColor *bgColorPtr out Pointer to location in which to store the background color of the given border. .AP XColor *darkColorPtr out Pointer to location in which to store the color for darker areas of the given border. .AP XColor *lightColorPtr out Pointer to location in which to store the color for lighter areas of the given border. .AP GC fgGC in Foreground X graphics context. .AP GC fgGC in Background X graphics context. .BE .SH DESCRIPTION .PP |
︙ | ︙ | |||
170 171 172 173 174 175 176 | then NULL is returned and an error message is left as the result of interpreter \fIinterp\fR. If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches information about the return value in \fIobjPtr\fR, which speeds up future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR and \fItkwin\fR. .PP | | < < | | < | | | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | then NULL is returned and an error message is left as the result of interpreter \fIinterp\fR. If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches information about the return value in \fIobjPtr\fR, which speeds up future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR and \fItkwin\fR. .PP \fBTk_ClipDrawableToRect\fR will clip all drawing into the drawable d to the given rectangle. If width or height are negative, reset to no clipping. Subsequent drawing into d is offset and clipped as specified. The function is only used when \fBTK_NO_DOUBLE_BUFFERING\fR is specified at compile time. .PP \fBTk_DrawHighlightBorder\fR draws a rectangular ring around the outside of a widget to indicate that it has received the input focus. On the Macintosh, this puts a 1 pixel border in the bgGC color between the widget and the focus ring, except in the case where highlightWidth is 1, in which case the border is left out. For proper Mac L&F, use highlightWidth of 3. .PP \fBTk_Get3DBorder\fR is identical to \fBTk_Alloc3DBorderFromObj\fR except that the color is specified with a string instead of a value. This |
︙ | ︙ | |||
219 220 221 222 223 224 225 | \fIwidth\fR and \fIheight\fR are the dimensions of the window), and \fIborderWidth\fR specifies the number of pixels actually occupied by the border. The \fIrelief\fR argument indicates which of several three-dimensional effects is desired: \fBTK_RELIEF_RAISED\fR means that the interior of the rectangle should appear raised relative to the exterior of the rectangle, and \fBTK_RELIEF_SUNKEN\fR means that the interior should appear depressed. | | | | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | \fIwidth\fR and \fIheight\fR are the dimensions of the window), and \fIborderWidth\fR specifies the number of pixels actually occupied by the border. The \fIrelief\fR argument indicates which of several three-dimensional effects is desired: \fBTK_RELIEF_RAISED\fR means that the interior of the rectangle should appear raised relative to the exterior of the rectangle, and \fBTK_RELIEF_SUNKEN\fR means that the interior should appear depressed. \fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should appear to be a groove or ridge around the exterior of the rectangle. .PP \fBTk_Fill3DRectangle\fR is somewhat like \fBTk_Draw3DRectangle\fR except that it first fills the rectangular area with the background color (one corresponding to the color used to create \fIborder\fR). Then it calls \fBTk_Draw3DRectangle\fR to draw a border just inside the outer edge of the rectangular area. The argument \fIrelief\fR indicates the desired |
︙ | ︙ | |||
318 319 320 321 322 323 324 | with the window and color name used to create the border; for \fBTk_Free3DBorder\fR the border to release is specified with the Tk_3DBorder token for the border. There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or \fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR or \fBTk_Get3DBorder\fR. .SH KEYWORDS | | < | 321 322 323 324 325 326 327 328 | with the window and color name used to create the border; for \fBTk_Free3DBorder\fR the border to release is specified with the Tk_3DBorder token for the border. There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or \fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR or \fBTk_Get3DBorder\fR. .SH KEYWORDS 3D, background, border, color, depressed, illumination, value, polygon, raised, shadow, three-dimensional effect |
Changes to doc/AddOption.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | \fB#include <tk.h>\fR .sp void \fBTk_AddOption\fR(\fItkwin, name, value, priority\fR) .sp Tcl_Obj * \fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | \fB#include <tk.h>\fR .sp void \fBTk_AddOption\fR(\fItkwin, name, value, priority\fR) .sp Tcl_Obj * \fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR) .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. .AP "const char" *name in Multi-element name of option. .AP "const char" *value in Value of option. |
︙ | ︙ |
Changes to doc/BindTable.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings, Tk_BindEvent \- invoke scripts in response to X events .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_BindingTable | | | | | | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | .SH NAME Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding, Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings, Tk_BindEvent \- invoke scripts in response to X events .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_BindingTable \fBTk_CreateBindingTable(\fIinterp\fB)\fR .sp \fBTk_DeleteBindingTable(\fIbindingTable\fB)\fR .sp unsigned long \fBTk_CreateBinding(\fIinterp, bindingTable, object, eventString, script, append\fB)\fR .sp int \fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR .sp const char * \fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR .sp \fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR .sp \fBTk_DeleteAllBindings(\fIbindingTable, object\fB)\fR .sp \fBTk_BindEvent(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fB)\fR .SH ARGUMENTS .AS Tk_BindingTable bindingTable .AP Tcl_Interp *interp in Interpreter to use when invoking bindings in binding table. Also used for returning results and errors from binding procedures. .AP Tk_BindingTable bindingTable in Token for binding table; must have been returned by some previous |
︙ | ︙ | |||
52 53 54 55 56 57 58 | Non-zero means append \fIscript\fR to existing script for binding, if any; zero means replace existing script with new one. .AP XEvent *eventPtr in X event to match against bindings in \fIbindingTable\fR. .AP Tk_Window tkwin in Identifier for any window on the display where the event occurred. Used to find display-related information such as key maps. | | | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | Non-zero means append \fIscript\fR to existing script for binding, if any; zero means replace existing script with new one. .AP XEvent *eventPtr in X event to match against bindings in \fIbindingTable\fR. .AP Tk_Window tkwin in Identifier for any window on the display where the event occurred. Used to find display-related information such as key maps. .AP int numObjects in Number of object identifiers pointed to by \fIobjectPtr\fR. .AP "void **" objectPtr in Points to an array of object identifiers: bindings will be considered for each of these objects in order from first to last. .BE .SH DESCRIPTION .PP |
︙ | ︙ |
Changes to doc/CanvPsY.3.
︙ | ︙ | |||
25 26 27 28 29 30 31 | int \fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR) .sp \fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) .sp int \fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) | < | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | int \fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR) .sp \fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) .sp int \fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) .SH ARGUMENTS .AS int "numPoints" .AP Tk_Canvas canvas in A token that identifies a canvas widget for which Postscript is being generated. .AP double canvasY in Y-coordinate in the space of the canvas. .AP Tcl_Interp *interp in/out A Tcl interpreter; Postscript is appended to its result, or the |
︙ | ︙ | |||
55 56 57 58 59 60 61 | .AP Tk_Font tkFont in Font for which Postscript is to be generated. .AP double *coordPtr in Pointer to an array of coordinates for one or more points specified in canvas coordinates. The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, and so on. | | | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | .AP Tk_Font tkFont in Font for which Postscript is to be generated. .AP double *coordPtr in Pointer to an array of coordinates for one or more points specified in canvas coordinates. The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, and so on. .AP int numPoints in Number of points at \fIcoordPtr\fR. .BE .SH DESCRIPTION .PP These procedures are called by canvas type managers to carry out common functions related to generating Postscript. Most of the procedures take a \fIcanvas\fR argument, which |
︙ | ︙ |
Changes to doc/CanvTkwin.3.
︙ | ︙ | |||
26 27 28 29 30 31 32 | \fBTk_CanvasWindowCoords\fR(\fIcanvas, x, y, screenXPtr, screenYPtr\fR) .sp \fBTk_CanvasEventuallyRedraw\fR(\fIcanvas, x1, y1, x2, y2\fR) .sp Tk_OptionParseProc *\fBTk_CanvasTagsParseProc\fR; .sp Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR; | < | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | \fBTk_CanvasWindowCoords\fR(\fIcanvas, x, y, screenXPtr, screenYPtr\fR) .sp \fBTk_CanvasEventuallyRedraw\fR(\fIcanvas, x1, y1, x2, y2\fR) .sp Tk_OptionParseProc *\fBTk_CanvasTagsParseProc\fR; .sp Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR; .SH ARGUMENTS .AS Tk_ItemType *drawableXPtr .AP Tk_Canvas canvas in A token that identifies a canvas widget. .AP Tcl_Interp *interp in/out Interpreter to use for error reporting. .AP "const char" *string in |
︙ | ︙ | |||
146 147 148 149 150 151 152 | .CS static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { ... | | | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | .CS static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { ... {TK_CONFIG_CUSTOM, "\-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, ... }; .CE .SH KEYWORDS canvas, focus, item type, redisplay, selection, type manager |
Changes to doc/CanvTxtInfo.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_CanvasTextInfo \- additional information for managing text items in canvases .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_CanvasTextInfo * \fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR) | < | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | Tk_CanvasTextInfo \- additional information for managing text items in canvases .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_CanvasTextInfo * \fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR) .SH ARGUMENTS .AS Tk_Canvas canvas .AP Tk_Canvas canvas in A token that identifies a particular canvas widget. .BE .SH DESCRIPTION .PP Textual canvas items are somewhat more complicated to manage than other items, due to things like the selection and the input focus. \fBTk_CanvasGetTextInfo\fR may be invoked by a type manager to obtain additional information needed for items that display text. The return value from \fBTk_CanvasGetTextInfo\fR is a pointer to a structure that is shared between Tk and all the items that display text. The structure has the following form: .CS typedef struct Tk_CanvasTextInfo { Tk_3DBorder \fIselBorder\fR; int \fIselBorderWidth\fR; XColor *\fIselFgColorPtr\fR; Tk_Item *\fIselItemPtr\fR; int \fIselectFirst\fR; int \fIselectLast\fR; Tk_Item *\fIanchorItemPtr\fR; |
︙ | ︙ |
Changes to doc/Clipboard.3.
︙ | ︙ | |||
15 16 17 18 19 20 21 | \fB#include <tk.h>\fR .sp int \fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) .sp int \fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) | < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | \fB#include <tk.h>\fR .sp int \fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) .sp int \fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) .SH ARGUMENTS .AS Tk_ClipboardClear tkwin .AP Tcl_Interp *interp in Interpreter to use for reporting errors. .AP Tk_Window tkwin in Window that determines which display's clipboard to manipulate. .AP Atom target in |
︙ | ︙ |
Changes to doc/ClrSelect.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_ClearSelection \- Deselect a selection .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_ClearSelection\fR(\fItkwin, selection\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_ClearSelection \- Deselect a selection .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_ClearSelection\fR(\fItkwin, selection\fR) .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in The selection will be cleared from the display containing this window. .AP Atom selection in The name of selection to be cleared. |
︙ | ︙ |
Changes to doc/ConfigWidg.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- process configuration options for widgets .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | | | < | | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | .SH NAME Tk_ConfigureWidget, Tk_ConfigureInfo, Tk_ConfigureValue, Tk_FreeOptions \- process configuration options for widgets .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_ConfigureWidget(\fIinterp, tkwin, specs, argc, argv, widgRec, flags\fB)\fR .sp int \fBTk_ConfigureInfo(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR .sp int \fBTk_ConfigureValue(\fIinterp, tkwin, specs, widgRec, argvName, flags\fB)\fR .sp \fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR .SH ARGUMENTS .AS void *widgRec in/out .AP Tcl_Interp *interp in Interpreter to use for returning error messages. .AP Tk_Window tkwin in Window used to represent widget (needed to set up X resources). .AP "const Tk_ConfigSpec" *specs in Pointer to table specifying legal configuration options for this widget. .AP int argc in Number of arguments in \fIargv\fR. .AP "const char" **argv in Command-line options for configuring widget. .AP char *widgRec in/out Points to widget record structure. Fields in this structure get modified by \fBTk_ConfigureWidget\fR to hold configuration information. .AP int flags in If non-zero, then it specifies an OR-ed combination of flags that control the processing of configuration information. |
︙ | ︙ | |||
59 60 61 62 63 64 65 | options. .AP Display *display in Display containing widget whose record is being freed; needed in order to free up resources. .BE .SH DESCRIPTION .PP | | | | | | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | options. .AP Display *display in Display containing widget whose record is being freed; needed in order to free up resources. .BE .SH DESCRIPTION .PP Note: \fBTk_ConfigureWidget\fR should be replaced with the new \fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is retained for backward compatibility. .PP \fBTk_ConfigureWidget\fR is called to configure various aspects of a widget, such as colors, fonts, border width, etc. It is intended as a convenience procedure to reduce the amount of code that must be written in individual widget managers to handle configuration information. It is typically invoked when widgets are created, and again when the \fBconfigure\fR command is invoked for a widget. Although intended primarily for widgets, \fBTk_ConfigureWidget\fR can be used in other situations where \fIargc-argv\fR information is to be used to fill in a record structure, such as configuring graphical elements for a canvas widget or entries of a menu. .PP \fBTk_ConfigureWidget\fR processes a table specifying the configuration options that are supported (\fIspecs\fR) and a collection of command-line arguments (\fIargc\fR and \fIargv\fR) to fill in fields of a record (\fIwidgRec\fR). It uses the option database and defaults specified in \fIspecs\fR to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR. \fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this case it does not modify \fIinterp\fR. If an error occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will leave an error message in interpreter \fIinterp\fR's result in the standard Tcl fashion. In the event of an error return, some of the fields of \fIwidgRec\fR |
︙ | ︙ | |||
117 118 119 120 121 122 123 | (e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for an integer value). The \fItype\fR field indicates how to use the value of the option (more on this below). The \fIargvName\fR field is a string such as .QW \-font or .QW \-bg , | | | | | | | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | (e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for an integer value). The \fItype\fR field indicates how to use the value of the option (more on this below). The \fIargvName\fR field is a string such as .QW \-font or .QW \-bg , which is compared with the values in \fIargv\fR (if \fIargvName\fR is NULL it means this is a grouped entry; see \fBGROUPED ENTRIES\fR below). The \fIdbName\fR and \fIdbClass\fR fields are used to look up a value for this option in the option database. The \fIdefValue\fR field specifies a default value for this configuration option if no value is specified in either \fIargv\fR or the option database. \fIOffset\fR indicates where in \fIwidgRec\fR to store information about this option, and \fIspecFlags\fR contains additional information to control the processing of this configuration option (see FLAGS below). The last field, \fIcustomPtr\fR, is only used if \fItype\fR is \fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below. .PP \fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which (if any) configuration options are specified there. \fIArgv\fR must contain an even number of fields; the first of each pair of fields must match the \fIargvName\fR of some entry in \fIspecs\fR (unique abbreviations are acceptable), and the second field of the pair contains the value for that configuration option. If there are entries in \fIspec\fR for which there were no matching entries in \fIargv\fR, \fBTk_ConfigureWidget\fR uses the \fIdbName\fR and \fIdbClass\fR fields of the \fIspecs\fR entry to probe the option database; if a value is found, then it is used as the value for the option. Finally, if no entry is found in the option database, the \fIdefValue\fR field of the \fIspecs\fR entry is used as the value for the configuration option. If the \fIdefValue\fR is NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in \fIflags\fR, then there is no default value and this \fIspecs\fR entry will be ignored if no value is specified in \fIargv\fR or the option database. .PP Once a string value has been determined for a configuration option, \fBTk_ConfigureWidget\fR translates the string value into a more useful form, such as a color if \fItype\fR is \fBTK_CONFIG_COLOR\fR or an integer if \fItype\fR is \fBTK_CONFIG_INT\fR. This value is then stored in the record pointed to by \fIwidgRec\fR. This record is assumed to |
︙ | ︙ | |||
168 169 170 171 172 173 174 | in the descriptions below. .PP The \fItype\fR field of each entry in \fIspecs\fR determines what to do with the string value of that configuration option. The legal values for \fItype\fR, and the corresponding actions, are: .TP \fBTK_CONFIG_ACTIVE_CURSOR\fR | < < < < < < < < < < < < < < < < < < < > | < | | | < < | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | in the descriptions below. .PP The \fItype\fR field of each entry in \fIspecs\fR determines what to do with the string value of that configuration option. The legal values for \fItype\fR, and the corresponding actions, are: .TP \fBTK_CONFIG_ACTIVE_CURSOR\fR The value must be an ASCII string identifying a cursor in a form suitable for passing to \fBTk_GetCursor\fR. The value is converted to a \fBTk_Cursor\fR by calling \fBTk_GetCursor\fR and the result is stored in the target. In addition, the resulting cursor is made the active cursor for \fItkwin\fR by calling \fBXDefineCursor\fR. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value may be an empty string, in which case the target and \fItkwin\fR's active cursor will be set to \fBNone\fR. If the previous value of the target was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeCursor\fR. .TP \fBTK_CONFIG_ANCHOR\fR The value must be an ASCII string identifying an anchor point in one of the ways accepted by \fBTk_GetAnchor\fR. The string is converted to a \fBTk_Anchor\fR by calling \fBTk_GetAnchor\fR and the result is stored in the target. .TP \fBTK_CONFIG_BITMAP\fR The value must be an ASCII string identifying a bitmap in a form suitable for passing to \fBTk_GetBitmap\fR. The value is converted to a \fBPixmap\fR by calling \fBTk_GetBitmap\fR and the result is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value may be an empty string, in which case the target is set to \fBNone\fR. If the previous value of the target was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR. .TP \fBTK_CONFIG_BOOLEAN\fR The value must be an ASCII string specifying a boolean value. Any of the values .QW true , .QW yes , .QW on , or .QW 1 , or an abbreviation of one of these values, means true; any of the values .QW false , .QW no , .QW off , or .QW 0 , or an abbreviation of one of these values, means false. The target is expected to be an integer; for true values it will be set to 1 and for false values it will be set to 0. .TP \fBTK_CONFIG_BORDER\fR The value must be an ASCII string identifying a border color in a form suitable for passing to \fBTk_Get3DBorder\fR. The value is converted to a (\fBTk_3DBorder *\fR) by calling \fBTk_Get3DBorder\fR and the result is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value may be an empty string, in which case the target will be set to NULL. If the previous value of the target was not NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR. .TP \fBTK_CONFIG_CAP_STYLE\fR The value must be an ASCII string identifying a cap style in one of the ways accepted by \fBTk_GetCapStyle\fR. The string is converted to an integer value corresponding to the cap style by calling \fBTk_GetCapStyle\fR and the result is stored in the target. .TP \fBTK_CONFIG_COLOR\fR The value must be an ASCII string identifying a color in a form suitable for passing to \fBTk_GetColor\fR. The value is converted to an (\fBXColor *\fR) by calling \fBTk_GetColor\fR and the result is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value may be an empty string, in which case the target will be set to \fBNone\fR. If the previous value of the target was not NULL, then it is freed by passing it to \fBTk_FreeColor\fR. .TP \fBTK_CONFIG_CURSOR\fR This option is identical to \fBTK_CONFIG_ACTIVE_CURSOR\fR except that the new cursor is not made the active one for \fItkwin\fR. .TP \fBTK_CONFIG_CUSTOM\fR This option allows applications to define new option types. The \fIcustomPtr\fR field of the entry points to a structure defining the new option type. See the section \fBCUSTOM OPTION TYPES\fR below for details. .TP \fBTK_CONFIG_DOUBLE\fR The value must be an ASCII floating-point number in the format accepted by \fBstrtol\fR. The string is converted to a \fBdouble\fR value, and the value is stored in the target. .TP \fBTK_CONFIG_END\fR Marks the end of the table. The last entry in \fIspecs\fR must have this type; all of its other fields are ignored and it will never match any arguments. .TP \fBTK_CONFIG_FONT\fR The value must be an ASCII string identifying a font in a form suitable for passing to \fBTk_GetFont\fR. The value is converted to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value may be an empty string, in which case the target will be set to NULL. If the previous value of the target was not NULL, then it is freed by passing it to \fBTk_FreeFont\fR. .TP \fBTK_CONFIG_INT\fR The value must be an ASCII integer string in the format accepted by \fBstrtol\fR (e.g. .QW 0 and .QW 0x prefixes may be used to specify octal or hexadecimal numbers, respectively). The string is converted to an integer value and the integer is stored in the target. .TP \fBTK_CONFIG_JOIN_STYLE\fR The value must be an ASCII string identifying a join style in one of the ways accepted by \fBTk_GetJoinStyle\fR. The string is converted to an integer value corresponding to the join style by calling \fBTk_GetJoinStyle\fR and the result is stored in the target. .TP \fBTK_CONFIG_JUSTIFY\fR The value must be an ASCII string identifying a justification method in one of the ways accepted by \fBTk_GetJustify\fR. The string is converted to a \fBTk_Justify\fR by calling \fBTk_GetJustify\fR and the result is stored in the target. .TP \fBTK_CONFIG_MM\fR The value must specify a screen distance in one of the forms acceptable to \fBTk_GetScreenMM\fR. The string is converted to double-precision floating-point distance in millimeters and the value is stored in the target. .TP \fBTK_CONFIG_PIXELS\fR The value must specify screen units in one of the forms acceptable to \fBTk_GetPixels\fR. The string is converted to an integer distance in pixels and the value is stored in the target. .TP \fBTK_CONFIG_RELIEF\fR The value must be an ASCII string identifying a relief in a form suitable for passing to \fBTk_GetRelief\fR. The value is converted to an integer relief value by calling \fBTk_GetRelief\fR and the result is stored in the target. .TP \fBTK_CONFIG_STRING\fR A copy of the value is made by allocating memory space with \fBTcl_Alloc\fR and copying the value into the dynamically-allocated space. A pointer to the new string is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value may be an empty string, in which case the target will be set to NULL. If the previous value of the target was not NULL, then it is freed by passing it to \fBTcl_Free\fR. .TP \fBTK_CONFIG_SYNONYM\fR This \fItype\fR value identifies special entries in \fIspecs\fR that are synonyms for other entries. If an \fIargv\fR value matches the \fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR for another entry whose \fIargvName\fR is the same as the \fIdbName\fR field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just as if its \fIargvName\fR had matched the \fIargv\fR value. The synonym mechanism allows multiple \fIargv\fR values to be used for a single configuration option, such as .QW \-background and .QW \-bg . .TP \fBTK_CONFIG_UID\fR The value is translated to a \fBTk_Uid\fR (by passing it to \fBTk_GetUid\fR). The resulting value is stored in the target. If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR and the value is an empty string then the target will be set to NULL. .TP \fBTK_CONFIG_WINDOW\fR The value must be a window path name. It is translated to a \fBTk_Window\fR token and the token is stored in the target. .SH "GROUPED ENTRIES" .PP In some cases it is useful to generate multiple resources from a single configuration value. For example, a color name might be used both to generate the background color for a widget (using |
︙ | ︙ | |||
399 400 401 402 403 404 405 | The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used in conjunction with the \fIspecFlags\fR fields in the entries of \fIspecs\fR to provide additional control over the processing of configuration options. These values are used in three different ways as described below. .PP First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has | | < | < < < < > > > > > > > > | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used in conjunction with the \fIspecFlags\fR fields in the entries of \fIspecs\fR to provide additional control over the processing of configuration options. These values are used in three different ways as described below. .PP First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0), then the option database and \fIdefValue\fR fields are not used. In this case, if an entry in \fIspecs\fR does not match a field in \fIargv\fR then nothing happens: the corresponding target is not modified. This feature is useful when the goal is to modify certain configuration options while leaving others in their current state, such as when a \fBconfigure\fR widget command is being processed. .PP Second, the \fIspecFlags\fR field of an entry in \fIspecs\fR may be used to control the processing of that entry. Each \fIspecFlags\fR field may consists of an OR-ed combination of the following values: .TP \fBTK_CONFIG_COLOR_ONLY\fR If this bit is set then the entry will only be considered if the display for \fItkwin\fR has more than one bit plane. If the display is monochromatic then this \fIspecs\fR entry will be ignored. .TP \fBTK_CONFIG_MONO_ONLY\fR If this bit is set then the entry will only be considered if the display for \fItkwin\fR has exactly one bit plane. If the display is not monochromatic then this \fIspecs\fR entry will be ignored. .TP \fBTK_CONFIG_NULL_OK\fR This bit is only relevant for some types of entries (see the descriptions of the various entry types above). If this bit is set, it indicates that an empty string value for the field is acceptable and if it occurs then the target should be set to NULL or \fBNone\fR, depending on the type of the target. This flag is typically used to allow a feature to be turned off entirely, e.g. set a cursor value to \fBNone\fR so that a window simply inherits its parent's cursor. If this bit is not set then empty strings are processed as strings, which generally results in an error. .TP \fBTK_CONFIG_DONT_SET_DEFAULT\fR If this bit is one, it means that the \fIdefValue\fR field of the entry should only be used for returning the default value in \fBTk_ConfigureInfo\fR. In calls to \fBTk_ConfigureWidget\fR no default will be supplied for entries with this flag set; it is assumed that the caller has already supplied a default value in the target location. This flag provides a performance optimization where it is expensive to process the default string: the client can compute the default once, save the value, and provide it before calling \fBTk_ConfigureWidget\fR. .TP \fBTK_CONFIG_OPTION_SPECIFIED\fR This bit is deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR so that callers could detect what entries were specified in \fIargv\fR, but it was removed because it was inherently thread-unsafe. Code that wishes to detect what options were specified should use \fBTk_SetOptions\fR instead. .PP The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically used to specify different default values for monochrome and color displays. This is done by creating two entries in \fIspecs\fR that are identical except for their \fIdefValue\fR and \fIspecFlags\fR fields. One entry should have the value \fBTK_CONFIG_MONO_ONLY\fR in its \fIspecFlags\fR and the |
︙ | ︙ | |||
548 549 550 551 552 553 554 | corresponding field of the widget record to null. .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with additional configuration types by writing procedures to parse and print options of the a type and creating a structure pointing to those procedures: .CS | | | | | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | corresponding field of the widget record to null. .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with additional configuration types by writing procedures to parse and print options of the a type and creating a structure pointing to those procedures: .CS typedef struct Tk_CustomOption { Tk_OptionParseProc *\fIparseProc\fR; Tk_OptionPrintProc *\fIprintProc\fR; void *\fIclientData\fR; } \fBTk_CustomOption\fR; typedef int \fBTk_OptionParseProc\fR( void *\fIclientData\fR, Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, char *\fIvalue\fR, char *\fIwidgRec\fR, int \fIoffset\fR); typedef const char *\fBTk_OptionPrintProc\fR( void *\fIclientData\fR, Tk_Window \fItkwin\fR, char *\fIwidgRec\fR, int \fIoffset\fR, Tcl_FreeProc **\fIfreeProcPtr\fR); .CE The Tk_CustomOption structure contains three fields, which are pointers to the two procedures and a \fIclientData\fR value to be passed to those procedures when they are invoked. The \fIclientData\fR value typically points to a structure containing information that is needed by the procedures when they are parsing and printing options. |
︙ | ︙ |
Changes to doc/ConfigWind.3.
︙ | ︙ | |||
35 36 37 38 39 40 41 | \fBTk_SetWindowBorderPixmap\fR(\fItkwin, pixmap\fR) .sp \fBTk_SetWindowColormap\fR(\fItkwin, colormap\fR) .sp \fBTk_DefineCursor\fR(\fItkwin, cursor\fR) .sp \fBTk_UndefineCursor\fR(\fItkwin\fR) | < | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | \fBTk_SetWindowBorderPixmap\fR(\fItkwin, pixmap\fR) .sp \fBTk_SetWindowColormap\fR(\fItkwin, colormap\fR) .sp \fBTk_DefineCursor\fR(\fItkwin, cursor\fR) .sp \fBTk_UndefineCursor\fR(\fItkwin\fR) .SH ARGUMENTS .AS XSetWindowAttributes borderWidth .AP Tk_Window tkwin in Token for window. .AP "unsigned int" valueMask in OR-ed mask of values like \fBCWX\fR or \fBCWBorderPixel\fR, indicating which fields of \fI*valuePtr\fR or \fI*attsPtr\fR to use. |
︙ | ︙ |
Changes to doc/CoordToWin.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_CoordsToWindow \- Find window containing a point .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_CoordsToWindow \- Find window containing a point .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) .SH ARGUMENTS .AS Tk_Window tkwin .AP int rootX in X-coordinate (in root window coordinates). .AP int rootY in Y-coordinate (in root window coordinates). .AP Tk_Window tkwin in |
︙ | ︙ |
Changes to doc/CrtCmHdlr.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateClientMessageHandler\fR(\fIproc\fR) .sp \fBTk_DeleteClientMessageHandler\fR(\fIproc\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateClientMessageHandler\fR(\fIproc\fR) .sp \fBTk_DeleteClientMessageHandler\fR(\fIproc\fR) .SH ARGUMENTS .AP Tk_ClientMessageProc *proc in Procedure to invoke whenever a ClientMessage X event occurs on any display. .BE .SH DESCRIPTION .PP \fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked |
︙ | ︙ |
Changes to doc/CrtConsoleChan.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .SH NAME Tk_InitConsoleChannels \- Install the console channels as standard channels .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_InitConsoleChannels\fR(\fIinterp\fR) | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | .SH NAME Tk_InitConsoleChannels \- Install the console channels as standard channels .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_InitConsoleChannels\fR(\fIinterp\fR) .SH ARGUMENTS .AS Tcl_Interp *interp in .AP Tcl_Interp *interp in Interpreter in which the console channels are created. .BE .SH DESCRIPTION .PP |
︙ | ︙ |
Changes to doc/CrtErrHdlr.3.
︙ | ︙ | |||
14 15 16 17 18 19 20 | .nf \fB#include <tk.h>\fR .sp Tk_ErrorHandler \fBTk_CreateErrorHandler\fR(\fIdisplay, error, request, minor, proc, clientData\fR) .sp \fBTk_DeleteErrorHandler\fR(\fIhandler\fR) | < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .nf \fB#include <tk.h>\fR .sp Tk_ErrorHandler \fBTk_CreateErrorHandler\fR(\fIdisplay, error, request, minor, proc, clientData\fR) .sp \fBTk_DeleteErrorHandler\fR(\fIhandler\fR) .SH ARGUMENTS .AS "Tk_ErrorHandler" clientData .AP Display *display in Display whose errors are to be handled. .AP int error in Match only error events with this value in the \fIerror_code\fR field. If \-1, then match any \fIerror_code\fR value. |
︙ | ︙ |
Changes to doc/CrtGenHdlr.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) .sp \fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) | < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) .sp \fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) .SH ARGUMENTS .AS "Tk_GenericProc" clientData .AP Tk_GenericProc *proc in Procedure to invoke whenever any X event occurs on any display. .AP void *clientData in Arbitrary one-word value to pass to \fIproc\fR. .BE |
︙ | ︙ |
Changes to doc/CrtImgType.3.
1 2 3 4 5 6 7 8 9 10 11 | '\" '\" Copyright (c) 1994 The Regents of the University of California. '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME | | | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | '\" '\" Copyright (c) 1994 The Regents of the University of California. '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateImageType\fR(\fItypePtr\fR) .sp void * \fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR) .sp \fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR) .SH ARGUMENTS .AS "const Tk_ImageType" *typePtrPtr .AP "const Tk_ImageType" *typePtr in Structure that defines the new type of image. For Tk 8.4 and earlier this must be static: a pointer to this structure is retained by the image code. In Tk 8.5, this limitation was relaxed. .AP Tcl_Interp *interp in Interpreter in which image was created. .AP "const char" *name in Name of existing image. .AP Tk_ImageType **typePtrPtr out Points to word in which to store a pointer to type information for the given image, if it exists. .AP int argc in Number of arguments .AP char ***argvPtr in/out Pointer to argument list .BE .SH DESCRIPTION .PP \fBTk_CreateImageType\fR is invoked to define a new kind of image. An image type corresponds to a particular value of the \fItype\fR |
︙ | ︙ | |||
51 52 53 54 55 56 57 | \fIimage manager\fR. It consists of a collection of procedures plus three different kinds of data structures. The first data structure is a Tk_ImageType structure, which contains the name of the image type and pointers to five procedures provided by the image manager to deal with images of this type: .CS | | | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | \fIimage manager\fR. It consists of a collection of procedures plus three different kinds of data structures. The first data structure is a Tk_ImageType structure, which contains the name of the image type and pointers to five procedures provided by the image manager to deal with images of this type: .CS typedef struct Tk_ImageType { const char *\fIname\fR; Tk_ImageCreateProc *\fIcreateProc\fR; Tk_ImageGetProc *\fIgetProc\fR; Tk_ImageDisplayProc *\fIdisplayProc\fR; Tk_ImageFreeProc *\fIfreeProc\fR; Tk_ImageDeleteProc *\fIdeleteProc\fR; } \fBTk_ImageType\fR; |
︙ | ︙ | |||
234 235 236 237 238 239 240 241 242 243 244 | in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is filled in with type information for the image (the \fItypePtr\fR value passed to \fBTk_CreateImageType\fR when the image type was registered) and the return value is the clientData value returned by the \fIcreateProc\fR when the image was created (this is typically a pointer to the image model data structure). If no such image exists then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. .SH "SEE ALSO" Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage .SH KEYWORDS image manager, image type, instance, model | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | in the interpreter given by \fIinterp\fR, then \fI*typePtrPtr\fR is filled in with type information for the image (the \fItypePtr\fR value passed to \fBTk_CreateImageType\fR when the image type was registered) and the return value is the clientData value returned by the \fIcreateProc\fR when the image was created (this is typically a pointer to the image model data structure). If no such image exists then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. .SH "LEGACY INTERFACE SUPPORT" .PP In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR was incompatibly different, with the following prototype: .CS typedef int \fBTk_ImageCreateProc\fR( Tcl_Interp *\fIinterp\fR, char *\fIname\fR, int \fIargc\fR, char **\fIargv\fR, Tk_ImageType *\fItypePtr\fR, Tk_ImageModel \fImodel\fR, void **\fImodelDataPtr\fR); .CE Legacy programs and libraries dating from those days may still contain code that defines extended Tk image types using the old interface. The Tk header file will still support this legacy interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR defined. .PP When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may see the routine \fBTk_InitImageArgs\fR in use. This was a migration tool used to create stub-enabled extensions that could be loaded into interps containing all versions of Tk 8.1 and later. Tk 8.5 no longer provides this routine, but uses a macro to convert any attempted calls of this routine into an empty comment. Any stub-enabled extension providing an extended image type via the legacy interface that is compiled against Tk 8.5 headers and linked against the Tk 8.5 stub library will produce a file that can be loaded only into interps with Tk 8.5 or later; that is, the normal stub-compatibility rules. If a developer needs to generate from such code a file that is loadable into interps with Tk 8.4 or earlier, they must use Tk 8.4 headers and stub libraries to do so. .PP Any new code written today should not make use of the legacy interfaces. Expect their support to go away in Tk 9. .SH "SEE ALSO" Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage .SH KEYWORDS image manager, image type, instance, model |
Changes to doc/CrtItemType.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .nf \fB#include <tk.h>\fR .sp \fBTk_CreateItemType\fR(\fItypePtr\fR) .sp Tk_ItemType * \fBTk_GetItemTypes\fR() | < < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | .nf \fB#include <tk.h>\fR .sp \fBTk_CreateItemType\fR(\fItypePtr\fR) .sp Tk_ItemType * \fBTk_GetItemTypes\fR() .SH ARGUMENTS .AS Tk_ItemType *typePtr .AP Tk_ItemType *typePtr in Structure that defines the new type of canvas item. .BE .SH INTRODUCTION .PP \fBTk_CreateItemType\fR is invoked to define a new kind of canvas item described by the \fItypePtr\fR argument. An item type corresponds to a particular value of the \fItype\fR argument to the \fBcreate\fR widget command for canvases, and |
︙ | ︙ | |||
69 70 71 72 73 74 75 | size_t \fIitemSize\fR; Tk_ItemCreateProc *\fIcreateProc\fR; const Tk_ConfigSpec *\fIconfigSpecs\fR; Tk_ItemConfigureProc *\fIconfigProc\fR; Tk_ItemCoordProc *\fIcoordProc\fR; Tk_ItemDeleteProc *\fIdeleteProc\fR; Tk_ItemDisplayProc *\fIdisplayProc\fR; | | | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | size_t \fIitemSize\fR; Tk_ItemCreateProc *\fIcreateProc\fR; const Tk_ConfigSpec *\fIconfigSpecs\fR; Tk_ItemConfigureProc *\fIconfigProc\fR; Tk_ItemCoordProc *\fIcoordProc\fR; Tk_ItemDeleteProc *\fIdeleteProc\fR; Tk_ItemDisplayProc *\fIdisplayProc\fR; int \fIalwaysRedraw\fR; Tk_ItemPointProc *\fIpointProc\fR; Tk_ItemAreaProc *\fIareaProc\fR; Tk_ItemPostscriptProc *\fIpostscriptProc\fR; Tk_ItemScaleProc *\fIscaleProc\fR; Tk_ItemTranslateProc *\fItranslateProc\fR; Tk_ItemIndexProc *\fIindexProc\fR; Tk_ItemCursorProc *\fIicursorProc\fR; Tk_ItemSelectionProc *\fIselectionProc\fR; Tk_ItemInsertProc *\fIinsertProc\fR; Tk_ItemDCharsProc *\fIdCharsProc\fR; Tk_ItemType *\fInextPtr\fR; .VS "8.7, TIP164" Tk_ItemRotateProc *\fIrotateProc\fR; .VE "8.7, TIP164" } \fBTk_ItemType\fR; .CE .PP The fields of a Tk_ItemType structure are described in more detail |
︙ | ︙ | |||
111 112 113 114 115 116 117 | defined by Tk via the type Tk_Item; the rest of the item record is defined by the type manager. A type manager must define its item records with a Tk_Item as the first field. For example, the item record for bitmap items is defined as follows: .PP .CS | | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | defined by Tk via the type Tk_Item; the rest of the item record is defined by the type manager. A type manager must define its item records with a Tk_Item as the first field. For example, the item record for bitmap items is defined as follows: .PP .CS typedef struct BitmapItem { Tk_Item \fIheader\fR; double \fIx\fR, \fIy\fR; Tk_Anchor \fIanchor\fR; Pixmap \fIbitmap\fR; XColor *\fIfgColor\fR; XColor *\fIbgColor\fR; GC \fIgc\fR; |
︙ | ︙ | |||
167 168 169 170 171 172 173 | Once \fBTk_CreateImageType\fR returns, this name may be used in \fBcreate\fR widget commands to create items of the new type. If there already existed an item type by this name then the new item type replaces the old one. .SS "FLAGS (IN ALWAYSREDRAW)" .PP | | > > > > > > > > | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | Once \fBTk_CreateImageType\fR returns, this name may be used in \fBcreate\fR widget commands to create items of the new type. If there already existed an item type by this name then the new item type replaces the old one. .SS "FLAGS (IN ALWAYSREDRAW)" .PP The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons) contains a collection of flag bits that modify how the canvas core interacts with the item. The following bits are defined: .TP \fBTK_ALWAYS_REDRAW\fR . Indicates that the item should always be redrawn when any part of the canvas is redrawn, rather than only when the bounding box of the item overlaps the area being redrawn. This is used by window items, for example, which need to unmap subwindows that are not on the screen. .TP \fBTK_CONFIG_OBJS\fR . Indicates that operations which would otherwise take a string (or array of strings) actually take a Tcl_Obj reference (or an array of such references). The operations to which this applies are the \fIconfigProc\fR, the \fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the \fIinsertProc\fR. .TP \fBTK_MOVABLE_POINTS\fR .VS 8.6 Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and \fIinsertProc\fR with the same semantics as Tk's built-in line and polygon types, and that hence individual coordinate points can be moved. Must not be set if any of the above methods is NULL. |
︙ | ︙ | |||
219 220 221 222 223 224 225 226 227 228 229 230 231 232 | \fIitemPtr\fR is a pointer to a newly-allocated item of size \fItypePtr\->itemSize\fR. Tk has already initialized the item's header (the first \fBsizeof(Tk_ItemType)\fR bytes). The \fIobjc\fR and \fIobjv\fR arguments describe all of the arguments to the \fBcreate\fR command after the \fItype\fR argument. For example, in the widget command: .PP .CS \fB\&.c create rectangle 10 20 50 50 \-fill black\fR .CE .PP \fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the | > > > | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | \fIitemPtr\fR is a pointer to a newly-allocated item of size \fItypePtr\->itemSize\fR. Tk has already initialized the item's header (the first \fBsizeof(Tk_ItemType)\fR bytes). The \fIobjc\fR and \fIobjv\fR arguments describe all of the arguments to the \fBcreate\fR command after the \fItype\fR argument. Note that if \fBTK_CONFIG_OBJS\fR is not set in the \fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually contain a pointer to an array of constant strings. For example, in the widget command: .PP .CS \fB\&.c create rectangle 10 20 50 50 \-fill black\fR .CE .PP \fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the |
︙ | ︙ | |||
248 249 250 251 252 253 254 | \fBTk_ConfigureWidget\fR. This table will normally be used by \fItypePtr\->createProc\fR and \fItypePtr\->configProc\fR, but Tk also uses it directly to retrieve option information in the \fBitemcget\fR and \fBitemconfigure\fR widget commands. \fItypePtr\->configSpecs\fR must point to the configuration table for this type. | < | | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | \fBTk_ConfigureWidget\fR. This table will normally be used by \fItypePtr\->createProc\fR and \fItypePtr\->configProc\fR, but Tk also uses it directly to retrieve option information in the \fBitemcget\fR and \fBitemconfigure\fR widget commands. \fItypePtr\->configSpecs\fR must point to the configuration table for this type. Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR for implementing the \fB\-tags\fR option; see an existing type manager for an example of how to use it in \fIconfigSpecs\fR. .SS CONFIGPROC .PP \fItypePtr\->configProc\fR is called by Tk whenever the \fBitemconfigure\fR widget command is invoked to change the configuration options for a canvas item. |
︙ | ︙ | |||
273 274 275 276 277 278 279 280 281 282 283 284 285 286 | int \fIflags\fR); .CE .PP The \fIinterp\fR argument identifies the interpreter in which the widget command was invoked, \fIcanvas\fR is a handle for the canvas widget, and \fIitemPtr\fR is a pointer to the item being configured. \fIobjc\fR and \fIobjv\fR contain the configuration options. For example, if the following command is invoked: .PP .CS \fB\&.c itemconfigure 2 \-fill red \-outline black\fR .CE .PP \fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR | > > > | 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | int \fIflags\fR); .CE .PP The \fIinterp\fR argument identifies the interpreter in which the widget command was invoked, \fIcanvas\fR is a handle for the canvas widget, and \fIitemPtr\fR is a pointer to the item being configured. \fIobjc\fR and \fIobjv\fR contain the configuration options. Note that if \fBTK_CONFIG_OBJS\fR is not set in the \fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually contain a pointer to an array of constant strings. For example, if the following command is invoked: .PP .CS \fB\&.c itemconfigure 2 \-fill red \-outline black\fR .CE .PP \fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR |
︙ | ︙ | |||
309 310 311 312 313 314 315 316 317 318 319 320 321 322 | int \fIobjc\fR, Tcl_Obj *const \fIobjv\fR[]); .CE .PP The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR all have the standard meanings, and \fIobjc\fR and \fIobjv\fR describe the coordinate arguments. For example, if the following widget command is invoked: .PP .CS \fB\&.c coords 2 30 90\fR .CE .PP \fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects | > > > | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | int \fIobjc\fR, Tcl_Obj *const \fIobjv\fR[]); .CE .PP The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR all have the standard meanings, and \fIobjc\fR and \fIobjv\fR describe the coordinate arguments. Note that if \fBTK_CONFIG_OBJS\fR is not set in the \fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually contain a pointer to an array of constant strings. For example, if the following widget command is invoked: .PP .CS \fB\&.c coords 2 30 90\fR .CE .PP \fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects |
︙ | ︙ | |||
383 384 385 386 387 388 389 | will not necessarily be the same as those in the canvas. \fIdisplayProc\fR should call \fBTk_CanvasDrawableCoords\fR to transform coordinates from those of the canvas to those of \fIdst\fR. .PP Normally an item's \fIdisplayProc\fR is only invoked if the item overlaps the area being displayed. | | | | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | will not necessarily be the same as those in the canvas. \fIdisplayProc\fR should call \fBTk_CanvasDrawableCoords\fR to transform coordinates from those of the canvas to those of \fIdst\fR. .PP Normally an item's \fIdisplayProc\fR is only invoked if the item overlaps the area being displayed. However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1, (i.e.\| .QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" ) then \fIdisplayProc\fR is invoked during every redisplay operation, even if the item does not overlap the area of redisplay; this is useful for cases such as window items, where the subwindow needs to be unmapped when it is off the screen. .SS POINTPROC .PP \fItypePtr\->pointProc\fR is invoked by Tk to find out how close |
︙ | ︙ | |||
559 560 561 562 563 564 565 | the item is to be rotated, and \fIangleRad\fR gives the anticlockwise rotation to be applied in radians. The item should adjust the coordinates of its control points so that where they used to have coordinates \fIx\fR and \fIy\fR, they will have new coordinates \fIx\(fm\fR and \fIy\(fm\fR, where .PP .CS | | | | 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | the item is to be rotated, and \fIangleRad\fR gives the anticlockwise rotation to be applied in radians. The item should adjust the coordinates of its control points so that where they used to have coordinates \fIx\fR and \fIy\fR, they will have new coordinates \fIx\(fm\fR and \fIy\(fm\fR, where .PP .CS \fIrelX\fR = \fIx\fR - \fIoriginX\fR \fIrelY\fR = \fIy\fR - \fIoriginY\fR \fIx\(fm\fR = \fIoriginX\fR + \fIrelX\fR \(mu cos(\fIangleRad\fR) + \fIrelY\fR \(mu sin(\fIangleRad\fR) \fIy\(fm\fR = \fIoriginY\fR \(mi \fIrelX\fR \(mu sin(\fIangleRad\fR) + \fIrelY\fR \(mu cos(\fIangleRad\fR) .CE .PP The control points for an item are not necessarily the coordinates provided to the item when it is created (or via the \fItypePtr\->coordProc\fR), but could instead be derived from them. |
︙ | ︙ | |||
598 599 600 601 602 603 604 605 606 607 608 609 610 611 | .CE .PP The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have the usual meaning. \fIindexObj\fR contains a textual description of an index, and \fIindexPtr\fR points to an integer value that should be filled in with a numerical index. It is up to the type manager to decide what forms of index are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR, \fBend\fR, etc.). \fIindexProc\fR should return a Tcl completion code and set the interpreter result in the event of an error. .SS ICURSORPROC .PP | > > > | 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | .CE .PP The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have the usual meaning. \fIindexObj\fR contains a textual description of an index, and \fIindexPtr\fR points to an integer value that should be filled in with a numerical index. Note that if \fBTK_CONFIG_OBJS\fR is not set in the \fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will actually contain a pointer to a constant string. It is up to the type manager to decide what forms of index are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR, \fBend\fR, etc.). \fIindexProc\fR should return a Tcl completion code and set the interpreter result in the event of an error. .SS ICURSORPROC .PP |
︙ | ︙ | |||
681 682 683 684 685 686 687 688 689 690 691 692 693 694 | .CE .PP \fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIindex\fR is an index into the item's text, as returned by a previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR contains new text to insert just before the character given by \fIindex\fR. If the item supports modification of the coordinates list by this .PP The type manager should insert the text and recompute the bounding box in the item's header. .SS DCHARSPROC .PP \fItypePtr\->dCharsProc\fR is invoked by Tk during the \fBdchars\fR | > > > | 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | .CE .PP \fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIindex\fR is an index into the item's text, as returned by a previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR contains new text to insert just before the character given by \fIindex\fR. Note that if \fBTK_CONFIG_OBJS\fR is not set in the \fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will actually contain a pointer to a constant string to be inserted. If the item supports modification of the coordinates list by this .PP The type manager should insert the text and recompute the bounding box in the item's header. .SS DCHARSPROC .PP \fItypePtr\->dCharsProc\fR is invoked by Tk during the \fBdchars\fR |
︙ | ︙ |
Changes to doc/CrtPhImgFmt.3.
︙ | ︙ | |||
54 55 56 57 58 59 60 | An image file format handler consists of a collection of procedures plus a \fBTk_PhotoImageFormatVersion3\fR structure, which contains the name of the image file format and pointers to six procedures provided by the handler to deal with files and strings in this format. The Tk_PhotoImageFormatVersion3 structure contains the following fields: .VS 8.7 .CS | | | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | An image file format handler consists of a collection of procedures plus a \fBTk_PhotoImageFormatVersion3\fR structure, which contains the name of the image file format and pointers to six procedures provided by the handler to deal with files and strings in this format. The Tk_PhotoImageFormatVersion3 structure contains the following fields: .VS 8.7 .CS typedef struct Tk_PhotoImageFormatVersion3 { const char *\fIname\fR; Tk_ImageFileMatchProcVersion3 *\fIfileMatchProc\fR; Tk_ImageStringMatchProcVersion3 *\fIstringMatchProc\fR; Tk_ImageFileReadProcVersion3 *\fIfileReadProc\fR; Tk_ImageStringReadProcVersion3 *\fIstringReadProc\fR; Tk_ImageFileWriteProcVersion3 *\fIfileWriteProc\fR; Tk_ImageStringWriteProcVersion3 *\fIstringWriteProc\fR; |
︙ | ︙ | |||
147 148 149 150 151 152 153 | return 0. .SS FILEREADPROC .PP \fIformatPtr->fileReadProc\fR provides the address of a procedure for Tk to call to read data from an image file into a photo image. \fIformatPtr->fileReadProc\fR must match the following prototype: .CS | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | return 0. .SS FILEREADPROC .PP \fIformatPtr->fileReadProc\fR provides the address of a procedure for Tk to call to read data from an image file into a photo image. \fIformatPtr->fileReadProc\fR must match the following prototype: .CS typedef int \fBTk_ImageFileReadProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Channel \fIchan\fR, const char *\fIfileName\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, PhotoHandle \fIimageHandle\fR, int \fIdestX\fR, int \fIdestY\fR, |
︙ | ︙ | |||
180 181 182 183 184 185 186 | The return value is a standard Tcl return value. .SS STRINGREADPROC .PP \fIformatPtr->stringReadProc\fR provides the address of a procedure for Tk to call to read data from a string into a photo image. \fIformatPtr->stringReadProc\fR must match the following prototype: .CS | | | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | The return value is a standard Tcl return value. .SS STRINGREADPROC .PP \fIformatPtr->stringReadProc\fR provides the address of a procedure for Tk to call to read data from a string into a photo image. \fIformatPtr->stringReadProc\fR must match the following prototype: .CS typedef int \fBTk_ImageStringReadProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIdata\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, PhotoHandle \fIimageHandle\fR, int \fIdestX\fR, int \fIdestY\fR, int \fIwidth\fR, int \fIheight\fR, |
︙ | ︙ | |||
212 213 214 215 216 217 218 | The return value is a standard Tcl return value. .SS FILEWRITEPROC .PP \fIformatPtr->fileWriteProc\fR provides the address of a procedure for Tk to call to write data from a photo image to a file. \fIformatPtr->fileWriteProc\fR must match the following prototype: .CS | | | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | The return value is a standard Tcl return value. .SS FILEWRITEPROC .PP \fIformatPtr->fileWriteProc\fR provides the address of a procedure for Tk to call to write data from a photo image to a file. \fIformatPtr->fileWriteProc\fR must match the following prototype: .CS typedef int \fBTk_ImageFileWriteProc\fR( Tcl_Interp *\fIinterp\fR, const char *\fIfileName\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE The \fIinterp\fR argument is the interpreter in which the command was |
︙ | ︙ | |||
241 242 243 244 245 246 247 | .SS STRINGWRITEPROC .PP \fIformatPtr->stringWriteProc\fR provides the address of a procedure for Tk to call to translate image data from a photo image into a string. \fIformatPtr->stringWriteProc\fR must match the following prototype: .CS | | | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | .SS STRINGWRITEPROC .PP \fIformatPtr->stringWriteProc\fR provides the address of a procedure for Tk to call to translate image data from a photo image into a string. \fIformatPtr->stringWriteProc\fR must match the following prototype: .CS typedef int \fBTk_ImageStringWriteProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE The \fIinterp\fR argument is the interpreter in which the command was invoked to convert the image; it should be used for reporting errors. |
︙ | ︙ | |||
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | .PP Image formats contain a description of the image bitmap and may contain additional information like image resolution or comments. Image metadata may be read from image files and passed to the script level by including dictionary keys into the metadata property of the image. Image metadata may be written to image data on file write or image data output. .PP .SS "METADATA KEYS" .PP The metadata may contain any key. A driver will handle only a set of dictionary keys documented in the documentation. See the photo image manual page for currently defined keys for the system drivers. .PP The following rules may give guidance to name metadata keys: | > | | | > | > > | < < < | | | | | | | | | < < | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | .PP Image formats contain a description of the image bitmap and may contain additional information like image resolution or comments. Image metadata may be read from image files and passed to the script level by including dictionary keys into the metadata property of the image. Image metadata may be written to image data on file write or image data output. .PP .PP .SS "METADATA KEYS" .PP The metadata may contain any key. A driver will handle only a set of dictionary keys documented in the documentation. See the photo image manual page for currently defined keys for the system drivers. .PP The following rules may give guidance to name metadata keys: .RS Abreviation are in upper case .RE .RS Words are in US English in small case (except proper nouns) .RE .RS Vertical DPI is expressed as DPI/aspect. The reason is, that some image formats may feature aspect and no resolution value. .RE .SS "METADATA INPUT" .PP Each driver function gets a Tcl object pointer \fBmetadataIn\fR as parameter. This parameter serves to input a metadata dict to the driver function. It may be NULL to flag that the metadata dict is empty. .PP A typical driver code snipped to check for a metadata key is: .CS if (NULL != metadataIn) { Tcl_Obj *itemData; Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1), &itemData)); .CE .PP The \-metadata command option data of the following commands is passed to the driver: \fBimage create\fR, \fBconfigure\fR, \fBput\fR, \fBread\fR, \fBdata\fR and \fBwrite\fR. If no \-metadata command option available or not given, the metadata property of the image is passed to the driver using the following commands: \fBcget\fR, \fBconfigure\fR, \fBdata\fR and \fBwrite\fR. .PP Note that setting the \-metadata property of an image using \fBconfigure\fR without any other option does not invoke any driver function. .PP The metadata dictionary is not suited to pass options to the driver related to the bitmap representation, as the image bitmap is not recreated on a metadata change. The format string should be used for this purpose. .PP .SS "METADATA OUTPUT" .PP The image match and read driver functions may set keys in a prepared matadata dict to return them. Those functions get a Tcl object pointer \fBmetadataOut\fR as parameter. metadataOut may be NULL to indicate, that no metadata return is attended(\fBput\fR, \fBread\fR subcommands). \fBmetadataOut\fR is initialized to an empty unshared dict object if metadata return is attended (\fBimage create\fR command, \fBconfigure\fR subcommand). The driver may set dict keys in this object to return metadata. If a match function succeeds, the metadataOut pointer is passed to the corresponding read function. .PP A sample driver code snippet is: .CS if (NULL != metadataOut) { Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1), Tcl_NewStringObj(xmpMetadata); .CE .PP The metadata keys returned by the driver are merged into the present metadata property of the image or into the metadata dict given by the \fB\-metadata\fR command line option. At the script level, the command \fBimage create\fR and the \fBconfigure\fR method may return metadata from the driver. |
︙ | ︙ | |||
373 374 375 376 377 378 379 | Structure that defines the new file format. .BE .SS DESCRIPTION A driver using the version 2 interface invokes \fBTk_CreatePhotoImageFormat\fR for driver registration. The Tk_PhotoImageFormat structure contains the following fields: .CS | | | 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | Structure that defines the new file format. .BE .SS DESCRIPTION A driver using the version 2 interface invokes \fBTk_CreatePhotoImageFormat\fR for driver registration. The Tk_PhotoImageFormat structure contains the following fields: .CS typedef struct Tk_PhotoImageFormat { const char *\fIname\fR; Tk_ImageFileMatchProc *\fIfileMatchProc\fR; Tk_ImageStringMatchProc *\fIstringMatchProc\fR; Tk_ImageFileReadProc *\fIfileReadProc\fR; Tk_ImageStringReadProc *\fIstringReadProc\fR; Tk_ImageFileWriteProc *\fIfileWriteProc\fR; Tk_ImageStringWriteProc *\fIstringWriteProc\fR; |
︙ | ︙ | |||
454 455 456 457 458 459 460 461 462 463 464 | \fIformatPtr->stringWriteProc\fR must match the following prototype: .CS typedef int \fBTk_ImageStringWriteProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIformat\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE .SH "SEE ALSO" Tk_FindPhoto, Tk_PhotoPutBlock .SH KEYWORDS photo image, image file | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | \fIformatPtr->stringWriteProc\fR must match the following prototype: .CS typedef int \fBTk_ImageStringWriteProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIformat\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE .PP .SH "LEGACY INTERFACE SUPPORT" .PP In Tk 8.2 and earlier, the definition of all the function pointer types stored in fields of a \fBTk_PhotoImageFormat\fR struct were incompatibly different. Legacy programs and libraries dating from those days may still contain code that defines extended Tk photo image formats using the old interface. The Tk header file will still support this legacy interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR defined. Alternatively, the legacy interfaces are used if the first character of \fIformatPtr->name\fR is an uppercase ASCII character (\fBA\fR-\fBZ\fR), and explicit casts are used to forgive the type mismatch. For example, .CS static Tk_PhotoImageFormat myFormat = { "MyFormat", (Tk_ImageFileMatchProc *) FileMatch, NULL, (Tk_ImageFileReadProc *) FileRead, NULL, NULL, NULL }; .CE would define a minimal \fBTk_PhotoImageFormat\fR that operates provide only file reading capability, where \fBFileMatch\fR and \fBFileRead\fR are written according to the legacy interfaces of Tk 8.2 or earlier. .PP Any stub-enabled extension providing an extended photo image format via the legacy interface enabled by the \fBUSE_OLD_IMAGE\fR macro that is compiled against Tk 8.5 headers and linked against the Tk 8.5 stub library will produce a file that can be loaded only into interps with Tk 8.5 or later; that is, the normal stub-compatibility rules. If a developer needs to generate from such code a file that is loadable into interps with Tk 8.4 or earlier, they must use Tk 8.4 headers and stub libraries to do so. .PP Any new code written today should not make use of the legacy interfaces. Expect their support to go away in Tk 9. .SH "SEE ALSO" Tk_FindPhoto, Tk_PhotoPutBlock .SH KEYWORDS photo image, image file |
Changes to doc/CrtSelHdlr.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR) .sp \fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR) | < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR) .sp \fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR) .SH ARGUMENTS .AS Tk_SelectionProc clientData .AP Tk_Window tkwin in Window for which \fIproc\fR will provide selection information. .AP Atom selection in The name of the selection for which \fIproc\fR will provide selection information. |
︙ | ︙ | |||
51 52 53 54 55 56 57 | X Inter-Client Communication Conventions Manual (ICCCM) or any other form in which an application is willing to present the selection. The most common form is STRING. .PP \fIProc\fR should have arguments and result that match the type \fBTk_SelectionProc\fR: .CS | | | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | X Inter-Client Communication Conventions Manual (ICCCM) or any other form in which an application is willing to present the selection. The most common form is STRING. .PP \fIProc\fR should have arguments and result that match the type \fBTk_SelectionProc\fR: .CS typedef int \fBTk_SelectionProc\fR( void *\fIclientData\fR, int \fIoffset\fR, char *\fIbuffer\fR, int \fImaxBytes\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR argument given to \fBTk_CreateSelHandler\fR. Typically, \fIclientData\fR points to a data structure containing application-specific information that is needed to retrieve the selection. \fIOffset\fR specifies an offset position into the selection, \fIbuffer\fR specifies a |
︙ | ︙ |
Changes to doc/CrtWindow.3.
︙ | ︙ | |||
22 23 24 25 26 27 28 | .sp Tk_Window \fBTk_CreateWindowFromPath\fR(\fIinterp, tkwin, pathName, topLevScreen\fR) .sp \fBTk_DestroyWindow\fR(\fItkwin\fR) .sp \fBTk_MakeWindowExist\fR(\fItkwin\fR) | < | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | .sp Tk_Window \fBTk_CreateWindowFromPath\fR(\fIinterp, tkwin, pathName, topLevScreen\fR) .sp \fBTk_DestroyWindow\fR(\fItkwin\fR) .sp \fBTk_MakeWindowExist\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tcl_Interp *topLevScreen .AP Tcl_Interp *interp out Tcl interpreter to use for error reporting. If no error occurs, then \fI*interp\fR is not modified. .AP Tk_Window parent in Token for the window that is to serve as the logical parent of |
︙ | ︙ |
Changes to doc/DeleteImg.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .SH NAME Tk_DeleteImage \- Destroy an image. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_DeleteImage\fR(\fIinterp, name\fR) | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | .SH NAME Tk_DeleteImage \- Destroy an image. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_DeleteImage\fR(\fIinterp, name\fR) .SH ARGUMENTS .AS Tcl_Interp *interp .AP Tcl_Interp *interp in Interpreter for which the image was created. .AP "const char" *name in Name of the image. .BE |
︙ | ︙ |
Changes to doc/DrawFocHlt.3.
︙ | ︙ | |||
9 10 11 12 13 14 15 | .BS .SH NAME Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp | | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | .BS .SH NAME Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tk_Window tkwin in Window for which the highlight is being drawn. Used to retrieve the window's dimensions, among other things. .AP GC gc in Graphics context to use for drawing the highlight. |
︙ | ︙ |
Changes to doc/EventHndlr.3.
︙ | ︙ | |||
17 18 19 20 21 22 23 | \fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) .sp \fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) .sp \fBTk_GetButtonMask\fR(\fIbutton\fR) .sp \fBTk_SendVirtualEvent\fR(\fItkwin, eventName, detail\fR) | < | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | \fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) .sp \fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) .sp \fBTk_GetButtonMask\fR(\fIbutton\fR) .sp \fBTk_SendVirtualEvent\fR(\fItkwin, eventName, detail\fR) .SH ARGUMENTS .AS "unsigned long" clientData .AP unsigned button in Button number. .AP "const char" *eventName in The name of the virtual event. .AP Tcl_Obj *detail in |
︙ | ︙ |
Changes to doc/FindPhoto.3.
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | int \fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\ zoomX, zoomY, subsampleX, subsampleY, compRule\fR) .sp int \fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR) .sp \fBTk_PhotoBlank\fR(\fIhandle\fR) .sp int \fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR) .sp \fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR) .sp int \fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR) | > > < | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | int \fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\ zoomX, zoomY, subsampleX, subsampleY, compRule\fR) .sp int \fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR) .sp void \fBTk_PhotoBlank\fR(\fIhandle\fR) .sp int \fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR) .sp void \fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR) .sp int \fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR) .SH ARGUMENTS .AS Tk_PhotoImageBlock window_path .AP Tcl_Interp *interp in Interpreter in which image was created and in which error reporting is to be done. .AP "const char" *imageName in Name of the photo image. |
︙ | ︙ |
Changes to doc/FontId.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for fonts .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Font | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for fonts .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Font \fBTk_FontId(\fItkfont\fB)\fR .sp \fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR .sp int \fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR .SH ARGUMENTS .AS Tk_FontMetrics *dsPtr .AP Tk_Font tkfont in Opaque font token being queried. Must have been returned by a previous call to \fBTk_GetFont\fR. .AP Tk_FontMetrics *fmPtr out Pointer to structure in which the font metrics for \fItkfont\fR will |
︙ | ︙ | |||
66 67 68 69 70 71 72 | Any other font families may not print correctly because the computed Postscript font name may be incorrect or not exist on the printer. .SH "DATA STRUCTURES" .PP The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to return information about a font and is defined as follows: .CS | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | Any other font families may not print correctly because the computed Postscript font name may be incorrect or not exist on the printer. .SH "DATA STRUCTURES" .PP The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to return information about a font and is defined as follows: .CS typedef struct Tk_FontMetrics { int \fIascent\fR; int \fIdescent\fR; int \fIlinespace\fR; } \fBTk_FontMetrics\fR; .CE .PP The \fIascent\fR field is the amount in pixels that the tallest |
︙ | ︙ |
Added doc/FreeXId.3.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME Tk_FreeXId \- make X resource identifier available for reuse .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_FreeXId(\fIdisplay, id\fB)\fR .SH ARGUMENTS .AS Display *display out .AP Display *display in Display for which \fIid\fR was allocated. .AP XID id in Identifier of X resource (window, font, pixmap, cursor, graphics context, or colormap) that is no longer in use. .BE .SH DESCRIPTION .PP This function is deprecated, it doesn't do anything since 2008-08-19. .SH KEYWORDS resource identifier |
Changes to doc/GeomReq.3.
︙ | ︙ | |||
17 18 19 20 21 22 23 | \fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR) .sp \fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) .sp \fBTk_SetInternalBorder\fR(\fItkwin, width\fR) .sp \fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) | < | < | < | < | < | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | \fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR) .sp \fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) .sp \fBTk_SetInternalBorder\fR(\fItkwin, width\fR) .sp \fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) .SH ARGUMENTS .AS baseHeight clientData .AP Tk_Window tkwin in Window for which geometry is being requested. .AP int reqWidth in Desired width for \fItkwin\fR, in pixel units. .AP int reqHeight in Desired height for \fItkwin\fR, in pixel units. .AP int minWidth in Desired minimum requested width for \fItkwin\fR, in pixel units. .AP int minHeight in Desired minimum requested height for \fItkwin\fR, in pixel units. .AP int width in Space to leave for internal border for \fItkwin\fR, in pixel units. .AP int left in Space to leave for left side of internal border for \fItkwin\fR, in pixel units. .AP int right in Space to leave for right side of internal border for \fItkwin\fR, in pixel units. .AP int top in Space to leave for top side of internal border for \fItkwin\fR, in pixel units. .AP int bottom in Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. .BE .SH DESCRIPTION .PP \fBTk_GeometryRequest\fR is called by widget code to indicate its preference for the dimensions of a particular window. The arguments to \fBTk_GeometryRequest\fR are made available to the geometry manager for the window, which then decides on the actual geometry |
︙ | ︙ |
Changes to doc/GetAnchor.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings and anchor positions .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | .SH NAME Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings and anchor positions .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetAnchorFromObj(\fIinterp, objPtr, anchorPtr\fB)\fR .sp int \fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR .sp const char * \fBTk_NameOfAnchor(\fIanchor\fB)\fR .SH ARGUMENTS .AS "Tk_Anchor" *anchorPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting, or NULL. .AP Tcl_Obj *objPtr in/out String value contains name of anchor point: .QW \fBn\fR , |
︙ | ︙ |
Changes to doc/GetBitmap.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap \- maintain database of single-plane pixmaps .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Pixmap | | | | | | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | .SH NAME Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap \- maintain database of single-plane pixmaps .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Pixmap \fBTk_AllocBitmapFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp Pixmap \fBTk_GetBitmap(\fIinterp, tkwin, info\fB)\fR .sp Pixmap \fBTk_GetBitmapFromObj(\fItkwin, objPtr\fB)\fR .sp int \fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR .sp const char * \fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR .sp \fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR .sp \fBTk_FreeBitmapFromObj(\fItkwin, objPtr\fB)\fR .sp \fBTk_FreeBitmap(\fIdisplay, bitmap\fB)\fR .SH ARGUMENTS .AS "unsigned long" *pixelPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting; if NULL then no error message is left after errors. .AP Tk_Window tkwin in Token for window in which the bitmap will be used. |
︙ | ︙ | |||
77 78 79 80 81 82 83 | \fBTk_AllocBitmapFromObj\fR returns a Pixmap identifier for a bitmap that matches the description in \fIobjPtr\fR and is suitable for use in \fItkwin\fR. It re-uses an existing bitmap, if possible, and creates a new one otherwise. \fIObjPtr\fR's value must have one of the following forms: .TP 20 \fB@\fIfileName\fR | < < > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | > | | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | \fBTk_AllocBitmapFromObj\fR returns a Pixmap identifier for a bitmap that matches the description in \fIobjPtr\fR and is suitable for use in \fItkwin\fR. It re-uses an existing bitmap, if possible, and creates a new one otherwise. \fIObjPtr\fR's value must have one of the following forms: .TP 20 \fB@\fIfileName\fR \fIFileName\fR must be the name of a file containing a bitmap description in the standard X11 format. .TP 20 \fIname\fR \fIName\fR must be the name of a bitmap defined previously with a call to \fBTk_DefineBitmap\fR. The following names are pre-defined by Tk: .RS .TP 12 \fBerror\fR The international .QW don't symbol: a circle with a diagonal line across it. .TP 12 \fBgray75\fR 75% gray: a checkerboard pattern where three out of four bits are on. .TP 12 \fBgray50\fR 50% gray: a checkerboard pattern where every other bit is on. .TP 12 \fBgray25\fR 25% gray: a checkerboard pattern where one out of every four bits is on. .TP 12 \fBgray12\fR 12.5% gray: a pattern where one-eighth of the bits are on, consisting of every fourth pixel in every other row. .TP 12 \fBhourglass\fR An hourglass symbol. .TP 12 \fBinfo\fR A large letter .QW i . .TP 12 \fBquesthead\fR The silhouette of a human head, with a question mark in it. .TP 12 \fBquestion\fR A large question-mark. .TP 12 \fBwarning\fR A large exclamation point. .PP In addition, the following pre-defined names are available only on the \fBMacintosh\fR platform: .TP 12 \fBdocument\fR A generic document. .TP 12 \fBstationery\fR Document stationery. .TP 12 \fBedition\fR The \fIedition\fR symbol. .TP 12 \fBapplication\fR Generic application icon. .TP 12 \fBaccessory\fR A desk accessory. .TP 12 \fBfolder\fR Generic folder icon. .TP 12 \fBpfolder\fR A locked folder. .TP 12 \fBtrash\fR A trash can. .TP 12 \fBfloppy\fR A floppy disk. .TP 12 \fBramdisk\fR A floppy disk with chip. .TP 12 \fBcdrom\fR A cd disk icon. .TP 12 \fBpreferences\fR A folder with prefs symbol. .TP 12 \fBquerydoc\fR A database document icon. .TP 12 \fBstop\fR A stop sign. .TP 12 \fBnote\fR A face with balloon words. .TP 12 \fBcaution\fR A triangle with an exclamation point. .RE .LP Under normal conditions, \fBTk_AllocBitmapFromObj\fR returns an identifier for the requested bitmap. If an error occurs in creating the bitmap, such as when \fIobjPtr\fR refers to a non-existent file, then \fBNone\fR is returned and an error |
︙ | ︙ | |||
183 184 185 186 187 188 189 | have been used in a call to \fBTk_DefineBitmap\fR. The arguments \fIsource\fR, \fIwidth\fR, and \fIheight\fR describe the bitmap. \fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs (e.g. a bitmap named \fInameId\fR has already been defined) then \fBTCL_ERROR\fR is returned and an error message is left in interpreter \fIinterp\fR's result. | | | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | have been used in a call to \fBTk_DefineBitmap\fR. The arguments \fIsource\fR, \fIwidth\fR, and \fIheight\fR describe the bitmap. \fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs (e.g. a bitmap named \fInameId\fR has already been defined) then \fBTCL_ERROR\fR is returned and an error message is left in interpreter \fIinterp\fR's result. Note: \fBTk_DefineBitmap\fR expects the memory pointed to by \fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make a private copy of this memory, but uses the bytes pointed to by \fIsource\fR later in calls to \fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. .PP Typically \fBTk_DefineBitmap\fR is used by \fB#include\fR-ing a bitmap file directly into a C program and then referencing |
︙ | ︙ |
Changes to doc/GetCapStyl.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | .SH NAME Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR .sp const char * \fBTk_NameOfCapStyle(\fIcap\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *capPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP "const char" *string in String containing name of cap style \- one of .QW \fBbutt\fR , |
︙ | ︙ |
Changes to doc/GetClrmap.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colormaps .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Colormap | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | .SH NAME Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colormaps .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Colormap \fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR .sp \fBTk_PreserveColormap(\fIdisplay, colormap\fB)\fR .sp \fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR .SH ARGUMENTS .AS "Colormap" colormap .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window in which colormap will be used. .AP "const char" *string in |
︙ | ︙ |
Changes to doc/GetColor.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_NameOfColor, Tk_FreeColorFromObj, Tk_FreeColor \- maintain database of colors .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp XColor * | | | | | | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | .SH NAME Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_NameOfColor, Tk_FreeColorFromObj, Tk_FreeColor \- maintain database of colors .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp XColor * \fBTk_AllocColorFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp XColor * \fBTk_GetColor(\fIinterp, tkwin, name\fB)\fR .sp XColor * \fBTk_GetColorFromObj(\fItkwin, objPtr\fB)\fR .sp XColor * \fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR .sp const char * \fBTk_NameOfColor(\fIcolorPtr\fB)\fR .sp GC \fBTk_GCForColor(\fIcolorPtr, drawable\fB)\fR .sp \fBTk_FreeColorFromObj(\fItkwin, objPtr\fB)\fR .sp \fBTk_FreeColor(\fIcolorPtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *colorPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window in which color will be used. .AP Tcl_Obj *objPtr in/out |
︙ | ︙ | |||
68 69 70 71 72 73 74 | .PP Given a textual description of a color, \fBTk_AllocColorFromObj\fR locates a pixel value that may be used to render the color in a particular window. The desired color is specified with a value whose string value must have one of the following forms: .TP 20 \fIcolorname\fR | < < | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | .PP Given a textual description of a color, \fBTk_AllocColorFromObj\fR locates a pixel value that may be used to render the color in a particular window. The desired color is specified with a value whose string value must have one of the following forms: .TP 20 \fIcolorname\fR Any of the valid textual names for a color defined in the server's color database file, such as \fBred\fR or \fBPeachPuff\fR. .TP 20 \fB#\fIRGB\fR .TP 20 \fB#\fIRRGGBB\fR .TP 20 \fB#\fIRRRGGGBBB\fR .TP 20 \fB#\fIRRRRGGGGBBBB\fR A numeric specification of the red, green, and blue intensities to use to display the color. Each \fIR\fR, \fIG\fR, or \fIB\fR represents a single hexadecimal digit. The four forms permit colors to be specified with 4-bit, 8-bit, 12-bit or 16-bit values. When fewer than 16 bits are provided for each color, they represent the most significant bits of the color, while the lower unfilled bits will be repeatedly replicated from the available higher bits. |
︙ | ︙ |
Changes to doc/GetCursor.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData, Tk_NameOfCursor, Tk_FreeCursorFromObj, Tk_FreeCursor \- maintain database of cursors .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Cursor | | | | | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | .SH NAME Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData, Tk_NameOfCursor, Tk_FreeCursorFromObj, Tk_FreeCursor \- maintain database of cursors .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Cursor \fBTk_AllocCursorFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp Tk_Cursor \fBTk_GetCursor(\fIinterp, tkwin, name\fB)\fR .sp Tk_Cursor \fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR .sp Tk_Cursor \fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR .sp const char * \fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR .sp \fBTk_FreeCursorFromObj(\fItkwin, objPtr\fB)\fR .sp \fBTk_FreeCursor(\fIdisplay, cursor\fB)\fR .SH ARGUMENTS .AS "unsigned long" *pixelPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window in which the cursor will be used. .AP Tcl_Obj *objPtr in/out |
︙ | ︙ | |||
84 85 86 87 88 89 90 | \fBTk_GetCursorFromObj\fR. If an error occurs in creating the cursor, such as when \fIobjPtr\fR refers to a non-existent file, then \fBNone\fR is returned and an error message will be stored in \fIinterp\fR's result if \fIinterp\fR is not NULL. \fIObjPtr\fR must contain a standard Tcl list with one of the following forms: .TP \fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]] | < | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | \fBTk_GetCursorFromObj\fR. If an error occurs in creating the cursor, such as when \fIobjPtr\fR refers to a non-existent file, then \fBNone\fR is returned and an error message will be stored in \fIinterp\fR's result if \fIinterp\fR is not NULL. \fIObjPtr\fR must contain a standard Tcl list with one of the following forms: .TP \fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]] \fIName\fR is the name of a cursor in the standard X cursor cursor, i.e., any of the names defined in \fBcursorcursor.h\fR, without the \fBXC_\fR. Some example values are \fBX_cursor\fR, \fBhand2\fR, or \fBleft_ptr\fR. Appendix B of .QW "The X Window System" by Scheifler & Gettys has illustrations showing what each of these cursors looks like. If \fIfgColor\fR and \fIbgColor\fR are both |
︙ | ︙ | |||
113 114 115 116 117 118 119 | name of the resource. The application and all its open dynamic library's resource files will be searched for the named cursor. If there are conflicts color cursors will always be loaded in preference to black and white cursors. .RE .TP \fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR | < < < | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | name of the resource. The application and all its open dynamic library's resource files will be searched for the named cursor. If there are conflicts color cursors will always be loaded in preference to black and white cursors. .RE .TP \fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR In this form, \fIsourceName\fR and \fImaskName\fR are the names of files describing cursors for the cursor's source bits and mask. Each file must be in standard X11 cursor format. \fIFgColor\fR and \fIbgColor\fR indicate the colors to use for the cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This form of the command will not work on Macintosh or Windows computers. .TP \fB@\fIsourceName\0fgColor\fR This form is similar to the one above, except that the source is used as mask also. This means that the cursor's background is transparent. This form of the command will not work on Macintosh or Windows computers. .TP \fB@\fIsourceName\fR This form only works on Windows, and will load a Windows system cursor (\fB.ani\fR or \fB.cur\fR) from the file specified in \fIsourceName\fR. .PP \fBTk_GetCursor\fR is identical to \fBTk_AllocCursorFromObj\fR except that the description of the cursor is specified with a string instead of an object. This prevents \fBTk_GetCursor\fR from caching the |
︙ | ︙ | |||
197 198 199 200 201 202 203 | The procedure \fBTk_NameOfCursor\fR is roughly the inverse of \fBTk_GetCursor\fR. If its \fIcursor\fR argument was created by \fBTk_GetCursor\fR, then the return value is the \fIname\fR argument that was passed to \fBTk_GetCursor\fR to create the cursor. If \fIcursor\fR was created by a call to \fBTk_GetCursorFromData\fR, or by any other mechanism, then the return value is a hexadecimal string giving the X identifier for the cursor. | | | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | The procedure \fBTk_NameOfCursor\fR is roughly the inverse of \fBTk_GetCursor\fR. If its \fIcursor\fR argument was created by \fBTk_GetCursor\fR, then the return value is the \fIname\fR argument that was passed to \fBTk_GetCursor\fR to create the cursor. If \fIcursor\fR was created by a call to \fBTk_GetCursorFromData\fR, or by any other mechanism, then the return value is a hexadecimal string giving the X identifier for the cursor. Note: the string returned by \fBTk_NameOfCursor\fR is only guaranteed to persist until the next call to \fBTk_NameOfCursor\fR. Also, this call is not portable except for cursors returned by \fBTk_GetCursor\fR. .PP When a cursor returned by \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, or \fBTk_GetCursorFromData\fR is no longer needed, \fBTk_FreeCursorFromObj\fR or |
︙ | ︙ |
Changes to doc/GetFont.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FontGetDescription, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Font | | | | | | | > | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | .SH NAME Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FontGetDescription, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Font \fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp Tk_Font \fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR .sp Tk_Font \fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR .sp Tcl_Obj * \fBTk_FontGetDescription(\fItkfont\fB)\fR .sp const char * \fBTk_NameOfFont(\fItkfont\fB)\fR .sp Tk_Font \fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR .sp void \fBTk_FreeFont(\fItkfont\fB)\fR .SH ARGUMENTS .AS "const char" *tkfont .AP "Tcl_Interp" *interp in Interpreter to use for error reporting. If \fBNULL\fR, then no error messages are left after errors. .AP Tk_Window tkwin in Token for window in which font will be used. |
︙ | ︙ | |||
88 89 90 91 92 93 94 | a database of all fonts they have allocated. If the same font is requested multiple times (e.g. by different windows or for different purposes), then a single Tk_Font will be shared for all uses. The underlying resources will be freed automatically when no-one is using the font anymore. .PP The procedure \fBTk_FontGetDescription\fR returns information about the font | | < | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | a database of all fonts they have allocated. If the same font is requested multiple times (e.g. by different windows or for different purposes), then a single Tk_Font will be shared for all uses. The underlying resources will be freed automatically when no-one is using the font anymore. .PP The procedure \fBTk_FontGetDescription\fR returns information about the font description as a Tcl list. One possible result is "{{DejaVu Sans} -16 bold underline}". .PP The procedure \fBTk_NameOfFont\fR is roughly the inverse of \fBTk_GetFont\fR. Given a \fItkfont\fR that was created by \fBTk_GetFont\fR (or \fBTk_AllocFontFromObj\fR), the return value is the \fIstring\fR argument that was passed to \fBTk_GetFont\fR to create the font. The string returned by \fBTk_NameOfFont\fR is only guaranteed to persist until the \fItkfont\fR |
︙ | ︙ |
Changes to doc/GetGC.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp GC \fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) .sp | | < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp GC \fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) .sp \fBTk_FreeGC(\fIdisplay, gc\fR) .SH ARGUMENTS .AS "unsigned long" valueMask .AP Tk_Window tkwin in Token for window in which the graphics context will be used. .AP "unsigned long" valueMask in Mask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR) indicating which fields of \fI*valuePtr\fR are valid. |
︙ | ︙ |
Changes to doc/GetHINSTANCE.3.
︙ | ︙ | |||
9 10 11 12 13 14 15 | Tk_GetHINSTANCE \- retrieve the global application instance handle .SH SYNOPSIS .nf \fB#include <tkPlatDecls.h>\fR .sp HINSTANCE \fBTk_GetHINSTANCE\fR() | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | Tk_GetHINSTANCE \- retrieve the global application instance handle .SH SYNOPSIS .nf \fB#include <tkPlatDecls.h>\fR .sp HINSTANCE \fBTk_GetHINSTANCE\fR() .BE .SH DESCRIPTION .PP \fBTk_GetHINSTANCE\fR returns the Windows application instance handle for the Tk application. This function is only available on Windows platforms. .SH KEYWORDS identifier, instance |
Changes to doc/GetHWND.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | \fB#include <tkPlatDecls.h>\fR .sp HWND \fBTk_GetHWND\fR(\fIwindow\fR) .sp Window \fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | \fB#include <tkPlatDecls.h>\fR .sp HWND \fBTk_GetHWND\fR(\fIwindow\fR) .sp Window \fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) .SH ARGUMENTS .AP Window window in X token for window. .AP Tk_Window tkwin in Tk window for window. .AP HWND hwnd in Windows HWND for window. |
︙ | ︙ |
Changes to doc/GetImage.3.
︙ | ︙ | |||
18 19 20 21 22 23 24 | \fBTk_GetImage\fR(\fIinterp, tkwin, name, changeProc, clientData\fR) .sp \fBTk_RedrawImage\fR(\fIimage, imageX, imageY, width, height, drawable, drawableX, drawableY\fR) .sp \fBTk_SizeOfImage\fR(\fIimage, widthPtr, heightPtr\fR) .sp \fBTk_FreeImage\fR(\fIimage\fR) | < | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | \fBTk_GetImage\fR(\fIinterp, tkwin, name, changeProc, clientData\fR) .sp \fBTk_RedrawImage\fR(\fIimage, imageX, imageY, width, height, drawable, drawableX, drawableY\fR) .sp \fBTk_SizeOfImage\fR(\fIimage, widthPtr, heightPtr\fR) .sp \fBTk_FreeImage\fR(\fIimage\fR) .SH ARGUMENTS .AS Tk_ImageChangedProc *changeProc .AP Tcl_Interp *interp in Place to leave error message. .AP Tk_Window tkwin in Window in which image will be used. .AP "const char" *name in |
︙ | ︙ |
Changes to doc/GetJoinStl.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | .SH NAME Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR .sp const char * \fBTk_NameOfJoinStyle(\fIjoin\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP "const char" *string in String containing name of join style \- one of .QW \fBbevel\fR , |
︙ | ︙ |
Changes to doc/GetJustify.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strings and justification styles .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | .SH NAME Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strings and justification styles .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetJustifyFromObj(\fIinterp, objPtr, justifyPtr\fB)\fR .sp int \fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR .sp const char * \fBTk_NameOfJustify(\fIjustify\fB)\fR .SH ARGUMENTS .AS "Tk_Justify" *justifyPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting, or NULL. .AP Tcl_Obj *objPtr in/out String value contains name of justification style \- one of .QW \fBleft\fR , |
︙ | ︙ | |||
45 46 47 48 49 50 51 | Justification style (one of the values listed below). .BE .SH DESCRIPTION .PP \fBTk_GetJustifyFromObj\fR places in \fI*justifyPtr\fR the justify value corresponding to \fIobjPtr\fR's value. This value will be one of the following: | > | > | > | | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | Justification style (one of the values listed below). .BE .SH DESCRIPTION .PP \fBTk_GetJustifyFromObj\fR places in \fI*justifyPtr\fR the justify value corresponding to \fIobjPtr\fR's value. This value will be one of the following: .TP \fBTK_JUSTIFY_LEFT\fR Means that the text on each line should start at the left edge of the line; as a result, the right edges of lines may be ragged. .TP \fBTK_JUSTIFY_RIGHT\fR Means that the text on each line should end at the right edge of the line; as a result, the left edges of lines may be ragged. .TP \fBTK_JUSTIFY_CENTER\fR Means that the text on each line should be centered; as a result, both the left and right edges of lines may be ragged. .PP Under normal circumstances the return value is \fBTCL_OK\fR and \fIinterp\fR is unused. If \fIobjPtr\fR does not contain a valid justification style or an abbreviation of one of these names, \fBTCL_ERROR\fR is returned, |
︙ | ︙ |
Changes to doc/GetOption.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_GetOption \- retrieve an option from the option database .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Uid \fBTk_GetOption\fR(\fItkwin, name, class\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_GetOption \- retrieve an option from the option database .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Uid \fBTk_GetOption\fR(\fItkwin, name, class\fR) .SH ARGUMENTS .AS Tk_Window *class .AP Tk_Window tkwin in Token for window. .AP "const char" *name in Name of desired option. .AP "const char" *class in |
︙ | ︙ |
Changes to doc/GetPixels.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM, Tk_GetDoublePixelsFromObj \- translate between strings and screen units .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | .SH NAME Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM, Tk_GetDoublePixelsFromObj \- translate between strings and screen units .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetPixelsFromObj(\fIinterp, tkwin, objPtr, intPtr\fB)\fR .sp int \fBTk_GetDoublePixelsFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR .sp int \fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR .sp int \fBTk_GetMMFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR .sp int \fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Window whose screen geometry determines the conversion between absolute units and pixels. |
︙ | ︙ | |||
53 54 55 56 57 58 59 | the screen (\fIobjPtr\fR or \fIstring\fR) and compute the corresponding distance either in integer pixels or floating-point millimeters. In either case, \fIobjPtr\fR or \fIstring\fR specifies a screen distance as a floating-point number followed by one of the following characters that indicates units: | > | > | > | > | > | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | the screen (\fIobjPtr\fR or \fIstring\fR) and compute the corresponding distance either in integer pixels or floating-point millimeters. In either case, \fIobjPtr\fR or \fIstring\fR specifies a screen distance as a floating-point number followed by one of the following characters that indicates units: .TP <none> The number specifies a distance in pixels. .TP \fBc\fR The number specifies a distance in centimeters on the screen. .TP \fBi\fR The number specifies a distance in inches on the screen. .TP \fBm\fR The number specifies a distance in millimeters on the screen. .TP \fBp\fR The number specifies a distance in printer's points (1/72 inch) on the screen. .PP \fBTk_GetPixelsFromObj\fR converts the value of \fIobjPtr\fR to the nearest even number of pixels and stores that value at \fI*intPtr\fR. It returns \fBTCL_OK\fR under normal circumstances. If an error occurs (e.g. \fIobjPtr\fR contains a number followed |
︙ | ︙ |
Changes to doc/GetPixmap.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Pixmap | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .SH NAME Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Pixmap \fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR .sp \fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR .SH ARGUMENTS .AS "Drawable" *pixelPtr .AP Display *display in X display for the pixmap. .AP Drawable d in Pixmap or window where the new pixmap will be used for drawing. .AP "int" width in |
︙ | ︙ |
Changes to doc/GetRelief.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings and relief values .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | .SH NAME Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings and relief values .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetReliefFromObj(\fIinterp, objPtr, reliefPtr\fB)\fR .sp int \fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR .sp const char * \fBTk_NameOfRelief(\fIrelief\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *reliefPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tcl_Obj *objPtr in/out String value contains name of relief, one of .QW \fBflat\fR , |
︙ | ︙ |
Changes to doc/GetRootCrd.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetRootCoords \- Compute root-window coordinates of window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_GetRootCoords\fR(\fItkwin, xPtr, yPtr\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_GetRootCoords \- Compute root-window coordinates of window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_GetRootCoords\fR(\fItkwin, xPtr, yPtr\fR) .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .AP int *xPtr out Pointer to location in which to store root-window x-coordinate corresponding to left edge of \fItkwin\fR's border. |
︙ | ︙ |
Changes to doc/GetScroll.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | < | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | .SH NAME Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR .sp int \fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *fractionPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP int objc in Number of Tcl_Obj's in \fIobjv\fR array. .AP "Tcl_Obj *const *" objv in Argument objects. These represent the entire widget command, of which the first word is typically the widget name and the second word is typically \fBxview\fR or \fByview\fR. .AP int argc in Number of strings in \fIargv\fR array. |
︙ | ︙ |
Changes to doc/GetSelect.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_GetSelection \- retrieve the contents of a selection .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetSelection\fR(\fIinterp, tkwin, selection, target, proc, clientData\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_GetSelection \- retrieve the contents of a selection .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_GetSelection\fR(\fIinterp, tkwin, selection, target, proc, clientData\fR) .SH ARGUMENTS .AS Tk_GetSelProc clientData .AP Tcl_Interp *interp in Interpreter to use for reporting errors. .AP Tk_Window tkwin in Window on whose behalf to retrieve the selection (determines display from which to retrieve). |
︙ | ︙ |
Changes to doc/GetUid.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_GetUid, Tk_Uid \- convert from string to unique identifier .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Uid \fBTk_GetUid\fR(\fIstring\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_GetUid, Tk_Uid \- convert from string to unique identifier .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Uid \fBTk_GetUid\fR(\fIstring\fR) .SH ARGUMENTS .AP char *string in String for which the corresponding unique identifier is desired. .BE .SH DESCRIPTION .PP |
︙ | ︙ |
Changes to doc/GetVRoot.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .BS .SH NAME Tk_GetVRootGeometry \- Get location and size of virtual root for window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp | | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .BS .SH NAME Tk_GetVRootGeometry \- Get location and size of virtual root for window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_GetVRootGeometry(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fB)\fR .SH ARGUMENTS .AS Tk_Window heightPtr .AP Tk_Window tkwin in Token for window whose virtual root is to be queried. .AP int xPtr out Points to word in which to store x-offset of virtual root. .AP int yPtr out |
︙ | ︙ |
Changes to doc/GetVisual.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetVisual \- translate from string to visual .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Visual * | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | .SH NAME Tk_GetVisual \- translate from string to visual .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Visual * \fBTk_GetVisual(\fIinterp, tkwin, string, depthPtr, colormapPtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *colormapPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window in which the visual will be used. .AP "const char" *string in |
︙ | ︙ | |||
45 46 47 48 49 50 51 | also locates an appropriate colormap for use with the result visual and stores its X identifier at \fI*colormapPtr\fR. .PP The \fIstring\fR argument specifies the desired visual in one of the following ways: .TP 15 \fIclass depth\fR | < < < < < | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | also locates an appropriate colormap for use with the result visual and stores its X identifier at \fI*colormapPtr\fR. .PP The \fIstring\fR argument specifies the desired visual in one of the following ways: .TP 15 \fIclass depth\fR The string consists of a class name followed by an integer depth, with any amount of white space (including none) in between. \fIclass\fR selects what sort of visual is desired and must be one of \fBdirectcolor\fR, \fBgrayscale\fR, \fBgreyscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, \fBstaticgrey\fR, or \fBtruecolor\fR, or a unique abbreviation. \fIdepth\fR specifies how many bits per pixel are needed for the visual. If possible, \fBTk_GetVisual\fR will return a visual with this depth; if there is no visual of the desired depth then \fBTk_GetVisual\fR looks first for a visual with greater depth, then one with less depth. .TP 15 \fBdefault\fR Use the default visual for \fItkwin\fR's screen. .TP 15 \fIpathName\fR Use the visual for the window given by \fIpathName\fR. \fIpathName\fR must be the name of a window on the same screen as \fItkwin\fR. .TP 15 \fInumber\fR Use the visual whose X identifier is \fInumber\fR. .TP 15 \fBbest\fR ?\fIdepth\fR? Choose the .QW "best possible" visual, using the following rules, in decreasing order of priority: .RS .IP (a) a visual that has exactly the desired depth is best, followed by a visual with greater depth than requested (but as little extra |
︙ | ︙ |
Changes to doc/Grab.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 17 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) .sp \fBTk_Ungrab\fR(\fItkwin\fR) | > < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) .sp void \fBTk_Ungrab\fR(\fItkwin\fR) .SH ARGUMENTS .AP Tcl_Interp *interp in Interpreter to use for error reporting .AP Tk_Window tkwin in Window on whose behalf the pointer is to be grabbed or released .AP int grabGlobal in Boolean indicating whether the grab is global or application local |
︙ | ︙ |
Changes to doc/HWNDToWindow.3.
︙ | ︙ | |||
9 10 11 12 13 14 15 | Tk_HWNDToWindow \- Find Tk's window information for a Windows window .SH SYNOPSIS .nf \fB#include <tkPlatDecls.h>\fR .sp Tk_Window \fBTk_HWNDToWindow\fR(\fIhwnd\fR) | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | Tk_HWNDToWindow \- Find Tk's window information for a Windows window .SH SYNOPSIS .nf \fB#include <tkPlatDecls.h>\fR .sp Tk_Window \fBTk_HWNDToWindow\fR(\fIhwnd\fR) .SH ARGUMENTS .AP HWND hwnd in Windows handle for the window. .BE .SH DESCRIPTION .PP Given a Windows HWND window identifier, this procedure returns the |
︙ | ︙ |
Changes to doc/HandleEvent.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_HandleEvent \- invoke event handlers for window system events .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_HandleEvent\fR(\fIeventPtr\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_HandleEvent \- invoke event handlers for window system events .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_HandleEvent\fR(\fIeventPtr\fR) .SH ARGUMENTS .AS XEvent *eventPtr .AP XEvent *eventPtr in Pointer to X event to dispatch to relevant handler(s). It is important that all unused fields of the structure be set to zero. .BE .SH DESCRIPTION |
︙ | ︙ |
Changes to doc/IdToWindow.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_IdToWindow \- Find Tk's window information for an X window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_IdToWindow\fR(\fIdisplay, window\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Tk_IdToWindow \- Find Tk's window information for an X window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_IdToWindow\fR(\fIdisplay, window\fR) .SH ARGUMENTS .AS Tk_Window display .AP Display *display in X display containing the window. .AP Window window in X id for window. .BE |
︙ | ︙ |
Changes to doc/ImgChanged.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_ImageChanged \- notify widgets that image needs to be redrawn .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_ImageChanged \- notify widgets that image needs to be redrawn .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR) .SH ARGUMENTS .AS Tk_ImageModel imageHeight .AP Tk_ImageModel model in Token for image, which was passed to image's \fIcreateProc\fR when the image was created. .AP int x in X-coordinate of upper-left corner of region that needs redisplay (measured |
︙ | ︙ |
Changes to doc/Inactive.3.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .SH NAME Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity time .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp long | | | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity time .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp long \fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR .sp \fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR .SH ARGUMENTS .AS Display *display .AP Display *display in The display on which the user inactivity timer is to be queried or reset. .BE .SH DESCRIPTION |
︙ | ︙ |
Changes to doc/InternAtom.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Atom | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | .SH NAME Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Atom \fBTk_InternAtom(\fItkwin, name\fR) .sp const char * \fBTk_GetAtomName(\fItkwin, atom\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. Used to map atom or name relative to a particular display. .AP "const char" *name in String name for which atom is desired. .AP Atom atom in |
︙ | ︙ |
Changes to doc/MainLoop.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_MainLoop \- loop for events until all windows are deleted .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_MainLoop\fR() | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_MainLoop \- loop for events until all windows are deleted .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_MainLoop\fR() .BE .SH DESCRIPTION .PP \fBTk_MainLoop\fR is a procedure that loops repeatedly calling \fBTcl_DoOneEvent\fR. It returns only when there are no applications left in this process (i.e. no main windows exist anymore). Most windowing applications will call \fBTk_MainLoop\fR after |
︙ | ︙ |
Changes to doc/MainWin.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_MainWindow\fR(\fIinterp\fR) .sp \fBTk_SetMainMenubar\fR(\fIinterp, tkwin, menuName\fR) .sp \fBTk_SetWindowMenubar\fR(\fIinterp, tkwin, oldMenuName, menuName\fR) .sp int \fBTk_GetNumMainWindows\fR() | > > < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_MainWindow\fR(\fIinterp\fR) .sp void \fBTk_SetMainMenubar\fR(\fIinterp, tkwin, menuName\fR) .sp void \fBTk_SetWindowMenubar\fR(\fIinterp, tkwin, oldMenuName, menuName\fR) .sp int \fBTk_GetNumMainWindows\fR() .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tcl_Interp *interp in/out Interpreter associated with the application. .AP Tk_Window tkwin in Token for main window. .AP const char *menuName in |
︙ | ︙ | |||
47 48 49 50 51 52 53 | associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and leaves an error message in interpreter \fIinterp\fR's result. .PP \fBTk_GetNumMainWindows\fR returns a count of the number of main windows currently open in the current thread. \fBTk_SetMainMenubar\fR Called when a toplevel widget is brought to front. On the Macintosh, | | | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and leaves an error message in interpreter \fIinterp\fR's result. .PP \fBTk_GetNumMainWindows\fR returns a count of the number of main windows currently open in the current thread. \fBTk_SetMainMenubar\fR Called when a toplevel widget is brought to front. On the Macintosh, sets up the menubar that goes accross the top of the main monitor. On other platforms, nothing is necessary. \fBTk_SetWindowMenubar\fR associates a menu with a window. The old menu clones for the menubar are thrown away, and a handler is set up to allocate the new ones. .SH KEYWORDS application, main window |
Changes to doc/MaintGeom.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR) .sp \fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR) | < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR) .sp \fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR) .SH ARGUMENTS .AS Tk_Window container .AP Tk_Window window in Window whose geometry is to be controlled. .AP Tk_Window container in Window relative to which \fIwindow\fR's geometry will be controlled. .AP int x in |
︙ | ︙ |
Changes to doc/ManageGeom.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_ManageGeometry \- arrange to handle geometry requests for a window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_ManageGeometry\fR(\fItkwin, mgrPtr, clientData\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_ManageGeometry \- arrange to handle geometry requests for a window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_ManageGeometry\fR(\fItkwin, mgrPtr, clientData\fR) .SH ARGUMENTS .AS Tk_GeometryProc clientData .AP Tk_Window tkwin in Token for window to be managed. .AP "const Tk_GeomMgr" *mgrPtr in Pointer to data structure containing information about the geometry manager, or NULL to indicate that \fItkwin\fR's geometry |
︙ | ︙ |
Changes to doc/MapWindow.3.
︙ | ︙ | |||
14 15 16 17 18 19 20 | .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_MapWindow\fR(\fItkwin\fR) .sp \fBTk_UnmapWindow\fR(\fItkwin\fR) | < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_MapWindow\fR(\fItkwin\fR) .sp \fBTk_UnmapWindow\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. .BE .SH DESCRIPTION .PP |
︙ | ︙ |
Changes to doc/MeasureChar.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .SH NAME Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to measure and display simple single-line strings. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int | | | | | | | | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | .SH NAME Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to measure and display simple single-line strings. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_MeasureChars(\fItkfont, string, numBytes, maxPixels, flags, lengthPtr\fB)\fR .sp int \fBTk_TextWidth(\fItkfont, string, numBytes\fB)\fR .sp \fBTk_DrawChars(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fB)\fR .sp \fBTk_UnderlineChars(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fB)\fR .sp .SH ARGUMENTS .AS "const char" firstChar .AP Tk_Font tkfont in Token for font in which text is to be drawn or measured. Must have been returned by a previous call to \fBTk_GetFont\fR. .AP "const char" *string in Text to be measured or displayed. Need not be null terminated. Any non-printing meta-characters in the string (such as tabs, newlines, and other control characters) will be measured or displayed in a platform-dependent manner. .AP int numBytes in The maximum number of bytes to consider when measuring or drawing \fIstring\fR. Must be greater than or equal to 0. .AP int maxPixels in If \fImaxPixels\fR is >= 0, it specifies the longest permissible line length in pixels. Characters from \fIstring\fR are processed only until this many pixels have been covered. If \fImaxPixels\fR is < 0, then the line length is unbounded and the \fIflags\fR argument is ignored. .AP int flags in Various flag bits OR-ed together: \fBTK_PARTIAL_OK\fR means include a character as long as any part of it fits in the length given by \fImaxPixels\fR; otherwise, a character must fit completely to be considered. \fBTK_WHOLE_WORDS\fR means stop on a word boundary, if possible. If \fBTK_AT_LEAST_ONE\fR is set, it means return at least one character even if no characters could fit in the length given by \fImaxPixels\fR. If \fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if not even one word fits on the line, return the first few letters of the word that did fit; if not even one letter of the word fit, then the first letter will still be returned. .AP int *lengthPtr out Filled with the number of pixels occupied by the number of characters returned as the result of \fBTk_MeasureChars\fR. .AP Display *display in Display on which to draw. |
︙ | ︙ |
Changes to doc/MoveToplev.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .BS .SH NAME Tk_MoveToplevelWindow \- Adjust the position of a top-level window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp | | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .BS .SH NAME Tk_MoveToplevelWindow \- Adjust the position of a top-level window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_MoveToplevelWindow(\fItkwin, x, y\fB)\fR .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for top-level window to move. .AP int x in New x-coordinate for the top-left pixel of \fItkwin\fR's border, or the top-left pixel of the decorative border supplied for \fItkwin\fR by the |
︙ | ︙ |
Changes to doc/Name.3.
︙ | ︙ | |||
18 19 20 21 22 23 24 | \fBTk_Name\fR(\fItkwin\fR) .sp char * \fBTk_PathName\fR(\fItkwin\fR) .sp Tk_Window \fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR) | < | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | \fBTk_Name\fR(\fItkwin\fR) .sp char * \fBTk_PathName\fR(\fItkwin\fR) .sp Tk_Window \fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR) .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tk_Window tkwin in Token for window. .AP Tcl_Interp *interp out Interpreter to use for error reporting. .AP "const char" *pathName in |
︙ | ︙ |
Changes to doc/NameOfImg.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_NameOfImage \- Return name of image. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp const char * \fBTk_NameOfImage\fR(\fIimageModel\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Tk_NameOfImage \- Return name of image. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp const char * \fBTk_NameOfImage\fR(\fIimageModel\fR) .SH ARGUMENTS .AS Tk_ImageModel imageModel .AP Tk_ImageModel imageModel in Token for image, which was passed to image manager's \fIcreateProc\fR when the image was created. .BE .SH DESCRIPTION |
︙ | ︙ |
Changes to doc/OwnSelect.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_OwnSelection \- make a window the owner of the primary selection .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .SH NAME Tk_OwnSelection \- make a window the owner of the primary selection .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) .SH ARGUMENTS .AS Tk_LostSelProc clientData .AP Tk_Window tkwin in Window that is to become new selection owner. .AP Atom selection in The name of the selection to be owned, such as XA_PRIMARY. .AP Tk_LostSelProc *proc in |
︙ | ︙ |
Changes to doc/ParseArgv.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_ParseArgv \- process command-line options .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_ParseArgv\fR(\fIinterp, tkwin, argcPtr, argv, argTable, flags\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_ParseArgv \- process command-line options .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_ParseArgv\fR(\fIinterp, tkwin, argcPtr, argv, argTable, flags\fR) .SH ARGUMENTS .AS Tk_ArgvInfo *argTable .AP Tcl_Interp *interp in Interpreter to use for returning error messages. .AP Tk_Window tkwin in Window to use when arguments specify Tk options. If NULL, then no Tk options will be processed. |
︙ | ︙ | |||
110 111 112 113 114 115 116 | .QW "the matching argument" in the descriptions below. As part of the processing, \fBTk_ParseArgv\fR may also use the next argument in \fIargv\fR after the matching argument, which is called .QW "the following argument" . The legal values for \fItype\fR, and the processing that they cause, are as follows: | > | > | > | > | > | > | > | > | > | > | > | > | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | .QW "the matching argument" in the descriptions below. As part of the processing, \fBTk_ParseArgv\fR may also use the next argument in \fIargv\fR after the matching argument, which is called .QW "the following argument" . The legal values for \fItype\fR, and the processing that they cause, are as follows: .TP \fBTK_ARGV_END\fR Marks the end of the table. The last entry in \fIargTable\fR must have this type; all of its other fields are ignored and it will never match any arguments. .TP \fBTK_ARGV_CONSTANT\fR \fISrc\fR is treated as an integer and \fIdst\fR is treated as a pointer to an integer. \fISrc\fR is stored at \fI*dst\fR. The matching argument is discarded. .TP \fBTK_ARGV_INT\fR The following argument must contain an integer string in the format accepted by \fBstrtol\fR (e.g. .QW 0 and .QW 0x prefixes may be used to specify octal or hexadecimal numbers, respectively). \fIDst\fR is treated as a pointer to an integer; the following argument is converted to an integer value and stored at \fI*dst\fR. \fISrc\fR is ignored. The matching and following arguments are discarded from \fIargv\fR. .TP \fBTK_ARGV_FLOAT\fR The following argument must contain a floating-point number in the format accepted by \fBstrtol\fR. \fIDst\fR is treated as the address of a double-precision floating point value; the following argument is converted to a double-precision value and stored at \fI*dst\fR. The matching and following arguments are discarded from \fIargv\fR. .TP \fBTK_ARGV_STRING\fR In this form, \fIdst\fR is treated as a pointer to a (char *); \fBTk_ParseArgv\fR stores at \fI*dst\fR a pointer to the following argument, and discards the matching and following arguments from \fIargv\fR. \fISrc\fR is ignored. .TP \fBTK_ARGV_UID\fR This form is similar to \fBTK_ARGV_STRING\fR, except that the argument is turned into a Tk_Uid by calling \fBTk_GetUid\fR. \fIDst\fR is treated as a pointer to a Tk_Uid; \fBTk_ParseArgv\fR stores at \fI*dst\fR the Tk_Uid corresponding to the following argument, and discards the matching and following arguments from \fIargv\fR. \fISrc\fR is ignored. .TP \fBTK_ARGV_CONST_OPTION\fR This form causes a Tk option to be set (as if the \fBoption\fR command had been invoked). The \fIsrc\fR field is treated as a pointer to a string giving the value of an option, and \fIdst\fR is treated as a pointer to the name of the option. The matching argument is discarded. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). .TP \fBTK_ARGV_OPTION_VALUE\fR This form is similar to \fBTK_ARGV_CONST_OPTION\fR, except that the value of the option is taken from the following argument instead of from \fIsrc\fR. \fIDst\fR is used as the name of the option. \fISrc\fR is ignored. The matching and following arguments are discarded. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). .TP \fBTK_ARGV_OPTION_NAME_VALUE\fR In this case the following argument is taken as the name of a Tk option and the argument after that is taken as the value for that option. Both \fIsrc\fR and \fIdst\fR are ignored. All three arguments are discarded from \fIargv\fR. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). .TP \fBTK_ARGV_HELP\fR When this kind of option is encountered, \fBTk_ParseArgv\fR uses the \fIhelp\fR fields of \fIargTable\fR to format a message describing all the valid arguments. The message is placed in interpreter \fIinterp\fR's result and \fBTk_ParseArgv\fR returns \fBTCL_ERROR\fR. When this happens, the caller normally prints the help message and aborts. If the \fIkey\fR field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will never match any arguments; in this case the specifier simply provides extra documentation, which will be included when some other \fBTK_ARGV_HELP\fR entry causes help information to be returned. .TP \fBTK_ARGV_REST\fR This option is used by programs or commands that allow the last several of their options to be the name and/or options for some other program. If a \fBTK_ARGV_REST\fR argument is found, then \fBTk_ParseArgv\fR does not process any of the remaining arguments; it returns them all at the beginning of \fIargv\fR (along with any other unprocessed arguments). In addition, \fBTk_ParseArgv\fR treats \fIdst\fR as the address of an integer value, and stores at \fI*dst\fR the index of the first of the \fBTK_ARGV_REST\fR options in the returned \fIargv\fR. This allows the program to distinguish the \fBTK_ARGV_REST\fR options from other unprocessed options that preceded the \fBTK_ARGV_REST\fR. .TP \fBTK_ARGV_FUNC\fR For this kind of argument, \fIsrc\fR is treated as the address of a procedure, which is invoked to process the following argument. The procedure should have the following structure: .RS .CS int \fIfunc\fR(\fIdst\fR, \fIkey\fR, \fInextArg\fR) |
︙ | ︙ | |||
217 218 219 220 221 222 223 | (or NULL if there are not any more arguments left in \fIargv\fR). If \fIfunc\fR uses \fInextArg\fR (so that \fBTk_ParseArgv\fR should discard it), then it should return 1. Otherwise it should return 0 and \fBTkParseArgv\fR will process the following argument in the normal fashion. In either event the matching argument is discarded. .RE | > | | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | (or NULL if there are not any more arguments left in \fIargv\fR). If \fIfunc\fR uses \fInextArg\fR (so that \fBTk_ParseArgv\fR should discard it), then it should return 1. Otherwise it should return 0 and \fBTkParseArgv\fR will process the following argument in the normal fashion. In either event the matching argument is discarded. .RE .TP \fBTK_ARGV_GENFUNC\fR This form provides a more general procedural escape. It treats \fIsrc\fR as the address of a procedure, and passes that procedure all of the remaining arguments. The procedure should have the following form: .RS .CS int |
︙ | ︙ | |||
250 251 252 253 254 255 256 | \fBTk_ParseArgv\fR will process them. If \fIgenfunc\fR encounters an error then it should leave an error message in interpreter \fIinterp\fR's result, in the usual Tcl fashion, and return \-1; when this happens \fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR. .RE .SS "FLAGS" | > | > | > | > | | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | \fBTk_ParseArgv\fR will process them. If \fIgenfunc\fR encounters an error then it should leave an error message in interpreter \fIinterp\fR's result, in the usual Tcl fashion, and return \-1; when this happens \fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR. .RE .SS "FLAGS" .TP \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR \fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program or command name, and returns it to the caller just as if it had not matched \fIargTable\fR. If this flag is given, then \fIargv[0]\fR is not given special treatment. .TP \fBTK_ARGV_NO_ABBREV\fR Normally, \fBTk_ParseArgv\fR accepts unique abbreviations for \fIkey\fR values in \fIargTable\fR. If this flag is given then only exact matches will be acceptable. .TP \fBTK_ARGV_NO_LEFTOVERS\fR Normally, \fBTk_ParseArgv\fR returns unrecognized arguments to the caller. If this bit is set in \fIflags\fR then \fBTk_ParseArgv\fR will return an error if it encounters any argument that does not match \fIargTable\fR. The only exception to this rule is \fIargv[0]\fR, which will be returned to the caller with no errors as long as \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR is not specified. .TP \fBTK_ARGV_NO_DEFAULTS\fR Normally, \fBTk_ParseArgv\fR searches an internal table of standard argument specifiers in addition to \fIargTable\fR. If this bit is set in \fIflags\fR, then \fBTk_ParseArgv\fR will use only \fIargTable\fR and not its default table. .SH EXAMPLE .PP Here is an example definition of an \fIargTable\fR and |
︙ | ︙ | |||
292 293 294 295 296 297 298 | char *fileName = defaultFileName; Boolean exec = FALSE; /* * Define option descriptions. */ Tk_ArgvInfo argTable[] = { | | | | > > | | | | | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | char *fileName = defaultFileName; Boolean exec = FALSE; /* * Define option descriptions. */ Tk_ArgvInfo argTable[] = { {"\-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag, "Turn on debugging printfs"}, {"\-N", TK_ARGV_INT, NULL, &numReps, "Number of repetitions"}, {"\-of", TK_ARGV_STRING, NULL, &fileName, "Name of file for output"}, {"x", TK_ARGV_REST, NULL, &exec, "File to exec, followed by any arguments (must be last argument)."}, {NULL, TK_ARGV_END, NULL, NULL, NULL} }; main(argc, argv) int argc; char *argv[]; { \&... if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) { fprintf(stderr, "%s\en", Tcl_GetString(Tcl_GetObjResult(interp))); exit(1); } /* * Remainder of the program. */ } .CE .PP Note that default values can be assigned to variables named in \fIargTable\fR: the variables will only be overwritten if the particular arguments are present in \fIargv\fR. Here are some example command lines and their effects. .CS prog \-N 200 infile # just sets the numReps variable to 200 prog \-of out200 infile # sets fileName to reference "out200" prog \-XN 10 infile # sets the debug flag, also sets numReps .CE In all of the above examples, \fIargc\fR will be set by \fBTk_ParseArgv\fR to 2, \fIargv\fR[0] will be .QW prog , \fIargv\fR[1] will be .QW infile , and \fIargv\fR[2] will be NULL. .SH KEYWORDS arguments, command line, options |
Changes to doc/QWinEvent.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .nf \fB#include <tk.h>\fR .sp int \fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) .sp \fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) | < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .nf \fB#include <tk.h>\fR .sp int \fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) .sp \fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) .SH ARGUMENTS .AS Tcl_QueuePosition position .AP Display *display in Display for which to control motion event collapsing. .AP int collapse in Indicates whether motion events should be collapsed or not. .AP XEvent *eventPtr in |
︙ | ︙ |
Changes to doc/Restack.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_RestackWindow \- Change a window's position in the stacking order .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_RestackWindow \- Change a window's position in the stacking order .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) .SH ARGUMENTS .AS Tk_Window aboveBelow .AP Tk_Window tkwin in Token for window to restack. .AP int aboveBelow in Indicates new position of \fItkwin\fR relative to \fIother\fR; must be \fBAbove\fR or \fBBelow\fR. |
︙ | ︙ |
Changes to doc/RestrictEv.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_RestrictEvents \- filter and selectively delay X events .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_RestrictProc * \fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_RestrictEvents \- filter and selectively delay X events .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_RestrictProc * \fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR) .SH ARGUMENTS .AS Tk_RestrictProc **prevArgPtr .AP Tk_RestrictProc *proc in Predicate procedure to call to filter incoming X events. NULL means do not restrict events at all. .AP void *arg in Arbitrary argument to pass to \fIproc\fR. |
︙ | ︙ |
Changes to doc/SetAppName.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_SetAppName \- Set the name of an application for 'send' commands .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp const char * \fBTk_SetAppName\fR(\fItkwin, name\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_SetAppName \- Set the name of an application for 'send' commands .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp const char * \fBTk_SetAppName\fR(\fItkwin, name\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window in application. Used only to select a particular application. .AP "const char" *name in Name under which to register the application. |
︙ | ︙ |
Changes to doc/SetCaret.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_SetCaretPos \- set the display caret location .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Tk_SetCaretPos \- set the display caret location .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. .AP int x in Window-relative x coordinate. .AP int y in Window-relative y coordinate. |
︙ | ︙ |
Changes to doc/SetClass.3.
︙ | ︙ | |||
14 15 16 17 18 19 20 | .nf \fB#include <tk.h>\fR .sp \fBTk_SetClass\fR(\fItkwin, class\fR) .sp Tk_Uid \fBTk_Class\fR(\fItkwin\fR) | < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .nf \fB#include <tk.h>\fR .sp \fBTk_SetClass\fR(\fItkwin, class\fR) .sp Tk_Uid \fBTk_Class\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. .AP char *class in New class name for window. .BE |
︙ | ︙ |
Changes to doc/SetClassProcs.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .SH NAME Tk_SetClassProcs \- register widget specific procedures .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) | < | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | .SH NAME Tk_SetClassProcs \- register widget specific procedures .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) .SH ARGUMENTS .AS Tk_ClassProc instanceData .AP Tk_Window tkwin in Token for window to modify. .AP "const Tk_ClassProcs" *procs in Pointer to data structure containing widget specific procedures. The data structure pointed to by \fIprocs\fR must be static: Tk keeps a reference to it as long as the window exists. .AP void *instanceData in Arbitrary one-word value to pass to widget callbacks. .BE .SH DESCRIPTION .PP \fBTk_SetClassProcs\fR is called to register a set of procedures that are used as callbacks in different places. .PP The structure pointed to by \fIprocs\fR contains the following: .CS typedef struct Tk_ClassProcs { size_t \fIsize\fR; Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; Tk_ClassCreateProc *\fIcreateProc\fR; Tk_ClassModalProc *\fImodalProc\fR; } \fBTk_ClassProcs\fR; .CE The \fIsize\fR field is used to simplify future expansion of the |
︙ | ︙ |
Changes to doc/SetGrid.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) .sp \fBTk_UnsetGrid\fR(\fItkwin\fR) | < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) .sp \fBTk_UnsetGrid\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tk_Window heightInc .AP Tk_Window tkwin in Token for window. .AP int reqWidth in Width in grid units that corresponds to the pixel dimension \fItkwin\fR has requested via \fBTk_GeometryRequest\fR. |
︙ | ︙ |
Changes to doc/SetOptions.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .SH NAME Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_FreeSavedOptions, Tk_RestoreSavedOptions, Tk_GetOptionValue, Tk_GetOptionInfo, Tk_FreeConfigOptions \- process configuration options .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_OptionTable | | | | | | | | | | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | .SH NAME Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_FreeSavedOptions, Tk_RestoreSavedOptions, Tk_GetOptionValue, Tk_GetOptionInfo, Tk_FreeConfigOptions \- process configuration options .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_OptionTable \fBTk_CreateOptionTable(\fIinterp, templatePtr\fB)\fR .sp \fBTk_DeleteOptionTable(\fIoptionTable\fB)\fR .sp int \fBTk_InitOptions(\fIinterp, recordPtr, optionTable, tkwin\fB)\fR .sp int \fBTk_SetOptions(\fIinterp, recordPtr, optionTable, objc, objv, tkwin, savePtr, maskPtr\fB)\fR .sp \fBTk_FreeSavedOptions(\fIsavedPtr\fB)\fR .sp \fBTk_RestoreSavedOptions(\fIsavedPtr\fB)\fR .sp Tcl_Obj * \fBTk_GetOptionValue(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR .sp Tcl_Obj * \fBTk_GetOptionInfo(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR .sp \fBTk_FreeConfigOptions(\fIrecordPtr, optionTable, tkwin\fB)\fR .SH ARGUMENTS .AS Tk_SavedOptions "*const objv[]" in/out .AP Tcl_Interp *interp in A Tcl interpreter. Most procedures use this only for returning error messages; if it is NULL then no error messages are returned. For \fBTk_CreateOptionTable\fR the value cannot be NULL; it gives the interpreter in which the option table will be used. |
︙ | ︙ | |||
55 56 57 58 59 60 61 | fields of this record are modified by procedures such as \fBTk_SetOptions\fR and read by procedures such as \fBTk_GetOptionValue\fR. .AP Tk_Window tkwin in For options such as \fBTK_OPTION_COLOR\fR, this argument indicates the window in which the option will be used. If \fIoptionTable\fR uses no window-dependent options, then a NULL value may be supplied for this argument. | | | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | fields of this record are modified by procedures such as \fBTk_SetOptions\fR and read by procedures such as \fBTk_GetOptionValue\fR. .AP Tk_Window tkwin in For options such as \fBTK_OPTION_COLOR\fR, this argument indicates the window in which the option will be used. If \fIoptionTable\fR uses no window-dependent options, then a NULL value may be supplied for this argument. .AP int objc in Number of values in \fIobjv\fR. .AP Tcl_Obj "*const *objv" in Command-line arguments for setting configuring options. .AP Tk_SavedOptions *savePtr out If not NULL, the structure pointed to by this argument is filled in with the old values of any options that were modified and old values are restored automatically if an error occurs in \fBTk_SetOptions\fR. |
︙ | ︙ | |||
95 96 97 98 99 100 101 | .QW widget will be used to refer to the object whose options are being managed; in practice the object may not actually be a widget. The term .QW "widget record" is used to refer to the C-level structure in which information about a particular widget or object is stored. .PP | | | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | .QW widget will be used to refer to the object whose options are being managed; in practice the object may not actually be a widget. The term .QW "widget record" is used to refer to the C-level structure in which information about a particular widget or object is stored. .PP Note: the easiest way to learn how to use these procedures is to look at a working example. In Tk, the simplest example is the code that implements the button family of widgets, which is in \fBtkButton.c\fR. Other examples are in \fBtkSquare.c\fR and \fBtkMenu.c\fR. .PP In order to use these procedures, the code that implements the widget must contain a static array of Tk_OptionSpec structures. This is a template that describes the various options supported by that class of |
︙ | ︙ | |||
298 299 300 301 302 303 304 | \fBTK_OPTION_INT\fR then the internal form is an integer. If the \fIobjOffset\fR or \fIinternalOffset\fR field is negative then the value is not stored in that form. At least one of the offsets must be greater than or equal to zero. .PP The \fIflags\fR field consists of one or more bits ORed together. The following flags are supported: | > | > | > | > | < | | | | | > | > | | | | > | > | > | > | > | > | > | > | | | > | | < | > | | < > | | | > | > | > | > | > | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | \fBTK_OPTION_INT\fR then the internal form is an integer. If the \fIobjOffset\fR or \fIinternalOffset\fR field is negative then the value is not stored in that form. At least one of the offsets must be greater than or equal to zero. .PP The \fIflags\fR field consists of one or more bits ORed together. The following flags are supported: .TP \fBTK_OPTION_NULL_OK\fR If this bit is set for an option then an empty string will be accepted as the value for the option and the resulting internal form will be a NULL pointer, a zero value, or \fBNone\fR, depending on the type of the option. If the flag is not set then empty strings will result in errors. \fBTK_OPTION_NULL_OK\fR is typically used to allow a feature to be turned off entirely, e.g. set a cursor value to \fBNone\fR so that a window simply inherits its parent's cursor. Not all option types support the \fBTK_OPTION_NULL_OK\fR flag; for those that do, there is an explicit indication of that fact in the descriptions below. .TP \fBTK_OPTION_DONT_SET_DEFAULT\fR If this bit is set for an option then no default value will be set in \fBTk_InitOptions\fR for this option. Neither the option database, nor any system default value, nor \fIoptionTable\fR are used to give a default value to this option. Instead it is assumed that the caller has already supplied a default value in the widget code. .TP \fBTK_OPTION_ENUM_VAR\fR If this value is set for an option, then it indicates the the internalOffset points to an enum variable in stead of an int variable. Only useful in combination with \fBTK_OPTION_STRING_TABLE\fR, \fBTK_OPTION_BOOLEAN\fR, \fBTK_OPTION_ANCHOR\fR, \fBTK_OPTION_JUSTIFY\fR, or \fBTK_OPTION_ANCHOR\fR. .TP \fBTK_OPTION_VAR(type)\fR If this value is set for an option, then it indicates the the internalOffset points to a \fItype\fR variable in stead of an int variable. Only useful in combination with \fBTK_OPTION_STRING_TABLE\fR or \fBTK_OPTION_BOOLEAN\fR, or as \fBTK_OPTION_VAR(Tcl_Size)\fR with \fBTK_OPTION_INT\fR .PP The \fItype\fR field of each Tk_OptionSpec structure determines how to parse the value of that configuration option. The legal value for \fItype\fR, and the corresponding actions, are described below. If the type requires a \fItkwin\fR value to be passed into procedures like \fBTk_SetOptions\fR, or if it uses the \fIclientData\fR field of the Tk_OptionSpec, then it is indicated explicitly; if not mentioned, the type requires neither \fItkwin\fR nor \fIclientData\fR. .TP \fBTK_OPTION_ANCHOR\fR The value must be a standard anchor position such as \fBne\fR or \fBcenter\fR. The internal form is a Tk_Anchor value like the ones returned by \fBTk_GetAnchorFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if the empty string is specified as the value for the option, the integer relief value is set to \fBTK_ANCHOR_NULL\fR. .TP \fBTK_OPTION_BITMAP\fR The value must be a standard Tk bitmap name. The internal form is a Pixmap token like the ones returned by \fBTk_AllocBitmapFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_BOOLEAN\fR The value must be a standard boolean value such as \fBtrue\fR or \fBno\fR. The internal form is an integer with value 0 or 1. Note: if the \fIobjOffset\fR field is not used then information about the original value of this option will be lost. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to -1. .TP \fBTK_OPTION_BORDER\fR The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR. The internal form is a Tk_3DBorder token like the ones returned by \fBTk_Alloc3DBorderFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_COLOR\fR The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR. The internal form is an (XColor *) token like the ones returned by \fBTk_AllocColorFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_CURSOR\fR The value must be a standard cursor name such as \fBcross\fR or \fB@foo\fR. The internal form is a Tk_Cursor token like the ones returned by \fBTk_AllocCursorFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and when the option is set the cursor for the window is changed by calling \fBXDefineCursor\fR. This option type also supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_CUSTOM\fR This option allows applications to define new option types. The clientData field of the entry points to a structure defining the new option type. See the section \fBCUSTOM OPTION TYPES\fR below for details. .TP \fBTK_OPTION_DOUBLE\fR The string value must be a floating-point number in the format accepted by \fBstrtol\fR. The internal form is a C \fBdouble\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to NaN. .TP \fBTK_OPTION_END\fR Marks the end of the template. There must be a Tk_OptionSpec structure with \fItype\fR \fBTK_OPTION_END\fR at the end of each template. If the \fIclientData\fR field of this structure is not NULL, then it points to an additional array of Tk_OptionSpec's, which is itself terminated by another \fBTK_OPTION_END\fR entry. Templates may be chained arbitrarily deeply. This feature allows common options to be shared by several widget classes. .TP \fBTK_OPTION_FONT\fR The value must be a standard font name such as \fBTimes 16\fR. The internal form is a Tk_Font handle like the ones returned by \fBTk_AllocFontFromObj\fR. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_INT\fR The string value must be an integer in the format accepted by \fBstrtol\fR (e.g. \fB0\fR and \fB0x\fR prefixes may be used to specify octal or hexadecimal numbers, respectively). The internal form is a C \fBint\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. .TP \fBTK_OPTION_INDEX\fR The string value must be an index in the format accepted by \fBTcl_GetIntForIndex()\fR or the empty string. The internal form is a C \fBint\fR value. If the string starts with \fB-\fR, the internal representation will be set to INT_MIN. If the string has the form \fBend-???\fR, then the result will be a negative number: \fB-1\fR stands for \fBend\fR, \fB-2\fR stands for \fBend-1\fR and so on. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. .TP \fBTK_OPTION_JUSTIFY\fR The value must be a standard justification value such as \fBleft\fR. The internal form is a Tk_Justify like the values returned by \fBTk_GetJustifyFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if the empty string is specified as the value for the option, the integer relief value is set to \fBTK_JUSTIFY_NULL\fR. .TP \fBTK_OPTION_PIXELS\fR The value must specify a screen distance such as \fB2i\fR or \fB6.4\fR. The internal form is an integer value giving a distance in pixels, like the values returned by \fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field is not used then information about the original value of this option will be lost. See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. .TP \fBTK_OPTION_RELIEF\fR The value must be standard relief such as \fBraised\fR. The internal form is an integer relief value such as \fBTK_RELIEF_RAISED\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to \fBTK_RELIEF_NULL\fR. .TP \fBTK_OPTION_STRING\fR The value may be any string. The internal form is a (char *) pointer that points to a dynamically allocated copy of the value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag. .TP \fBTK_OPTION_STRING_TABLE\fR For this type, \fIclientData\fR is a pointer to an array of strings suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must be one of the strings in the table, or a unique abbreviation of one of the strings. The internal form is an integer giving the index into the table of the matching string, like the return value from \fBTcl_GetStringFromObj\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to -1. .TP \fBTK_OPTION_SYNONYM\fR This type is used to provide alternative names for an option (for example, \fB\-bg\fR is often used as a synonym for \fB\-background\fR). The \fBclientData\fR field is a string that gives the name of another option in the same table. Whenever the synonym option is used, the information from the other option will be used instead. .TP \fBTK_OPTION_WINDOW\fR The value must be a window path name. The internal form is a \fBTk_Window\fR token for the window. This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR (in order to identify the application), and it supports the \fBTK_OPTION_NULL_OK\fR flag. .SH "STORAGE MANAGEMENT ISSUES" .PP |
︙ | ︙ | |||
505 506 507 508 509 510 511 | the original screen-independent value. Thus for \fBTK_OPTION_PIXELS\fR options it is better to use the \fIobjOffset\fR field. In this case the original value of the option is retained in the object and can be returned when the option is retrieved. In most cases it is convenient to use the \fIinternalOffset\fR field as well, so that the integer value is immediately available for use in the widget code (alternatively, \fBTk_GetPixelsFromObj\fR can be used to extract the integer value from | | | | | | 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | the original screen-independent value. Thus for \fBTK_OPTION_PIXELS\fR options it is better to use the \fIobjOffset\fR field. In this case the original value of the option is retained in the object and can be returned when the option is retrieved. In most cases it is convenient to use the \fIinternalOffset\fR field as well, so that the integer value is immediately available for use in the widget code (alternatively, \fBTk_GetPixelsFromObj\fR can be used to extract the integer value from the object whenever it is needed). Note: the problem of losing information on retrievals exists only for \fBTK_OPTION_PIXELS\fR options. .PP The second reason to use the \fIobjOffset\fR field is in order to implement new types of options not supported by these procedures. To implement a new type of option, you can use \fBTK_OPTION_STRING\fR as the type in the Tk_OptionSpec structure and set the \fIobjOffset\fR field but not the \fIinternalOffset\fR field. Then, after calling \fBTk_SetOptions\fR, convert the object to internal form yourself. .PP Ttk widgets do not support the \fIinternalOffset\fR machinery. Option values of Ttk widgets are always stored as (Tcl_Obj *), meaning that the \fIobjOffset\fR field must be used. .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with additional configuration types by writing procedures to parse, print, free, and restore saved copies of the type and creating a structure pointing to those procedures: .CS typedef struct Tk_ObjCustomOption { const char *\fname\fR; Tk_CustomOptionSetProc *\fIsetProc\fR; Tk_CustomOptionGetProc *\fIgetProc\fR; Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; Tk_CustomOptionFreeProc *\fIfreeProc\fR; void *\fIclientData\fR; } \fBTk_ObjCustomOption\fR; |
︙ | ︙ | |||
575 576 577 578 579 580 581 | may be NULL, indicating that no function should be called for those operations. .PP The \fIsetProc\fR procedure is invoked by \fBTk_SetOptions\fR to convert a Tcl_Obj into an internal representation and store the resulting value in the widget record. The arguments are: .RS | > | > | > | > | > | > | > | > | | 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | may be NULL, indicating that no function should be called for those operations. .PP The \fIsetProc\fR procedure is invoked by \fBTk_SetOptions\fR to convert a Tcl_Obj into an internal representation and store the resulting value in the widget record. The arguments are: .RS .TP \fIclientData\fR A copy of the \fIclientData\fR field in the Tk_ObjCustomOption structure. .TP \fIinterp\fR A pointer to a Tcl interpreter, used for error reporting. .TP \fITkwin\fR A copy of the \fItkwin\fR argument to \fBTk_SetOptions\fR .TP \fIvaluePtr\fR A pointer to a reference to a Tcl_Obj describing the new value for the option; it could have been specified explicitly in the call to \fBTk_SetOptions\fR or it could come from the option database or a default. If the objOffset for the option is non-negative (the option value is stored as a (Tcl_Obj *) in the widget record), the Tcl_Obj pointer referenced by \fIvaluePtr\fR is the pointer that will be stored at the objOffset for the option. \fISetProc\fR may modify the value if necessary; for example, \fIsetProc\fR may change the value to NULL to support the \fBTK_OPTION_NULL_OK\fR flag. .TP \fIrecordPtr\fR A pointer to the start of the widget record to modify. .TP \fIinternalOffset\fR Offset in bytes from the start of the widget record to the location where the internal representation of the option value is to be placed. .TP \fIsaveInternalPtr\fR A pointer to storage allocated in a Tk_SavedOptions structure for the internal representation of the original option value. Before setting the option to its new value, \fIsetProc\fR should set the value referenced by \fIsaveInternalPtr\fR to the original value of the option in order to support \fBTk_RestoreSavedOptions\fR. .TP \fIflags\fR A copy of the \fIflags\fR field in the Tk_OptionSpec structure for the option .RE .PP \fISetProc\fR returns a standard Tcl result: \fBTCL_OK\fR to indicate successful processing, or \fBTCL_ERROR\fR to indicate a failure of any kind. An error message may be left in the Tcl interpreter given by \fIinterp\fR in |
︙ | ︙ |
Changes to doc/SetVisual.3.
︙ | ︙ | |||
12 13 14 15 16 17 18 | Tk_SetWindowVisual \- change visual characteristics of window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_SetWindowVisual\fR(\fItkwin, visual, depth, colormap\fR) | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Tk_SetWindowVisual \- change visual characteristics of window .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_SetWindowVisual\fR(\fItkwin, visual, depth, colormap\fR) .SH ARGUMENTS .AS "Tk_Window int" colormap .AP Tk_Window tkwin in Token for window. .AP Visual *visual in New visual type to use for \fItkwin\fR. .AP "int" depth in |
︙ | ︙ | |||
40 41 42 43 44 45 46 | The safest thing is to call \fBTk_SetWindowVisual\fR immediately after calling \fBTk_CreateWindow\fR. If \fItkwin\fR has already been created before \fBTk_SetWindowVisual\fR is called then it returns 0 and does not make any changes; otherwise it returns 1 to signify that the operation completed successfully. .PP | | | 39 40 41 42 43 44 45 46 47 48 49 50 | The safest thing is to call \fBTk_SetWindowVisual\fR immediately after calling \fBTk_CreateWindow\fR. If \fItkwin\fR has already been created before \fBTk_SetWindowVisual\fR is called then it returns 0 and does not make any changes; otherwise it returns 1 to signify that the operation completed successfully. .PP Note: \fBTk_SetWindowVisual\fR should not be called if you just want to change a window's colormap without changing its visual or depth; call \fBTk_SetWindowColormap\fR instead. .SH KEYWORDS colormap, depth, visual |
Changes to doc/StrictMotif.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_StrictMotif \- Return value of tk_strictMotif variable .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_StrictMotif\fR(\fItkwin\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Tk_StrictMotif \- Return value of tk_strictMotif variable .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp int \fBTk_StrictMotif\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .BE .SH DESCRIPTION .PP |
︙ | ︙ |
Changes to doc/TextLayout.3.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .SH NAME Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayout, Tk_PointToChar, Tk_CharBbox, Tk_DistanceToTextLayout, Tk_IntersectTextLayout, Tk_TextLayoutToPostscript \- routines to measure and display single-font, multi-line, justified text. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_TextLayout | | > | > | > | | | | | > | < | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | .SH NAME Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayout, Tk_PointToChar, Tk_CharBbox, Tk_DistanceToTextLayout, Tk_IntersectTextLayout, Tk_TextLayoutToPostscript \- routines to measure and display single-font, multi-line, justified text. .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_TextLayout \fBTk_ComputeTextLayout(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fB)\fR .sp void \fBTk_FreeTextLayout(\fIlayout\fB)\fR .sp void \fBTk_DrawTextLayout(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fB)\fR .sp void \fBTk_UnderlineTextLayout(\fIdisplay, drawable, gc, layout, x, y, underline\fB)\fR .sp int \fBTk_PointToChar(\fIlayout, x, y\fB)\fR .sp int \fBTk_CharBbox(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fB)\fR .sp int \fBTk_DistanceToTextLayout(\fIlayout, x, y\fB)\fR .sp int \fBTk_IntersectTextLayout(\fIlayout, x, y, width, height\fB)\fR .sp void \fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR .SH ARGUMENTS .AS Tk_TextLayout "*xPtr, *yPtr" .AP Tk_Font tkfont in Font to use when constructing and displaying a text layout. The \fItkfont\fR must remain valid for the lifetime of the text layout. Must have been returned by a previous call to \fBTk_GetFont\fR. .AP "const char" *string in Potentially multi-line string whose dimensions are to be computed and stored in the text layout. The \fIstring\fR must remain valid for the lifetime of the text layout. .AP int numChars in The number of characters to consider from \fIstring\fR. If \fInumChars\fR is negative, then assumes \fIstring\fR is null terminated and uses \fBTcl_NumUtfChars\fR to determine the length of \fIstring\fR. .AP int wrapLength in Longest permissible line length, in pixels. Lines in \fIstring\fR will automatically be broken at word boundaries and wrapped when they reach this length. If \fIwrapLength\fR is too small for even a single character to fit on a line, it will be expanded to allow one character to |
︙ | ︙ | |||
93 94 95 96 97 98 99 | this GC must correspond to the \fItkfont\fR used when constructing the text layout. .AP int "x, y" in Point, in pixels, at which to place the upper-left hand corner of the text layout when it is being drawn, or the coordinates of a point (with respect to the upper-left hand corner of the text layout) to check against the text layout. | | | | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | this GC must correspond to the \fItkfont\fR used when constructing the text layout. .AP int "x, y" in Point, in pixels, at which to place the upper-left hand corner of the text layout when it is being drawn, or the coordinates of a point (with respect to the upper-left hand corner of the text layout) to check against the text layout. .AP int firstChar in The index of the first character to draw from the given text layout. The number 0 means to draw from the beginning. .AP int lastChar in The index of the last character up to which to draw. The character specified by \fIlastChar\fR itself will not be drawn. A number less than 0 means to draw all characters in the text layout. .AP int underline in Index of the single character to underline in the text layout, or a negative number counting backwards from the end of the string. Any out-of-range number (e.g. INT_MIN) means no underline. .AP int index in The index of the character whose bounding box is desired. The bounding box is computed with respect to the upper-left hand corner of the text layout. .AP int "*xPtr, *yPtr" out Filled with the upper-left hand corner, in pixels, of the bounding box for the character specified by \fIindex\fR. Either or both \fIxPtr\fR and \fIyPtr\fR may be NULL, in which case the corresponding value is not calculated. |
︙ | ︙ | |||
172 173 174 175 176 177 178 | \fBTk_PointToChar\fR uses the information in \fIlayout\fR to determine the character closest to the given point. The point is specified with respect to the upper-left hand corner of the \fIlayout\fR, which is considered to be located at (0, 0). Any point whose \fIy\fR-value is less that 0 will be considered closest to the first character in the text layout; any point whose \fIy\fR-value is greater than the height of the text layout will be considered closest to the last character in the text layout. Any point | | | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | \fBTk_PointToChar\fR uses the information in \fIlayout\fR to determine the character closest to the given point. The point is specified with respect to the upper-left hand corner of the \fIlayout\fR, which is considered to be located at (0, 0). Any point whose \fIy\fR-value is less that 0 will be considered closest to the first character in the text layout; any point whose \fIy\fR-value is greater than the height of the text layout will be considered closest to the last character in the text layout. Any point whose \fIx\fR-value is negative will be considered closest to the first character on that line; any point whose \fIx\fR-value is greater than the width of the text layout will be considered closest to the last character on that line. The return value is the index of the character that was closest to the point, or one more than the index of any character (to indicate that the point was after the end of the string and that the corresponding caret would be at the end of the string). Given a \fIlayout\fR with no characters, the value 0 will always be returned, referring to a hypothetical zero-width |
︙ | ︙ |
Changes to doc/TkInitStubs.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | Tk_InitStubs \- initialize the Tk stubs mechanism .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp const char * \fBTk_InitStubs\fR(\fIinterp, version, exact\fR) | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Tk_InitStubs \- initialize the Tk stubs mechanism .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp const char * \fBTk_InitStubs\fR(\fIinterp, version, exact\fR) .SH ARGUMENTS .AS Tcl_Interp *interp in .AP Tcl_Interp *interp in Tcl interpreter handle. .AP char *version in A version string consisting of one or more decimal numbers separated by dots. |
︙ | ︙ |
Changes to doc/Tk_Init.3.
︙ | ︙ | |||
43 44 45 46 47 48 49 | its command-line arguments). .PP \fBTk_SafeInit\fR is identical to \fBTk_Init\fR except that it removes all Tk commands that are considered unsafe. Those commands and the reasons for their exclusion are: .TP \fBbell\fR | < < < < < < < < < < | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | its command-line arguments). .PP \fBTk_SafeInit\fR is identical to \fBTk_Init\fR except that it removes all Tk commands that are considered unsafe. Those commands and the reasons for their exclusion are: .TP \fBbell\fR Continuous ringing of the bell is a nuisance. .TP \fBclipboard\fR A malicious script could replace the contents of the clipboard with the string .QW "\fBrm \-r *\fR" and lead to surprises when the contents of the clipboard are pasted. .TP \fBgrab\fR Grab can be used to block the user from using any other applications. .TP \fBmenu\fR Menus can be used to cover the entire screen and to steal input from the user. .TP \fBselection\fR See clipboard. .TP \fBsend\fR Send can be used to cause unsafe interpreters to execute commands. .TP \fBtk\fR The tk command recreates the send command, which is unsafe. .TP \fBtkwait\fR Tkwait can block the containing process forever .TP \fBtoplevel\fR Toplevels can be used to cover the entire screen and to steal input from the user. .TP \fBwm\fR If toplevels are ever allowed, wm can be used to remove decorations, move windows around, etc. .SH KEYWORDS safe, application, initialization, load, main window |
Changes to doc/Tk_Main.3.
︙ | ︙ | |||
13 14 15 16 17 18 19 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_Main\fR(\fIargc, argv, appInitProc\fR) .SH ARGUMENTS .AS Tcl_AppInitProc *appInitProc | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp \fBTk_Main\fR(\fIargc, argv, appInitProc\fR) .SH ARGUMENTS .AS Tcl_AppInitProc *appInitProc .AP int argc in Number of elements in \fIargv\fR. .AP char *argv[] in Array of strings containing command-line arguments. On Windows, when using -DUNICODE, the parameter type changes to wchar_t *. .AP Tcl_AppInitProc *appInitProc in Address of an application-specific initialization procedure. The value for this argument is usually \fBTcl_AppInit\fR. |
︙ | ︙ |
Changes to doc/WinUtil.3.
︙ | ︙ | |||
11 12 13 14 15 16 17 | .SH NAME Tk_GetOtherWindow, Tk_MakeContainer, Tk_MakeWindow, Tk_UseWindow \- window utility functions .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window | | | | | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | .SH NAME Tk_GetOtherWindow, Tk_MakeContainer, Tk_MakeWindow, Tk_UseWindow \- window utility functions .SH SYNOPSIS .nf \fB#include <tk.h>\fR .sp Tk_Window \fBTk_GetOtherWindow(\fItkwin\fB)\fR .sp \fBTk_MakeContainer(\fItkwin\fB)\fR .sp \fBTk_MakeWindow(\fItkwin, parent\fB)\fR .sp int \fBTk_UseWindow(\fIinterp, tkwin, string\fB)\fR .SH ARGUMENTS .AS XSetWindowAttributes borderWidth .AP Tcl_Interp * interp in Interpreter associated with the application. .AP Tk_Window tkwin in Token for window. .AP Window parent in |
︙ | ︙ |
Changes to doc/WindowId.3.
︙ | ︙ | |||
99 100 101 102 103 104 105 | \fBTk_Colormap\fR(\fItkwin\fR) .sp Tcl_Interp * \fBTk_Interp\fR(\fItkwin\fR) .sp Tcl_Obj * \fBTk_NewWindowObj\fR(\fItkwin\fR) | < | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | \fBTk_Colormap\fR(\fItkwin\fR) .sp Tcl_Interp * \fBTk_Interp\fR(\fItkwin\fR) .sp Tcl_Obj * \fBTk_NewWindowObj\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .BE .SH DESCRIPTION .PP |
︙ | ︙ | |||
144 145 146 147 148 149 150 | The width and height information refers to the interior size of the window, not including any border. \fBTk_Changes\fR returns a pointer to a structure containing all of the above information plus a few other fields. \fBTk_Attributes\fR returns a pointer to an XSetWindowAttributes structure describing all of the attributes of the \fItkwin\fR's window, such as background pixmap, event mask, and so on (Tk keeps track of all this information | | | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | The width and height information refers to the interior size of the window, not including any border. \fBTk_Changes\fR returns a pointer to a structure containing all of the above information plus a few other fields. \fBTk_Attributes\fR returns a pointer to an XSetWindowAttributes structure describing all of the attributes of the \fItkwin\fR's window, such as background pixmap, event mask, and so on (Tk keeps track of all this information as it is changed by the application). Note: it is essential that applications use Tk procedures like \fBTk_ResizeWindow\fR instead of X procedures like \fBXResizeWindow\fR, so that Tk can keep its data structures up-to-date. .PP \fBTk_IsContainer\fR returns a non-zero value if \fItkwin\fR is a container, and that some other application may be embedding itself inside \fItkwin\fR. |
︙ | ︙ |
Changes to doc/bind.n.
︙ | ︙ | |||
145 146 147 148 149 150 151 | times, and also place a time and space requirement on the sequence: for a sequence of events to match a \fBDouble\fR, \fBTriple\fR or \fBQuadruple\fR pattern, all of the events must occur close together in time and without substantial mouse motion in between. For example, \fB<Double\-Button\-1>\fR is equivalent to \fB<Button\-1><Button\-1>\fR with the extra time and space requirement. .PP | | < | | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | times, and also place a time and space requirement on the sequence: for a sequence of events to match a \fBDouble\fR, \fBTriple\fR or \fBQuadruple\fR pattern, all of the events must occur close together in time and without substantial mouse motion in between. For example, \fB<Double\-Button\-1>\fR is equivalent to \fB<Button\-1><Button\-1>\fR with the extra time and space requirement. .PP The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are equivalents of \fBMod1\fR up to \fBMod4\fR, they correspond to Macintosh-specific modifier keys. .PP The \fBExtended\fR modifier is, at present, specific to Windows. It appears on events that are associated with the keys on the .QW "extended keyboard" . On a US keyboard, the extended keys include the \fBAlt\fR and \fBControl\fR keys at the right of the keyboard, the cursor keys in the cluster to the left of the numeric pad, the \fBNumLock\fR key, |
︙ | ︙ | |||
646 647 648 649 650 651 652 | appended scripts, is terminated but Tk will continue processing binding scripts associated with other \fItag\fR's. If the \fBbreak\fR command is invoked within a binding script, then that script terminates and no other scripts will be invoked for the event. .PP Within a script called from the binding script, \fBreturn\fR | | | | 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | appended scripts, is terminated but Tk will continue processing binding scripts associated with other \fItag\fR's. If the \fBbreak\fR command is invoked within a binding script, then that script terminates and no other scripts will be invoked for the event. .PP Within a script called from the binding script, \fBreturn\fR \fB-code ok\fR may be used to continue processing (including .QW + appended scripts), or \fBreturn\fR \fB-code break\fR may be used to stop processing all other binding scripts. .PP If more than one binding matches a particular event and they have the same \fItag\fR, then the most specific binding is chosen and its script is evaluated. The following tests are applied, in order, to determine which of several matching sequences is more specific: |
︙ | ︙ | |||
736 737 738 739 740 741 742 | The \fBbgerror\fR command will be executed at global level (outside the context of any Tcl procedure). .SH "EXAMPLES" .PP Arrange for a string describing the motion of the mouse to be printed out when the mouse is double-clicked: .CS | | | | 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | The \fBbgerror\fR command will be executed at global level (outside the context of any Tcl procedure). .SH "EXAMPLES" .PP Arrange for a string describing the motion of the mouse to be printed out when the mouse is double-clicked: .CS \fBbind\fR . <Double\-1> { puts "hi from (%x,%y)" } .CE .PP A little GUI that displays what the keysym name of the last key pressed is: .CS set keysym "Press any key" pack [label .l \-textvariable keysym \-padx 2m \-pady 1m] \fBbind\fR . <Key> { set keysym "You pressed %K" } .CE .SH "SEE ALSO" bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n) .SH KEYWORDS binding, event '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/bitmap.n.
︙ | ︙ | |||
11 12 13 14 15 16 17 | '\" Note: do not modify the .SH NAME line immediately below! .SH NAME bitmap \- Images that display two colors .SH SYNOPSIS .nf \fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | '\" Note: do not modify the .SH NAME line immediately below! .SH NAME bitmap \- Images that display two colors .SH SYNOPSIS .nf \fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? \fIimageName \fBcget\fR \fIoption\fR \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? .fi .BE .SH DESCRIPTION .PP A bitmap is an image whose pixels can display either of two colors or be transparent. |
︙ | ︙ | |||
35 36 37 38 39 40 41 | the source data is one and the background color if the source data is zero. .SH "CREATING BITMAPS" .PP Like all images, bitmaps are created using the \fBimage create\fR command. Bitmaps support the following \fIoptions\fR: | < < < < < < < | < | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | the source data is one and the background color if the source data is zero. .SH "CREATING BITMAPS" .PP Like all images, bitmaps are created using the \fBimage create\fR command. Bitmaps support the following \fIoptions\fR: .TP \fB\-background \fIcolor\fR . Specifies a background color for the image in any of the standard ways accepted by Tk. If this option is set to an empty string then the background pixels will be transparent. This effect is achieved by using the source bitmap as the mask bitmap, ignoring any \fB\-maskdata\fR or \fB\-maskfile\fR options. .TP \fB\-data \fIstring\fR . Specifies the contents of the source bitmap as a string. The string must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). If both the \fB\-data\fR and \fB\-file\fR options are specified, the \fB\-data\fR option takes precedence. .TP \fB\-file \fIname\fR . \fIname\fR gives the name of a file whose contents define the source bitmap. The file must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). .TP \fB\-foreground \fIcolor\fR . Specifies a foreground color for the image in any of the standard ways accepted by Tk. .TP \fB\-maskdata \fIstring\fR . Specifies the contents of the mask as a string. The string must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified, the \fB\-maskdata\fR option takes precedence. .TP \fB\-maskfile \fIname\fR . \fIname\fR gives the name of a file whose contents define the mask. The file must adhere to X11 bitmap format (e.g., as generated by the \fBbitmap\fR program). .SH "IMAGE COMMAND" .PP When a bitmap image is created, Tk also creates a new command whose name is the same as the image. This command may be used to invoke various operations on the image. It has the following general form: .CS \fIimageName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for bitmap images: .TP \fIimageName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBimage create\fR \fBbitmap\fR command. .TP \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options for the image. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified |
︙ | ︙ |
Changes to doc/busy.n.
︙ | ︙ | |||
26 27 28 29 30 31 32 | .TH busy n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME busy \- Make Tk widgets busy, temporarily blocking user interactions .SH SYNOPSIS | < | > > | > > | > > < | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | .TH busy n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME busy \- Make Tk widgets busy, temporarily blocking user interactions .SH SYNOPSIS \fBtk busy\fR \fIwindow \fR?\fIoptions\fR? .sp \fBtk busy busywindow \fIwindow\fR .sp \fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR? .sp \fBtk busy configure \fIwindow\fR ?\fIoption value\fR?... .sp \fBtk busy forget\fR \fIwindow \fR?\fIwindow \fR?... .sp \fBtk busy current\fR ?\fIpattern\fR? .sp \fBtk busy status \fIwindow\fR .BE .SH DESCRIPTION .PP The \fBtk busy\fR command provides a simple means to block mouse pointer events from Tk widgets, while overriding the widget's cursor with a configurable busy cursor. Note this command does not prevent keyboard events from being sent to the widgets made busy. |
︙ | ︙ | |||
108 109 110 111 112 113 114 | \fBtk busy\fR forget .top .CE .PP The busy window has a configurable cursor. You can change the busy cursor using the \fBconfigure\fR operation. .PP .CS | | < < | < | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | \fBtk busy\fR forget .top .CE .PP The busy window has a configurable cursor. You can change the busy cursor using the \fBconfigure\fR operation. .PP .CS \fBtk busy\fR configure .top \-cursor "watch" .CE .PP Destroying the widget will also clean up any resources allocated by the \fBtk busy\fR command. .PP .SH OPERATIONS .PP The following operations are available for the \fBtk busy\fR command: .TP \fBtk busy \fIwindow\fR ?\fIoption value\fR?... . Shortcut for \fBtk busy hold\fR command. .TP \fBtk busy busywindow \fIwindow\fR . Returns the pathname of the busy window (i.e. the transparent window shielding the window appearing busy) created by the \fBtk busy hold\fR command for \fIwindow\fR, or the empty string if \fIwindow\fR is not busy. .TP \fBtk busy cget \fIwindow\fR \fIoption\fR . Queries the \fBtk busy\fR command configuration options for \fIwindow\fR. \fIWindow\fR must be the path name of a widget previously made busy by the \fBhold\fR operation. The command returns the present value of the specified \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBhold\fR operation. .TP \fBtk busy configure \fIwindow\fR ?\fIoption value\fR?... . Queries or modifies the \fBtk busy\fR command configuration options for \fIwindow\fR. \fIWindow\fR must be the path name of a widget previously made busy by the \fBhold\fR operation. If no options are specified, a list describing all of the available options for \fIwindow\fR (see |
︙ | ︙ | |||
164 165 166 167 168 169 170 | specified for it by either \fBoption\fR command: .PP .CS option add *frame.busyCursor gumby option add *Frame.BusyCursor gumby .CE .RE | < < < < < | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | specified for it by either \fBoption\fR command: .PP .CS option add *frame.busyCursor gumby option add *Frame.BusyCursor gumby .CE .RE .TP \fBtk busy current \fR?\fIpattern\fR? . Returns the pathnames of all widgets that are currently busy. If a \fIpattern\fR is given, only the path names of busy widgets matching \fIpattern\fR are returned. .TP \fBtk busy forget \fIwindow\fR ?\fIwindow\fR?... . Releases resources allocated by the \fBtk busy\fR command for \fIwindow\fR, including the transparent window. User events will again be received by \fIwindow\fR. Resources are also released when \fIwindow\fR is destroyed. \fIWindow\fR must be the name of a widget specified in the \fBhold\fR operation, otherwise an error is reported. .TP \fBtk busy hold \fIwindow\fR ?\fIoption value\fR?... . Makes the specified \fIwindow\fR (and its descendants in the Tk window hierarchy) appear busy. \fIWindow\fR must be a valid path name of a Tk widget. A transparent window is put in front of the specified window. This transparent window is mapped the next time idle tasks are processed, and the specified window and its descendants will be blocked from user interactions. Normally \fBupdate\fR should be called immediately afterward to insure that the hold operation is in effect before the application starts its processing. The command returns the pathname of the busy window that was created (i.e. the transparent window shielding the window appearing busy). The following configuration options are valid: .RS .TP \fB\-cursor \fIcursorName\fR . Specifies the cursor to be displayed when the widget is made busy. \fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms. .RE .TP \fBtk busy status \fIwindow\fR . Returns the status of a widget \fIwindow\fR. If \fIwindow\fR presently can not receive user interactions, \fB1\fR is returned, otherwise \fB0\fR. .SH "EVENT HANDLING" .SS BINDINGS |
︙ | ︙ |
Changes to doc/button.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH button n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME button \- Create and manipulate 'button' action widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH button n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME button \- Create and manipulate 'button' action widgets .SH SYNOPSIS \fBbutton\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-font \-relief \-activeforeground \-foreground \-repeatdelay \-anchor \-highlightbackground \-repeatinterval \-background \-highlightcolor \-takefocus \-bitmap \-highlightthickness \-text \-borderwidth \-image \-textvariable |
︙ | ︙ | |||
110 111 112 113 114 115 116 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for button widgets: | < | < < < < < < < | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for button widgets: .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBbutton\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBbutton\fR command. .TP \fIpathName \fBflash\fR Flash the button. This is accomplished by redisplaying the button several times, alternating between the configured activebackground and background colors. At the end of the flash the button is left in the same normal/active state as when the command was invoked. This command is ignored if the button's state is \fBdisabled\fR. .TP \fIpathName \fBinvoke\fR Invoke the Tcl command associated with the button, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the button. This command is ignored if the button's state is \fBdisabled\fR. .SH "DEFAULT BINDINGS" .PP Tk automatically creates class bindings for buttons that give them |
︙ | ︙ | |||
192 193 194 195 196 197 198 | .SH EXAMPLES .PP This is the classic Tk .QW "Hello, World!" demonstration: .PP .CS | | | | | | | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | .SH EXAMPLES .PP This is the classic Tk .QW "Hello, World!" demonstration: .PP .CS \fBbutton\fR .b \-text "Hello, World!" \-command exit pack .b .CE .PP This example demonstrates how to handle button accelerators: .PP .CS \fBbutton\fR .b1 \-text Hello \-underline 0 \fBbutton\fR .b2 \-text World \-underline 0 bind . <Key\-h> {.b1 flash; .b1 invoke} bind . <Key\-w> {.b2 flash; .b2 invoke} pack .b1 .b2 .CE .SH "SEE ALSO" ttk::button(n) .SH KEYWORDS button, widget '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/canvas.n.
︙ | ︙ | |||
9 10 11 12 13 14 15 | .TH canvas n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME canvas \- Create and manipulate 'canvas' hypergraphics drawing surface widgets .SH SYNOPSIS | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | .TH canvas n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME canvas \- Create and manipulate 'canvas' hypergraphics drawing surface widgets .SH SYNOPSIS \fBcanvas\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-highlightbackground \-highlightcolor \-highlightthickness \-insertbackground \-insertborderwidth \-insertofftime \-insertontime \-insertwidth \-relief \-selectbackground \-selectborderwidth \-selectforeground \-takefocus \-xscrollcommand \-yscrollcommand |
︙ | ︙ | |||
63 64 65 66 67 68 69 | Specifies an increment for horizontal scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the horizontal view in the window will be constrained so that the canvas x coordinate at the left edge of the window is always an even multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling (e.g., the change in view when the left and right arrows of a scrollbar are selected) will also be \fBxScrollIncrement\fR. If the value of | | | | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | Specifies an increment for horizontal scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the horizontal view in the window will be constrained so that the canvas x coordinate at the left edge of the window is always an even multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling (e.g., the change in view when the left and right arrows of a scrollbar are selected) will also be \fBxScrollIncrement\fR. If the value of this option is negative or zero, then horizontal scrolling is unconstrained. .OP \-yscrollincrement yScrollIncrement ScrollIncrement Specifies an increment for vertical scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the vertical view in the window will be constrained so that the canvas y coordinate at the top edge of the window is always an even multiple of \fByScrollIncrement\fR; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be \fByScrollIncrement\fR. If the value of this option is negative or zero, then vertical scrolling is unconstrained. .BE .SH INTRODUCTION .PP The \fBcanvas\fR command creates a new window (given by the \fIpathName\fR argument) and makes it into a canvas widget. Additional options, described above, may be specified on the |
︙ | ︙ | |||
252 253 254 255 256 257 258 | support as many of these forms as practical. Note that it is possible to refer to the character just after the last one in the text item; this is necessary for such tasks as inserting new text at the end of the item. Lines and Polygons do not support the insertion cursor and the selection. Their indices are supposed to be even always, because coordinates always appear in pairs. | > | > | | > | > > | > > | > > | > > | > | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | support as many of these forms as practical. Note that it is possible to refer to the character just after the last one in the text item; this is necessary for such tasks as inserting new text at the end of the item. Lines and Polygons do not support the insertion cursor and the selection. Their indices are supposed to be even always, because coordinates always appear in pairs. .TP 10 \fInumber\fR . A decimal number giving the position of the desired character within the text item. 0 refers to the first character, 1 to the next character, and so on. If indexes are odd for lines and polygons, they will be automatically decremented by one. A negative number is treated as if it were zero, and a number greater than the length of the text item is treated as if it were equal to the length of the text item. For polygons, negative numbers or numbers greater than the length of the coordinate list will be adjusted by adding or subtracting the length until the result is between zero and the length, inclusive. .TP 10 \fBend\fR . Refers to the character or coordinate just after the last one in the item (same as the number of characters or coordinates in the item). .TP 10 \fBinsert\fR . Refers to the character just before which the insertion cursor is drawn in this item. Not valid for lines and polygons. .TP 10 \fBsel.first\fR . Refers to the first selected character in the item. If the selection is not in this item then this form is illegal. .TP 10 \fBsel.last\fR . Refers to the last selected character in the item. If the selection is not in this item then this form is illegal. .TP 10 \fB@\fIx,y\fR . Refers to the character or coordinate at the point given by \fIx\fR and \fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate system of the canvas. If \fIx\fR and \fIy\fR lie outside the coordinates covered by the text item, then they refer to the first or last character in the line that is closest to the given point. .SH "DASH PATTERNS" |
︙ | ︙ | |||
337 338 339 340 341 342 343 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following widget commands are possible for canvas widgets: | < > | > > | > > | > > | > > | > > | > > | > < < | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following widget commands are possible for canvas widgets: .TP \fIpathName \fBaddtag \fItag searchSpec \fR?\fIarg ...\fR? . For each item that meets the constraints specified by \fIsearchSpec\fR and the \fIarg\fRs, add \fItag\fR to the list of tags associated with the item if it is not already present on that list. It is possible that no items will satisfy the constraints given by \fIsearchSpec\fR and \fIarg\fRs, in which case the command has no effect. This command returns an empty string as result. \fISearchSpec\fR and \fIarg\fR's may take any of the following forms: .RS .TP \fBabove \fItagOrId\fR . Selects the item just after (above) the one given by \fItagOrId\fR in the display list. If \fItagOrId\fR denotes more than one item, then the last (topmost) of these items in the display list is used. .TP \fBall\fR . Selects all the items in the canvas. .TP \fBbelow \fItagOrId\fR . Selects the item just before (below) the one given by \fItagOrId\fR in the display list. If \fItagOrId\fR denotes more than one item, then the first (lowest) of these items in the display list is used. .TP \fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR? . Selects the item closest to the point given by \fIx\fR and \fIy\fR. If more than one item is at the same closest distance (e.g. two items overlap the point), then the top-most of these items (the last one in the display list) is used. If \fIhalo\fR is specified, then it must be a non-negative value. Any item closer than \fIhalo\fR to the point is considered to overlap it. The \fIstart\fR argument may be used to step circularly through all the closest items. If \fIstart\fR is specified, it names an item using a tag or id (if by tag, it selects the first item in the display list with the given tag). Instead of selecting the topmost closest item, this form will select the topmost closest item that is below \fIstart\fR in the display list; if no such item exists, then the selection behaves as if the \fIstart\fR argument had not been specified. .TP \fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR . Selects all the items completely enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. .TP \fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR . Selects all the items that overlap or are enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. .TP \fBwithtag \fItagOrId\fR . Selects all the items given by \fItagOrId\fR. .RE .TP \fIpathName \fBbbox \fItagOrId\fR ?\fItagOrId tagOrId ...\fR? . Returns a list with four elements giving an approximate bounding box for all the items named by the \fItagOrId\fR arguments. The list has the form .QW "\fIx1 y1 x2 y2\fR" such that the drawn areas of all the named elements are within the region bounded by \fIx1\fR on the left, \fIx2\fR on the right, \fIy1\fR on the top, and \fIy2\fR on the bottom. The return value may overestimate the actual bounding box by a few pixels. If no items match any of the \fItagOrId\fR arguments or if the matching items have empty bounding boxes (i.e. they have nothing to display) then an empty string is returned. .TP \fIpathName \fBbind \fItagOrId\fR ?\fIsequence\fR? ?\fIcommand\fR? . This command associates \fIcommand\fR with all the items given by \fItagOrId\fR such that whenever the event sequence given by \fIsequence\fR occurs for one of the items the command will be invoked. |
︙ | ︙ | |||
476 477 478 479 480 481 482 | .PP If bindings have been created for a canvas window using the \fBbind\fR command, then they are invoked in addition to bindings created for the canvas's items using the \fBbind\fR widget command. The bindings for items will be invoked before any of the bindings for the window as a whole. .RE | < < < | < < | | < < < < < < | 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | .PP If bindings have been created for a canvas window using the \fBbind\fR command, then they are invoked in addition to bindings created for the canvas's items using the \fBbind\fR widget command. The bindings for items will be invoked before any of the bindings for the window as a whole. .RE .TP \fIpathName \fBcanvasx \fIscreenx\fR ?\fIgridspacing\fR? . Given a window x-coordinate in the canvas \fIscreenx\fR, this command returns the canvas x-coordinate that is displayed at that location. If \fIgridspacing\fR is specified, then the canvas coordinate is rounded to the nearest multiple of \fIgridspacing\fR units. .TP \fIpathName \fBcanvasy \fIscreeny\fR ?\fIgridspacing\fR? . Given a window y-coordinate in the canvas \fIscreeny\fR this command returns the canvas y-coordinate that is displayed at that location. If \fIgridspacing\fR is specified, then the canvas coordinate is rounded to the nearest multiple of \fIgridspacing\fR units. .TP \fIpathName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBcanvas\fR command. .TP \fIpathName \fBconfigure ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBcanvas\fR command. .TP \fIpathName\fR \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR? .TP \fIpathName\fR \fBcoords \fItagOrId \fR?\fIcoordList\fR? . Query or modify the coordinates that define an item. If no coordinates are specified, this command returns a list whose elements are the coordinates of the item named by \fItagOrId\fR. If coordinates are specified, then they replace the current coordinates for the named item. If \fItagOrId\fR refers to multiple items, then 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 \fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR? .TP \fIpathName \fBcreate \fItype coordList \fR?\fIoption value ...\fR? . Create a new item in \fIpathName\fR of type \fItype\fR. The exact format of the arguments after \fItype\fR depends on \fItype\fR, but usually they consist of the coordinates for one or more points, followed by specifications for zero or more item options. See the subsections on individual item types below for more on the syntax of this command. This command returns the id for the new item. .TP \fIpathName \fBdchars \fItagOrId first \fR?\fIlast\fR? . For each item given by \fItagOrId\fR, delete the characters, or coordinates, in the range given by \fIfirst\fR and \fIlast\fR, inclusive. If some of the items given by \fItagOrId\fR do not support indexing operations then they ignore this operation. Text items interpret \fIfirst\fR and \fIlast\fR as indices to a character, line and polygon items interpret them as indices to a coordinate (an x,y pair). Indices are described in \fBINDICES\fR above. If \fIlast\fR is omitted, it defaults to \fIfirst\fR. This command returns an empty string. .TP \fIpathName \fBdelete \fR?\fItagOrId tagOrId ...\fR? . Delete each of the items given by each \fItagOrId\fR, and return an empty string. .TP \fIpathName \fBdtag \fItagOrId \fR?\fItagToDelete\fR? . For each of the items given by \fItagOrId\fR, delete the tag given by \fItagToDelete\fR from the list of those associated with the item. If an item does not have the tag \fItagToDelete\fR then the item is unaffected by the command. If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR. This command returns an empty string. .TP \fIpathName \fBfind \fIsearchCommand \fR?\fIarg ...\fR? . This command returns a list consisting of all the items that meet the constraints specified by \fIsearchCommand\fR and \fIarg\fR's. \fISearchCommand\fR and \fIargs\fR have any of the forms accepted by the \fBaddtag\fR command. The items are returned in stacking order, with the lowest item first. .TP \fIpathName \fBfocus \fR?\fItagOrId\fR? . Set the keyboard focus for the canvas widget to the item given by \fItagOrId\fR. If \fItagOrId\fR refers to several items, then the focus is set to the first such item in the display list that supports the |
︙ | ︙ | |||
623 624 625 626 627 628 629 | a given item does not actually have the input focus unless (a) its canvas is the focus window and (b) the item is the focus item within the canvas. In most cases it is advisable to follow the \fBfocus\fR widget command with the \fBfocus\fR command to set the focus window to the canvas (if it was not there already). .RE | < | < < < | < < < | | | < | | < < < | | | | | < < < < < < < < < < | < | 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | a given item does not actually have the input focus unless (a) its canvas is the focus window and (b) the item is the focus item within the canvas. In most cases it is advisable to follow the \fBfocus\fR widget command with the \fBfocus\fR command to set the focus window to the canvas (if it was not there already). .RE .TP \fIpathName \fBgettags\fR \fItagOrId\fR . Return a list whose elements are the tags associated with the item given by \fItagOrId\fR. If \fItagOrId\fR refers to more than one item, then the tags are returned from the first such item in the display list. If \fItagOrId\fR does not refer to any items, or if the item contains no tags, then an empty string is returned. .TP \fIpathName \fBicursor \fItagOrId index\fR . Set the position of the insertion cursor for the item(s) given by \fItagOrId\fR to just before the character whose position is given by \fIindex\fR. If some or all of the items given by \fItagOrId\fR do not support an insertion cursor then this command has no effect on them. See \fBINDICES\fR above for a description of the legal forms for \fIindex\fR. Note: the insertion cursor is only displayed in an item if that item currently has the keyboard focus (see the \fBfocus\fR widget command, above), but the cursor position may be set even when the item does not have the focus. This command returns an empty string. .TP \fIpathName \fBimage \fIimagename\fR ?\fIsubsample\fR? ?\fIzoom\fR? . Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB-scrollregion\fR has been defined then this will be the boundaries of the canvas region drawn and the final size of the photo image. Otherwise the widget width and height with an origin of 0,0 will be the size of the canvas region drawn and the final size of the photo image. Optionally an integer \fIsubsample\fR factor may be given and the photo image will be reduced in size. In addition to the \fIsubsample\fR an integer \fIzoom\fR factor can also be given and the photo image will be enlarged. The image background will be filled with the canvas background colour. The canvas widget does not need to be mapped for this widget command to work, but at least one of it's ancestors must be mapped. This command returns an empty string. .TP \fIpathName \fBimove \fItagOrId index x y\fR . This command causes the \fIindex\fR'th coordinate of each of the items indicated by \fItagOrId\fR to be relocated to the location (\fIx\fR,\fIy\fR). Each item interprets \fIindex\fR independently according to the rules described in \fBINDICES\fR above. Out of the standard set of items, only line and polygon items may have their coordinates relocated this way. .TP \fIpathName \fBindex \fItagOrId index\fR . This command returns a decimal string giving the numerical index within \fItagOrId\fR corresponding to \fIindex\fR. \fIIndex\fR gives a textual description of the desired position as described in \fBINDICES\fR above. Text items interpret \fIindex\fR as an index to a character, line and polygon items interpret it as an index to a coordinate (an x,y pair). The return value is guaranteed to lie between 0 and the number of characters, or coordinates, within the item, inclusive. If \fItagOrId\fR refers to multiple items, then the index is processed in the first of these items that supports indexing operations (in display list order). .TP \fIpathName \fBinsert \fItagOrId beforeThis string\fR . For each of the items given by \fItagOrId\fR, if the item supports text or coordinate, insertion then \fIstring\fR is inserted into the item's text just before the character, or coordinate, whose index is \fIbeforeThis\fR. Text items interpret \fIbeforeThis\fR as an index to a character, line and polygon items interpret it as an index to a coordinate (an x,y pair). For lines and polygons the \fIstring\fR must be a valid coordinate sequence. See \fBINDICES\fR above for information about the forms allowed for \fIbeforeThis\fR. This command returns an empty string. .TP \fIpathName \fBitemcget\fR \fItagOrId\fR \fIoption\fR . Returns the current value of the configuration option for the item given by \fItagOrId\fR whose name is \fIoption\fR. This command is similar to the \fBcget\fR widget command except that it applies to a particular item rather than the widget as a whole. \fIOption\fR may have any of the values accepted by the \fBcreate\fR widget command when the item was created. If \fItagOrId\fR is a tag that refers to more than one item, the first (lowest) such item is used. .TP \fIpathName \fBitemconfigure \fItagOrId\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . This command is similar to the \fBconfigure\fR widget command except that it modifies item-specific options for the items given by \fItagOrId\fR instead of modifying options for the overall canvas widget. |
︙ | ︙ | |||
750 751 752 753 754 755 756 | modifies the given widget option(s) to have the given value(s) in each of the items given by \fItagOrId\fR; in this case the command returns an empty string. The \fIoption\fRs and \fIvalue\fRs are the same as those permissible in the \fBcreate\fR widget command when the item(s) were created; see the sections describing individual item types below for details on the legal options. | < | < < < | 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | modifies the given widget option(s) to have the given value(s) in each of the items given by \fItagOrId\fR; in this case the command returns an empty string. The \fIoption\fRs and \fIvalue\fRs are the same as those permissible in the \fBcreate\fR widget command when the item(s) were created; see the sections describing individual item types below for details on the legal options. .TP \fIpathName \fBlower \fItagOrId \fR?\fIbelowThis\fR? . Move all of the items given by \fItagOrId\fR to a new position in the display list just before the item given by \fIbelowThis\fR. If \fItagOrId\fR refers to more than one item then all are moved but the relative order of the moved items will not be changed. \fIBelowThis\fR is a tag or id; if it refers to more than one item then the first (lowest) of these items in the display list is used as the destination location for the moved items. Note: this command has no effect on window items. Window items always obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. This command returns an empty string. .TP \fIpathName \fBmove \fItagOrId xAmount yAmount\fR . Move each of the items given by \fItagOrId\fR in the canvas coordinate space by adding \fIxAmount\fR to the x-coordinate of each point associated with the item and \fIyAmount\fR to the y-coordinate of each point associated with the item. This command returns an empty string. .TP \fIpathName \fBmoveto \fItagOrId xPos yPos\fR . Move the items given by \fItagOrId\fR in the canvas coordinate 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 position (\fIxPos\fR,\fIyPos\fR). \fIxPos\fR and \fIyPos\fR may be the empty string, in which case the corresponding coordinate will be unchanged. All items matching \fItagOrId\fR remain in the same positions relative to each other. This command returns an empty string. .TP \fIpathName \fBpostscript \fR?\fIoption value option value ...\fR? . Generate a Postscript representation for part or all of the canvas. If the \fB\-file\fR option is specified then the Postscript is written to a file and an empty string is returned; otherwise the Postscript is returned as the result of the command. |
︙ | ︙ | |||
815 816 817 818 819 820 821 | either invoke the \fBupdate\fR command to wait for the canvas window to reach its final size, or else use the \fB\-width\fR and \fB\-height\fR options to specify the area of the canvas to print. The \fIoption\fR\-\fIvalue\fR argument pairs provide additional information to control the generation of Postscript. The following options are supported: .RS | < < < < < < < < < < < < < < < < < < < < < < < < < | < < | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | either invoke the \fBupdate\fR command to wait for the canvas window to reach its final size, or else use the \fB\-width\fR and \fB\-height\fR options to specify the area of the canvas to print. The \fIoption\fR\-\fIvalue\fR argument pairs provide additional information to control the generation of Postscript. The following options are supported: .RS .TP \fB\-channel \fIchannelName\fR . Specifies the name of the channel to which to write the Postscript. If this option and the \fB\-file\fR option are not specified then the Postscript is returned as the result of the command. .TP \fB\-colormap \fIvarName\fR . \fIVarName\fR must be the name of an array variable that specifies a color mapping to use in the Postscript. Each element of \fIvarName\fR must consist of Postscript code to set a particular color value (e.g. .QW "\fB1.0 1.0 0.0 setrgbcolor\fR" ). When outputting color information in the Postscript, Tk checks to see if there is an element of \fIvarName\fR with the same name as the color. If so, Tk uses the value of the element as the Postscript command to set the color. If this option has not been specified, or if there is no entry in \fIvarName\fR for a given color, then Tk uses the red, green, and blue intensities from the X color. .TP \fB\-colormode \fImode\fR . Specifies how to output color information. \fIMode\fR must be either \fBcolor\fR (for full color output), \fBgray\fR (convert all colors to their gray-scale equivalents) or \fBmono\fR (convert all colors to black or white). .TP \fB\-file \fIfileName\fR . Specifies the name of the file in which to write the Postscript. If this option and the \fB\-channel\fR option are not specified then the Postscript is returned as the result of the command. .TP \fB\-fontmap \fIvarName\fR . \fIVarName\fR must be the name of an array variable that specifies a font mapping to use in the Postscript. Each element of \fIvarName\fR must consist of a Tcl list with two elements, which are the name and point size of a Postscript font. When outputting Postscript commands for a particular font, Tk checks to see if \fIvarName\fR contains an element with the same name as the font. If there is such an element, then the font information contained in that element is used in the Postscript. Otherwise Tk attempts to guess what Postscript font to use. Tk's guesses generally only work for well-known fonts such as Times and Helvetica and Courier, and only if the X font name does not omit any dashes up through the point size. For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but \fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to parse the font name). .TP \fB\-height \fIsize\fR . Specifies the height of the area of the canvas to print. Defaults to the height of the canvas window. .TP \fB\-pageanchor \fIanchor\fR . Specifies which point of the printed area of the canvas should appear over the positioning point on the page (which is given by the \fB\-pagex\fR and \fB\-pagey\fR options). For example, \fB\-pageanchor n\fR means that the top center of the area of the canvas being printed (as it appears in the canvas window) should be over the positioning point. Defaults to \fBcenter\fR. .TP \fB\-pageheight \fIsize\fR . Specifies that the Postscript should be scaled in both x and y so that the printed area is \fIsize\fR high on the Postscript page. \fISize\fR consists of a floating-point number followed by \fBc\fR for centimeters, \fBi\fR for inches, \fBm\fR for millimeters, or \fBp\fR or nothing for printer's points (1/72 inch). Defaults to the height of the printed area on the screen. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling is not implemented). .TP \fB\-pagewidth \fIsize\fR . Specifies that the Postscript should be scaled in both x and y so that the printed area is \fIsize\fR wide on the Postscript page. \fISize\fR has the same form as for \fB\-pageheight\fR. Defaults to the width of the printed area on the screen. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling is not implemented). .TP \fB\-pagex \fIposition\fR . \fIPosition\fR gives the x-coordinate of the positioning point on the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. .TP \fB\-pagey \fIposition\fR . \fIPosition\fR gives the y-coordinate of the positioning point on the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. .TP \fB\-rotate \fIboolean\fR . \fIBoolean\fR specifies whether the printed area is to be rotated 90 degrees. In non-rotated output the x-axis of the printed area runs along the short dimension of the page .PQ portrait " orientation" ; in rotated output the x-axis runs along the long dimension of the page .PQ landscape " orientation" . Defaults to non-rotated. .TP \fB\-width \fIsize\fR . Specifies the width of the area of the canvas to print. Defaults to the width of the canvas window. .TP \fB\-x \fIposition\fR . Specifies the x-coordinate of the left edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the left edge of the window. .TP \fB\-y \fIposition\fR . Specifies the y-coordinate of the top edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the top edge of the window. .RE .TP \fIpathName \fBraise \fItagOrId \fR?\fIaboveThis\fR? . Move all of the items given by \fItagOrId\fR to a new position in the display list just after the item given by \fIaboveThis\fR. If \fItagOrId\fR refers to more than one item then all are moved but the relative order of the moved items will not be changed. \fIAboveThis\fR is a tag or id; if it refers to more than one item then the last (topmost) of these items in the display list is used as the destination location for the moved items. This command returns an empty string. .RS .PP Note: this command has no effect on window items. Window items always obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. .RE .TP \fIpathName \fBrchars \fItagOrId first last string\fR . This command causes the text or coordinates between \fIfirst\fR and \fIlast\fR for each of the items indicated by \fItagOrId\fR to be replaced by \fIstring\fR. Each item interprets \fIfirst\fR and \fIlast\fR independently according to the rules described in \fBINDICES\fR above. Out of the standard set of items, text items support this operation by altering their text as directed, and line and polygon items support this operation by altering their coordinate list (in which case \fIstring\fR should be a list of coordinates to use as a replacement). The other items ignore this operation. .TP \fIpathName \fBrotate \fItagOrId xOrigin yOrigin angle\fR .VS "8.7, TIP164" Rotate the coordinates of all of the items given by \fItagOrId\fR in canvas coordinate space. \fIXOrigin\fR and \fIyOrigin\fR identify the origin for the rotation operation and \fIangle\fR identifies the amount to rotate the coordinates |
︙ | ︙ | |||
1031 1032 1033 1034 1035 1036 1037 | points, and the \fBarc\fR, \fBoval\fR and \fBrectangle\fR types rotate about a computed center point instead of moving the bounding box coordinates directly. .PP Some items (currently \fBarc\fR and\fB text\fR) have angles in their options; this command \fIdoes not\fR affect those options. .RE .VE "8.7, TIP164" | < | 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 | points, and the \fBarc\fR, \fBoval\fR and \fBrectangle\fR types rotate about a computed center point instead of moving the bounding box coordinates directly. .PP Some items (currently \fBarc\fR and\fB text\fR) have angles in their options; this command \fIdoes not\fR affect those options. .RE .VE "8.7, TIP164" .TP \fIpathName \fBscale \fItagOrId xOrigin yOrigin xScale yScale\fR . Rescale the coordinates of all of the items given by \fItagOrId\fR in canvas coordinate space. \fIXOrigin\fR and \fIyOrigin\fR identify the origin for the scaling operation and \fIxScale\fR and \fIyScale\fR identify the scale |
︙ | ︙ | |||
1053 1054 1055 1056 1057 1058 1059 | This command returns an empty string. .RS .PP Note that some items have only a single pair of coordinates (e.g., text, images and windows) and so scaling of them by this command can only move them around. .RE | < | | 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 | This command returns an empty string. .RS .PP Note that some items have only a single pair of coordinates (e.g., text, images and windows) and so scaling of them by this command can only move them around. .RE .TP \fIpathName \fBscan\fR \fIoption args\fR . This command is used to implement scanning on canvases. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx y\fR . |
︙ | ︙ | |||
1081 1082 1083 1084 1085 1086 1087 | It then adjusts the view by \fIgain\fR times the difference in coordinates, where \fIgain\fR defaults to 10. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the canvas at high speed through its window. The return value is an empty string. .RE | < | 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 | It then adjusts the view by \fIgain\fR times the difference in coordinates, where \fIgain\fR defaults to 10. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the canvas at high speed through its window. The return value is an empty string. .RE .TP \fIpathName \fBselect \fIoption\fR ?\fItagOrId arg\fR? . Manipulates the selection in one of several ways, depending on \fIoption\fR. The command may take any of the forms described below. In all of the descriptions below, \fItagOrId\fR must refer to |
︙ | ︙ | |||
1148 1149 1150 1151 1152 1153 1154 | The anchor point is determined by the most recent \fBselect adjust\fR or \fBselect from\fR command for this widget. If the selection anchor point for the widget is not currently in \fItagOrId\fR, then it is set to the same character given by \fIindex\fR. Returns an empty string. .RE | < < | 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | The anchor point is determined by the most recent \fBselect adjust\fR or \fBselect from\fR command for this widget. If the selection anchor point for the widget is not currently in \fItagOrId\fR, then it is set to the same character given by \fIindex\fR. Returns an empty string. .RE .TP \fIpathName \fBtype\fI tagOrId\fR . Returns the type of the item given by \fItagOrId\fR, such as \fBrectangle\fR or \fBtext\fR. If \fItagOrId\fR refers to more than one item, then the type of the first item in the display list is returned. If \fItagOrId\fR does not refer to any items at all then an empty string is returned. .TP \fIpathName \fBxview \fR?\fIargs\fR? . This command is used to query and change the horizontal position of the information displayed in the canvas's window. It can take any of the following forms: .RS |
︙ | ︙ | |||
1202 1203 1204 1205 1206 1207 1208 | If \fInumber\fR is negative then information farther to the left becomes visible; if it is positive then information farther to the right becomes visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units of the \fBxScrollIncrement\fR option, if it is greater than zero, or in units of one-tenth the window's width otherwise. .RE | < | 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 | If \fInumber\fR is negative then information farther to the left becomes visible; if it is positive then information farther to the right becomes visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units of the \fBxScrollIncrement\fR option, if it is greater than zero, or in units of one-tenth the window's width otherwise. .RE .TP \fIpathName \fByview ?\fIargs\fR? . This command is used to query and change the vertical position of the information displayed in the canvas's window. It can take any of the following forms: .RS |
︙ | ︙ | |||
1263 1264 1265 1266 1267 1268 1269 | At present, text, line and polygon items provide this support. For lines and polygons the indexing facility is used to manipulate the coordinates of the item. .SS "COMMON ITEM OPTIONS" .PP Many items share a common set of options. These options are explained here, and then referred to be each widget type for brevity. | < < < < | < < < < | < < < | < < < < | < < < < | < < < < < | | | < | 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 | At present, text, line and polygon items provide this support. For lines and polygons the indexing facility is used to manipulate the coordinates of the item. .SS "COMMON ITEM OPTIONS" .PP Many items share a common set of options. These options are explained here, and then referred to be each widget type for brevity. .TP \fB\-anchor \fIanchorPos\fR . \fIAnchorPos\fR tells how to position the item relative to the positioning point for the item; it may have any of the forms accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR is \fBcenter\fR then the item is centered on the point; if \fIanchorPos\fR is \fBn\fR then the item will be drawn so that its top center point is at the positioning point. This option defaults to \fBcenter\fR. .TP \fB\-dash \fIpattern\fR .TP \fB\-activedash \fIpattern\fR .TP \fB\-disableddash \fIpattern\fR . This option specifies dash patterns for the normal, active state, and disabled state of an item. \fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. If the dash options are omitted then the default is a solid outline. See \fBDASH PATTERNS\fR for more information. .TP \fB\-dashoffset \fIoffset\fR . The starting \fIoffset\fR in pixels into the pattern provided by the \fB\-dash\fR option. \fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern. The \fIoffset\fR may have any of the forms described in the \fBCOORDINATES\fR section above. .TP \fB\-fill \fIcolor\fR .TP \fB\-activefill \fIcolor\fR .TP \fB\-disabledfill \fIcolor\fR . Specifies the color to be used to fill item's area. in its normal, active, and disabled states. The even-odd fill rule is used. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. For the line item, it specifies the color of the line drawn. 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 \fB\-outline \fIcolor\fR .TP \fB\-activeoutline \fIcolor\fR .TP \fB\-disabledoutline \fIcolor\fR . This option specifies the color that should be used to draw the outline of the item in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR is specified as an empty string then no outline is drawn for the item. .TP \fB\-offset \fIoffset\fR . Specifies the offset of stipples. The offset value can be of the form \fBx,y\fR or \fIside\fR, where side can be \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. In the first case the origin is the origin of the toplevel of the current window. For the canvas itself and canvas objects the origin is the canvas origin, but putting \fB#\fR in front of the coordinate pair indicates using the toplevel origin instead. For canvas objects, the \fB\-offset\fR option is used for stippling as well. For the line and polygon canvas items you can also specify an index as argument, which connects the stipple origin to one of the coordinate points of the line/polygon. Note that stipple offsets are \fIonly supported on X11\fR; they are silently ignored on other platforms. .TP \fB\-outlinestipple \fIbitmap\fR .TP \fB\-activeoutlinestipple \fIbitmap\fR .TP \fB\-disabledoutlinestipple \fIbitmap\fR . This option specifies stipple patterns that should be used to draw the outline of the item in its normal, active and disabled states. Indicates that the outline for the item should be drawn with a stipple pattern; \fIbitmap\fR specifies the stipple pattern to use, in any of the forms accepted by \fBTk_GetBitmap\fR. If the \fB\-outline\fR option has not been specified then this option has no effect. If \fIbitmap\fR is an empty string (the default), then the outline is drawn in a solid fashion. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR .TP \fB\-outlineoffset \fIoffset\fR . Specifies the offset of the stipple pattern used for outlines, in the same way that the \fB\-outline\fR option controls fill stipples. (See the \fB\-outline\fR option for a description of the syntax of \fIoffset\fR.) .TP \fB\-stipple \fIbitmap\fR .TP \fB\-activestipple \fIbitmap\fR .TP \fB\-disabledstipple \fIbitmap\fR . This option specifies stipple patterns that should be used to fill the item in its normal, active and disabled states. \fIbitmap\fR specifies the stipple pattern to use, in any of the forms accepted by \fBTk_GetBitmap\fR. If the \fB\-fill\fR option has not been specified then this option has no effect. If \fIbitmap\fR is an empty string (the default), then filling is done in a solid fashion. For the text item, it affects the actual text. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR .TP \fB\-state \fIstate\fR . This allows an item to override the canvas widget's global \fIstate\fR option. It takes the same values: \fInormal\fR, \fIdisabled\fR or \fIhidden\fR. .TP \fB\-tags \fItagList\fR . Specifies a set of tags to apply to the item. \fITagList\fR consists of a list of tag names, which replace any existing tags for the item. \fITagList\fR may be an empty list. .TP \fB\-width \fIoutlineWidth\fR .TP \fB\-activewidth \fIoutlineWidth\fR .TP \fB\-disabledwidth \fIoutlineWidth\fR . Specifies the width of the outline to be drawn around the item's region, in its normal, active and disabled states. \fIoutlineWidth\fR may be in any of the forms described in the \fBCOORDINATES\fR section above. If the \fB\-outline\fR option has been specified as an empty string then this option has no effect. This option defaults to 1.0. For arcs, wide outlines will be drawn centered on the edges of the arc's region. .SH "STANDARD ITEM TYPES" .SS "ARC ITEMS" .PP Items of type \fBarc\fR appear on the display as arc-shaped regions. An arc is a section of an oval delimited by two angles (specified by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR option) and displayed in one of several ways (specified by the \fB\-style\fR option). Arcs are created with widget commands of the following form: .CS \fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR? \fIpathName \fBcreate arc \fIcoordList\fR ?\fIoption value ...\fR? .CE The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give the coordinates of two diagonally opposite corners of a |
︙ | ︙ | |||
1469 1470 1471 1472 1473 1474 1475 | \fB\-disabledoutlinestipple\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for arcs: | < < < < < < | | 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 | \fB\-disabledoutlinestipple\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for arcs: .TP \fB\-extent \fIdegrees\fR Specifies the size of the angular range occupied by the arc. The arc's range extends for \fIdegrees\fR degrees counter-clockwise from the starting angle given by the \fB\-start\fR option. \fIDegrees\fR may be negative. If it is greater than 360 or less than \-360, then \fIdegrees\fR modulo 360 is used as the extent. .TP \fB\-start \fIdegrees\fR Specifies the beginning of the angular range occupied by the arc. \fIDegrees\fR is given in units of degrees measured counter-clockwise from the 3-o'clock position; it may be either positive or negative. .TP \fB\-height \fIdistance\fR Provides a shortcut for creating a circular arc segment by defining the distance of the mid-point of the arc from its chord. When this option is used the coordinates are interpreted as the start and end coordinates of the chord, and the options \fB\-start\fR and \fB-extent\fR are ignored. The value of \fIdistance\fR has the following meaning: .RS .PP .RS \fIdistance\fR > 0 creates a clockwise arc .br \fIdistance\fR < 0 creates an counter-clockwise arc |
︙ | ︙ | |||
1517 1518 1519 1520 1521 1522 1523 | .RE .PP choosing the minus sign for the minor arc and the plus sign for the major arc. .PP Note that \fBitemcget \-height\fR always returns 0 so that introspection code can be kept simple. .RE | < < | 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 | .RE .PP choosing the minus sign for the minor arc and the plus sign for the major arc. .PP Note that \fBitemcget \-height\fR always returns 0 so that introspection code can be kept simple. .RE .TP \fB\-style \fItype\fR Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR (the default) then the arc's region is defined by a section of the oval's perimeter plus two line segments, one between the center of the oval and each end of the perimeter section. If \fItype\fR is \fBchord\fR then the arc's region is defined by a section of the oval's perimeter plus a single line segment connecting the two end points of the perimeter section. |
︙ | ︙ | |||
1558 1559 1560 1561 1562 1563 1564 | The following standard options are supported by bitmaps: .DS .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for bitmaps: | < < < < < < < < | | < < < < | | 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 | The following standard options are supported by bitmaps: .DS .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for bitmaps: .TP \fB\-background \fIcolor\fR .TP \fB\-activebackground \fIcolor\fR .TP \fB\-disabledbackground \fIcolor\fR Specifies the color to use for each of the bitmap's .QW 0 valued pixels in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If this option is not specified, or if it is specified as an empty string, then nothing is displayed where the bitmap pixels are 0; this produces a transparent effect. .TP \fB\-bitmap \fIbitmap\fR .TP \fB\-activebitmap \fIbitmap\fR .TP \fB\-disabledbitmap \fIbitmap\fR Specifies the bitmaps to display in the item in its normal, active and disabled states. \fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR. .TP \fB\-foreground \fIcolor\fR .TP \fB\-activeforeground \fIcolor\fR .TP \fB\-disabledforeground \fIcolor\fR Specifies the color to use for each of the bitmap's .QW 1 valued pixels in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. .SS "IMAGE ITEMS" .PP Items of type \fBimage\fR are used to display images on a canvas. |
︙ | ︙ | |||
1628 1629 1630 1631 1632 1633 1634 | The following standard options are supported by images: .DS .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for images: | < < < < | 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 | The following standard options are supported by images: .DS .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for images: .TP \fB\-image \fIname\fR .TP \fB\-activeimage \fIname\fR .TP \fB\-disabledimage \fIname\fR Specifies the name of the images to display in the item in is normal, active and disabled states. This image must have been created previously with the \fBimage create\fR command. .SS "LINE ITEMS" .PP Items of type \fBline\fR appear on the display as one or more connected |
︙ | ︙ | |||
1677 1678 1679 1680 1681 1682 1683 | \fB\-disabledfill\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for lines: | < < < < < < < < < < | < < < | 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 | \fB\-disabledfill\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for lines: .TP \fB\-arrow \fIwhere\fR Indicates whether or not arrowheads are to be drawn at one or both ends of the line. \fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads), \fBfirst\fR (for an arrowhead at the first point of the line), \fBlast\fR (for an arrowhead at the last point of the line), or \fBboth\fR (for arrowheads at both ends). 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 \fB\-arrowshape \fIshape\fR This option indicates how to draw arrowheads. The \fIshape\fR argument must be a list with three elements, each specifying a distance in any of the forms described in the \fBCOORDINATES\fR section above. The first element of the list gives the distance along the line from the neck of the arrowhead to its tip. The second element gives the distance along the line from the trailing points of the arrowhead to the tip, and the third element gives the distance from the outside edge of the line to the trailing points. If this option is not specified then Tk picks a .QW reasonable shape. .TP \fB\-capstyle \fIstyle\fR Specifies the ways in which caps are to be drawn at the endpoints of the line. \fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR (\fBbutt\fR, \fBprojecting\fR, or \fBround\fR). If this option is not specified then it defaults to \fBbutt\fR. Where arrowheads are drawn the cap style is ignored. .TP \fB\-joinstyle \fIstyle\fR Specifies the ways in which joints are to be drawn at the vertices of the line. \fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). If this option is not specified then it defaults to \fBround\fR. If the line only contains two points then this option is irrelevant. .TP \fB\-smooth \fIsmoothMethod\fR \fIsmoothMethod\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes \fBtrue\fR smoothing. If the smoothing method is \fBtrue\fR, this indicates that the line should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. If the smoothing method is \fBraw\fR, this indicates that the line should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve. Straight line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is a control point and not a knot point, the point is repeated (one or two times) so that it also becomes a knot point. .TP \fB\-splinesteps \fInumber\fR Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. .SS "OVAL ITEMS" .PP Items of type \fBoval\fR appear as circular or oval regions on the display. Each oval may have an outline, a fill, or |
︙ | ︙ | |||
1817 1818 1819 1820 1821 1822 1823 | Polygon items support coordinate indexing operations using the \fBdchars\fR, \fBindex\fR and \fBinsert\fR widget commands. Polygons are created with widget commands of the following form: .CS \fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value ...\fR? \fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value ...\fR? .CE | | | | 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 | Polygon items support coordinate indexing operations using the \fBdchars\fR, \fBindex\fR and \fBinsert\fR widget commands. Polygons are created with widget commands of the following form: .CS \fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value ...\fR? \fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value ...\fR? .CE The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the coordinates for three or more points that define a polygon. The first point should not be repeated as the last to close the shape; Tk will automatically close the periphery between the first and last points. After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be used in \fBitemconfigure\fR widget commands to change the item's |
︙ | ︙ | |||
1847 1848 1849 1850 1851 1852 1853 | \fB\-disabledoutlinestipple\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for polygons: | < < < < | < < < | 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 | \fB\-disabledoutlinestipple\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for polygons: .TP \fB\-joinstyle \fIstyle\fR Specifies the ways in which joints are to be drawn at the vertices of the outline. \fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). If this option is not specified then it defaults to \fBround\fR. .TP \fB\-smooth \fIboolean\fR \fIBoolean\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes \fBtrue\fR smoothing. If the smoothing method is \fBtrue\fR, this indicates that the polygon should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. If the smoothing method is \fBraw\fR, this indicates that the polygon should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve. Straight line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is not the second point of a pair of control points, the point is repeated (one or two times) so that it also becomes the second point of a pair of control points (the associated knot point will be the first control point). .TP \fB\-splinesteps \fInumber\fR Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. .PP Polygon items are different from other items such as rectangles, ovals and arcs in that interior points are considered to be .QW inside |
︙ | ︙ | |||
1975 1976 1977 1978 1979 1980 1981 | \fB\-anchor\fR \fB\-fill\fR \fB\-activefill\fR \fB\-disabledfill\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for text items: | < < < < < < < < | < < < | 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 | \fB\-anchor\fR \fB\-fill\fR \fB\-activefill\fR \fB\-disabledfill\fR \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for text items: .TP \fB\-angle \fIrotationDegrees\fR . \fIRotationDegrees\fR tells how many degrees to rotate the text anticlockwise about the positioning point for the text; it may have any floating-point value from 0.0 to 360.0. For example, if \fIrotationDegrees\fR is \fB90\fR, then the text will be drawn vertically from bottom to top. This option defaults to \fB0.0\fR. .TP \fB\-font \fIfontName\fR Specifies the font to use for the text item. \fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR. If this option is not specified, it defaults to a system-dependent font. .TP \fB\-justify \fIhow\fR Specifies how to justify the text within its bounding region. \fIHow\fR must be one of the values \fBleft\fR, \fBright\fR, or \fBcenter\fR. This option will only matter if the text is displayed as multiple lines. If the option is omitted, it defaults to \fBleft\fR. .TP \fB\-text \fIstring\fR \fIString\fR specifies the characters to be displayed in the text item. Newline characters cause line breaks. The characters in the item may also be changed with the \fBinsert\fR and \fBdelete\fR widget commands. This option defaults to an empty string. .TP \fB\-underline \fI\fR Specifies the integer index of a character within the text to be underlined. 0 corresponds to the first character of the text displayed, 1 to the next character, and so on. \-1 means that no underline should be drawn (if the whole text item is to be underlined, the appropriate font should be used instead). .TP \fB\-width \fIlineLength\fR Specifies a maximum line length for the text, in any of the forms described in the \fBCOORDINATES\fR section above. If this option is zero (the default) the text is broken into lines only at newline characters. However, if this option is non-zero then any line that would be longer than \fIlineLength\fR is broken just before a space character to make the line shorter than \fIlineLength\fR; the |
︙ | ︙ | |||
2062 2063 2064 2065 2066 2067 2068 | The following standard options are supported by window items: .DS .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for window items: | < < < | | 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 | The following standard options are supported by window items: .DS .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for window items: .TP \fB\-height \fIpixels\fR . Specifies the height to assign to the item's window. \fIPixels\fR may have any of the forms described in the \fBCOORDINATES\fR section above. If this option is not specified, or if it is specified as zero, then the window is given whatever height it requests internally. .TP \fB\-width \fIpixels\fR . Specifies the width to assign to the item's window. \fIPixels\fR may have any of the forms described in the \fBCOORDINATES\fR section above. If this option is not specified, or if it is specified as zero, then the window is given whatever width it requests internally. .TP \fB\-window \fIpathName\fR . Specifies the window to associate with this item. The window specified by \fIpathName\fR must either be a child of the canvas widget or a child of some ancestor of the canvas widget. \fIPathName\fR may not refer to a top-level window. .PP Note: due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that overlap it, regardless of their order in the display list. Also note that window items, unlike other canvas items, are not clipped for display by their containing canvas's border, and are instead clipped by the parent widget of the window specified by the \fB\-window\fR option; when the parent widget is the canvas, this means that the window item can overlap the canvas's border. |
︙ | ︙ |
Changes to doc/checkbutton.n.
︙ | ︙ | |||
193 194 195 196 197 198 199 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for checkbutton widgets: | < | < < < < < < < < < < < < < | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for checkbutton widgets: .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBcheckbutton\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBcheckbutton\fR command. .TP \fIpathName \fBdeselect\fR Deselects the checkbutton and sets the associated variable to its .QW off value. .TP \fIpathName \fBflash\fR Flashes the checkbutton. This is accomplished by redisplaying the checkbutton several times, alternating between active and normal colors. At the end of the flash the checkbutton is left in the same normal/active state as when the command was invoked. This command is ignored if the checkbutton's state is \fBdisabled\fR. .TP \fIpathName \fBinvoke\fR Does just what would have happened if the user invoked the checkbutton with the mouse: toggle the selection state of the button and invoke the Tcl command associated with the checkbutton, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the checkbutton. This command is ignored if the checkbutton's state is \fBdisabled\fR. .TP \fIpathName \fBselect\fR Selects the checkbutton and sets the associated variable to its .QW on value. .TP \fIpathName \fBtoggle\fR Toggles the selection state of the button, redisplaying it and modifying its associated variable to reflect the new state. .SH BINDINGS .PP Tk automatically creates class bindings for checkbuttons that give them the following default behavior: .IP [1] |
︙ | ︙ | |||
287 288 289 290 291 292 293 | The behavior of checkbuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH EXAMPLE .PP This example shows a group of uncoupled checkbuttons. .PP .CS | | | | | | | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | The behavior of checkbuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH EXAMPLE .PP This example shows a group of uncoupled checkbuttons. .PP .CS labelframe .lbl \-text "Steps:" \fBcheckbutton\fR .c1 \-text Lights \-variable lights \fBcheckbutton\fR .c2 \-text Cameras \-variable cameras \fBcheckbutton\fR .c3 \-text Action! \-variable action pack .c1 .c2 .c3 \-in .lbl pack .lbl .CE .SH "SEE ALSO" button(n), options(n), radiobutton(n), ttk::checkbutton(n) .SH KEYWORDS checkbutton, widget '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/chooseColor.n.
︙ | ︙ | |||
14 15 16 17 18 19 20 | \fBtk_chooseColor \fR?\fIoption value ...\fR? .BE .SH DESCRIPTION .PP The procedure \fBtk_chooseColor\fR pops up a dialog box for the user to select a color. The following \fIoption\-value\fR pairs are possible as command line arguments: | < | < < | < < | < | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | \fBtk_chooseColor \fR?\fIoption value ...\fR? .BE .SH DESCRIPTION .PP The procedure \fBtk_chooseColor\fR pops up a dialog box for the user to select a color. The following \fIoption\-value\fR pairs are possible as command line arguments: .TP \fB\-initialcolor\fR \fIcolor\fR Specifies the color to display in the color dialog when it pops up. \fIcolor\fR must be in a form acceptable to the \fBTk_GetColor\fR function. .TP \fB\-parent\fR \fIwindow\fR Makes \fIwindow\fR the logical parent of the color dialog. The color dialog is displayed on top of its parent window. .TP \fB\-title\fR \fItitleString\fR Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .LP If the user selects a color, \fBtk_chooseColor\fR will return the name of the color in a form acceptable to \fBTk_GetColor\fR. If the user cancels the operation, both commands will return the empty string. .SH EXAMPLE .PP .CS button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"] .CE .SH KEYWORDS color, color selection, dialog '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/chooseDirectory.n.
︙ | ︙ | |||
12 13 14 15 16 17 18 | \fBtk_chooseDirectory \fR?\fIoption value ...\fR? .BE .SH DESCRIPTION .PP The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the user to select a directory. The following \fIoption\-value\fR pairs are possible as command line arguments: | < | < < | < < | < < | < < | < < | < | | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | \fBtk_chooseDirectory \fR?\fIoption value ...\fR? .BE .SH DESCRIPTION .PP The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the user to select a directory. The following \fIoption\-value\fR pairs are possible as command line arguments: .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 Specifies that the directories in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. .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 Specifies whether the user may specify non-existent directories. If this parameter is true, then the user may only select directories that already exist. The default value is \fIfalse\fR. .TP \fB\-parent\fR \fIwindow\fR Makes \fIwindow\fR the logical parent of the dialog. The dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window. .TP \fB\-title\fR \fItitleString\fR Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .SH EXAMPLE .PP .CS set dir [\fBtk_chooseDirectory\fR \e \-initialdir ~ \-title "Choose a directory"] if {$dir eq ""} { label .l \-text "No directory selected" } else { label .l \-text "Selected $dir" } .CE .SH "SEE ALSO" tk_getOpenFile(n), tk_getSaveFile(n) .SH KEYWORDS directory, selection, dialog, platform-specific '\" Local Variables: |
︙ | ︙ |
Changes to doc/clipboard.n.
︙ | ︙ | |||
23 24 25 26 27 28 29 | be called, followed by a sequence of one or more calls to \fBclipboard append\fR. To ensure that the clipboard is updated atomically, all appends should be completed before returning to the event loop. .PP The first argument to \fBclipboard\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: | < | | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | be called, followed by a sequence of one or more calls to \fBclipboard append\fR. To ensure that the clipboard is updated atomically, all appends should be completed before returning to the event loop. .PP The first argument to \fBclipboard\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: .TP \fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR . Appends \fIdata\fR to the clipboard on \fIwindow\fR's display in the form given by \fItype\fR with the representation given by \fIformat\fR and claims ownership of the clipboard on \fIwindow\fR's display. .RS .PP |
︙ | ︙ | |||
68 69 70 71 72 73 74 | irrelevant. .PP A \fB\-\|\-\fR argument may be specified to mark the end of options: the next argument will always be used as \fIdata\fR. This feature may be convenient if, for example, \fIdata\fR starts with a \fB\-\fR. .RE | < | < | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | irrelevant. .PP A \fB\-\|\-\fR argument may be specified to mark the end of options: the next argument will always be used as \fIdata\fR. This feature may be convenient if, for example, \fIdata\fR starts with a \fB\-\fR. .RE .TP \fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR? . Claims ownership of the clipboard on \fIwindow\fR's display and removes any previous contents. \fIWindow\fR defaults to .QW . . Returns an empty string. .TP \fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR? . Retrieve data from the clipboard on \fIwindow\fR's display. \fIWindow\fR defaults to .QW . . \fIType\fR specifies the form in which the data is to be returned and should be an atom name such as \fBSTRING\fR or \fBFILE_NAME\fR. \fIType\fR defaults to \fBSTRING\fR. This command is |
︙ | ︙ | |||
121 122 123 124 125 126 127 | # it produces a script that recreates the item(s) when executed proc getItemConfig {canvas tag} { set script {} foreach item [$canvas find withtag $tag] { append script {$canvas create } [$canvas type $item] append script { } [$canvas coords $item] { } foreach config [$canvas itemconf $item] { | | | | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | # it produces a script that recreates the item(s) when executed proc getItemConfig {canvas tag} { set script {} foreach item [$canvas find withtag $tag] { append script {$canvas create } [$canvas type $item] append script { } [$canvas coords $item] { } foreach config [$canvas itemconf $item] { lassign $config name \- \- \- value append script [list $name $value] { } } append script \en } return [string trim $script] } # Set up a binding on a canvas to cut and paste an item set c [canvas .c] pack $c $c create text 150 30 \-text "cut and paste me" bind $c <<Cut>> { \fBclipboard clear\fR \fBclipboard append \-type\fR TkCanvasItem \e [getItemConfig %W current] # Delete because this is cut, not copy. %W delete current } bind $c <<Paste>> { catch { set canvas %W eval [\fBclipboard get \-type\fR TkCanvasItem] } } .CE .SH "SEE ALSO" interp(n), selection(n) .SH KEYWORDS clear, format, clipboard, append, selection, type '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/colors.n.
︙ | ︙ | |||
892 893 894 895 896 897 898 | systemTextBackgroundColor systemTextColor .DE .RE . The numbered systemWindowBackgroundColors below are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets | | > | 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | 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 .RE .TP \fBWindows\fR . On Windows, the following additional system colors are available (note that the actual color values depend on the currently active OS theme): .RS .DS .ta 6c |
︙ | ︙ |
Changes to doc/console.n.
1 2 3 4 5 6 7 8 9 10 11 12 13 | '\" '\" Copyright (c) 2001 Donal K. Fellows '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH console n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME console \- Control the console on systems without a real console .SH SYNOPSIS | | | | < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | '\" '\" Copyright (c) 2001 Donal K. Fellows '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH console n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME console \- Control the console on systems without a real console .SH SYNOPSIS \fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The console window is a replacement for a real console to allow input and output on the standard I/O channels on platforms that do not have a real console. It is implemented as a separate interpreter with the Tk toolkit loaded, and control over this interpreter is given through the \fBconsole\fR command. The behaviour of the console window is defined mainly through the contents of the \fIconsole.tcl\fR file in the Tk library. Except for TkAqua, this command is not available when Tk is loaded into a tclsh interpreter with .QW "\fBpackage require tk\fR" , as a conventional terminal is expected to be present in that case. In TkAqua, this command is disabled when there is a startup script and stdin is \fB/dev/null\fR (as is the case e.g. when a bundled application 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 .TP \fBconsole eval \fIscript\fR Evaluate the \fIscript\fR argument as a Tcl script in the console interpreter. The normal interpreter is accessed through the \fBconsoleinterp\fR command in the console interpreter. .TP \fBconsole hide\fR Hide the console window from view. Precisely equivalent to withdrawing the \fB.\fR window in the console interpreter. .TP \fBconsole show\fR Display the console window. Precisely equivalent to deiconifying the \fB.\fR window in the console interpreter. .TP \fBconsole title \fR?\fIstring\fR? Query or modify the title of the console window. If \fIstring\fR is not specified, queries the title of the console window, and sets the title of the console window to \fIstring\fR otherwise. Precisely equivalent to using the \fBwm title\fR command in the console interpreter. .SH "ACCESS TO THE MAIN INTERPRETER" .PP The \fBconsoleinterp\fR command in the console interpreter allows scripts to be evaluated in the main interpreter. It supports two subcommands: \fBeval\fR and \fBrecord\fR. .PP .TP \fBconsoleinterp eval \fIscript\fR Evaluates \fIscript\fR as a Tcl script at the global level in the main interpreter. .TP \fBconsoleinterp record \fIscript\fR Records and evaluates \fIscript\fR as a Tcl script at the global level in the main interpreter as if \fIscript\fR had been typed in at the console. .SH "ADDITIONAL TRAP CALLS" .PP There are several additional commands in the console interpreter that are called in response to activity in the main interpreter. |
︙ | ︙ |
Changes to doc/cursors.n.
︙ | ︙ | |||
97 98 99 100 101 102 103 | xterm .CE .PP The \fBnone\fR cursor can be specified to eliminate the cursor. .SH "PORTABILITY ISSUES" .TP \fBWindows\fR | < | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | xterm .CE .PP The \fBnone\fR cursor can be specified to eliminate the cursor. .SH "PORTABILITY ISSUES" .TP \fBWindows\fR On Windows systems, the following cursors are mapped to native cursors: .RS .CS arrow center_ptr crosshair fleur |
︙ | ︙ | |||
128 129 130 131 132 133 134 | size_we uparrow wait .CE .RE .TP \fBMac OS X\fR | < | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | size_we uparrow wait .CE .RE .TP \fBMac OS X\fR On Mac OS X systems, the following cursors are mapped to native cursors: .RS .CS arrow top_left_arrow left_ptr cross |
︙ | ︙ |
Changes to doc/dialog.n.
︙ | ︙ | |||
15 16 17 18 19 20 21 | \fBtk_dialog \fIwindow title text bitmap default string string ...\fR .BE .SH DESCRIPTION .PP This procedure is part of the Tk script library. It is largely \fIdeprecated\fR by the \fBtk_messageBox\fR. Its arguments describe a dialog box: | > | > | > | > | > | | > | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | \fBtk_dialog \fIwindow title text bitmap default string string ...\fR .BE .SH DESCRIPTION .PP This procedure is part of the Tk script library. It is largely \fIdeprecated\fR by the \fBtk_messageBox\fR. Its arguments describe a dialog box: .TP \fIwindow\fR Name of top-level window to use for dialog. Any existing window by this name is destroyed. .TP \fItitle\fR Text to appear in the window manager's title bar for the dialog. .TP \fItext\fR Message to appear in the top portion of the dialog box. .TP \fIbitmap\fR If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap) to display in the top portion of the dialog, to the left of the text. If this is an empty string then no bitmap is displayed in the dialog. .TP \fIdefault\fR If this is an integer greater than or equal to zero, then it gives the index of the button that is to be the default button for the dialog (0 for the leftmost button, and so on). If negative or an empty string then there will not be any default button. .TP \fIstring\fR There will be one button for each of these arguments. Each \fIstring\fR specifies text to display in a button, in order from left to right. .PP After creating a dialog box, \fBtk_dialog\fR waits for the user to select one of the buttons either by clicking on the button with the mouse or by typing return to invoke the default button (if any). |
︙ | ︙ |
Changes to doc/entry.n.
︙ | ︙ | |||
9 10 11 12 13 14 15 | .TH entry n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME entry \- Create and manipulate 'entry' one-line text entry widgets .SH SYNOPSIS | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | .TH entry n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME entry \- Create and manipulate 'entry' one-line text entry widgets .SH SYNOPSIS \fBentry\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-highlightthickness \-selectbackground \-borderwidth \-insertbackground \-selectborderwidth \-cursor \-insertborderwidth \-selectforeground \-exportselection \-insertofftime \-takefocus \-font \-insertontime \-textvariable \-foreground \-insertwidth \-xscrollcommand |
︙ | ︙ | |||
73 74 75 76 77 78 79 | the valid Tcl boolean equivalent) then it means you reject the new edition and it will not occur and the \fB\-invalidcommand\fR will be evaluated if it is set. If it returns 1, then the new edition occurs. See \fBVALIDATION\fR below for more information. .OP \-width width Width Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | the valid Tcl boolean equivalent) then it means you reject the new edition and it will not occur and the \fB\-invalidcommand\fR will be evaluated if it is set. If it returns 1, then the new edition occurs. See \fBVALIDATION\fR below for more information. .OP \-width width Width Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. If the value is negative or zero, the widget picks a size just large enough to hold its current text. .BE .SH DESCRIPTION .PP The \fBentry\fR command creates a new window (given by the \fIpathName\fR argument) and makes it into an entry widget. Additional options, described above, may be specified on the |
︙ | ︙ | |||
172 173 174 175 176 177 178 | \fB\-invalidcommand\fR encounters an error in its script while evaluating or \fB\-validatecommand\fR does not return a valid Tcl boolean value. The \fB\-validate\fR option will also set itself to \fBnone\fR when you edit the entry widget from within either the \fB\-validatecommand\fR or the \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the entry widget (for example set it to {}) during validation and still have the \fB\-validate\fR option set, you should | | | | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | \fB\-invalidcommand\fR encounters an error in its script while evaluating or \fB\-validatecommand\fR does not return a valid Tcl boolean value. The \fB\-validate\fR option will also set itself to \fBnone\fR when you edit the entry widget from within either the \fB\-validatecommand\fR or the \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the entry widget (for example set it to {}) during validation and still have the \fB\-validate\fR option set, you should include the command .CS after idle {%W config \-validate %v} .CE in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the entry widget from). It is also recommended to not set an associated \fB\-textvariable\fR during validation, as that can cause the entry widget to become out of sync with the \fB\-textvariable\fR. .SH "WIDGET COMMAND" .PP |
︙ | ︙ | |||
197 198 199 200 201 202 203 | .SS INDICES .PP Many of the widget commands for entries take one or more indices as arguments. An index specifies a particular character in the entry's string, in any of the following ways: .TP 12 \fInumber\fR | < < < < < < < < < < | < < < < < < < < < < < < < < | < < < < < < < < < | < < < < < < < | < < < | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | .SS INDICES .PP Many of the widget commands for entries take one or more indices as arguments. An index specifies a particular character in the entry's string, in any of the following ways: .TP 12 \fInumber\fR Specifies the character as a numerical index, where 0 corresponds to the first character in the string. .TP 12 \fBanchor\fR Indicates the anchor point for the selection, which is set with the \fBselect from\fR and \fBselect adjust\fR widget commands. .TP 12 \fBend\fR Indicates the character just after the last one in the entry's string. This is equivalent to specifying a numerical index equal to the length of the entry's string. .TP 12 \fBinsert\fR Indicates the character adjacent to and immediately following the insertion cursor. .TP 12 \fBsel.first\fR Indicates the first character in the selection. It is an error to use this form if the selection is not in the entry window. .TP 12 \fBsel.last\fR Indicates the character just after the last one in the selection. It is an error to use this form if the selection is not in the entry window. .TP 12 \fB@\fInumber\fR In this form, \fInumber\fR is treated as an x-coordinate in the entry's window; the character spanning that x-coordinate is used. For example, .QW \fB@0\fR indicates the left-most character in the window. .LP Abbreviations may be used for any of the forms above, e.g. .QW \fBe\fR or .QW \fBsel.f\fR . In general, out-of-range indices are automatically rounded to the nearest legal value. Indexes support the same simple interpretation as for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. .SS SUBCOMMANDS .PP The following commands are possible for entry widgets: .TP \fIpathName \fBbbox \fIindex\fR Returns a list of four numbers describing the bounding box of the character given by \fIindex\fR. The first two elements of the list give the x and y coordinates of the upper-left corner of the screen area covered by the character (in pixels relative to the widget) and the last two elements give the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBentry\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBentry\fR command. .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? Delete one or more elements of the entry. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns an empty string. .TP \fIpathName \fBget\fR Returns the entry's string. .TP \fIpathName \fBicursor \fIindex\fR Arrange for the insertion cursor to be displayed just before the character given by \fIindex\fR. Returns an empty string. .TP \fIpathName \fBindex\fI index\fR Returns the numerical index corresponding to \fIindex\fR. .TP \fIpathName \fBinsert \fIindex string\fR Insert the characters of \fIstring\fR just before the character indicated by \fIindex\fR. Returns an empty string. .TP \fIpathName \fBscan\fR \fIoption args\fR This command is used to implement scanning on entries. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx\fR Records \fIx\fR and the current view in the entry window; used in conjunction with later \fBscan dragto\fR commands. Typically this command is associated with a mouse button press in the widget. It returns an empty string. .TP \fIpathName \fBscan dragto \fIx\fR This command computes the difference between its \fIx\fR argument and the \fIx\fR argument to the last \fBscan mark\fR command for the widget. It then adjusts the view left or right by 10 times the difference in x-coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the entry at high speed through the window. The return value is an empty string. .RE .TP \fIpathName \fBselection \fIoption arg\fR This command is used to adjust the selection within an entry. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection adjust \fIindex\fR Locate the end of the selection nearest to the character given by \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR (i.e. including but not going beyond \fIindex\fR). The other end of the selection is made the anchor point for future \fBselect to\fR commands. If the selection is not currently in the entry, then a new selection is created to include the characters between \fIindex\fR and the most recent selection anchor point, inclusive. Returns an empty string. .TP \fIpathName \fBselection clear\fR Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns an empty string. .TP \fIpathName \fBselection from \fIindex\fR Set the selection anchor point to just before the character given by \fIindex\fR. Does not change the selection. Returns an empty string. .TP \fIpathName \fBselection present\fR Returns 1 if there is are characters selected in the entry, 0 if nothing is selected. .TP \fIpathName \fBselection range \fIstart\fR \fIend\fR Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the entry's selection is cleared. .TP \fIpathName \fBselection to \fIindex\fR If \fIindex\fR is before the anchor point, set the selection to the characters from \fIindex\fR up to but not including the anchor point. If \fIindex\fR is the same as the anchor point, do nothing. If \fIindex\fR is after the anchor point, set the selection to the characters from the anchor point up to but not including \fIindex\fR. The anchor point is determined by the most recent \fBselect from\fR or \fBselect adjust\fR command in this widget. If the selection is not in this widget then a new selection is created using the most recent anchor point specified for the widget. Returns an empty string. .RE .TP \fIpathName \fBvalidate\fR This command is used to force an evaluation of the \fB\-validatecommand\fR independent of the conditions specified by the \fB\-validate\fR option. This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. .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 or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation of one of these. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. |
︙ | ︙ |
Changes to doc/event.n.
︙ | ︙ | |||
16 17 18 19 20 21 22 | .BE .SH DESCRIPTION .PP The \fBevent\fR command provides several facilities for dealing with window system events, such as defining virtual events and synthesizing events. The command has several different forms, determined by the first argument. The following forms are currently supported: | < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | .BE .SH DESCRIPTION .PP The \fBevent\fR command provides several facilities for dealing with window system events, such as defining virtual events and synthesizing events. The command has several different forms, determined by the first argument. The following forms are currently supported: .TP \fBevent add <<\fIvirtual\fB>>\fI sequence \fR?\fIsequence ...\fR? Associates the virtual event \fIvirtual\fR with the physical event sequence(s) given by the \fIsequence\fR arguments, so that the virtual event will trigger whenever any one of the \fIsequence\fRs occurs. \fIVirtual\fR may be any string value and \fIsequence\fR may have any of the values allowed for the \fIsequence\fR argument to the \fBbind\fR command. If \fIvirtual\fR is already defined, the new physical event sequences add to the existing sequences for the event. .TP \fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence\fR \fIsequence ...\fR? Deletes each of the \fIsequence\fRs from those associated with the virtual event given by \fIvirtual\fR. \fIVirtual\fR may be any string value and \fIsequence\fR may have any of the values allowed for the \fIsequence\fR argument to the \fBbind\fR command. Any \fIsequence\fRs not currently associated with \fIvirtual\fR are ignored. If no \fIsequence\fR argument is provided, all physical event sequences are removed for \fIvirtual\fR, so that the virtual event will not trigger anymore. .TP \fBevent generate \fIwindow event \fR?\fIoption value option value ...\fR? Generates a window event and arranges for it to be processed just as if it had come from the window system. \fIWindow\fR gives the path name of the window for which the event will be generated; it may also be an identifier (such as returned by \fBwinfo id\fR) as long as it is for a window in the current application. \fIEvent\fR provides a basic description of the event, such as \fB<Shift-Button-2>\fR or \fB<<Paste>>\fR. If \fIWindow\fR is empty the whole screen is meant, and coordinates are relative to the screen. \fIEvent\fR may have any of the forms allowed for the \fIsequence\fR argument of the \fBbind\fR command except that it must consist of a single event pattern, not a sequence. \fIOption-value\fR pairs may be used to specify additional attributes of the event, such as the x and y mouse position; see \fBEVENT FIELDS\fR below. If the \fB\-when\fR option is not specified, the event is processed immediately: all of the handlers for the event will complete before the \fBevent generate\fR command returns. If the \fB\-when\fR option is specified then it determines when the event is processed. Certain events, such as key events, require that the window has focus to receive the event properly. .TP \fBevent info \fR?\fB<<\fIvirtual\fB>>\fR? Returns information about virtual events. If the \fB<<\fIvirtual\fB>>\fR argument is omitted, the return value is a list of all the virtual events that are currently defined. If \fB<<\fIvirtual\fB>>\fR is specified then the return value is a list whose elements are the physical event sequences currently defined for the given virtual event; if the virtual event is not defined then an empty string is returned. .RS .PP Note that virtual events that are not bound to physical event sequences are \fInot\fR returned by \fBevent info\fR. .RE .SH "EVENT FIELDS" .PP The following options are supported for the \fBevent generate\fR command. These correspond to the .QW % expansions allowed in binding scripts for the \fBbind\fR command. .TP \fB\-above\fI window\fR \fIWindow\fR specifies the \fIabove\fR field for the event, either as a window path name or as an integer window id. Valid for \fBConfigure\fR events. Corresponds to the \fB%a\fR substitution for binding scripts. .TP \fB\-borderwidth\fI size\fR \fISize\fR must be a screen distance; it specifies the \fIborder_width\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%B\fR substitution for binding scripts. .TP \fB\-button\fI number\fR \fINumber\fR must be an integer; it specifies the \fIdetail\fR field for a \fBButton\fR or \fBButtonRelease\fR event, overriding any button number provided in the base \fIevent\fR argument. Corresponds to the \fB%b\fR substitution for binding scripts. .TP \fB\-count\fI number\fR \fINumber\fR must be an integer; it specifies the \fIcount\fR field for the event. Valid for \fBExpose\fR events. Corresponds to the \fB%c\fR substitution for binding scripts. .TP \fB\-data\fI string\fR \fIString\fR may be any value; it specifies the \fIuser_data\fR field for the event. Only valid for virtual events. Corresponds to the \fB%d\fR substitution for virtual events in binding scripts. .TP \fB\-delta\fI number\fR \fINumber\fR must be an integer; it specifies the \fIdelta\fR field for the \fBMouseWheel\fR event. The \fIdelta\fR refers to the direction and magnitude the mouse wheel was rotated. Note the value is not a screen distance but are units of motion in the mouse wheel. Typically these values are multiples of 120. For example, 120 should scroll the text widget up 4 lines and \-240 would scroll the text widget down 8 lines. Of course, other widgets may define different behaviors for mouse wheel motion. This field corresponds to the \fB%D\fR substitution for binding scripts. .TP \fB\-detail\fI detail\fR \fIDetail\fR specifies the \fIdetail\fR field for the event and must be one of the following: .RS .DS .ta 6c \fBNotifyAncestor\fR \fBNotifyNonlinearVirtual\fR \fBNotifyDetailNone\fR \fBNotifyPointer\fR \fBNotifyInferior\fR \fBNotifyPointerRoot\fR \fBNotifyNonlinear\fR \fBNotifyVirtual\fR .DE Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR and \fBFocusOut\fR events. Corresponds to the \fB%d\fR substitution for binding scripts. .RE .TP \fB\-focus\fI boolean\fR \fIBoolean\fR must be a boolean value; it specifies the \fIfocus\fR field for the event. Valid for \fBEnter\fR and \fBLeave\fR events. Corresponds to the \fB%f\fR substitution for binding scripts. .TP \fB\-height\fI size\fR \fISize\fR must be a screen distance; it specifies the \fIheight\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%h\fR substitution for binding scripts. .TP \fB\-keycode\fI number\fR \fINumber\fR must be an integer; it specifies the \fIkeycode\fR field for the event. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%k\fR substitution for binding scripts. .TP \fB\-keysym\fI name\fR \fIName\fR must be the name of a valid keysym, such as \fBg\fR, \fBspace\fR, or \fBReturn\fR; its corresponding keycode value is used as the \fIkeycode\fR field for event, overriding any detail specified in the base \fIevent\fR argument. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%K\fR substitution for binding scripts. .TP \fB\-mode\fI notify\fR \fINotify\fR specifies the \fImode\fR field for the event and must be one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or \fBNotifyWhileGrabbed\fR. Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events. Corresponds to the \fB%m\fR substitution for binding scripts. .TP \fB\-override\fI boolean\fR \fIBoolean\fR must be a boolean value; it specifies the \fIoverride_redirect\fR field for the event. Valid for \fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events. Corresponds to the \fB%o\fR substitution for binding scripts. .TP \fB\-place\fI where\fR \fIWhere\fR specifies the \fIplace\fR field for the event; it must be either \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR. Valid for \fBCirculate\fR events. Corresponds to the \fB%p\fR substitution for binding scripts. .TP \fB\-root\fI window\fR \fIWindow\fR must be either a window path name or an integer window identifier; it specifies the \fIroot\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%R\fR substitution for binding scripts. .TP \fB\-rootx\fI coord\fR \fICoord\fR must be a screen distance; it specifies the \fIx_root\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%X\fR substitution for binding scripts. .TP \fB\-rooty\fI coord\fR \fICoord\fR must be a screen distance; it specifies the \fIy_root\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%Y\fR substitution for binding scripts. .TP \fB\-sendevent\fI boolean\fR \fIBoolean\fR must be a boolean value; it specifies the \fIsend_event\fR field for the event. Valid for all events. Corresponds to the \fB%E\fR substitution for binding scripts. .TP \fB\-serial\fI number\fR \fINumber\fR must be an integer; it specifies the \fIserial\fR field for the event. Valid for all events. Corresponds to the \fB%#\fR substitution for binding scripts. .TP \fB\-state\fI state\fR \fIState\fR specifies the \fIstate\fR field for the event. For \fBKey\fR, \fBKeyRelease\fR, \fBButtons\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events it must be an integer value. For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR, \fBVisibilityPartiallyObscured\fR, or \fBVisibilityFullyObscured\fR. This option overrides any modifiers such as \fBMeta\fR or \fBControl\fR specified in the base \fIevent\fR. Corresponds to the \fB%s\fR substitution for binding scripts. .TP \fB\-subwindow\fI window\fR \fIWindow\fR specifies the \fIsubwindow\fR field for the event, either as a path name for a Tk widget or as an integer window identifier. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Similar to \fB%S\fR substitution for binding scripts. .TP \fB\-time\fI integer\fR \fIInteger\fR must be an integer value; it specifies the \fItime\fR field for the event. Additonally the special value \fBcurrent\fR is allowed, this value will be substituted by the current event time. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR, and \fBProperty\fR events. Corresponds to the \fB%t\fR substitution for binding scripts. .TP \fB\-warp\fI boolean\fR \fIboolean\fR must be a boolean value; it specifies whether the screen pointer should be warped as well. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, and \fBMotion\fR events. The pointer will only warp to a window if it is mapped. .TP \fB\-width\fI size\fR \fISize\fR must be a screen distance; it specifies the \fIwidth\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%w\fR substitution for binding scripts. .TP \fB\-when\fI when\fR \fIWhen\fR determines when the event will be processed; it must have one of the following values: .RS .IP \fBnow\fR 10 Process the event immediately, before the command returns. This also happens if the \fB\-when\fR option is omitted. .IP \fBtail\fR 10 Place the event on Tcl's event queue behind any events already queued for this application. .IP \fBhead\fR 10 Place the event at the front of Tcl's event queue, so that it will be handled before any other events already queued. .IP \fBmark\fR 10 Place the event at the front of Tcl's event queue but behind any other events already queued with \fB\-when mark\fR. This option is useful when generating a series of events that should be processed in order but at the front of the queue. .RE .TP \fB\-x\fI coord\fR \fICoord\fR must be a screen distance; it specifies the \fIx\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBMotion\fR, \fBEnter\fR, \fBLeave\fR, \fBExpose\fR, \fBConfigure\fR, \fBGravity\fR, and \fBReparent\fR events. Corresponds to the \fB%x\fR substitution for binding scripts. If \fIWindow\fR is empty the coordinate is relative to the screen, and this option corresponds to the \fB%X\fR substitution for binding scripts. .TP \fB\-y\fI coord\fR \fICoord\fR must be a screen distance; it specifies the \fIy\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBMotion\fR, \fBEnter\fR, \fBLeave\fR, \fBExpose\fR, \fBConfigure\fR, \fBGravity\fR, and \fBReparent\fR events. Corresponds to the \fB%y\fR substitution for binding scripts. If \fIWindow\fR is empty the coordinate is relative to the screen, and this option corresponds to the \fB%Y\fR substitution for binding scripts. .PP Any options that are not specified when generating an event are filled with the value 0, except for \fIserial\fR, which is filled with the next X event serial number. .SH "PREDEFINED VIRTUAL EVENTS" .PP Tk defines the following virtual events for the purposes of notification: .TP \fB<<AltUnderlined>>\fR This is sent to widget to notify it that the letter it has underlined (as an accelerator indicator) with the \fB\-underline\fR option has been pressed in combination with the Alt key. The usual response to this is to either focus into the widget (or some related widget) or to invoke the widget. .TP \fB<<Invoke>>\fR This can be sent to some widgets (e.g. button, listbox, menu) as an alternative to <space>. .TP \fB<<ListboxSelect>>\fR This is sent to a listbox when the set of selected item(s) in the listbox is updated. .TP \fB<<MenuSelect>>\fR This is sent to a menu when the currently selected item in the menu changes. It is intended for use with context-sensitive help systems. .TP \fB<<Modified>>\fR This is sent to a text widget when the contents of the widget are changed. .TP \fB<<Selection>>\fR This is sent to a text widget when the selection in the widget is changed. .TP \fB<<ThemeChanged>>\fR 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 \fB<<TkWorldChanged>>\fR . This event is sent to all widgets when a font is changed, for example, by the use of [font configure]. The user_data field (%d) will have the value "FontChanged". For other system wide changes, this event will be sent to all widgets, and the user_data field will indicate the cause of the change. NOTE: all tk and ttk widgets already handle this event internally. .TP \fB<<TraverseIn>>\fR This is sent to a widget when the focus enters the widget because of a user-driven .QW "tab to widget" action. .TP \fB<<TraverseOut>>\fR This is sent to a widget when the focus leaves the widget because of a user-driven .QW "tab to widget" action. .TP \fB<<UndoStack>>\fR This is sent to a text widget when its undo stack or redo stack becomes empty or unempty. .TP \fB<<WidgetViewSync>>\fR This is sent to a text widget when its internal data become obsolete, and again when these internal data are back in sync with the widget view. The detail field (%d substitution) is either true (when the widget is in sync) or false (when it is not). .PP Tk defines the following virtual events for the purposes of unifying bindings across multiple platforms. Users expect them to behave in the following way: .TP \fB<<Clear>>\fR Delete the currently selected widget contents. .TP \fB<<Copy>>\fR Copy the currently selected widget contents to the clipboard. .TP \fB<<Cut>>\fR Move the currently selected widget contents to the clipboard. .TP \fB<<LineEnd>>\fR . Move to the end of the line in the current widget while deselecting any selected contents. .TP |
︙ | ︙ | |||
490 491 492 493 494 495 496 | .TP \fB<<NextWord>>\fR . Move to the next group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<<Paste>>\fR | < < < < | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | .TP \fB<<NextWord>>\fR . Move to the next group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<<Paste>>\fR Replace the currently selected widget contents with the contents of the clipboard. .TP \fB<<PasteSelection>>\fR Insert the contents of the selection at the mouse location. (This event has meaningful \fB%x\fR and \fB%y\fR substitutions). .TP \fB<<PrevChar>>\fR . Move to the previous item (i.e., visible character) in the current widget while deselecting any selected contents. .TP \fB<<PrevLine>>\fR . Move to the previous line in the current widget while deselecting any selected contents. .TP \fB<<PrevPara>>\fR . Move to the previous paragraph in the current widget while deselecting any selected contents. .TP \fB<<PrevWindow>>\fR Traverse to the previous window. .TP \fB<<PrevWord>>\fR . Move to the previous group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<<Redo>>\fR Redo one undone action. .TP \fB<<SelectAll>>\fR . Set the range of selected contents to the complete widget. .TP \fB<<SelectLineEnd>>\fR |
︙ | ︙ |
Changes to doc/focus.n.
︙ | ︙ | |||
51 52 53 54 55 56 57 | implement a focus order among the windows of a top-level; they are used in the default bindings for Tab and Shift-Tab, among other things. .PP The \fBfocus\fR command can take any of the following forms: .TP \fBfocus\fR | < < | < < | < | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | implement a focus order among the windows of a top-level; they are used in the default bindings for Tab and Shift-Tab, among other things. .PP The \fBfocus\fR command can take any of the following forms: .TP \fBfocus\fR Returns the path name of the focus window on the display containing the application's main window, or an empty string if no window in this application has the focus on that display. Note: it is better to specify the display explicitly using \fB\-displayof\fR (see below) so that the code will work in applications using multiple displays. .TP \fBfocus \fIwindow\fR If the application currently has the input focus on \fIwindow\fR's display, this command resets the input focus for \fIwindow\fR's display to \fIwindow\fR and returns an empty string. If the application does not currently have the input focus on \fIwindow\fR's display, \fIwindow\fR will be remembered as the focus for its top-level; the next time the focus arrives at the top-level, Tk will redirect it to \fIwindow\fR. If \fIwindow\fR is an empty string then the command does nothing. .TP \fBfocus \-displayof\fR \fIwindow\fR Returns the name of the focus window on the display containing \fIwindow\fR. If the focus window for \fIwindow\fR's display is not in this application, the return value is an empty string. .TP \fBfocus \-force \fIwindow\fR Sets the focus of \fIwindow\fR's display to \fIwindow\fR, even if the application does not currently have the input focus for the display. This command should be used sparingly, if at all. In normal usage, an application should not claim the focus for itself; instead, it should wait for the window manager to give it the focus. If \fIwindow\fR is an empty string then the command does nothing. .TP \fBfocus \-lastfor\fR \fIwindow\fR Returns the name of the most recent window to have the input focus among all the windows in the same top-level as \fIwindow\fR. If no window in that top-level has ever had the input focus, or if the most recent focus window has been deleted, then the name of the top-level is returned. The return value is the window that will receive the input focus the next time the window manager gives the focus to the top-level. |
︙ | ︙ | |||
110 111 112 113 114 115 116 | the fact that the X focus is on the top-level is invisible unless you use C code to query the X server directly. .SH "EXAMPLE" .PP To make a window that only participates in the focus traversal ring when a variable is set, add the following bindings to the widgets \fIbefore\fR and \fIafter\fR it in that focus ring: | < | | | | | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | the fact that the X focus is on the top-level is invisible unless you use C code to query the X server directly. .SH "EXAMPLE" .PP To make a window that only participates in the focus traversal ring when a variable is set, add the following bindings to the widgets \fIbefore\fR and \fIafter\fR it in that focus ring: .CS button .before \-text "Before" button .middle \-text "Middle" button .after \-text "After" checkbutton .flag \-variable traverseToMiddle \-takefocus 0 pack .flag \-side left pack .before .middle .after bind .before <Tab> { if {!$traverseToMiddle} { \fBfocus\fR .after break } } bind .after <Shift\-Tab> { if {!$traverseToMiddle} { \fBfocus\fR .before break } } \fBfocus\fR .before .CE .SH KEYWORDS events, focus, keyboard, top-level, window manager '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/focusNext.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH tk_focusNext n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for managing the input focus. .SH SYNOPSIS | < > > < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .TH tk_focusNext n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for managing the input focus. .SH SYNOPSIS \fBtk_focusNext \fIwindow\fR .sp \fBtk_focusPrev \fIwindow\fR .sp \fBtk_focusFollowsMouse\fR .BE .SH DESCRIPTION .PP \fBtk_focusNext\fR is a utility procedure used for keyboard traversal. It returns the .QW next window after \fIwindow\fR in focus order. The focus order is determined by |
︙ | ︙ | |||
45 46 47 48 49 50 51 | \fBtk_focusFollowsMouse\fR changes the focus model for the application to an implicit one where the window under the mouse gets the focus. After this procedure is called, whenever the mouse enters a window Tk will automatically give it the input focus. The \fBfocus\fR command may be used to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to that window. | < | | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | \fBtk_focusFollowsMouse\fR changes the focus model for the application to an implicit one where the window under the mouse gets the focus. After this procedure is called, whenever the mouse enters a window Tk will automatically give it the input focus. The \fBfocus\fR command may be used to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to that window. Note: at present there is no built-in support for returning the application to an explicit focus model; to do this you will have to write a script that deletes the bindings created by \fBtk_focusFollowsMouse\fR. .SH KEYWORDS focus, keyboard traversal, top-level '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/font.n.
︙ | ︙ | |||
16 17 18 19 20 21 22 | .BE .SH DESCRIPTION .PP The \fBfont\fR command provides several facilities for dealing with fonts, such as defining named fonts and inspecting the actual attributes of a font. The command has several different forms, determined by the first argument. The following forms are currently supported: | < < < < | < < < < < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | .BE .SH DESCRIPTION .PP The \fBfont\fR command provides several facilities for dealing with fonts, such as defining named fonts and inspecting the actual attributes of a font. The command has several different forms, determined by the first argument. The following forms are currently supported: .TP \fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? ?\fB\-\|\-\fR? ?\fIchar\fR? . Returns information about the actual attributes that are obtained when \fIfont\fR is used on \fIwindow\fR's display; the actual attributes obtained may differ from the attributes requested due to platform-dependent limitations, such as the availability of font families and point sizes. \fIfont\fR is a font description; see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR argument is omitted, it defaults to the main window. If \fIoption\fR is specified, returns the value of that attribute; if it is omitted, the return value is a list of all the attributes and their values. See \fBFONT OPTIONS\fR below for a list of the possible attributes. If the \fIchar\fR argument is supplied, it must be a single character. The font attributes returned will be those of the specific font used to render that character, which will be different from the base font if the base font does not contain the given character. If \fIchar\fR may be a hyphen, it should be preceded by \fB\-\|\-\fR to distinguish it from a misspelled \fIoption\fR. .TP \fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the desired attributes for the named font called \fIfontname\fR. If no \fIoption\fR is specified, returns a list describing all the options and their values for \fIfontname\fR. If a single \fIoption\fR is specified with no \fIvalue\fR, then returns the current value of that attribute. If one or more \fIoption\fR\-\fIvalue\fR pairs are specified, then the command modifies the given named font to have the given values; in this case, all widgets using that font will redisplay themselves using the new attributes for the font. See \fBFONT OPTIONS\fR below for a list of the possible attributes. .RS .PP Note that on Aqua/Mac OS X, the system fonts (see \fBPLATFORM SPECIFIC FONTS\fR below) may not be actually altered because they are implemented by the system theme. To achieve the effect of modification, use \fBfont actual\fR to get their configuration and \fBfont create\fR to synthesize a copy of the font which can be modified. .RE .TP \fBfont create\fR ?\fIfontname\fR? ?\fIoption value ...\fR? . Creates a new named font and returns its name. \fIfontname\fR specifies the name for the font; if it is omitted, then Tk generates a new name of the form \fBfont\fIx\fR, where \fIx\fR is an integer. There may be any number of \fIoption\fR\-\fIvalue\fR pairs, which provide the desired attributes for the new named font. See \fBFONT OPTIONS\fR below for a list of the possible attributes. .TP \fBfont delete\fR \fIfontname\fR ?\fIfontname ...\fR? . Delete the specified named fonts. If there are widgets using the named font, the named font will not actually be deleted until all the instances are released. Those widgets will continue to display using the last known values for the named font. If a deleted named font is subsequently recreated with another call to \fBfont create\fR, the widgets will use the new named font and redisplay themselves using the new attributes of that font. .TP \fBfont families\fR ?\fB\-displayof \fIwindow\fR? . The return value is a list of the case-insensitive names of all font families that exist on \fIwindow\fR's display. If the \fIwindow\fR argument is omitted, it defaults to the main window. .TP \fBfont measure \fIfont\fR ?\fB\-displayof \fIwindow\fR? \fItext\fR . Measures the amount of space the string \fItext\fR would use in the given \fIfont\fR when displayed in \fIwindow\fR. \fIfont\fR is a font description; see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR argument is omitted, it defaults to the main window. The return value is the total width in pixels of \fItext\fR, not including the extra pixels used by highly exaggerated characters such as cursive .QW f . If the string contains newlines or tabs, those characters are not expanded or treated specially when measuring the string. .TP \fBfont metrics \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? . Returns information about the metrics (the font-specific data), for \fIfont\fR when it is used on \fIwindow\fR's display. \fIfont\fR is a font description; see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR argument is omitted, it defaults to the main window. If \fIoption\fR is specified, returns the value of that metric; if it is omitted, the return value is a list of all the metrics and their values. See \fBFONT METRICS\fR below for a list of the possible metrics. .TP \fBfont names\fR The return value is a list of all the named fonts that are currently defined. .SH "FONT DESCRIPTIONS" .PP The following formats are accepted as a font description anywhere \fIfont\fR is specified as an argument above; these same forms are also permitted when specifying the \fB\-font\fR option for widgets. .TP |
︙ | ︙ | |||
205 206 207 208 209 210 211 | font. In the following definitions, the .QW baseline of a font is the horizontal line where the bottom of most letters line up; certain letters, such as lower-case .QW g stick below the baseline. | < | < | < < | < < < < < < < < < > | > > | > > | > > | > > | > > | > > | > > | > > | > < < < | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | font. In the following definitions, the .QW baseline of a font is the horizontal line where the bottom of most letters line up; certain letters, such as lower-case .QW g stick below the baseline. .TP \fB\-ascent \0\fR . The amount in pixels that the tallest letter sticks up above the baseline of the font, plus any extra blank space added by the designer of the font. .TP \fB\-descent \0\fR . The largest amount in pixels that any letter sticks down below the baseline of the font, plus any extra blank space added by the designer of the font. .TP \fB\-linespace\fR . Returns how far apart vertically in pixels two lines of text using the same font should be placed so that none of the characters in one line overlap any of the characters in the other line. This is generally the sum of the ascent above the baseline line plus the descent below the baseline. .TP \fB\-fixed \0\fR . Returns a boolean flag that is .QW \fB1\fR if this is a fixed-width font, where each normal character is the same width as all the other characters, or is .QW \fB0\fR if this is a proportionally-spaced font, where individual characters have different widths. The widths of control characters, tab characters, and other non-printing characters are not included when calculating this value. .SH "FONT OPTIONS" .PP The following options are supported on all platforms, and are used when constructing a named font or when specifying a font using style [5] as above: .TP \fB\-family \fIname\fR . The case-insensitive font family name. Tk guarantees to support the font families named \fBCourier\fR (a monospaced .QW typewriter font), \fBTimes\fR (a serifed .QW newspaper font), and \fBHelvetica\fR (a sans-serif .QW European font). The most closely matching native font family will automatically be substituted when one of the above font families is used. The \fIname\fR may also be the name of a native, platform-specific font family; in that case it will work as desired on one platform but may not display correctly on other platforms. If the family is unspecified or unrecognized, a platform-specific default font will be chosen. .TP \fB\-size \fIsize\fR . The desired size of the font. If the \fIsize\fR argument is a positive number, it is interpreted as a size in points. If \fIsize\fR is a negative number, its absolute value is interpreted as a size in pixels. If a font cannot be displayed at the specified size, a nearby size will be chosen. If \fIsize\fR is unspecified or zero, a platform-dependent default size will be chosen. .RS .PP Sizes should normally be specified in points so the application will remain the same ruler size on the screen, even when changing screen resolutions or moving scripts across platforms. However, specifying pixels is useful in certain circumstances such as when a piece of text must line up with respect to a fixed-size bitmap. The mapping between points and pixels is set when the application starts, based on properties of the installed monitor, but it can be overridden by calling the \fBtk scaling\fR command. .RE .TP \fB\-weight \fIweight\fR . The nominal thickness of the characters in the font. The value \fBnormal\fR specifies a normal weight font, while \fBbold\fR specifies a bold font. The closest available weight to the one specified will be chosen. The default weight is \fBnormal\fR. .TP \fB\-slant \fIslant\fR The amount the characters in the font are slanted away from the vertical. Valid values for slant are \fBroman\fR and \fBitalic\fR. A roman font is the normal, upright appearance of a font, while an italic font is one that is tilted some number of degrees from upright. The closest available slant to the one specified will be chosen. The default slant is \fBroman\fR. .TP \fB\-underline \fIboolean\fR The value is a boolean flag that specifies whether characters in this font should be underlined. The default value for underline is \fBfalse\fR. .TP \fB\-overstrike \fIboolean\fR The value is a boolean flag that specifies whether a horizontal line should be drawn through the middle of characters in this font. The default value for overstrike is \fBfalse\fR. .SH "STANDARD FONTS" .PP The following named fonts are supported on all systems, and default to values that match appropriate system defaults. .TP \fBTkDefaultFont\fR . This font is the default for all GUI items not otherwise specified. .TP \fBTkTextFont\fR . This font should be used for user text in entry widgets, listboxes etc. .TP \fBTkFixedFont\fR . This font is the standard fixed-width font. .TP \fBTkMenuFont\fR . This font is used for menu items. .TP \fBTkHeadingFont\fR . This font should be used for column headings in lists and tables. .TP \fBTkCaptionFont\fR . This font should be used for window and dialog caption bars. .TP \fBTkSmallCaptionFont\fR . This font should be used for captions on contained windows or tool dialogs. .TP \fBTkIconFont\fR . This font should be used for icon captions. .TP \fBTkTooltipFont\fR . This font should be used for tooltip windows (transient information windows). .LP It is \fInot\fR advised to change these fonts, as they may be modified by Tk itself in response to system changes. Instead, make a copy of the font and modify that. .SH "PLATFORM SPECIFIC FONTS" .PP The following system fonts are supported: .TP \fBX Windows\fR All valid X font names, including those listed by xlsfonts(1), are available. .TP \fBMS Windows\fR The following fonts are supported, and are mapped to the user's style defaults. .RS .DS .ta 3c 6c \fBsystem\fR \fBansi\fR \fBdevice\fR \fBsystemfixed\fR \fBansifixed\fR \fBoemfixed\fR .DE .RE .TP \fBMac OS X\fR The following fonts are supported, and are mapped to the user's style defaults. .RS .DS .ta 3c 6c \fBsystem\fR \fBapplication\fR \fBmenu\fR .DE |
︙ | ︙ | |||
389 390 391 392 393 394 395 | .DE .RE .SH EXAMPLE .PP Fill a text widget with lots of font demonstrators, one for every font family installed on your system: .CS | | | | | | | | | | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | .DE .RE .SH EXAMPLE .PP Fill a text widget with lots of font demonstrators, one for every font family installed on your system: .CS pack [text .t \-wrap none] \-fill both \-expand 1 set count 0 set tabwidth 0 foreach family [lsort \-dictionary [\fBfont families\fR]] { .t tag configure f[incr count] \-font [list $family 10] .t insert end ${family}:\\t {} \e "This is a simple sampler\en" f$count set w [\fBfont measure\fR [.t cget \-font] ${family}:] if {$w+5 > $tabwidth} { set tabwidth [expr {$w+5}] .t configure \-tabs $tabwidth } } .CE .SH "SEE ALSO" options(n) .SH KEYWORDS font '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/fontchooser.n.
1 2 3 4 5 6 7 8 9 10 11 12 13 | '\" '\" Copyright (c) 2008 Daniel A. Steffen <das@users.sourceforge.net> '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH fontchooser n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME fontchooser \- control font selection dialog .SH SYNOPSIS | < > > < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | '\" '\" Copyright (c) 2008 Daniel A. Steffen <das@users.sourceforge.net> '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH fontchooser n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME fontchooser \- control font selection dialog .SH SYNOPSIS \fBtk fontchooser\fR \fBconfigure\fR ?\fI\-option value ...\fR? .sp \fBtk fontchooser\fR \fBshow\fR .sp \fBtk fontchooser\fR \fBhide\fR .BE .SH DESCRIPTION .PP The \fBtk fontchooser\fR command controls the Tk font selection dialog. It uses the native platform font selection dialog where available, or a dialog implemented in Tcl otherwise. .PP Unlike most of the other Tk dialog commands, \fBtk fontchooser\fR does not return an immediate result, as on some platforms (Mac OS X) the standard font dialog is modeless while on others (Windows) it is modal. To accommodate this difference, all user interaction with the dialog will be communicated to the caller via callbacks or virtual events. .PP The \fBtk fontchooser\fR command can have one of the following forms: .TP \fBtk fontchooser\fR \fBconfigure \fR?\fI\-option value ...\fR? . Set or query one or more of the configurations options below (analogous to Tk widget configuration). .TP \fBtk fontchooser\fR \fBshow\fR . Show the font selection dialog. Depending on the platform, may return immediately or only once the dialog has been withdrawn. .TP \fBtk fontchooser\fR \fBhide\fR . Hide the font selection dialog if it is visible and cause any pending \fBtk fontchooser\fR \fBshow\fR command to return. .PP .SH "CONFIGURATION OPTIONS" .TP \fB\-parent\fR Specifies/returns the logical parent window of the font selection dialog (similar to the \fB\-parent\fR option to other dialogs). The font selection dialog is hidden if it is visible when the parent window is destroyed. .TP \fB\-title\fR Specifies/returns the title of the dialog. Has no effect on platforms where the font selection dialog does not support titles. .TP \fB\-font\fR Specifies/returns the font that is currently selected in the dialog if it is visible, or that will be initially selected when the dialog is shown (if supported by the platform). Can be set to the empty string to indicate that no font should be selected. Fonts can be specified in any form given by the "FONT DESCRIPTION" section in the \fBfont\fR manual page. .TP \fB\-command\fR Specifies/returns the command prefix to be called when a font selection has been made by the user. The command prefix is evaluated at the global level after having the specification of the selected font appended. On platforms where the font selection dialog offers the user control of further font attributes (such as color), additional key/value pairs may be appended before evaluation. Can be set to the empty string to indicate that no callback should be invoked. Fonts are specified by a list of form [3] of the "FONT DESCRIPTION" section in the \fBfont\fR manual page (i.e. a list of the form \fI{family size style ?style ...?}\fR). .TP \fB\-visible\fR Read-only option that returns a boolean indicating whether the font selection dialog is currently visible. Attempting to set this option results in an error. .PP .SH "VIRTUAL EVENTS" .TP \fB<<TkFontchooserVisibility>>\fR Sent to the dialog parent whenever the visibility of the font selection dialog changes, both as a result of user action (e.g. disposing of the dialog via OK/Cancel button or close box) and of the \fBtk fontchooser\fR \fBshow\fR/\fBhide\fR commands being called. Binding scripts can determine the current visibility of the dialog by querying the \fB\-visible\fR configuration option. .TP \fB<<TkFontchooserFontChanged>>\fR Sent to the dialog parent whenever the font selection dialog is visible and the selected font changes, both as a result of user action and of the \fB\-font\fR configuration option being set. Binding scripts can determine the currently selected font by querying the \fB\-font\fR configuration option. .PP .SH NOTES .PP |
︙ | ︙ | |||
150 151 152 153 154 155 156 | to ensure its selected font matches the new value of the named font. .PP .SH EXAMPLE .PP .CS proc fontchooserDemo {} { wm title . "Font Chooser Demo" | | | | | | | | | | | | | | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | to ensure its selected font matches the new value of the named font. .PP .SH EXAMPLE .PP .CS proc fontchooserDemo {} { wm title . "Font Chooser Demo" \fBtk fontchooser\fR \fBconfigure\fR \-parent . button .b \-command fontchooserToggle \-takefocus 0 fontchooserVisibility .b bind . \fB<<TkFontchooserVisibility>>\fR \\ [list fontchooserVisibility .b] foreach w {.t1 .t2} { text $w \-width 20 \-height 4 \-borderwidth 1 \-relief solid bind $w <FocusIn> [list fontchooserFocus $w] $w insert end "Text Widget $w" } .t1 configure \-font {Courier 14} .t2 configure \-font {Times 16} pack .b .t1 .t2; focus .t1 } proc fontchooserToggle {} { \fBtk fontchooser\fR [expr { [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ? "\fBhide\fR" : "\fBshow\fR"}] } proc fontchooserVisibility {w} { $w configure \-text [expr { [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ? "Hide Font Dialog" : "Show Font Dialog"}] } proc fontchooserFocus {w} { \fBtk fontchooser\fR \fBconfigure\fR \-font [$w cget \-font] \\ \-command [list fontchooserFontSelection $w] } proc fontchooserFontSelection {w font args} { $w configure \-font [font actual $font] } fontchooserDemo .CE .SH "SEE ALSO" font(n), tk(n) .SH KEYWORDS dialog, font, font selection, font chooser, font panel '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/frame.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH frame n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME frame \- Create and manipulate 'frame' simple container widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH frame n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME frame \- Create and manipulate 'frame' simple container widgets .SH SYNOPSIS \fBframe\fR \fIpathName\fR ?\fIoptions\fR? .SO \-borderwidth \-highlightcolor \-pady \-cursor \-highlightthickness \-relief \-highlightbackground \-padx \-takefocus .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-background background Background |
︙ | ︙ | |||
62 63 64 65 66 67 68 | children of its own in this application. This option may not be changed with the \fBconfigure\fR widget command. Note that \fB\-borderwidth\fR, \fB\-padx\fR and \fB\-pady\fR are ignored when configured as a container since a container has no border. .OP \-height height Height Specifies the desired height for the window in any of the forms | | | | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | children of its own in this application. This option may not be changed with the \fBconfigure\fR widget command. Note that \fB\-borderwidth\fR, \fB\-padx\fR and \fB\-pady\fR are ignored when configured as a container since a container has no border. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. If this option is negative or zero then the window will not request any size at all. Note that this sets the total height of the frame, any \fB\-borderwidth\fR or similar is not added. Normally \fB\-height\fR should not be used if a propagating geometry manager, such as \fBgrid\fR or \fBpack\fR, is used within the frame since the geometry manager will override the height of the frame. .OP \-tile tile Tile .VS "8.7, TIP262" This specifies how to draw the background image (see |
︙ | ︙ | |||
86 87 88 89 90 91 92 | forms accepted by \fBTk_GetVisual\fR. If this option is not specified, the new window will use the same visual as its parent. The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms | | | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | forms accepted by \fBTk_GetVisual\fR. If this option is not specified, the new window will use the same visual as its parent. The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. If this option is negative or zero then the window will not request any size at all. Note that this sets the total width of the frame, any \fB\-borderwidth\fR or similar is not added. Normally \fB\-width\fR should not be used if a propagating geometry manager, such as \fBgrid\fR or \fBpack\fR, is used within the frame since the geometry manager will override the width of the frame. .BE .SH DESCRIPTION .PP |
︙ | ︙ | |||
123 124 125 126 127 128 129 | \fIpathName option \fR?\fIarg ...\fR? .CE .PP \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 determine the exact behavior of the command. The following commands are possible for frame widgets: | < | < | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | \fIpathName option \fR?\fIarg ...\fR? .CE .PP \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 determine the exact behavior of the command. The following commands are possible for frame widgets: .TP \fIpathName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBframe\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified |
︙ | ︙ |
Changes to doc/getOpenFile.n.
︙ | ︙ | |||
30 31 32 33 34 35 36 | The \fBtk_getSaveFile\fR command is usually associated with the \fBSave as\fR command in the \fBFile\fR menu. If the user enters a file that already exists, the dialog box prompts the user for confirmation whether the existing file should be overwritten or not. .PP The following \fIoption\-value\fR pairs are possible as command line arguments to these two commands: | < | < < | < < | < | < | < | < | < | < | < | < | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | The \fBtk_getSaveFile\fR command is usually associated with the \fBSave as\fR command in the \fBFile\fR menu. If the user enters a file that already exists, the dialog box prompts the user for confirmation whether the existing file should be overwritten or not. .PP The following \fIoption\-value\fR pairs are possible as command line arguments to these two commands: .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 Configures how the Save dialog reacts when the selected file already exists, and saving would overwrite it. A true value requests a confirmation dialog be presented to the user. A false value requests that the overwrite take place without confirmation. Default value is true. .TP \fB\-defaultextension\fR \fIextension\fR . Specifies a string that will be appended to the filename if the user enters a filename without an extension. The default value is the empty string, which means no extension will be appended to the filename in any case. This option is ignored on Mac OS X, which does not require extensions to filenames, and the UNIX implementation guesses reasonable values for this from the \fB\-filetypes\fR option when this is not supplied. .TP \fB\-filetypes\fR \fIfilePatternList\fR . If a \fBFile types\fR listbox exists in the file dialog on the particular platform, this option gives the \fIfiletype\fRs in this listbox. When the user choose a filetype in the listbox, only the files of that type are listed. If this option is unspecified, or if it is set to the empty list, or if the \fBFile types\fR listbox is not supported by the particular platform then all files are listed regardless of their types. See the section \fBSPECIFYING FILE PATTERNS\fR below for a discussion on the contents of \fIfilePatternList\fR. .TP \fB\-initialdir\fR \fIdirectory\fR . Specifies that the files in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. .TP \fB\-initialfile\fR \fIfilename\fR . Specifies a filename to be displayed in the dialog when it pops up. .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\-multiple\fR \fIboolean\fR . Allows the user to choose multiple files from the Open dialog. .TP \fB\-parent\fR \fIwindow\fR . Makes \fIwindow\fR the logical parent of the file dialog. The file dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window. .TP \fB\-title\fR \fItitleString\fR . Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title is displayed. .TP \fB\-typevariable\fR \fIvariableName\fR . The global variable \fIvariableName\fR is used to preselect which filter is used from \fIfilterList\fR when the dialog box is opened and is updated when the dialog box is closed, to the last selected filter. The variable is read once at the beginning to select the appropriate filter. If the variable does not exist, or its value does not match any filter typename, or is empty (\fB{}\fR), the dialog box |
︙ | ︙ | |||
201 202 203 204 205 206 207 | {{Text Files} {.txt} } {{TCL Scripts} {.tcl} } {{C Source Files} {.c} TEXT} {{GIF Files} {.gif} } {{GIF Files} {} GIFF} {{All Files} * } } | | | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | {{Text Files} {.txt} } {{TCL Scripts} {.tcl} } {{C Source Files} {.c} TEXT} {{GIF Files} {.gif} } {{GIF Files} {} GIFF} {{All Files} * } } set filename [\fBtk_getOpenFile\fR \-filetypes $types] if {$filename ne ""} { # Open the file ... } .CE .SH "SEE ALSO" tk_chooseDirectory .SH KEYWORDS file selection dialog '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/grab.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH grab n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME grab \- Confine pointer and keyboard events to a window sub-tree .SH SYNOPSIS | < > < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .TH grab n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME grab \- Confine pointer and keyboard events to a window sub-tree .SH SYNOPSIS \fBgrab \fR?\fB\-global\fR? \fIwindow\fR .sp \fBgrab \fIoption \fR?\fIarg \fR...? .BE .SH DESCRIPTION .PP This command implements simple pointer and keyboard grabs for Tk. Tk's grabs are different than the grabs described in the Xlib documentation. When a grab is set for a particular window, Tk restricts all pointer |
︙ | ︙ | |||
80 81 82 83 84 85 86 | It is possible for different applications on a single display to have simultaneous local grabs, but only one application can have a global grab on a given display at once. .PP The \fBgrab\fR command can take any of the following forms: .TP \fBgrab \fR?\fB\-global\fR? \fIwindow\fR | < < < < < < < < < | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | It is possible for different applications on a single display to have simultaneous local grabs, but only one application can have a global grab on a given display at once. .PP The \fBgrab\fR command can take any of the following forms: .TP \fBgrab \fR?\fB\-global\fR? \fIwindow\fR Same as \fBgrab set\fR, described below. .TP \fBgrab current \fR?\fIwindow\fR? If \fIwindow\fR is specified, returns the name of the current grab window in this application for \fIwindow\fR's display, or an empty string if there is no such window. If \fIwindow\fR is omitted, the command returns a list whose elements are all of the windows grabbed by this application for all displays, or an empty string if the application has no grabs. .TP \fBgrab release \fIwindow\fR Releases the grab on \fIwindow\fR if there is one, otherwise does nothing. Returns an empty string. .TP \fBgrab set \fR?\fB\-global\fR? \fIwindow\fR Sets a grab on \fIwindow\fR. If \fB\-global\fR is specified then the grab is global, otherwise it is local. If a grab was already in effect for this application on \fIwindow\fR's display then it is automatically released. If there is already a grab on \fIwindow\fR and it has the same global/local form as the requested grab, then the command does nothing. Returns an empty string. .TP \fBgrab status \fIwindow\fR Returns \fBnone\fR if no grab is currently set on \fIwindow\fR, \fBlocal\fR if a local grab is set on \fIwindow\fR, and \fBglobal\fR if a global grab is set. .SH WARNING .PP It is very easy to use global grabs to render a display completely unusable (e.g. by setting a grab on a widget which does not respond to |
︙ | ︙ | |||
142 143 144 145 146 147 148 | processes, this restriction does not exist. .SH EXAMPLE .PP Set a grab so that only one button may be clicked out of a group. The other buttons are unresponsive to the mouse until the middle button is clicked. .CS | | | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | processes, this restriction does not exist. .SH EXAMPLE .PP Set a grab so that only one button may be clicked out of a group. The other buttons are unresponsive to the mouse until the middle button is clicked. .CS pack [button .b1 \-text "Click me! #1" \-command {destroy .b1}] pack [button .b2 \-text "Click me! #2" \-command {destroy .b2}] pack [button .b3 \-text "Click me! #3" \-command {destroy .b3}] \fBgrab\fR .b2 .CE .SH "SEE ALSO" busy(n) .SH KEYWORDS grab, keyboard events, pointer events, window '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/grid.n.
︙ | ︙ | |||
24 25 26 27 28 29 30 | \fBgrid \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? . If the first argument to \fBgrid\fR is suitable as the first window 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 (see the \fBRELATIVE PLACEMENT\fR section below), then the command is processed in the same way as \fBgrid configure\fR. | < < < | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | \fBgrid \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? . If the first argument to \fBgrid\fR is suitable as the first window 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 (see the \fBRELATIVE PLACEMENT\fR section below), then the command is processed in the same way as \fBgrid configure\fR. .TP \fBgrid anchor \fIwindow\fR ?\fIanchor\fR? . 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 for further details. The default \fIanchor\fR is \fInw\fR. .TP \fBgrid bbox \fIwindow\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? . With no arguments, the bounding box (in pixels) of the grid is returned. The return value consists of 4 integers. The first two are the pixel 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, 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 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 indicated is returned. .TP \fBgrid columnconfigure \fIwindow index \fR?\fI\-option value...\fR? . Query or set the column properties of the \fIindex\fR column of the geometry container, \fIwindow\fR. The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR and \fB\-pad\fR. |
︙ | ︙ | |||
81 82 83 84 85 86 87 | The \fB\-pad\fR option specifies the number of screen units that will be added to the largest window contained completely in that column when the grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of | | < < < < < < < < < < < | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | The \fB\-pad\fR option specifies the number of screen units that will be added to the largest window contained completely in that column when the grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of .QW "\-option value" pairs. .TP \fBgrid configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? . The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how to manage the content. The characters \fB\-\fR, \fBx\fR and \fB^\fR, can be specified instead of a window name to alter the default location of a \fIwindow\fR, as described in the \fBRELATIVE PLACEMENT\fR section, below. The following options are supported: .RS .TP \fB\-column \fIn\fR . 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 window is arranged just to the right of previous window specified on this call to \fBgrid\fR, or column .QW 0 if it is the first window. For each \fBx\fR that immediately precedes the \fIwindow\fR, the column position is incremented by one. Thus the \fBx\fR represents a blank column for this row in the grid. .TP \fB\-columnspan \fIn\fR . 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 \fB\-\fR, in which case the columnspan is incremented once for each immediately following \fB\-\fR. .TP \fB\-in \fIcontainer\fR . Insert the window(s) in the container window given by \fIcontainer\fR. The default is the first window's parent window. .TP \fB\-ipadx \fIamount\fR . The \fIamount\fR specifies how much horizontal internal padding to leave on each side of the content. This is space is added inside the content border. The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. .TP \fB\-ipady \fIamount\fR . The \fIamount\fR specifies how much vertical internal padding to leave on the top and bottom of the content. This space is added inside the content border. The \fIamount\fR defaults to 0. .TP \fB\-padx \fIamount\fR . The \fIamount\fR specifies how much horizontal external padding to leave on each side of the content, in screen units. \fIAmount\fR may be a list of two values to specify padding for left and right separately. The \fIamount\fR defaults to 0. This space is added outside the content border. .TP \fB\-pady \fIamount\fR . The \fIamount\fR specifies how much vertical external padding to leave on the top and bottom of the content, in screen units. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately. The \fIamount\fR defaults to 0. This space is added outside the content border. .TP \fB\-row \fIn\fR . 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 content is arranged on the same row as the previous content specified on this call to \fBgrid\fR, or the next row after the highest occupied row if this is the first content. .TP \fB\-rowspan \fIn\fR . 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 \fB^\fR characters instead of \fIcontent\fR that line up with the columns of this \fIcontent\fR, then the \fBrowspan\fR of this \fIcontent\fR is extended by one. .TP \fB\-sticky \fIstyle\fR . If a content's cell is larger than its requested dimensions, this 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 \fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR. |
︙ | ︙ | |||
203 204 205 206 207 208 209 | .QW "" , which causes the content to be centered in its cavity, at its requested size. .LP If any of the content is already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE | < < < < < < < < < < | | < < | | | | < < < < < | | | | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | .QW "" , which causes the content to be centered in its cavity, at its requested size. .LP If any of the content is already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE .TP \fBgrid forget \fIwindow \fR?\fIwindow ...\fR? . Removes each of the \fIwindow\fRs from grid for its container and unmaps their windows. The content will no longer be managed by the grid geometry manager. The configuration options for that window are forgotten, so that if the window is managed once more by the grid geometry manager, the initial default settings are used. .RS .PP .VS "TIP 518" If the last content window of the container becomes unmanaged, this will also send the virtual event \fB<<NoManagedChild>>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE .TP \fBgrid info \fIwindow\fR . Returns a list whose elements are the current configuration state of the content given by \fIwindow\fR in the same option-value form that might be specified to \fBgrid configure\fR. The first two elements of the list are .QW "\fB\-in \fIcontainer\fR" where \fIcontainer\fR is the windows's container window. .TP \fBgrid location \fIwindow x y\fR . 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. For locations that are above or to the left of the grid, \fB\-1\fR is returned. .TP \fBgrid propagate \fIwindow\fR ?\fIboolean\fR? . If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR then propagation is enabled for \fIwindow\fR, which must be a window name (see \fBGEOMETRY PROPAGATION\fR below). If \fIboolean\fR has a false boolean value then propagation is disabled for \fIwindow\fR. In either of these cases an empty string is returned. If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIwindow\fR. Propagation is enabled by default. .TP \fBgrid rowconfigure \fIwindow index \fR?\fI\-option value...\fR? . Query or set the row properties of the \fIindex\fR row of the geometry container, \fIwindow\fR. The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR and \fB\-pad\fR. 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. Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR the options apply to all rows currently occupied by content windows. For a window name, that window must be a content window of this container and the options apply to all rows currently occupied by the container window. The \fB\-minsize\fR option sets the minimum size, in screen units, that will be permitted for this row. The \fB\-weight\fR option (an integer value) sets the relative weight for apportioning any extra spaces among rows. A weight of zero (0) indicates the row will not deviate from its requested |
︙ | ︙ | |||
303 304 305 306 307 308 309 | grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of .QW "-option value" pairs. | < | | | < | > > > > > > > > | > | | | > | > > | > | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of .QW "-option value" pairs. .TP \fBgrid remove \fIwindow \fR?\fIwindow ...\fR? . Removes each of the \fIwindow\fRs from grid for its container and unmaps their windows. The content will no longer be managed by the grid geometry manager. However, the configuration options for that window are remembered, so that if the content window is managed once more by the grid geometry manager, the previous values are retained. .RS .PP .VS "TIP 518" If the last content window of the container becomes unmanaged, this will also send the virtual event \fB<<NoManagedChild>>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE .TP \fBgrid size \fIcontainer\fR . Returns the size of the grid (in columns then rows) for \fIcontainer\fR. 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, \fB\-weight\fR, or \fB\-pad\fR that is non-zero. .TP \fBgrid content \fIwindow\fR ?\fI\-option value\fR? . If no options are supplied, a list of all of the content in \fIwindow\fR is returned, most recently managed first. \fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which causes only the content in the row (or column) specified by \fIvalue\fR to be returned. .TP \fBgrid slaves \fIwindow\fR ?\fI\-option value\fR? . Synonym for \fBgrid content \fIwindow\fR ?\fI\-option value\fR?. .SH "RELATIVE PLACEMENT" .PP The \fBgrid\fR command contains a limited set of capabilities that permit layouts to be created without specifying the row and column information for each content. This permits content to be rearranged, added, or removed without the need to explicitly specify row and column information. When no column or row information is specified for a \fIcontent\fR, default values are chosen for \fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR at the time the \fIcontent\fR is managed. The values are chosen based upon the current layout of the grid, the position of the \fIcontent\fR 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 command where \fIcontent\fR names are normally expected. .RS .TP \fB\-\fR . 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 may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIcontent\fR argument to \fBgrid configure\fR. .TP \fBx\fR . This leaves an empty column between the \fIcontent\fR on the left and the \fIcontent\fR on the right. .TP \fB^\fR . 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 columns spanned by the \fIcontent\fR above it. .RE .SH "THE GRID ALGORITHM" .PP The grid geometry manager lays out its content in three steps. 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 of the container window to become that size. In the second step, the requested size is compared against the actual size of the container. If the sizes are different, then spaces is added to or taken away from the layout as needed. For the final step, each content is positioned in its row(s) and column(s) based on the setting of its \fIsticky\fR flag. .PP To compute the minimum size of a layout, the grid geometry manager 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 \fIminsize\fR for that row or column, or the sum of the \fIpad\fRding 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 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 in order to accommodate these content, then extra space is added to each |
︙ | ︙ | |||
457 458 459 460 461 462 463 | .SH EXAMPLES .PP A toplevel window containing a text widget and two scrollbars: .PP .CS # Make the widgets toplevel .t | | | | | | | | | | | | | | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | .SH EXAMPLES .PP A toplevel window containing a text widget and two scrollbars: .PP .CS # Make the widgets toplevel .t text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set} scrollbar .t.v \-orient vertical \-command {.t.txt yview} scrollbar .t.h \-orient horizontal \-command {.t.txt xview} # Lay them out \fBgrid\fR .t.txt .t.v \-sticky nsew \fBgrid\fR .t.h \-sticky nsew # Tell the text widget to take all the extra room \fBgrid rowconfigure\fR .t .t.txt \-weight 1 \fBgrid columnconfigure\fR .t .t.txt \-weight 1 .CE .PP Three widgets of equal width, despite their different .QW natural widths: .PP .CS button .b \-text "Foo" entry .e \-textvariable foo ; set foo "Hello World!" label .l \-text "This is a fairly long piece of text" \fBgrid\fR .b .e .l \-sticky ew \fBgrid columnconfigure\fR . "all" \-uniform allTheSame .CE .SH "SEE ALSO" pack(n), place(n) .SH KEYWORDS geometry manager, location, grid, cell, propagation, size, pack '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/image.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH image n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME image \- Create and manipulate images .SH SYNOPSIS | | < < < < < < < < < < < < < < < < > | > | > | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | .TH image n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME image \- Create and manipulate images .SH SYNOPSIS \fBimage\fR \fIoption \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBimage\fR command is used to create, delete, and query images. It can take several different forms, depending on the \fIoption\fR argument. The legal forms are: .TP \fBimage create \fItype \fR?\fIname\fR? ?\fIoption value ...\fR? Creates a new image and a command with the same name and returns its name. \fItype\fR specifies the type of the image, which must be one of the types currently defined (e.g., \fBbitmap\fR). \fIname\fR specifies the name for the image; if it is omitted then Tk picks a name of the form \fBimage\fIx\fR, where \fIx\fR is an integer. There may be any number of \fIoption\fR\-\fIvalue\fR pairs, which provide configuration options for the new image. The legal set of options is defined separately for each image type; see below for details on the options for built-in image types. If an image already exists by the given name then it is replaced with the new image and any instances of that image will redisplay with the new contents. It is important to note that the image command will silently overwrite any procedure that may currently be defined by the given name, so choose the name wisely. It is recommended to use a separate namespace for image names (e.g., \fB::img::logo\fR, \fB::img::large\fR). .TP \fBimage delete \fR?\fIname name\fR ...? Deletes each of the named images and returns an empty string. If there are instances of the images displayed in widgets, the images will not actually be deleted until all of the instances are released. However, the association between the instances and the image manager will be dropped. Existing instances will retain their sizes but redisplay as empty areas. If a deleted image is recreated with another call to \fBimage create\fR, the existing instances will use the new image. .TP \fBimage height \fIname\fR Returns a decimal string giving the height of image \fIname\fR in pixels. .TP \fBimage inuse \fIname\fR Returns a boolean value indicating whether or not the image given by \fIname\fR is in use by any widgets. .TP \fBimage names\fR Returns a list containing the names of all existing images. .TP \fBimage type \fIname\fR Returns the type of image \fIname\fR (the value of the \fItype\fR argument to \fBimage create\fR when the image was created). .TP \fBimage types\fR Returns a list whose elements are all of the valid image types (i.e., all of the values that may be supplied for the \fItype\fR argument to \fBimage create\fR). .TP \fBimage width \fIname\fR Returns a decimal string giving the width of image \fIname\fR in pixels. .PP Additional operations (e.g. writing the image to a file) may be available as subcommands of the image instance command. See the manual page for the particular image type for details. .SH "BUILT-IN IMAGE TYPES" .PP The following image types are defined by Tk so they will be available in any Tk application. Individual applications or extensions may define additional types. .TP \fBbitmap\fR Each pixel in the image displays a foreground color, a background color, or nothing. See the \fBbitmap\fR manual entry for more information. .TP \fBphoto\fR Displays a variety of full-color images, using dithering to approximate colors on displays with limited color capabilities. See the \fBphoto\fR manual entry for more information. .TP \fBnsimage\fR This type is only available in the Aqua platform. It is a full-color image which may be created from a named system image. It has options designed to facilitate the use of these images in buttons. An \fBnsimage\fR can be based on an a \fItemplate image\fR, which is an anti-aliased 2-color image format that automatically interchanges black and white in response to changes between the light and dark modes on macOS. An \fBnsimage\fR can also generate an alternate |
︙ | ︙ |
Changes to doc/label.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH label n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME label \- Create and manipulate 'label' non-interactive text or image widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH label n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME label \- Create and manipulate 'label' non-interactive text or image widgets .SH SYNOPSIS \fBlabel\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady \-anchor \-foreground \-relief \-background \-highlightbackground \-takefocus \-bitmap \-highlightcolor \-text \-borderwidth \-highlightthickness \-textvariable |
︙ | ︙ | |||
76 77 78 79 80 81 82 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for label widgets: | < | < < < | | | | | | | | | | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for label widgets: .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlabel\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBlabel\fR command. .SH BINDINGS .PP When a new label is created, it has no default event bindings: labels are not intended to be interactive. .SH EXAMPLE .PP .CS # Make the widgets \fBlabel\fR .t \-text "This widget is at the top" \-bg red \fBlabel\fR .b \-text "This widget is at the bottom" \-bg green \fBlabel\fR .l \-text "Left\enHand\enSide" \fBlabel\fR .r \-text "Right\enHand\enSide" text .mid \&.mid insert end "This layout is like Java's BorderLayout" # Lay them out pack .t \-side top \-fill x pack .b \-side bottom \-fill x pack .l \-side left \-fill y pack .r \-side right \-fill y pack .mid \-expand 1 \-fill both .CE .SH "SEE ALSO" labelframe(n), button(n), ttk::label(n) .SH KEYWORDS label, widget '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/labelframe.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH labelframe n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME labelframe \- Create and manipulate 'labelframe' labelled container widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH labelframe n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME labelframe \- Create and manipulate 'labelframe' labelled container widgets .SH SYNOPSIS \fBlabelframe\fR \fIpathName\fR ?\fIoptions\fR? .SO \-borderwidth \-highlightbackground \-pady \-cursor \-highlightcolor \-relief \-font \-highlightthickness \-takefocus \-foreground \-padx \-text .SE .SH "WIDGET-SPECIFIC OPTIONS" |
︙ | ︙ | |||
43 44 45 46 47 48 49 | If the \fB\-colormap\fR option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the \fBconfigure\fR widget command. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. | | | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | If the \fB\-colormap\fR option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the \fBconfigure\fR widget command. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. If this option is negative or zero then the window will not request any size at all. .OP \-labelanchor labelAnchor LabelAnchor Specifies where to place the label. A label is only displayed if the \fB\-text\fR option is not the empty string. Valid values for this option are (listing them clockwise) \fBnw\fR, \fBn\fR, \fBne\fR, \fBen\fR, \fBe\fR, \fBes\fR, \fBse\fR, \fBs\fR,\fBsw\fR, \fBws\fR, \fBw\fR and \fBwn\fR. |
︙ | ︙ | |||
67 68 69 70 71 72 73 | If this option is not specified, the new window will use the same visual as its parent. The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. | | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | If this option is not specified, the new window will use the same visual as its parent. The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. If this option is negative or zero then the window will not request any size at all. .BE .SH DESCRIPTION .PP The \fBlabelframe\fR command creates a new window (given by the \fIpathName\fR argument) and makes it into a labelframe widget. Additional |
︙ | ︙ | |||
97 98 99 100 101 102 103 | .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIPathName\fR is the name of the command, which is the same as the labelframe widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for frame widgets: | < | < < < | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIPathName\fR is the name of the command, which is the same as the labelframe widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for frame widgets: .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlabelframe\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If |
︙ | ︙ | |||
132 133 134 135 136 137 138 | .SH EXAMPLE .PP This shows how to build part of a GUI for a hamburger vendor. The \fBlabelframe\fR widgets are used to organize the available choices by the kinds of things that the choices are being made over. .PP .CS | | | | | | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | .SH EXAMPLE .PP This shows how to build part of a GUI for a hamburger vendor. The \fBlabelframe\fR widgets are used to organize the available choices by the kinds of things that the choices are being made over. .PP .CS grid [\fBlabelframe\fR .burger \-text "Burger"] \e [\fBlabelframe\fR .bun \-text "Bun"] \-sticky news grid [\fBlabelframe\fR .cheese \-text "Cheese Option"] \e [\fBlabelframe\fR .pickle \-text "Pickle Option"] \-sticky news foreach {type name val} { burger Beef beef burger Lamb lamb burger Vegetarian beans bun Plain white bun Sesame seeds |
︙ | ︙ | |||
157 158 159 160 161 162 163 | cheese "Monterey Jack" jack pickle None none pickle Gherkins gherkins pickle Onions onion pickle Chili chili } { | | | | | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | cheese "Monterey Jack" jack pickle None none pickle Gherkins gherkins pickle Onions onion pickle Chili chili } { set w [radiobutton .$type.$val \-text $name \-anchor w \e \-variable $type \-value $val] pack $w \-side top \-fill x } set burger beef set bun white set cheese none set pickle none .CE .SH "SEE ALSO" frame(n), label(n), ttk::labelframe(n) .SH KEYWORDS labelframe, widget '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/listbox.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH listbox n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME listbox \- Create and manipulate 'listbox' item list widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH listbox n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME listbox \- Create and manipulate 'listbox' item list widgets .SH SYNOPSIS \fBlistbox\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-disabledforeground \-exportselection \-font \-foreground \-highlightbackground \-highlightcolor \-highlightthickness \-justify \-relief \-selectbackground \-selectborderwidth \-selectforeground \-setgrid \-takefocus \-xscrollcommand |
︙ | ︙ | |||
91 92 93 94 95 96 97 | They also support scanning, as described below. .SH "INDICES" .PP Many of the widget commands for listboxes take one or more indices as arguments. An index specifies a particular element of the listbox, in any of the following ways: | > | > > | > > | > > | > > | | < | < | < | < < < < < < < < < < < < < < | | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | They also support scanning, as described below. .SH "INDICES" .PP Many of the widget commands for listboxes take one or more indices as arguments. An index specifies a particular element of the listbox, in any of the following ways: .TP 12 \fInumber\fR . Specifies the element as a numerical index, where 0 corresponds to the first element in the listbox. .TP 12 \fBactive\fR . Indicates the element that has the location cursor. This element will be displayed as specified by \fB\-activestyle\fR when the listbox has the keyboard focus, and it is specified with the \fBactivate\fR widget command. .TP 12 \fBanchor\fR . Indicates the anchor point for the selection, which is set with the \fBselection anchor\fR widget command. .TP 12 \fBend\fR . Indicates the end of the listbox. For most commands this refers to the last element in the listbox, but for a few commands such as \fBindex\fR and \fBinsert\fR it refers to the element just after the last one. .TP 12 \fB@\fIx\fB,\fIy\fR Indicates the element that covers the point in the listbox window specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no element covers that point, then the closest element to that point is used. .LP Indexes support the same simple interpretation as for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. In the widget command descriptions below, arguments named \fIindex\fR, \fIfirst\fR, and \fIlast\fR always contain text indices in one of the above forms. .SH "WIDGET COMMAND" .PP The \fBlistbox\fR command creates a new Tcl command whose name is \fIpathName\fR. This command may be used to invoke various operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for listbox widgets: .TP \fIpathName \fBactivate\fR \fIindex\fR . Sets the active element to the one indicated by \fIindex\fR. If \fIindex\fR is outside the range of elements in the listbox then the closest element is activated. The active element is drawn as specified by \fB\-activestyle\fR when the widget has the input focus, and its index may be retrieved with the index \fBactive\fR. .TP \fIpathName \fBbbox\fR \fIindex\fR . Returns a list of four numbers describing the bounding box of the text in the element given by \fIindex\fR. The first two elements of the list give the x and y coordinates of the upper-left corner of the screen area covered by the text (specified in pixels relative to the widget) and the last two elements give the width and height of the area, in pixels. If no part of the element given by \fIindex\fR is visible on the screen, or if \fIindex\fR refers to a non-existent element, then the result is an empty string; if the element is partially visible, the result gives the full area of the element, including any parts that are not visible. .TP \fIpathName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlistbox\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBlistbox\fR command. .TP \fIpathName \fBcurselection\fR . Returns a list containing the numerical indices of all of the elements in the listbox that are currently selected. If there are no elements selected in the listbox then an empty string is returned. .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? . Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR are indices specifying the first and last elements in the range to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR, i.e. a single element is deleted. .TP \fIpathName \fBget \fIfirst\fR ?\fIlast\fR? . If \fIlast\fR is omitted, returns the contents of the listbox element indicated by \fIfirst\fR, or an empty string if \fIfirst\fR refers to a non-existent element. If \fIlast\fR is specified, the command returns a list whose elements are all of the listbox elements between \fIfirst\fR and \fIlast\fR, inclusive. Both \fIfirst\fR and \fIlast\fR may have any of the standard forms for indices. .TP \fIpathName \fBindex \fIindex\fR . Returns the integer index value that corresponds to \fIindex\fR. If \fIindex\fR is \fBend\fR the return value is a count of the number of elements in the listbox (not the index of the last element). .TP \fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR? . Inserts zero or more new elements in the list just before the element given by \fIindex\fR. If \fIindex\fR is specified as \fBend\fR then the new elements are added to the end of the list. Returns an empty string. .TP \fIpathName \fBitemcget \fIindex option\fR . Returns the current value of the item configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBitemconfigure\fR command. .TP \fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . Query or modify the configuration options of an item in the listbox. If no \fIoption\fR is specified, returns a list describing all of the available options for the item (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. The following options are currently supported for items: .RS .TP \fB\-background \fIcolor\fR . \fIColor\fR specifies the background color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-foreground \fIcolor\fR . \fIColor\fR specifies the foreground color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-selectbackground \fIcolor\fR . \fIcolor\fR specifies the background color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-selectforeground \fIcolor\fR . \fIcolor\fR specifies the foreground color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. .RE .TP \fIpathName \fBnearest \fIy\fR . Given a y-coordinate within the listbox window, this command returns the index of the (visible) listbox element nearest to that y-coordinate. .TP \fIpathName \fBscan\fR \fIoption args\fR . This command is used to implement scanning on listboxes. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx y\fR . |
︙ | ︙ | |||
306 307 308 309 310 311 312 | \fBscan mark\fR command for the widget. It then adjusts the view by 10 times the difference in coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the list at high speed through the window. The return value is an empty string. .RE | < < | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | \fBscan mark\fR command for the widget. It then adjusts the view by 10 times the difference in coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the list at high speed through the window. The return value is an empty string. .RE .TP \fIpathName \fBsee \fIindex\fR . Adjust the view in the listbox so that the element given by \fIindex\fR is visible. If the element is already visible then the command has no effect; if the element is near one edge of the window then the listbox scrolls to bring the element into view at the edge; otherwise the listbox scrolls to center the element. .TP \fIpathName \fBselection \fIoption arg\fR . This command is used to adjust the selection within a listbox. It has several forms, depending on \fIoption\fR: .RS .TP |
︙ | ︙ | |||
352 353 354 355 356 357 358 | .TP \fIpathName \fBselection set \fIfirst \fR?\fIlast\fR? . Selects all of the elements in the range between \fIfirst\fR and \fIlast\fR, inclusive, without affecting the selection state of elements outside that range. .RE | < < | 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | .TP \fIpathName \fBselection set \fIfirst \fR?\fIlast\fR? . Selects all of the elements in the range between \fIfirst\fR and \fIlast\fR, inclusive, without affecting the selection state of elements outside that range. .RE .TP \fIpathName \fBsize\fR . Returns a decimal string indicating the total number of elements in the listbox. .TP \fIpathName \fBxview \fR?\fIargs\fR . This command is used to query and change the horizontal position of the information in the widget's window. It can take any of the following forms: .RS |
︙ | ︙ | |||
407 408 409 410 411 412 413 | 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. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by \fInumber\fR character units (the width of the \fB0\fR character) on the display. .RE | < < | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | 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. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by \fInumber\fR character units (the width of the \fB0\fR character) on the display. .RE .TP \fIpathName \fByview \fR?\fIargs\fR? . This command is used to query and change the vertical position of the text in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fByview\fR Returns a list containing two elements, both of which are real fractions between 0 and 1. The first element gives the position of the listbox element at the top of the window, relative to the listbox as a whole (0.5 means it is halfway through the listbox, for example). The second element gives the position of the listbox element just after the last one in the window, relative to the listbox as a whole. |
︙ | ︙ |
Changes to doc/loadTk.n.
1 2 3 4 5 6 7 8 9 10 11 12 13 | '\" '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH "Safe Tk" n 8.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME safe::loadTk \- Load Tk into a safe interpreter. .SH SYNOPSIS | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | '\" '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH "Safe Tk" n 8.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME safe::loadTk \- Load Tk into a safe interpreter. .SH SYNOPSIS \fBsafe::loadTk \fIchild\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? .BE .SH DESCRIPTION .PP Safe Tk is based on Safe Tcl, which provides a mechanism that allows restricted and mediated access to auto-loading and packages for safe interpreters. Safe Tk adds the ability to configure the interpreter for safe Tk operations and load Tk into safe interpreters. .PP The \fBsafe::loadTk\fR command initializes the required data structures in the named safe interpreter and then loads Tk into it. The interpreter must have been created with \fBsafe::interpCreate\fR or have been initialized with \fBsafe::interpInit\fR. The command returns the name of the safe interpreter. If \fB\-use\fR is specified, the window identified by the specified system dependent identifier \fIwindowId\fR is used to contain the .QW . window of the safe interpreter; it can be any valid id, eventually referencing a window belonging to another application. As a convenience, if the window you plan to use is a Tk Window of the application you can use the window name (e.g., .QW \fB.x.y\fR ) instead of its window Id (e.g., from \fBwinfo id\fR \fB.x.y\fR). When \fB\-use\fR is not specified, a new toplevel window is created for the .QW . window of the safe interpreter. On X11 if you want the embedded window to use another display than the default one, specify it with \fB\-display\fR. See the \fBSECURITY ISSUES\fR section below for implementation details. .SH "SECURITY ISSUES" .PP Please read the \fBsafe\fR manual page for Tcl to learn about the basic security considerations for Safe Tcl. .PP \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 auto-loading will work in the safe interpreter. .PP Tk initialization is now safe with respect to not trusting the child's state 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 parent's \fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent (\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.) .PP When \fB\-use\fR is not used, the new toplevel created is specially decorated so the user is always aware that the user interface presented comes from a potentially unsafe code and can easily delete the corresponding interpreter. .PP On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely to generate a fatal X error. |
︙ | ︙ |
Changes to doc/menu.n.
︙ | ︙ | |||
9 10 11 12 13 14 15 | .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME menu, tk_menuSetFocus \- Create and manipulate 'menu' widgets and menubars .SH SYNOPSIS .nf | | | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME menu, tk_menuSetFocus \- Create and manipulate 'menu' widgets and menubars .SH SYNOPSIS .nf \fBmenu\fR \fIpathName \fR?\fIoptions\fR? \fBtk_menuSetFocus\fR \fIpathName\fR .SO \-activebackground \-borderwidth \-foreground \-activeborderwidth \-cursor \-relief \-activeforeground \-disabledforeground \-takefocus \-background \-font \-activerelief .SE .SH "WIDGET-SPECIFIC OPTIONS" |
︙ | ︙ | |||
309 310 311 312 313 314 315 | \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. .PP Many of the widget commands for a menu take as one argument an indicator of which entry of the menu to operate on. These indicators are called \fIindex\fRes and may be specified in any of the following forms: | > | > > | > > | > > | > > > > > > > | > > | > > | > > | > < | < < < < < < < < < | < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 | \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. .PP Many of the widget commands for a menu take as one argument an indicator of which entry of the menu to operate on. These indicators are called \fIindex\fRes and may be specified in any of the following forms: .TP 12 \fBactive\fR . Indicates the entry that is currently active. If no entry is active then this form is equivalent to \fB{}\fR. This form may not be abbreviated. .TP 12 \fBend\fR . Indicates the bottommost entry in the menu. If there are no entries in the menu then this form is equivalent to \fB{}\fR. This form may not be abbreviated. .TP 12 \fBlast\fR . Same as \fBend\fR. .TP 12 \fB{}\fR . Indicates .QW "no entry at all" ; this is used most commonly with the \fBactivate\fR option to deactivate all the entries in the menu. In most cases the specification of \fB{}\fR causes nothing to happen in the widget command. .TP 12 \fBnone\fR . Same as \fB{}\fR This form is deprecated and may not be abbreviated. .TP 12 \fB@\fIx\fB,\fIy\fR . Indicates the entry that covers the point in the menu's window specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no entry covers that point, then this form is equivalent to \fB{}\fR. If only a single number is specified, it is treated as the y-coordinate. .TP 12 \fInumber\fR . Specifies the entry numerically, where 0 corresponds to the top-most entry of the menu, 1 to the entry below it, and so on. .TP 12 \fIid\fR . If the index does not satisfy one of the above forms then the menu is searched for an entry with the specified id. .TP 12 \fIpattern\fR . If all of the above methods for finding an entry fail, this form is used. \fIPattern\fR is pattern-matched against the label of each entry in the menu, in order from the top down, until a matching entry is found. The rules of \fBstring match\fR are used. .PP If the index could match more than one of the above forms, then the form earlier in the above list takes precedence. Indexes support the same simple interpretation as for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. .PP The following widget commands are possible for menu widgets: .TP \fIpathName \fBactivate \fIindex\fR . Change the state of the entry indicated by \fIindex\fR to \fBactive\fR and redisplay it using its active colors. Any previously-active entry is deactivated. If \fIindex\fR is specified as \fB{}\fR or \fBnone\fR, or if the specified entry is disabled, then the menu ends up with no active entry. Returns an empty string. .TP \fIpathName \fBadd \fItype \fR?\fIid\fR? ?\fIoption value option value ...\fR? . Add a new entry to the bottom of the menu. The new entry's type is given by \fItype\fR and must be one of \fBcascade\fR, \fBcheckbutton\fR, \fBcommand\fR, \fBradiobutton\fR, or \fBseparator\fR, or a unique abbreviation of one of the above. If the \fIid\fR argument is specified, it is used as the entry identifier; \fIid\fR must not already exist in the menu. Otherwise, a new unique identifier is generated. If additional arguments are present, they specify the options listed in the \fBMENU ENTRY OPTIONS\fR section below. The \fBadd\fR widget command returns the id of the new entry. .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmenu\fR command. .TP \fIpathName \fBclone \fInewPathname\fR ?\fIcloneType\fR? . Makes a clone of the current menu named \fInewPathName\fR. This clone is a menu in its own right, but any changes to the clone are propagated to the original menu and vice versa. \fIcloneType\fR can be \fBnormal\fR, \fBmenubar\fR, or \fBtearoff\fR. Should not normally be called outside of the Tk library. See the \fBCLONES\fR section for more information. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBmenu\fR command. .TP \fIpathName \fBdelete \fIindex1\fR ?\fIindex2\fR? . Delete all of the menu entries between \fIindex1\fR and \fIindex2\fR inclusive. If \fIindex2\fR is omitted then it defaults to \fIindex1\fR. Attempts to delete a tear-off menu entry are ignored (instead, you should change the \fB\-tearoff\fR option to remove the tear-off entry). .TP \fIpathName \fBentrycget \fIindex option\fR . Returns the current value of a configuration option for the entry given by \fIindex\fR. \fIOption\fR may have any of the names described in the \fBMENU ENTRY OPTIONS\fR section below. .TP \fIpathName \fBentryconfigure \fIindex \fR?\fIoptions...\fR? . This command is similar to the \fBconfigure\fR command, except that it applies to the options for an individual entry, whereas \fBconfigure\fR applies to the options for the menu as a whole. \fIOptions\fR may have any of the values described in the \fBMENU ENTRY OPTIONS\fR section below. If \fIoptions\fR are specified, options are modified as indicated in the command and the command returns an empty string. If no \fIoptions\fR are specified, returns a list describing the current options for entry \fIindex\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). .TP \fIpathName \fBid \fIindex\fR . Returns the id of the menu entry given by \fIindex\fR. This is the identifier that was assigned to the entry when it was created using the \fBadd\fR or \fBinsert\fR widget command. Returns an empty string for the tear-off entry, or if \fIindex\fR is equivalent to \fB{}\fR. .TP \fIpathName \fBindex \fIindex\fR . Returns the numerical index corresponding to \fIindex\fR, or \fB{}\fR if \fIindex\fR was specified as \fB{}\fR or \fBnone\fR. .TP \fIpathName \fBinsert \fIindex type \fR?\fIid\fR? ?\fIoption value option value ...\fR? . Same as the \fBadd\fR widget command except that it inserts the new entry just before the entry given by \fIindex\fR, instead of appending to the end of the menu. The \fItype\fR, \fIid\fR, \fIoption\fR, and \fIvalue\fR arguments have the same interpretation as for the \fBadd\fR widget command. It is not possible to insert new menu entries before the tear-off entry, if the menu has one. The \fBinsert\fR widget command returns the id of the new entry. .TP \fIpathName \fBinvoke \fIindex\fR . Invoke the action of the menu entry. See the sections on the individual entries above for details on what happens. If the menu entry is disabled then nothing happens. If the entry has a command associated with it then the result of that command is returned as the result of the \fBinvoke\fR widget command. Otherwise the result is an empty string. Note: invoking a menu entry does not automatically unpost the menu; the default bindings normally take care of this before invoking the \fBinvoke\fR widget command. .TP \fIpathName \fBpost \fIx y\fR ?\fIindex\fR? . Arrange for the menu to be displayed on the screen at the root-window coordinates given by \fIx\fR and \fIy\fR. If an index is specified the menu will be located so that the entry with that index is displayed at the point. These coordinates are adjusted if necessary to guarantee that the entire menu is visible on the screen. This command normally returns an empty string. If the \fB\-postcommand\fR option has been specified, then its value is executed as a Tcl script before posting the menu and the result of that script is returned as the result of the \fBpost\fR widget command. If an error returns while executing the command, then the error is returned without posting the menu. .TP \fIpathName \fBpostcascade \fIindex\fR . Posts the submenu associated with the cascade entry given by \fIindex\fR, and unposts any previously posted submenu. If \fIindex\fR does not correspond to a cascade entry, or if \fIpathName\fR is not posted, the command has no effect except to unpost any currently posted submenu. .TP \fIpathName \fBtype \fIindex\fR . Returns the type of the menu entry given by \fIindex\fR. This is the \fItype\fR argument passed to the \fBadd\fR or \fBinsert\fR widget command when the entry was created, such as \fBcommand\fR or \fBseparator\fR, or \fBtearoff\fR for a tear-off entry. .TP \fIpathName \fBunpost\fR . Unmap the window so that it is no longer displayed. If a lower-level cascaded menu is posted, unpost that menu. Returns an empty string. This subcommand does not work on Windows and the Macintosh, as those platforms have their own way of unposting menus. .TP \fIpathName \fBxposition \fIindex\fR . Returns a decimal string giving the x-coordinate within the menu window of the leftmost pixel in the entry specified by \fIindex\fR. .TP \fIpathName \fByposition \fIindex\fR . Returns a decimal string giving the y-coordinate within the menu window of the topmost pixel in the entry specified by \fIindex\fR. .SH "MENU ENTRY OPTIONS" The following options are allowed on menu entries. Most options are not supported by all entry types. .TP \fB\-activebackground \fIvalue\fR . Specifies a background color to use for displaying this entry when it is active. This option is ignored on Aqua/MacOS. If it is specified as an empty string (the default), then the \fB\-activebackground\fR option for the overall menu is used. If the \fBtk_strictMotif\fR variable has been set to request strict Motif compliance, then this option is ignored and the \fB\-background\fR option is used in its place. This option is not available for separator or tear-off entries. .TP \fB\-activeforeground \fIvalue\fR . Specifies a foreground color to use for displaying this entry when it is active. This option is ignored on Aqua/macOS. If this option is specified as an empty string (the default), then the \fB\-activeforeground\fR option for the overall menu is used. This option is not available for separator or tear-off entries. .TP \fB\-accelerator \fIvalue\fR . Specifies a string to display at the right side of the menu entry. Normally describes an accelerator keystroke sequence that may be used to invoke the same function as 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). This option is not available for separator or tear-off entries. .TP \fB\-background \fIvalue\fR . Specifies a background color to use for displaying this entry when it is in the normal state (neither active nor disabled). 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. This option is not available for separator or tear-off entries. .TP \fB\-bitmap \fIvalue\fR . Specifies a bitmap to display in the menu instead of a textual label, in any of the forms accepted by \fBTk_GetBitmap\fR. This option overrides the \fB\-label\fR option (as controlled by the \fB\-compound\fR option) but may be reset to an empty string to enable a textual label to be displayed. If a \fB\-image\fR option has been specified, it overrides \fB\-bitmap\fR. This option is not available for separator or tear-off entries. .TP \fB\-columnbreak \fIvalue\fR . 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 menu. This option is ignored on Aqua/macOS, where menus are always a single column. .TP \fB\-command \fIvalue\fR . Specifies a Tcl command to execute when the menu entry is invoked. Not available for separator or tear-off entries. .TP \fB\-compound \fIvalue\fR . Specifies whether the menu entry should display both an image and text, and if so, where the image should be placed relative to the text. Valid values for this option are \fBbottom\fR, \fBcenter\fR, \fBleft\fR, \fBnone\fR, \fBright\fR and \fBtop\fR. The default value is \fBnone\fR, meaning that the button will display either an image or text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR options. .TP \fB\-font \fIvalue\fR . Specifies the font to use when drawing the label or accelerator string in this entry. If this option is specified as an empty string (the default) then the \fB\-font\fR option for the overall menu is used. This option is not available for separator or tear-off entries. .TP \fB\-foreground \fIvalue\fR . Specifies a foreground color to use for displaying this entry when it is in the normal state (neither active nor disabled). 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. This option is not available for separator or tear-off entries. .TP \fB\-hidemargin \fIvalue\fR . Specifies whether the standard margins should be drawn for this menu entry. This is useful when creating palette with images in them, i.e., color palettes, pattern palettes, etc. 1 indicates that the margin for the entry is hidden; 0 means that the margin is used. .TP \fB\-image \fIvalue\fR . Specifies an image to display in the menu instead of a text string or bitmap. The image must have been created by some previous invocation of \fBimage create\fR. This option overrides the \fB\-label\fR and \fB\-bitmap\fR options (as controlled by the \fB\-compound\fR option) but may be reset to an empty string to enable a textual or bitmap label to be displayed. This option is not available for separator or tear-off entries. .TP \fB\-indicatoron \fIvalue\fR . Available only for checkbutton and radiobutton entries. \fIValue\fR is a boolean that determines whether or not the indicator should be displayed. .TP \fB\-label \fIvalue\fR . Specifies a string to display as an identifying label in the menu entry. Not available for separator or tear-off entries. .TP \fB\-menu \fIvalue\fR . Available only for cascade entries. Specifies the path name of the submenu associated with this entry. The submenu must be a child of the menu. .TP \fB\-offvalue \fIvalue\fR . Available only for checkbutton entries. Specifies the value to store in the entry's associated variable when the entry is deselected. .TP \fB\-onvalue \fIvalue\fR . Available only for checkbutton entries. Specifies the value to store in the entry's associated variable when the entry is selected. .TP \fB\-selectcolor \fIvalue\fR . Available only for checkbutton and radiobutton entries. Specifies the color to display in the indicator when the entry is selected. If the value is an empty string (the default) then the \fB\-selectcolor\fR option for the menu determines the indicator color. .TP \fB\-selectimage \fIvalue\fR . Available only for checkbutton and radiobutton entries. Specifies an image to display in the entry (in place of the \fB\-image\fR option) when it is selected. \fIValue\fR is the name of an image, which must have been created by some previous invocation of \fBimage create\fR. This option is ignored unless the \fB\-image\fR option has been specified. .TP \fB\-state \fIvalue\fR . Specifies one of three states for the entry: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the entry is displayed using the \fB\-foreground\fR option for the menu and the \fB\-background\fR option from the entry or the menu. The active state is typically used when the pointer is over the entry. In active state the entry is displayed using the \fB\-activeforeground\fR option for the menu along with the \fB\-activebackground\fR option from the entry. Disabled state means that the entry should be insensitive: the default bindings will refuse to activate or invoke the entry. In this state the entry is displayed according to the \fB\-disabledforeground\fR option for the menu and the \fB\-background\fR option from the entry. This option is not available for separator entries. .TP \fB\-underline \fIvalue\fR . Specifies the integer index of a character to underline in the entry. This option is also queried by the default bindings and used to implement keyboard traversal. 0 corresponds to the first character of the text displayed in the entry, 1 to the next character, and so on. If a bitmap or image is displayed in the entry then this option is ignored. This option is not available for separator or tear-off entries. .TP \fB\-value \fIvalue\fR . Available only for radiobutton entries. Specifies the value to store in the entry's associated variable when the entry is selected. If an empty string is specified, then the \fB\-label\fR option for the entry as the value to store in the variable. .TP \fB\-variable \fIvalue\fR . Available only for checkbutton and radiobutton entries. Specifies the name of a global variable to set when the entry is selected. For checkbutton entries the variable is also set when the entry is deselected. For radiobutton entries, changing the variable |
︙ | ︙ |
Changes to doc/menubutton.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH menubutton n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME menubutton \- Create and manipulate 'menubutton' pop-up menu indicator widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH menubutton n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME menubutton \- Create and manipulate 'menubutton' pop-up menu indicator widgets .SH SYNOPSIS \fBmenubutton\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady \-anchor \-foreground \-relief \-background \-highlightbackground \-takefocus \-bitmap \-highlightcolor \-text \-borderwidth \-highlightthickness \-textvariable |
︙ | ︙ | |||
118 119 120 121 122 123 124 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for menubutton widgets: | < < | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for menubutton widgets: .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmenubutton\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified |
︙ | ︙ |
Changes to doc/message.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH message n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME message \- Create and manipulate 'message' non-interactive text widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH message n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME message \- Create and manipulate 'message' non-interactive text widgets .SH SYNOPSIS \fBmessage\fR \fIpathName \fR?\fIoptions\fR? .SO \-anchor \-background \-borderwidth \-cursor \-font \-foreground \-highlightbackground \-highlightcolor \-highlightthickness \-padx \-pady \-relief \-takefocus \-text \-textvariable .SE |
︙ | ︙ | |||
53 54 55 56 57 58 59 | in the vertical span of the window. .OP \-width width Width Specifies the length of lines in the window. The value may have any of the forms acceptable to \fBTk_GetPixels\fR. If this option has a value greater than zero then the \fB\-aspect\fR option is ignored and the \fB\-width\fR option determines the line length. | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | in the vertical span of the window. .OP \-width width Width Specifies the length of lines in the window. The value may have any of the forms acceptable to \fBTk_GetPixels\fR. If this option has a value greater than zero then the \fB\-aspect\fR option is ignored and the \fB\-width\fR option determines the line length. If this option value is negative or zero, then the \fB\-aspect\fR option determines the line length. .BE .SH DESCRIPTION .PP The \fBmessage\fR command creates a new window (given by the \fIpathName\fR argument) and makes it into a message widget. Additional |
︙ | ︙ | |||
107 108 109 110 111 112 113 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for message widgets: | < < | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for message widgets: .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmessage\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified |
︙ | ︙ |
Changes to doc/messageBox.n.
︙ | ︙ | |||
19 20 21 22 23 24 25 | application-specified message, an icon and a set of buttons. Each of the buttons in the message window is identified by a unique symbolic name (see the \fB\-type\fR options). After the message window is popped up, \fBtk_messageBox\fR waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. .PP The following option-value pairs are supported: | < | < < | < | < | < | < | < | < | > | > > | > > | > > | > > | > > | > | | | | | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | application-specified message, an icon and a set of buttons. Each of the buttons in the message window is identified by a unique symbolic name (see the \fB\-type\fR options). After the message window is popped up, \fBtk_messageBox\fR waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. .PP The following option-value pairs are supported: .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 . \fIName\fR gives the symbolic name of the default button for this message window ( .QW ok , .QW cancel , and so on). See \fB\-type\fR for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default. .TP \fB\-detail\fR \fIstring\fR . Specifies an auxiliary message to the main message given by the \fB\-message\fR option. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message. .TP \fB\-icon\fR \fIiconImage\fR . Specifies an icon to display. \fIIconImage\fR must be one of the following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or \fBwarning\fR. If this option is not specified, then the info icon will be displayed. .TP \fB\-message\fR \fIstring\fR . Specifies the message to display in this message box. The default value is an empty string. .TP \fB\-parent\fR \fIwindow\fR . Makes \fIwindow\fR the logical parent of the message box. The message box is displayed on top of its parent window. .TP \fB\-title\fR \fItitleString\fR . Specifies a string to display as the title of the message box. The default value is an empty string. .TP \fB\-type\fR \fIpredefinedType\fR . Arranges for a predefined set of buttons to be displayed. The following values are possible for \fIpredefinedType\fR: .RS .TP 18 \fBabortretryignore\fR . Displays three buttons whose symbolic names are \fBabort\fR, \fBretry\fR and \fBignore\fR. .TP 18 \fBok\fR . Displays one button whose symbolic name is \fBok\fR. .TP 18 \fBokcancel\fR . Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR. .TP 18 \fBretrycancel\fR . Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR. .TP 18 \fByesno\fR . Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR. .TP 18 \fByesnocancel\fR . Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR and \fBcancel\fR. .RE .PP .SH EXAMPLE .PP .CS set answer [\fBtk_messageBox\fR \-message "Really quit?" \e \-icon question \-type yesno \e \-detail "Select \e"Yes\e" to make the application exit"] switch \-\- $answer { yes exit no {\fBtk_messageBox\fR \-message "I know you like this application!" \e \-type ok} } .CE .SH KEYWORDS message box '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/nsimage.n.
︙ | ︙ | |||
22 23 24 25 26 27 28 | \fBimage create nsimage \fR?\fIname\fR? ?\fIoption value ...\fR? .PP creates a new nsimage and a command with the same name and returns its name. .SH OPTIONS .PP Valid \fIoptions\fR are: | < | < | | | | > | | | > > | > > | > < < | < | < | < | < | | < | < | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | \fBimage create nsimage \fR?\fIname\fR? ?\fIoption value ...\fR? .PP creates a new nsimage and a command with the same name and returns its name. .SH OPTIONS .PP Valid \fIoptions\fR are: .TP \fB\-source\fR .PP The value of the \fB\-source\fR option is a string describing an NSimage. There are several ways to interpret this string, and the interpretation is determined by the value of the \fB\-as\fR option. This option is required. .PP .TP \fB\-as\fR .PP There are four possible values for the \fB-as\fR option which specify how the source string should be interpreted. The allowed values and their meanings are: .IP \fBname\fR .IP The source should be interpreted as the name of a named NSImage provided by the system. This is the default if the -as option is not specified. .IP \fBfile\fR .IP The source should be interpreted as a path to an image file in one of the formats understood by the NSImage class. .IP \fBpath\fR .IP The source should be interpreted as a path to an arbitrary file. The type of the file will be examined and the resulting image will be the system icon for files of that type. .IP \fBfiletype\fR .IP The source is interpreted as a string identifying a particular file type. It may be a filename extension, an Apple Uniform Type Identifier or a 4-character OSType value as used in the HFS filesystem. .TP \fB\-width\fR .PP The value of the \fIwidth\fR option is an integer specifying the width in pixels of the nsimage. If the width is not specified it will be computed from the height so as to preserve the aspect ration. If neither width nor height are specified then the width and height of the underlying NSImage will be used. .TP \fB\-height\fR .PP The value of the \fIheight\fR option is an integer specifying the height in pixels of the nsimage. If the height is not specified it will be computed from the height so as to preserve the aspect ration. If neither width nor height are specified then the width and height of the underlying NSImage will be used. .TP \fB\-radius\fR .PP The value of the \fIradius\fR option is an integer. If non-zero the image will be clipped to a rounded rectangle with the same width and height as the image, but with circular arcs of the specified radius cutting off the corners of the rectangle. .TP \fB\-ring\fR .PP The value of the \fIring\fR option is an integer. If non-zero then it specifies the thickness of a focus ring which will be drawn around the image using the control accent color specified in the System Preferences. The image is resized to reduce its width and height by twice the thickness of the ring. Note that this may create a small amount of distortion. The aspect ration of a non-square image will change slightly. .TP \fB\-alpha\fR .PP The value of the \fIalpha\fR option should be a floating point number between 0.0 and 1.0. This alpha value will be applied to each pixel of the nsimage, producing a partially transparent image. The default value is 1,0, which makes the image opaque. .TP \fB\-pressed\fR .PP The \fIpressed\fR option takes a boolean value. If the value is true or 1 then the image will be algorithmically modified to become darker in light mode or lighter in dark mode. The default is false. For an image button, the primary image should use the value false while the pressed image should be the same image but with the \fIpressed\fR option set to true. .TP \fB\-template\fR .PP The \fItemplate\fR option takes a boolean value. If the value is true or 1 then the image will be marked as being a template image. This means that the system will algorithmically convert the image to a light colored image when in dark mode. For the algorithm to work correctly the image must consist only of black pixels with alpha values. |
︙ | ︙ |
Changes to doc/option.n.
︙ | ︙ | |||
18 19 20 21 22 23 24 | \fBoption get \fIwindow name class\fR \fBoption readfile \fIfileName \fR?\fIpriority\fR? .fi .BE .SH DESCRIPTION .PP The \fBoption\fR command allows you to add entries to the Tk option | | < | < < < > | > | > | > | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | \fBoption get \fIwindow name class\fR \fBoption readfile \fIfileName \fR?\fIpriority\fR? .fi .BE .SH DESCRIPTION .PP The \fBoption\fR command allows you to add entries to the Tk option database or to retrieve options from the database. The \fBadd\fR form of the command adds a new option to the database. \fIPattern\fR contains the option being specified, and consists of names and/or classes separated by asterisks or dots, in the usual X format (see \fBPATTERN FORMAT\fR). \fIValue\fR contains a text string to associate with \fIpattern\fR; this is the value that will be returned in calls to \fBTk_GetOption\fR or by invocations of the \fBoption get\fR command. If \fIpriority\fR is specified, it indicates the priority level for this option (see below for legal values); it defaults to \fBinteractive\fR. This command always returns an empty string. .PP The \fBoption clear\fR command clears the option database. Default options (from the \fBRESOURCE_MANAGER\fR property or the \fB.Xdefaults\fR file) will be reloaded automatically the next time an option is added to the database or removed from it. This command always returns an empty string. .PP The \fBoption get\fR command returns the value of the option specified for \fIwindow\fR under \fIname\fR and \fIclass\fR. If several entries in the option database match \fIwindow\fR, \fIname\fR, and \fIclass\fR, then the command returns whichever was created with highest \fIpriority\fR level. If there are several matching entries at the same priority level, then it returns whichever entry was most recently entered into the option database. If there are no matching entries, then the empty string is returned. .PP The \fBreadfile\fR form of the command reads \fIfileName\fR, which should have the standard format for an X resource database such as \fB.Xdefaults\fR, and adds all the options specified in that file to the option database. If \fIpriority\fR is specified, it indicates the priority level at which to enter the options; \fIpriority\fR defaults to \fBinteractive\fR. .PP The file is read through a channel which is in "utf-8" encoding, invalid byte sequences are automatically converted to valid ones. This means that encodings like ISO 8859-1 or cp1252 with high probability will work as well, but this cannot be guaranteed. This cannot be changed, setting the [encoding system] has no effect. .PP The \fIpriority\fR arguments to the \fBoption\fR command are normally specified symbolically using one of the following values: .TP \fBwidgetDefault\fR Level 20. Used for default values hard-coded into widgets. .TP \fBstartupFile\fR Level 40. Used for options specified in application-specific startup files. .TP \fBuserDefault\fR Level 60. Used for options specified in user-specific defaults files, such as \fB.Xdefaults\fR, resource databases loaded into the X server, or user-specific startup files. .TP \fBinteractive\fR Level 80. Used for options specified interactively after the application starts running. If \fIpriority\fR is not specified, it defaults to this level. .PP Any of the above keywords may be abbreviated. In addition, priorities may be specified numerically using integers between 0 and 100, inclusive. The numeric form is probably a bad idea except for new priority |
︙ | ︙ |
Changes to doc/options.n.
︙ | ︙ | |||
56 57 58 59 60 61 62 | This option is typically only available in widgets displaying more than one element at a time (e.g. menus but not buttons). .OP \-activeforeground activeForeground Background Specifies foreground color to use when drawing active elements. See above for definition of active elements. .OP \-activerelief activeRelief Relief Specifies the 3-D effect desired for the active item of the widget. | | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | This option is typically only available in widgets displaying more than one element at a time (e.g. menus but not buttons). .OP \-activeforeground activeForeground Background Specifies foreground color to use when drawing active elements. See above for definition of active elements. .OP \-activerelief activeRelief Relief Specifies the 3-D effect desired for the active item of the widget. See the \fB-relief\fR option for details. .OP \-anchor anchor Anchor Specifies how the information in a widget (e.g. text or a bitmap) is to be displayed in the widget. Must be one of the values \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. For example, \fBnw\fR means display the information such that its top-left corner is at the top-left corner of the widget. |
︙ | ︙ | |||
288 289 290 291 292 293 294 | If the value has any other form, then the traversal scripts take the value, append the name of the window to it (with a separator space), and evaluate the resulting string as a Tcl script. The script must return \fB0\fR, \fB1\fR, or an empty string: a \fB0\fR or \fB1\fR value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. | | | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | If the value has any other form, then the traversal scripts take the value, append the name of the window to it (with a separator space), and evaluate the resulting string as a Tcl script. The script must return \fB0\fR, \fB1\fR, or an empty string: a \fB0\fR or \fB1\fR value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. Note: this interpretation of the option is defined entirely by the Tcl scripts that implement traversal: the widget implementations ignore the option entirely, so you can change its meaning if you redefine the keyboard traversal scripts. .OP \-text text Text Specifies a string to be displayed inside the widget. The way in which the string is displayed depends on the particular widget and may be determined by other options, such as \fB\-anchor\fR or \fB\-justify\fR. |
︙ | ︙ | |||
321 322 323 324 325 326 327 | .OP \-wraplength wrapLength WrapLength For widgets that can perform word-wrapping, this option specifies the maximum line length. Lines that would exceed this length are wrapped onto the next line, so that no line is longer than the specified length. The value may be specified in any of the standard forms for screen distances. | | | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | .OP \-wraplength wrapLength WrapLength For widgets that can perform word-wrapping, this option specifies the maximum line length. Lines that would exceed this length are wrapped onto the next line, so that no line is longer than the specified length. The value may be specified in any of the standard forms for screen distances. If this value is negative or zero then no wrapping is done: lines will break only at newline characters in the text. .OP \-xscrollcommand xScrollCommand ScrollCommand Specifies the prefix for a command used to communicate with horizontal scrollbars. When the view in the widget's window changes (or whenever anything else occurs that could change the display in a scrollbar, such as a change in the total size of the widget's |
︙ | ︙ |
Changes to doc/pack.n.
︙ | ︙ | |||
19 20 21 22 23 24 25 | The \fBpack\fR command is used to communicate with the packer, a geometry manager that arranges the children of a parent by packing them in order around the edges of the parent. The \fBpack\fR command can have any of several forms, depending on the \fIoption\fR argument: .TP \fBpack \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? | < < < < < < < < < < < < < > | > | > | > | < < < < < < < < < < < < < < < < < < < < < < | | | < < < < | > > > > > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | The \fBpack\fR command is used to communicate with the packer, a geometry manager that arranges the children of a parent by packing them in order around the edges of the parent. The \fBpack\fR command can have any of several forms, depending on the \fIoption\fR argument: .TP \fBpack \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? If the first argument to \fBpack\fR is a window name (any value starting with .QW . ), then the command is processed in the same way as \fBpack configure\fR. .TP \fBpack configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how to manage the content. See \fBTHE PACKER ALGORITHM\fR below for details on how the options are used by the packer. The following options are supported: .RS .TP \fB\-after \fIother\fR \fIOther\fR must the name of another window. Use its container as the container for the content, and insert the content just after \fIother\fR in the packing order. .TP \fB\-anchor \fIanchor\fR \fIAnchor\fR must be a valid anchor position such as \fBn\fR or \fBsw\fR; it specifies where to position each content in its parcel. Defaults to \fBcenter\fR. .TP \fB\-before \fIother\fR \fIOther\fR must the name of another window. Use its container as the container for the content, and insert the content just before \fIother\fR in the packing order. .TP \fB\-expand \fIboolean\fR Specifies whether the content should be expanded to consume extra space in their container. \fIBoolean\fR may have any proper boolean value, such as \fB1\fR or \fBno\fR. Defaults to 0. .TP \fB\-fill \fIstyle\fR If a content's parcel is larger than its requested dimensions, this option may be used to stretch the content. \fIStyle\fR must have one of the following values: .RS .TP \fBnone\fR Give the content its requested dimensions plus any internal padding requested with \fB\-ipadx\fR or \fB\-ipady\fR. This is the default. .TP \fBx\fR Stretch the content horizontally to fill the entire width of its parcel (except leave external padding as specified by \fB\-padx\fR). .TP \fBy\fR Stretch the content vertically to fill the entire height of its parcel (except leave external padding as specified by \fB\-pady\fR). .TP \fBboth\fR Stretch the content both horizontally and vertically. .RE .TP \fB\-in \fIcontainer\fR Insert the window at the end of the packing order for the container window given by \fIcontainer\fR. .TP \fB\-ipadx \fIamount\fR \fIAmount\fR specifies how much horizontal internal padding to leave on each side of the content. \fIAmount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. .TP \fB\-ipady \fIamount\fR \fIAmount\fR specifies how much vertical internal padding to leave on each side of the content. \fIAmount\fR defaults to 0. .TP \fB\-padx \fIamount\fR \fIAmount\fR specifies how much horizontal external padding to leave on each side of the content. \fIAmount\fR may be a list of two values to specify padding for left and right separately. \fIAmount\fR defaults to 0. .TP \fB\-pady \fIamount\fR \fIAmount\fR specifies how much vertical external padding to leave on each side of the content. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately. \fIAmount\fR defaults to 0. .TP \fB\-side \fIside\fR Specifies which side of the container the content will be packed against. Must be \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. Defaults to \fBtop\fR. .LP If no \fB\-in\fR, \fB\-after\fR or \fB\-before\fR option is specified 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 case it will be left where it is). If one of these options is specified then all the content will be inserted at the specified point. If any of the content are already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE .TP \fBpack forget \fIwindow \fR?\fIwindow ...\fR? Removes each of the \fIwindow\fRs from the packing order for its container and unmaps their windows. The content will no longer be managed by the packer. .RS .PP .VS "TIP 518" If the last content window of the container becomes unmanaged, this will also send the virtual event \fB<<NoManagedChild>>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE .TP \fBpack info \fIwindow\fR Returns a list whose elements are the current configuration state of the window given by \fIwindow\fR in the same option-value form that might be specified to \fBpack configure\fR. The first two elements of the list are .QW "\fB\-in \fIcontainer\fR" where \fIcontainer\fR is the window's container. .TP \fBpack propagate \fIcontainer\fR ?\fIboolean\fR? If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR then propagation is enabled for \fIcontainer\fR, which must be a window name (see \fBGEOMETRY PROPAGATION\fR below). If \fIboolean\fR has a false boolean value then propagation is disabled for \fIcontainer\fR. In either of these cases an empty string is returned. If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIcontainer\fR. Propagation is enabled by default. .TP \fBpack content \fIwindow\fR Returns a list of all of the content windows in the packing order for \fIwindow\fR. The order of the content windows in the list is the same as their order in the packing order. If \fIwindow\fR has no content then an empty string is returned. .TP \fBpack slaves \fIwindow\fR . Synonym for \fBpack content \fIwindow\fR. .SH "THE PACKER ALGORITHM" .PP For each container the packer maintains an ordered list of content |
︙ | ︙ | |||
299 300 301 302 303 304 305 | will be highest in the stacking order. Or, you can use the \fBraise\fR and \fBlower\fR commands to change the stacking order of either the container or the content. .SH EXAMPLE .PP .CS # Make the widgets | | | | | | | | | | | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | will be highest in the stacking order. Or, you can use the \fBraise\fR and \fBlower\fR commands to change the stacking order of either the container or the content. .SH EXAMPLE .PP .CS # Make the widgets label .t \-text "This widget is at the top" \-bg red label .b \-text "This widget is at the bottom" \-bg green label .l \-text "Left\enHand\enSide" label .r \-text "Right\enHand\enSide" text .mid \&.mid insert end "This layout is like Java's BorderLayout" # Lay them out \fBpack\fR .t \-side top \-fill x \fBpack\fR .b \-side bottom \-fill x \fBpack\fR .l \-side left \-fill y \fBpack\fR .r \-side right \-fill y \fBpack\fR .mid \-expand 1 \-fill both .CE .SH "SEE ALSO" grid(n), place(n) .SH KEYWORDS geometry manager, location, packer, parcel, propagation, size '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/palette.n.
1 2 3 4 5 6 7 8 9 10 11 12 13 | '\" '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk_setPalette n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk_setPalette, tk_bisque \- Modify the Tk color palette .SH SYNOPSIS | < > > < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | '\" '\" Copyright (c) 1995-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk_setPalette n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk_setPalette, tk_bisque \- Modify the Tk color palette .SH SYNOPSIS \fBtk_setPalette \fIbackground\fR .sp \fBtk_setPalette \fIname value \fR?\fIname value ...\fR? .sp \fBtk_bisque\fR .BE .SH DESCRIPTION .PP The \fBtk_setPalette\fR procedure changes the color scheme for Tk. It does this by modifying the colors of existing widgets and by changing the option database so that future widgets will use the new color scheme. If \fBtk_setPalette\fR is invoked with a single argument, the |
︙ | ︙ |
Changes to doc/panedwindow.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH panedwindow n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME panedwindow \- Create and manipulate 'panedwindow' split container widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH panedwindow n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME panedwindow \- Create and manipulate 'panedwindow' split container widgets .SH SYNOPSIS \fBpanedwindow\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-orient \-relief .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-handlepad handlePad HandlePad When sash handles are drawn, specifies the distance from the top or |
︙ | ︙ | |||
34 35 36 37 38 39 40 | 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 | | | | | | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 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 Background color to use when drawing the proxy. If an empty string, the value of the \fB-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth Specifies the borderwidth of the proxy. May be any value accepted by \fBTk_GetPixels\fR. .OP \-proxyrelief proxyRelief ProxyRelief 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 option will be used. .OP \-sashcursor sashCursor SashCursor Mouse cursor to use when over a sash. If null, \fBsb_h_double_arrow\fR will be used for horizontal panedwindows, and \fBsb_v_double_arrow\fR will be used for vertical panedwindows. .OP \-sashpad sashPad SashPad Specifies the amount of padding to leave of each side of a sash. May |
︙ | ︙ | |||
94 95 96 97 98 99 100 | .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIPathName\fR is the name of the command, which is the same as the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for panedwindow widgets: | < < < < < < < < < < < < < < < < > | > > | > > | > > | > > | > < < < | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIPathName\fR is the name of the command, which is the same as the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for panedwindow widgets: .TP \fIpathName \fBadd \fIwindow \fR?\fIwindow ...\fR? ?\fIoption value ...\fR? . Add one or more windows to the panedwindow, each in a separate pane. The arguments consist of the names of one or more windows followed by pairs of arguments that specify how to manage the windows. \fIOption\fR may have any of the values accepted by the \fBconfigure\fR subcommand. .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBpanedwindow\fR command. .TP \fIpathName \fBconfigure \fR?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBpanedwindow\fR command. .TP \fIpathName \fBforget \fIwindow \fR?\fIwindow ...\fR? . Remove the pane containing \fIwindow\fR from the panedwindow. All geometry management options for \fIwindow\fR will be forgotten. .TP \fIpathName \fBidentify \fIx y\fR . Identify the panedwindow component underneath the point given by \fIx\fR and \fIy\fR, in window coordinates. If the point is over a sash or a sash handle, the result is a two element list containing the 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 over any other part of the panedwindow, the result is an empty list. .TP \fIpathName \fBpanecget \fIwindow option\fR . Query a management option for \fIwindow\fR. \fIOption\fR may be any value allowed by the \fBpaneconfigure\fR subcommand. .TP \fIpathName \fBpaneconfigure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the management options for \fIwindow\fR. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. The following options are supported: .RS .TP \fB\-after \fIwindow\fR . Insert the window after the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. .TP \fB\-before \fIwindow\fR . Insert the window before the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. .TP \fB\-height \fIsize\fR . Specify a height for the window. The height will be the outer dimension of the window including its border, if any. If \fIsize\fR is an empty string, or if \fB\-height\fR is not specified, then the height requested internally by the window will be used initially; the height may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .TP \fB\-hide \fIboolean\fR . Controls the visibility of a pane. When the \fIboolean\fR is true (according to \fBTcl_GetBoolean\fR) the pane will not be visible, but it will still be maintained in the list of panes. .TP \fB\-minsize \fIn\fR . Specifies that the size of the window cannot be made less than \fIn\fR. This constraint only affects the size of the widget in the paned dimension \(em the x dimension for horizontal panedwindows, the y dimension for vertical panedwindows. May be any value accepted by \fBTk_GetPixels\fR. .TP \fB\-padx \fIn\fR . Specifies a non-negative value indicating how much extra space to leave on each side of the window in the X-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. .TP \fB\-pady \fIn\fR . Specifies a non-negative value indicating how much extra space to leave on each side of the window in the Y-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. .TP \fB\-sticky \fIstyle\fR . If a window's pane is larger than the requested dimensions of the window, this option may be used to position (or stretch) the window within its pane. \fIStyle\fR is a string that contains zero or more of the characters \fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR. The string can optionally contains spaces or commas, but they are ignored. Each letter refers to a side (north, south, east, or west) that the window will .QW stick to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are specified, the window will be stretched to fill the entire height (or width) of its cavity. .TP \fB\-stretch \fIwhen\fR . Controls how extra space is allocated to each of the panes. \fIWhen\fR is one of \fBalways\fR, \fBfirst\fR, \fBlast\fR, \fBmiddle\fR, and \fBnever\fR. The panedwindow will calculate the required size of all its panes. Any remaining (or deficit) space will be distributed to those panes marked for stretching. The space will be distributed based on each panes current ratio of the whole. The \fIwhen\fR values have the following definition: .RS .TP \fBalways\fR . This pane will always stretch. .TP \fBfirst\fR . Only if this pane is the first pane (left-most or top-most) will it stretch. .TP \fBlast\fR . Only if this pane is the last pane (right-most or bottom-most) will it stretch. This is the default value. .TP \fBmiddle\fR . Only if this pane is not the first or last pane will it stretch. .TP \fBnever\fR . This pane will never stretch. .RE .TP \fB\-width \fIsize\fR . Specify a width for the window. The width will be the outer dimension of the window including its border, if any. If \fIsize\fR is an empty string, or if \fB\-width\fR is not specified, then the width requested internally by the window will be used initially; the width may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .RE .TP \fIpathName \fBpanes\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 |
︙ | ︙ | |||
294 295 296 297 298 299 300 | . 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 | < < | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | . 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 |
︙ | ︙ |
Changes to doc/photo.n.
︙ | ︙ | |||
39 40 41 42 43 44 45 | internally in full color (32 bits per pixel), and is displayed using dithering if necessary. Image data for a photo image can be obtained from a file or a string, or it can be supplied from C code through a procedural interface. At present, only .VS 8.6 PNG, .VE 8.6 | < < < < | | < < | < < < < < < | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | internally in full color (32 bits per pixel), and is displayed using dithering if necessary. Image data for a photo image can be obtained from a file or a string, or it can be supplied from C code through a procedural interface. At present, only .VS 8.6 PNG, .VE 8.6 GIF and PPM/PGM formats are supported, but an interface exists to allow additional image file formats to be added easily. A photo image is (semi)transparent if the image data it was obtained from had transparency informaton. In regions where no image data has been supplied, it is fully transparent. Transparency may also be modified with the \fBtransparency set\fR subcommand. .SH "CREATING PHOTOS" .PP Like all images, photos are created using the \fBimage create\fR command. Photos support the following \fIoptions\fR: .TP \fB\-data \fIstring\fR . Specifies the contents of the image as a string. .VS 8.7 The string should contain data in the default list-of-lists form, .VE 8.7 binary data or, for some formats, base64-encoded data (this is currently guaranteed to be supported for PNG and GIF images). The format of the string must be one of those for which there is an image file format handler that will accept string data. If both the \fB\-data\fR and \fB\-file\fR options are specified, the \fB\-file\fR option takes precedence. .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the file format for the data specified with the \fB\-data\fR or \fB\-file\fR option and optional arguments passed to the format handler. Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .TP \fB\-file \fIname\fR . \fIname\fR gives the name of a file that is to be read to supply data for the photo image. The file format must be one of those for which there is an image file format handler that can read data. .TP \fB\-gamma \fIvalue\fR . Specifies that the colors allocated for displaying this image in a window should be corrected for a non-linear display with the specified gamma exponent value. (The intensity produced by most CRT displays is a power function of the input value, to a good approximation; gamma is the exponent and is typically around 2). The value specified must be greater than zero. The default value is one (no correction). In general, values greater than one will make the image lighter, and values less than one will make it darker. .TP \fB\-height \fInumber\fR . Specifies the height of the image, in pixels. This option is useful primarily in situations where the user wishes to build up the contents of the image piece by piece. A value of zero (the default) allows the image to expand or shrink vertically to fit the data stored in it. .VS 8.7 .TP \fB\-metadata \fImetadata\fR . Set the metadata dictionary of the image. Additional keys may be set within the metadata dictionary of the image, if image data is processed due to a \fB\-file\fR or \fB\-data\fR options and the driver outputs any metadata keys. See section \fBMETADATA DICTIONARY\fR below. .VE 8.7 .TP \fB\-palette \fIpalette-spec\fR . Specifies the resolution of the color cube to be allocated for displaying this image, and thus the number of colors used from the colormaps of the windows where it is displayed. The \fIpalette-spec\fR string may be either a single decimal number, specifying the number of shades of gray to use, or three decimal numbers separated by slashes (/), specifying the number of shades of red, green and blue to use, respectively. If the first form (a single number) is used, the image will be displayed in monochrome (i.e., grayscale). .TP \fB\-width \fInumber\fR . Specifies the width of the image, in pixels. This option is useful primarily in situations where the user wishes to build up the contents of the image piece by piece. A value of zero (the default) allows the image to expand or shrink horizontally to fit the data stored in it. |
︙ | ︙ | |||
159 160 161 162 163 164 165 | of the image, if necessary, to accommodate the data written to the image, unless the user has specified non-zero values for the \fB\-width\fR and/or \fB\-height\fR configuration options, in which case the width and/or height, respectively, of the image will not be changed. .PP The following commands are possible for photo images: | < | < < | < | < | < < < < < < < | < < | < < < | < < | | | | < | < | | < | < | < | < < | | < < < < > | < > | > > | < > | < < < | < < < | | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | of the image, if necessary, to accommodate the data written to the image, unless the user has specified non-zero values for the \fB\-width\fR and/or \fB\-height\fR configuration options, in which case the width and/or height, respectively, of the image will not be changed. .PP The following commands are possible for photo images: .TP \fIimageName \fBblank\fR . Blank the image; that is, set the entire image to have no data, so it will be displayed as transparent, and the background of whatever window it is displayed in will show through. The metadata dict of the image is not changed. .TP \fIimageName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBimage create\fR \fBphoto\fR command. .TP \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options for the image. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBimage create\fR \fBphoto\fR command. .VS 8.7 Note: setting the \fB\-metadata\fR option without any other option will not invoke the image format driver to recreate the bitmap. .VE 8.7 .TP \fIimageName \fBcopy\fR \fIsourceImage\fR ?\fIoption value(s) ...\fR? . Copies a region from the image called \fIsourceImage\fR (which must be a photo image) to the image called \fIimageName\fR, possibly with pixel zooming and/or subsampling. If no options are specified, this command copies the whole of \fIsourceImage\fR into \fIimageName\fR, starting at coordinates (0,0) in \fIimageName\fR. The following options may be specified: .RS .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular sub-region of the source image to be copied. (\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite corners of the rectangle. If \fIx2\fR and \fIy2\fR are not specified, the default value is the bottom-right corner of the source image. The pixels copied will include the left and top edges of the specified rectangle but not the bottom or right edges. If the \fB\-from\fR option is not given, the default is the whole source image. .TP \fB\-to \fIx1 y1 x2 y2\fR . Specifies a rectangular sub-region of the destination image to be affected. (\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite corners of the rectangle. If \fIx2\fR and \fIy2\fR are not specified, the default value is (\fIx1,y1\fR) plus the size of the source region (after subsampling and zooming, if specified). If \fIx2\fR and \fIy2\fR are specified, the source region will be replicated if necessary to fill the destination region in a tiled fashion. .TP \fB\-shrink\fR . Specifies that the size of the destination image should be reduced, if necessary, so that the region being copied into is at the bottom-right corner of the image. This option will not affect the width or height of the image if the user has specified a non-zero value for the \fB\-width\fR or \fB\-height\fR configuration option, respectively. .TP \fB\-zoom \fIx y\fR . Specifies that the source region should be magnified by a factor of \fIx\fR in the X direction and \fIy\fR in the Y direction. If \fIy\fR is not given, the default value is the same as \fIx\fR. With this option, each pixel in the source image will be expanded into a block of \fIx\fR x \fIy\fR pixels in the destination image, all the same color. \fIx\fR and \fIy\fR must be greater than 0. .TP \fB\-subsample \fIx y\fR . Specifies that the source image should be reduced in size by using only every \fIx\fRth pixel in the X direction and \fIy\fRth pixel in the Y direction. Negative values will cause the image to be flipped about the Y or X axes, respectively. If \fIy\fR is not given, the default value is the same as \fIx\fR. .TP \fB\-compositingrule \fIrule\fR . Specifies how transparent pixels in the source image are combined with the destination image. When a compositing rule of \fIoverlay\fR is set, the old contents of the destination image are visible, as if the source image were printed on a piece of transparent film and placed over the top of the destination. When a compositing rule of \fIset\fR is set, the old contents of the destination image are discarded and the source image is used as-is. The default compositing rule is \fIoverlay\fR. .RE .TP \fIimageName \fBdata\fR ?\fIoption value(s) ...\fR? . Returns image data in the form of a string. .VS 8.7 The format of the string depends on the format handler. By default, a human readable format as a list of lists of pixel data is used, other formats can be chosen with the \fB-format\fR option. See \fBIMAGE FORMATS\fR below for details. .VE 8.7 The following options may be specified: .RS .TP \fB\-background\fI color\fR . If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the image file format handler to use and, optionally, arguments to the format handler. Specifically, this subcommand searches for the first handler whose name matches an initial substring of \fIformat-name\fR and which has the capability to write a string containing this image data. .VS 8.7 If this option is not given, this subcommand uses the default format that consists of a list (one element per row) of lists (one element per pixel/column) of colors in .QW \fB#\fIrrggbb\fR format (see \fBIMAGE FORMATS\fR below). .VE 8.7 Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular region of \fIimageName\fR to be returned. If only \fIx1\fR and \fIy1\fR are specified, the region extends from \fI(x1,y1)\fR to the bottom-right corner of \fIimageName\fR. If all four coordinates are given, they specify diagonally opposite corners of the rectangular region, including x1,y1 and excluding x2,y2. The default, if this option is not given, is the whole image. .TP \fB\-grayscale\fR . If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 .TP \fB\-metadata\fR \fImetadata\fR . Image format handler may use metadata to be included in the returned data string. The specified \fImetadata\fR is passed to the driver for inclusion in the data. If no \fB\-metadata\fR option is given, the current metadata of the image is used. .VE 8.7 .RE \fIimageName \fBget\fR \fIx y\fR ?\fB-withalpha\fR? . Returns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in the image as a list of three integers between 0 and 255, representing the red, green and blue components respectively. If the \fB-withalpha\fR option is specified, the returned list will have a fourth element representing the alpha value of the pixel as an integer between 0 and 255. .VE 8.7 .TP \fIimageName \fBput\fR \fIdata\fR ?\fIoption value(s) ...\fR? . Sets pixels in \fI imageName\fR to the data specified in \fIdata\fR. .VS 8.7 This command searches the list of image file format handlers for a handler that can interpret the data in \fIdata\fR, and then reads the image encoded within into \fIimageName\fR (the destination image). See \fBIMAGE FORMATS\fR below for details on formats for image data. .VE 8.7 The following options may be specified: .RS .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ..\fR?} . Specifies the format of the image data in \fIdata\fR and, optionally, arguments to be passed to the format handler. Specifically, only image file format handlers whose names begin with \fIformat-name\fR will be used while searching for an image data format handler to read the data. Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .VS 8.7 .TP \fB\-metadata\fR \fImetadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. Note: The current metadata of the image is not passed to the format driver and is not changed by the command. .VE 8.7 .TP \fB\-to \fIx1 y1\fR ?\fIx2 y2\fR? . Specifies the coordinates of the top-left corner (\fIx1\fR,\fIy1\fR) of the region of \fIimageName\fR into which the image data will be copied. The default position is (0,0). If \fIx2\fR,\fIy2\fR is given and \fIdata\fR is not large enough to cover the rectangle specified by this option, the image data extracted will be tiled so it covers the entire destination rectangle. If the region specified with this opion is smaller than the supplied \fIdata\fR, the exceeding data is silently discarded. Note that if \fIdata\fR specifies a single color value, then a region extending to the bottom-right corner represented by (\fIx2\fR,\fIy2\fR) will be filled with that color. .RE .TP \fIimageName \fBread\fR \fIfilename\fR ?\fIoption value(s) ...\fR? . Reads image data from the file named \fIfilename\fR into the image. This command first searches the list of image file format handlers for a handler that can interpret the data in \fIfilename\fR, and then reads the image in \fIfilename\fR into \fIimageName\fR (the destination image). The following options may be specified: .RS .TP \fB\-format {\fIformat-name\fR ?\fIoption value ..\fR?} . Specifies the format of the image data in \fIfilename\fR and, optionally, additional options to the format handler. Specifically, only image file format handlers whose names begin with \fIformat-name\fR will be used while searching for an image data format handler to read the data. Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular sub-region of the image file data to be copied to the destination image. If only \fIx1\fR and \fIy1\fR are specified, the region extends from (\fIx1,y1\fR) to the bottom-right corner of the image in the image file. If all four coordinates are specified, they specify diagonally opposite corners or the region. The default, if this option is not specified, is the whole of the image in the image file. .VS 8.7 .TP \fB\-metadata\fR \fImetadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. Note: The current metadata of the image is not passed to the format driver and is not changed by the command. .VE 8.7 .TP \fB\-shrink\fR . If this option, the size of \fIimageName\fR will be reduced, if necessary, so that the region into which the image file data are read is at the bottom-right corner of the \fIimageName\fR. This option will not affect the width or height of the image if the user has specified a non-zero value for the \fB\-width\fR or \fB\-height\fR configuration option, respectively. .TP \fB\-to \fIx y\fR . Specifies the coordinates of the top-left corner of the region of \fIimageName\fR into which data from \fIfilename\fR are to be read. The default is (0,0). .RE .TP \fIimageName \fBredither\fR . The dithering algorithm used in displaying photo images propagates quantization errors from one pixel to its neighbors. If the image data for \fIimageName\fR is supplied in pieces, the dithered image may not be exactly correct. Normally the difference is not noticeable, but if it is a problem, this command can be used to recalculate the dithered image in each window where the image is displayed. .TP \fIimageName \fBtransparency \fIsubcommand \fR?\fIarg ...\fR? . Allows examination and manipulation of the transparency information in the photo image. Several subcommands are available: .RS .VS 8.7 .TP \fIimageName \fBtransparency get \fIx y\fR ?\fB-alpha\fR? . Returns true if the pixel at (\fIx\fR,\fIy\fR) is fully transparent, false otherwise. If the option \fB-alpha\fR is passed, returns the alpha value of the pixel instead, as an integer in the range 0 to 255. .VE 8.7 .VS 8.7 .TP \fIimageName \fBtransparency set \fIx y\fR \fInewVal\fR ?\fB-alpha\fR? . Change the transparency of the pixel at (\fIx\fR,\fIy\fR) to \fInewVal.\fR If no additional option is passed, \fInewVal\fR is interpreted as a boolean and the pixel is made fully transparent if that value is true, fully opaque otherwise. If the \fB-alpha\fR option is passed, \fInewVal\fR is interpreted as an integral alpha value for the pixel, which must be in the range 0 to 255. .VE 8.7 .RE .TP \fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR? . Writes image data from \fIimageName\fR to a file named \fIfilename\fR. The following options may be specified: .RS .TP \fB\-background\fI color\fR . If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the image file format handler to be used to write the data to the file and, optionally, options to pass to the format handler. Specifically, this subcommand searches for the first handler whose name matches an initial substring of \fIformat-name\fR and which has the capability to write an image file. If this option is not given, the format is guessed from the file extension. If that cannot be determined, this subcommand uses the first handler that has the capability to write an image file. Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular region of \fIimageName\fR to be written to the image file. If only \fIx1\fR and \fIy1\fR are specified, the region extends from \fI(x1,y1)\fR to the bottom-right corner of \fIimageName\fR. If all four coordinates are given, they specify diagonally opposite corners of the rectangular region. The default, if this option is not given, is the whole image. .TP \fB\-grayscale\fR . If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 .TP \fB\-metadata\fR \fBmetadata\fR . Image format handler may use metadata to be included in the written file. The specified \fImetadata\fR is passed to the driver for inclusion in the file. If no \fB\-metadata\fR option is given, the current metadata of the image is used. .VE 8.7 .RE .SH "IMAGE FORMATS" .PP The photo image code is structured to allow handlers for additional image file formats to be added easily. The photo image code maintains a list of these handlers. Handlers are added to the list by registering them with a call to \fBTk_CreatePhotoImageFormat\fR. The standard Tk distribution comes with handlers for PPM/PGM, PNG and GIF formats, .VS 8.7 as well as the \fBdefault\fR handler to encode/decode image data in a human readable form. .VE 8.7 These handlers are automatically registered on initialization. .PP When reading an image file or processing string data specified with |
︙ | ︙ | |||
596 597 598 599 600 601 602 | .SS "THE DEFAULT IMAGE HANDLER" .PP The \fBdefault\fR image handler cannot be used to read or write data from/to a file. Its sole purpose is to encode and decode image data in string form in a clear text, human readable, form. The \fIimageName\fR \fBdata\fR subcommand uses this handler when no other format is specified. When reading image data from a string with \fIimageName\fR | | | < | < < < < < < | < < | < < > | < < | | < < | | | | | < < | | < < | | < < | | < < < < | < < | | < < | | < < > < | 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | .SS "THE DEFAULT IMAGE HANDLER" .PP The \fBdefault\fR image handler cannot be used to read or write data from/to a file. Its sole purpose is to encode and decode image data in string form in a clear text, human readable, form. The \fIimageName\fR \fBdata\fR subcommand uses this handler when no other format is specified. When reading image data from a string with \fIimageName\fR \fBput\fR or the \fB-data\fR option, the default handler is treated as the other handlers. .PP Image data in the \fBdefault\fR string format is a (top-to-bottom) list of scan-lines, with each scan-line being a (left-to-right) list of pixel data. Every scan-line has the same length. The color and, optionally, alpha value of each pixel is specified in any of the forms described in the \fBCOLOR FORMATS\fR section below. .VE 8.7 .SS "FORMAT SUBOPTIONS" .PP .VS 8.6 Image formats may support sub-options, wich ahre specified using additional words in the value to the \fB\-format\fR option. These suboptions can affect how image data is read or written to file or string. The nature and values of these options is up to the format handler. The built-in handlers support these suboptions: .VS 8.7 .TP \fBdefault \-colorformat\fI formatType\fR . The option is allowed when writing image data to a string with \fIimageName\fR \fBdata\fR. Specifies the format to use for the color string of each pixel. \fIformatType\fR may be one of: \fBrgb\fR to encode pixel data in the form \fB#\fIRRGGBB\fR, \fBrgba\fR to encode pixel data in the form \fB#\fIRRGGBBAA\fR or \fBlist\fR to encode pixel data as a list with four elements. See \fBCOLOR FORMATS\fR below for details. The default is \fBrgb\fR. .VE 8.7 .TP \fBgif \-index\fI indexValue\fR . The option has effect when reading image data from a file. When parsing a multi-part GIF image, Tk normally only accesses the first image. By giving the \fB\-index\fR sub-option, the \fIindexValue\fR'th value may be used instead. The \fIindexValue\fR must be an integer from 0 up to the number of image parts in the GIF data. .TP \fBpng \-alpha\fI alphaValue\fR . The option has effect when reading image data from a file. Specifies an additional alpha filtering for the overall image, which allows the background on which the image is displayed to show through. This usually also has the effect of desaturating the image. The \fIalphaValue\fR must be between 0.0 and 1.0. .TP \fBsvg \-dpi\fI dpiValue\fB \-scale\fI scaleValue\fB \-scaletowidth \fI width\fB \-scaletoheight\fI height\fR . \fIdpiValue\fR is used in conversion between given coordinates and screen resolution. The value must be greater than 0 and the default value is 96. \fIscaleValue\fR is used to scale the resulting image. The value must be greater than 0 and the default value is 1. \fIwidth\fR and \fIheight\fR are the width or height that the image will be adjusted to. Only one parameter among \fB\-scale\fR, \fB\-scaletowidth\fR and \fB\-scaletoheight\fR can be given at a time and the aspect ratio of the original image is always preserved. The svg format supports a wide range of SVG features, but the full SVG standard is not available, for instance the 'text' feature is missing and silently ignored when reading the SVG data. The supported SVG features are: . .RS \fB elements:\fR g, path, rect, circle, ellipse, line, polyline, polygon, linearGradient, radialGradient, stop, defs, svg, style .PP \fB attributes:\fR width, height, viewBox, preserveAspectRatio with none, xMin, xMid, xMax, yMin, yMid, yMax, slice .PP \fB gradient attributes:\fR gradientUnits with objectBoundingBox, gradientTransform, cx, cy, r fx, fy x1, y1, x2, y2 spreadMethod with pad, reflect or repeat, xlink:href .PP \fB poly attributes: \fR points .PP \fB line attributes: \fR x1, y1, x2, y2 .PP \fB ellipse attributes: \fR cx, cy, rx, ry .PP \fB circle attributes: \fR cx, cy, r .PP \fB rectangle attributes: \fR x, y, width, height, rx, ry .PP \fB path attributes: \fR d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z .PP \fB style attributes: \fR display with none, visibility, hidden, visible, fill with nonzero and evenodd, opacity, fill-opacity, stroke, stroke-width, stroke-dasharray, stroke-dashoffset, stroke-opacity, stroke-linecap with butt, round and square, stroke-linejoin with miter, round and bevel, stroke-miterlimit fill-rule, font-size, transform with matrix, translate, scale, rotate, skewX and skewY, stop-color, stop-opacity, offset, id, class .RE . Currently only SVG images reading and conversion into (pixel-based format) photos is supported: Tk does not (yet) support bundling photo images in SVG vector graphics. .VE 8.6 .VS 8.7 .SH "COLOR FORMATS" .PP The default image handler can represent/parse color and alpha values of a pixel in one of the formats listed below. If a color format does not contain transparency information, full opacity is assumed. The |
︙ | ︙ | |||
817 818 819 820 821 822 823 | comments. Image format drivers may output metadata when image data is parsed, or may use metadata to be included in image files or formats. .SS "METADATA KEYS (MULTIPLE FORMATS)" .PP Each image format driver supports an individual set of metadata dictionary keys. Predefined keys are: | > | > > | > > | > | | | | | < | | < | | | | | | | | | 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | comments. Image format drivers may output metadata when image data is parsed, or may use metadata to be included in image files or formats. .SS "METADATA KEYS (MULTIPLE FORMATS)" .PP Each image format driver supports an individual set of metadata dictionary keys. Predefined keys are: .TP DPI . Horizontal image resolution in DPI as a double value. Supported by format \fBpng\fR. .TP aspect . Aspect ratio horizontal divided by vertical as double value. Supported by formats \fBgif\fR and \fBpng\fR. .TP comment . Image text comment. Supported by formats \fBgif\fR and \fBpng\fR. .PP It is valid to set any key in the metadata dict. A format driver will ignore keys it does not handle. .SS "METADATA KEYS FOR ANIMATED GIF INFORMATION" .PP The following metadata keys are reported when reading a \fBgif\fR format file. They are typically used in conjunction with the \fI-index\fR option of an animated \fBgif\fR file to properly display the subimage sequence. The options are linked to each subimage selected by \fI-index\fR. .TP \fBdelay time\fR \fItime\fR . Update delay time in 10ms unit. This key is only present, if delay time is not 0. .TP \fBdisposal method\fR \fImethod\fR . Disposal method of the preceeding image, if given for the current image. Possible values are: \fIdo not dispose\fR, \fIrestore to background color\fR, \fIrestore to previous\fR. .TP \fBuser interaction\fR \fIbool\fR . The key is present with a value of 1, if user interaction is specified. Otherwise, the key is not present. .TP \fBupdate region\fR \fIX0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR . Update region of the current subimage, if subimage has not the same size as the full image. The pixel outside of this box are all fully transparent. .PP .VE 8.7 .SH CREDITS .PP The photo image type was designed and implemented by Paul Mackerras, based on his earlier photo widget and some suggestions from John Ousterhout. .SH EXAMPLE .PP Load an image from a file and tile it to the size of a window, which is useful for producing a tiled background: .PP .CS # These lines should be called once \fBimage create photo\fR untiled \-file "theFile.ppm" \fBimage create photo\fR tiled # These lines should be called whenever .someWidget changes # size; a <Configure> binding is useful here set width [winfo width .someWidget] set height [winfo height .someWidget] tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink .CE .PP .VS 8.6 The PNG image loader allows the application of an additional alpha factor during loading, which is useful for generating images suitable for disabled buttons: .PP .CS \fBimage create photo\fR icon \-file "icon.png" \fBimage create photo\fR iconDisabled \-file "icon.png" \e \-format "png \-alpha 0.5" button .b \-image icon \-disabledimage iconDisabled .CE .VE 8.6 .PP .VS 8.7 Create a green box with a simple shadow effect .PP .CS |
︙ | ︙ |
Changes to doc/place.n.
︙ | ︙ | |||
26 27 28 29 30 31 32 | in response to changes in the size of the container. Lastly, the placer allows you to mix these styles of placement so that, for example, the content has a fixed width and height but is centered inside the container. .PP .TP \fBplace \fIwindow option value \fR?\fIoption value ...\fR? | < < < < < < < | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | in response to changes in the size of the container. Lastly, the placer allows you to mix these styles of placement so that, for example, the content has a fixed width and height but is centered inside the container. .PP .TP \fBplace \fIwindow option value \fR?\fIoption value ...\fR? Arrange for the placer to manage the geometry of a content whose pathName is \fIwindow\fR. The remaining arguments consist of one or more \fIoption\-value\fR pairs that specify the way in which \fIwindow\fR's geometry is managed. \fIOption\fR may have any of the values accepted by the \fBplace configure\fR command. .TP \fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? Query or modify the geometry options of the content given by \fIwindow\fR. If no \fIoption\fR is specified, this command returns a list describing the available options (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given option(s) to have the given value(s); in this case the command returns an empty string. .RS .PP The following \fIoption\-value\fR pairs are supported: .TP \fB\-anchor \fIwhere\fR \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR, \fB\-relx\fR, and \fB\-rely\fR options. The anchor point is in terms of the outer area of \fIwindow\fR including its border, if any. 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 in the container. The anchor position defaults to \fBnw\fR. .TP \fB\-bordermode \fImode\fR \fIMode\fR determines the degree to which borders within the container are used in determining the placement of the content. The default and most common value is \fBinside\fR. In this case the placer considers the area of the container to be the innermost area of the container, inside any border: 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 |
︙ | ︙ | |||
87 88 89 90 91 92 93 | 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 case borders are ignored: the area of the container is considered to be its official X area, which includes any internal border but no external border. A bordermode of \fBignore\fR is probably not very useful. .RE | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | > > > | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | 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 case borders are ignored: the area of the container is considered to be its official X area, which includes any internal border but no external border. A bordermode of \fBignore\fR is probably not very useful. .RE .TP \fB\-height \fIsize\fR \fISize\fR specifies the height for \fIwindow\fR in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR). The height will be the outer dimension of \fIwindow\fR including its border, if any. If \fIsize\fR is an empty string, or if no \fB\-height\fR or \fB\-relheight\fR option is specified, then the height requested internally by the window will be used. .TP \fB\-in \fIcontainer\fR \fIContainer\fR specifies the path name of the window relative to which \fIwindow\fR is to be placed. \fIContainer\fR must either be \fIwindow\fR's parent or a descendant of \fIwindow\fR's parent. In addition, \fIcontainer\fR and \fIwindow\fR must both be descendants of the same top-level window. These restrictions are necessary to guarantee that \fIwindow\fR is visible whenever \fIcontainer\fR is visible. If this option is not specified then the other window defaults to \fIwindow\fR's parent. .TP \fB\-relheight \fIsize\fR \fISize\fR specifies the height for \fIwindow\fR. In this case the height is specified as a floating-point number relative to the height of the container: 0.5 means \fIwindow\fR will be half as high as the container, 1.0 means \fIwindow\fR will have the same height as the container, and so on. 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 makes the content 2 pixels shorter than the container. .TP \fB\-relwidth \fIsize\fR \fISize\fR specifies the width for \fIwindow\fR. In this case the width is specified as a floating-point number relative to the width of the container: 0.5 means \fIwindow\fR will be half as wide as the container, 1.0 means \fIwindow\fR will have the same width as the container, and so on. 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 makes the content 5 pixels wider than the container. .TP \fB\-relx \fIlocation\fR \fILocation\fR specifies the x-coordinate within the container window of the anchor point for \fIwindow\fR. In this case the location is specified in a relative fashion as a floating-point number: 0.0 corresponds to the left edge of the container and 1.0 corresponds to the right edge of the container. \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 content then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR positions the left edge of the content 2 pixels to the left of the center of its container. .TP \fB\-rely \fIlocation\fR \fILocation\fR specifies the y-coordinate within the container window of the anchor point for \fIwindow\fR. In this case the value is specified in a relative fashion as a floating-point number: 0.0 corresponds to the top edge of the container and 1.0 corresponds to the bottom edge of the container. \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 content then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR positions the top edge of the content 3 pixels below the center of its container. .TP \fB\-width \fIsize\fR \fISize\fR specifies the width for \fIwindow\fR in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR). The width will be the outer width of \fIwindow\fR including its border, if any. If \fIsize\fR is an empty string, or if no \fB\-width\fR or \fB\-relwidth\fR option is specified, then the width requested internally by the window will be used. .TP \fB\-x \fIlocation\fR \fILocation\fR specifies the x-coordinate within the container window of the anchor point for \fIwindow\fR. 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 of the container window. .TP \fB\-y \fIlocation\fR \fILocation\fR specifies the y-coordinate within the container window of the anchor point for \fIwindow\fR. 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 of the container window. .PP If the same value is specified separately with two different options, such as \fB\-x\fR and \fB\-relx\fR, then the most recent option is used and the older one is ignored. .RE .TP \fBplace forget \fIwindow\fR Causes the placer to stop managing the geometry of \fIwindow\fR. As a side effect of this command \fIwindow\fR will be unmapped so that it does not appear on the screen. If \fIwindow\fR is not currently managed by the placer then the command has no effect. This command returns an empty string. .TP \fBplace info \fIwindow\fR Returns a list giving the current configuration of \fIwindow\fR. The list consists of \fIoption\-value\fR pairs in exactly the same form as might be specified to the \fBplace configure\fR command. .TP \fBplace content \fIwindow\fR Returns a list of all the content windows for which \fIwindow\fR is the container. If there is no content for \fIwindow\fR then an empty string is returned. .TP \fBplace slaves \fIwindow\fR . Synonym for \fBplace content \fIwindow\fR. .PP If the configuration of a window has been retrieved with \fBplace info\fR, that configuration can be restored later by |
︙ | ︙ | |||
276 277 278 279 280 281 282 | To control the sizes of these windows, make them windows like frames and canvases that provide configuration options for this purpose. .SH EXAMPLE .PP Make the label occupy the middle bit of the toplevel, no matter how it is resized: .CS | | | | < | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | To control the sizes of these windows, make them windows like frames and canvases that provide configuration options for this purpose. .SH EXAMPLE .PP Make the label occupy the middle bit of the toplevel, no matter how it is resized: .CS label .l \-text "In the\enMiddle!" \-bg black \-fg white \fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35 .CE .SH "SEE ALSO" grid(n), pack(n) .SH KEYWORDS geometry manager, height, location, container, place, rubber sheet, content, width '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/popup.n.
︙ | ︙ | |||
27 28 29 30 31 32 33 | the given point. .SH EXAMPLE .PP How to attach a simple popup menu to a widget. .CS # Create a menu set m [menu .popupMenu] | | | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | the given point. .SH EXAMPLE .PP How to attach a simple popup menu to a widget. .CS # Create a menu set m [menu .popupMenu] $m add command \-label "Example 1" \-command bell $m add command \-label "Example 2" \-command bell # Create something to attach it to pack [label .l \-text "Click me!"] # Arrange for the menu to pop up when the label is clicked bind .l <Button-1> {\fBtk_popup\fR .popupMenu %X %Y} .CE .SH "SEE ALSO" bind(n), menu(n), tk_optionMenu(n) .SH KEYWORDS |
︙ | ︙ |
Changes to doc/radiobutton.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH radiobutton n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME radiobutton \- Create and manipulate 'radiobutton' pick-one widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH radiobutton n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME radiobutton \- Create and manipulate 'radiobutton' pick-one widgets .SH SYNOPSIS \fBradiobutton\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady \-anchor \-foreground \-relief \-background \-highlightbackground \-takefocus \-bitmap \-highlightcolor \-text \-borderwidth \-highlightthickness \-textvariable |
︙ | ︙ | |||
61 62 63 64 65 66 67 | 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. 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. | | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | 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. 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 Specifies an image to display (in place of the \fB\-image\fR option) when the radiobutton is selected. This option is ignored unless the \fB\-image\fR option has been |
︙ | ︙ | |||
177 178 179 180 181 182 183 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for radiobutton widgets: | < | < < < < < | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for radiobutton widgets: .TP \fIpathName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBradiobutton\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, the 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 the values accepted by the \fBradiobutton\fR command. .TP \fIpathName \fBdeselect\fR . Deselects the radiobutton and sets the associated variable to an empty string. If this radiobutton was not currently selected, the command has no effect. .TP \fIpathName \fBflash\fR . Flashes the radiobutton. This is accomplished by redisplaying the radiobutton several times, alternating between active and normal colors. At the end of the flash the radiobutton is left in the same normal/active state as when the command was invoked. This command is ignored if the radiobutton's state is \fBdisabled\fR. .TP \fIpathName \fBinvoke\fR . Does just what would have happened if the user invoked the radiobutton with the mouse: selects the button and invokes its associated Tcl command, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the radiobutton. This command is ignored if the radiobutton's state is \fBdisabled\fR. .TP \fIpathName \fBselect\fR . Selects the radiobutton and sets the associated variable to the value corresponding to this widget. .SH BINDINGS .PP |
︙ | ︙ | |||
259 260 261 262 263 264 265 | .PP If the radiobutton's state is \fBdisabled\fR then none of the above actions occur: the radiobutton is completely non-responsive. .PP The behavior of radiobuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH "SEE ALSO" | | < | 253 254 255 256 257 258 259 260 261 262 263 264 265 | .PP If the radiobutton's state is \fBdisabled\fR then none of the above actions occur: the radiobutton is completely non-responsive. .PP The behavior of radiobuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH "SEE ALSO" checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), ttk::radiobutton(n) .SH KEYWORDS radiobutton, widget '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/raise.n.
︙ | ︙ | |||
37 38 39 40 41 42 43 | .SH EXAMPLE .PP Make a button appear to be in a sibling frame that was created after it. This is is often necessary when building GUIs in the style where you create your activity widgets first before laying them out on the display: .CS | | | | | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | .SH EXAMPLE .PP Make a button appear to be in a sibling frame that was created after it. This is is often necessary when building GUIs in the style where you create your activity widgets first before laying them out on the display: .CS button .b \-text "Hi there!" pack [frame .f \-background blue] pack [label .f.l1 \-text "This is above"] pack .b \-in .f pack [label .f.l2 \-text "This is below"] \fBraise\fR .b .CE .SH "SEE ALSO" lower(n) .SH KEYWORDS obscure, raise, stacking order '\" Local Variables: |
︙ | ︙ |
Changes to doc/scale.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH scale n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME scale \- Create and manipulate 'scale' value-controlled slider widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH scale n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME scale \- Create and manipulate 'scale' value-controlled slider widgets .SH SYNOPSIS \fBscale\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-foreground \-relief \-background \-highlightbackground \-repeatdelay \-borderwidth \-highlightcolor \-repeatinterval \-cursor \-highlightthickness \-takefocus \-font \-orient \-troughcolor .SE |
︙ | ︙ | |||
32 33 34 35 36 37 38 | value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale. .OP \-digits digits Digits An integer specifying how many significant digits should be retained when converting the value of the scale to a string. | | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale. .OP \-digits digits Digits An integer specifying how many significant digits should be retained when converting the value of the scale to a string. If the number is negative or zero, then the scale picks the smallest value that guarantees that every possible slider position prints as a different string. .OP \-from from From A real value corresponding to the left or top end of the scale. .OP \-label label Label A string to display as a label for the scale. For vertical scales the label is displayed just to the right of the top end of the scale. For horizontal scales the label is displayed just above the left end of the scale. If the option is specified as an empty string, no label is displayed. .OP \-length length Length Specifies the desired long dimension of the scale in screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR). For vertical scales this is the scale's height; for horizontal scales it is the scale's width. .OP \-resolution resolution Resolution A real value specifying the resolution for the scale. If this value is greater than zero then the scale's value will always be rounded to an even multiple of this value, as will the endpoints of the scale. If the value is negative then no rounding occurs. Defaults to 1 (i.e., the value will be integral). .OP \-showvalue showValue ShowValue Specifies a boolean value indicating whether or not the current value of the scale is to be displayed. .OP \-sliderlength sliderLength SliderLength Specifies the size of the slider, measured in screen units along the slider's long dimension. The value may be specified in any of the forms acceptable |
︙ | ︙ | |||
74 75 76 77 78 79 80 | If the scale is disabled then the value may not be changed and the scale will not activate. If the scale is active, the slider is displayed using the color specified by the \fB\-activebackground\fR option. .OP \-tickinterval tickInterval TickInterval Must be a real value. Determines the spacing between numerical | | < < | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | If the scale is disabled then the value may not be changed and the scale will not activate. If the scale is active, the slider is displayed using the color specified by the \fB\-activebackground\fR option. .OP \-tickinterval tickInterval TickInterval Must be a real value. Determines the spacing between numerical 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. .OP \-to to To 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. .OP \-variable variable Variable Specifies the name of a global variable to link to the scale. Whenever the |
︙ | ︙ | |||
141 142 143 144 145 146 147 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for scale widgets: | < | < < < < < | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for scale widgets: .TP \fIpathName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBscale\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBscale\fR command. .TP \fIpathName \fBcoords \fR?\fIvalue\fR? . Returns a list whose elements are the x and y coordinates of the point along the centerline of the trough that corresponds to \fIvalue\fR. If \fIvalue\fR is omitted then the scale's current value is used. .TP \fIpathName \fBget\fR ?\fIx y\fR? . If \fIx\fR and \fIy\fR are omitted, returns the current value of the scale. If \fIx\fR and \fIy\fR are specified, they give pixel coordinates within the widget; the command returns the scale value corresponding to the given pixel. Only one of \fIx\fR or \fIy\fR is used: for horizontal scales \fIy\fR is ignored, and for vertical scales \fIx\fR is ignored. .TP \fIpathName \fBidentify \fIx y\fR . Returns a string indicating what part of the scale lies under the coordinates given by \fIx\fR and \fIy\fR. A return value of \fBslider\fR means that the point is over the slider; \fBtrough1\fR means that the point is over the portion of the slider above or to the left of the slider; and \fBtrough2\fR means that the point is over the portion of the slider below or to the right of the slider. If the point is not over one of these elements, an empty string is returned. .TP \fIpathName \fBset \fIvalue\fR . This command is invoked to change the current value of the scale, and hence the position at which the slider is displayed. \fIValue\fR gives the new value for the scale. The command has no effect if the scale is disabled. |
︙ | ︙ |
Changes to doc/scrollbar.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH scrollbar n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME scrollbar \- Create and manipulate 'scrollbar' scrolling control and indicator widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH scrollbar n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME scrollbar \- Create and manipulate 'scrollbar' scrolling control and indicator widgets .SH SYNOPSIS \fBscrollbar\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-highlightcolor \-repeatdelay \-background \-highlightthickness \-repeatinterval \-borderwidth \-jump \-takefocus \-cursor \-orient \-troughcolor \-highlightbackground \-relief .SE |
︙ | ︙ | |||
38 39 40 41 42 43 44 | All scrollable widgets have \fBxview\fR and \fByview\fR commands that take exactly the additional arguments appended by the scrollbar as described in \fBSCROLLING COMMANDS\fR below. .OP \-elementborderwidth elementBorderWidth BorderWidth Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to \fBTk_GetPixels\fR. | | | | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | All scrollable widgets have \fBxview\fR and \fByview\fR commands that take exactly the additional arguments appended by the scrollbar as described in \fBSCROLLING COMMANDS\fR below. .OP \-elementborderwidth elementBorderWidth BorderWidth Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to \fBTk_GetPixels\fR. If this value is negative (the default is -1), the value of the \fB\-borderwidth\fR option is used in its place. .OP \-width width Width Specifies the desired narrow dimension of the scrollbar window, not including 3-D border, if any. For vertical scrollbars this will be the width and for horizontal scrollbars this will be the height. The value may have any of the forms acceptable to \fBTk_GetPixels\fR. .BE |
︙ | ︙ | |||
77 78 79 80 81 82 83 | Scrollbars can be used to adjust the view in the associated window by clicking or dragging with the mouse. See the \fBBINDINGS\fR section below for details. .SH "ELEMENTS" .PP A scrollbar displays five elements, which are referred to in the widget commands for the scrollbar: | > | > | > | > | > | < < < < < < < < | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | Scrollbars can be used to adjust the view in the associated window by clicking or dragging with the mouse. See the \fBBINDINGS\fR section below for details. .SH "ELEMENTS" .PP A scrollbar displays five elements, which are referred to in the widget commands for the scrollbar: .TP 10 \fBarrow1\fR The top or left arrow in the scrollbar. .TP 10 \fBtrough1\fR The region between the slider and \fBarrow1\fR. .TP 10 \fBslider\fR The rectangle that indicates what is visible in the associated widget. .TP 10 \fBtrough2\fR The region between the slider and \fBarrow2\fR. .TP 10 \fBarrow2\fR The bottom or right arrow in the scrollbar. .SH "WIDGET COMMAND" .PP The \fBscrollbar\fR command creates a new Tcl command whose name is \fIpathName\fR. This command may be used to invoke various operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for scrollbar widgets: .TP \fIpathName \fBactivate \fR?\fIelement\fR? . Marks the element indicated by \fIelement\fR as active, which causes it to be displayed as specified by the \fB\-activebackground\fR and \fB\-activerelief\fR options. The only element values understood by this command are \fBarrow1\fR, \fBslider\fR, or \fBarrow2\fR. If any other value is specified then no element of the scrollbar will be active. If \fIelement\fR is not specified, the command returns the name of the element that is currently active, or an empty string if no element is active. .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR command. .TP \fIpathName \fBdelta \fIdeltaX deltaY\fR . Returns a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in slider position. For example, if the scrollbar is horizontal, the result indicates how much the scrollbar setting must change to move the slider \fIdeltaX\fR pixels to the right (\fIdeltaY\fR is ignored in this case). If the scrollbar is vertical, the result indicates how much the scrollbar setting must change to move the slider \fIdeltaY\fR pixels down. The arguments and the result may be zero or negative. .TP \fIpathName \fBfraction \fIx y\fR . Returns a real number between 0 and 1 indicating where the point given by \fIx\fR and \fIy\fR lies in the trough area of the scrollbar. The value 0 corresponds to the top or left of the trough, the value 1 corresponds to the bottom or right, 0.5 corresponds to the middle, and so on. \fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar widget. If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest point in the trough is used. .TP \fIpathName \fBget\fR . Returns the scrollbar settings in the form of a list whose elements are the arguments to the most recent \fBset\fR widget command. .TP \fIpathName \fBidentify \fIx y\fR . Returns the name of the element under the point given by \fIx\fR and \fIy\fR (such as \fBarrow1\fR), or an empty string if the point does not lie in any element of the scrollbar. \fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar widget. .TP \fIpathName \fBset \fIfirst last\fR . This command is invoked by the scrollbar's associated widget to tell the scrollbar about the current view in the widget. The command takes two arguments, each of which is a real fraction between 0 and 1. |
︙ | ︙ | |||
203 204 205 206 207 208 209 | must change its view. The scrollbar makes the notification by evaluating a Tcl command generated from the scrollbar's \fB\-command\fR option. The command may take any of the following forms. In each case, \fIprefix\fR is the contents of the \fB\-command\fR option, which usually has a form like .QW "\fB.t yview\fR" . | < < | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | must change its view. The scrollbar makes the notification by evaluating a Tcl command generated from the scrollbar's \fB\-command\fR option. The command may take any of the following forms. In each case, \fIprefix\fR is the contents of the \fB\-command\fR option, which usually has a form like .QW "\fB.t yview\fR" . .TP \fIprefix \fBmoveto \fIfraction\fR . \fIFraction\fR is a real number between 0 and 1. The widget should adjust its view so that the point given by \fIfraction\fR appears at the beginning of the widget. If \fIfraction\fR is 0 it refers to the beginning of the document. 1.0 refers to the end of the document, 0.333 refers to a point one-third of the way through the document, and so on. .TP \fIprefix \fBscroll \fInumber \fBpages\fR . The widget should adjust its view by \fInumber\fR pages. It is up to the widget to define the meaning of a page; typically it is slightly less than what fits in the window, so that there is a slight overlap between the old and new views. |
︙ | ︙ | |||
309 310 311 312 313 314 315 | .IP [14] The End key adjusts the view to the bottom (right edge) of the document. .SH EXAMPLE .PP Create a window with a scrollable \fBtext\fR widget: .CS toplevel .tl | | | | | | | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | .IP [14] The End key adjusts the view to the bottom (right edge) of the document. .SH EXAMPLE .PP Create a window with a scrollable \fBtext\fR widget: .CS toplevel .tl text .tl.t \-yscrollcommand {.tl.s set} \fBscrollbar\fR .tl.s \-command {.tl.t yview} grid .tl.t .tl.s \-sticky nsew grid columnconfigure .tl 0 \-weight 1 grid rowconfigure .tl 0 \-weight 1 .CE .SH "SEE ALSO" ttk:scrollbar(n) .SH KEYWORDS scrollbar, widget '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/selection.n.
︙ | ︙ | |||
22 23 24 25 26 27 28 | .PP Note that for management of the \fBCLIPBOARD\fR selection (see below), the \fBclipboard\fR command may also be used. .PP The first argument to \fBselection\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: | < | < | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | .PP Note that for management of the \fBCLIPBOARD\fR selection (see below), the \fBclipboard\fR command may also be used. .PP The first argument to \fBselection\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: .TP \fBselection clear\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? . If \fIselection\fR exists anywhere on \fIwindow\fR's display, clear it so that no window owns the selection anymore. \fISelection\fR specifies the X selection that should be cleared, and should be an atom name such as \fBPRIMARY\fR or \fBCLIPBOARD\fR; see the Inter-Client Communication Conventions Manual for complete details. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . Returns an empty string. .TP \fBselection get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR? . Retrieves the value of \fIselection\fR from \fIwindow\fR's display and returns it as a result. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . \fIType\fR specifies the form in which the selection is to be returned (the desired |
︙ | ︙ | |||
59 60 61 62 63 64 65 | than the selection type; see the ICCCM for all the confusing details). If the selection is returned in a non-string format, such as \fBINTEGER\fR or \fBATOM\fR, the \fBselection\fR command converts it to string format as a collection of fields separated by spaces: atoms are converted to their textual names, and anything else is converted to hexadecimal integers. Note that \fBselection get\fR does not retrieve the selection in the \fBUTF8_STRING\fR format unless told to. | < | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | than the selection type; see the ICCCM for all the confusing details). If the selection is returned in a non-string format, such as \fBINTEGER\fR or \fBATOM\fR, the \fBselection\fR command converts it to string format as a collection of fields separated by spaces: atoms are converted to their textual names, and anything else is converted to hexadecimal integers. Note that \fBselection get\fR does not retrieve the selection in the \fBUTF8_STRING\fR format unless told to. .TP \fBselection handle\fR ?\fB\-selection\fR \fIs\fR? ?\fB\-type\fR \fIt\fR? ?\fB\-format\fR \fIf\fR? \fIwindow command\fR . Creates a handler for selection requests, such that \fIcommand\fR will be executed whenever selection \fIs\fR is owned by \fIwindow\fR and someone attempts to retrieve it in the form given by type \fIt\fR (e.g. \fIt\fR is specified in the \fBselection get\fR command). \fIS\fR defaults to \fBPRIMARY\fR, \fIt\fR defaults to \fBSTRING\fR, and \fIf\fR defaults to \fBSTRING\fR. If \fIcommand\fR is an empty string |
︙ | ︙ | |||
118 119 120 121 122 123 124 | .PP The \fIformat\fR argument is needed only for compatibility with selection requesters that do not use Tk. If Tk is being used to retrieve the selection then the value is converted back to a string at the requesting end, so \fIformat\fR is irrelevant. .RE | < | | | < < < < | < < < | < | < < < < < | < < | < < | < < | | | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | .PP The \fIformat\fR argument is needed only for compatibility with selection requesters that do not use Tk. If Tk is being used to retrieve the selection then the value is converted back to a string at the requesting end, so \fIformat\fR is irrelevant. .RE .TP \fBselection own\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? .TP \fBselection own\fR ?\fB\-command\fR \fIcommand\fR? ?\fB\-selection\fR \fIselection\fR? \fIwindow\fR . The first form of \fBselection own\fR returns the path name of the window in this application that owns \fIselection\fR on the display containing \fIwindow\fR, or an empty string if no window in this application owns the selection. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . .RS .PP The second form of \fBselection own\fR causes \fIwindow\fR to become the new owner of \fIselection\fR on \fIwindow\fR's display, returning an empty string as result. The existing owner, if any, is notified that it has lost the selection. If \fIcommand\fR is specified, it is a Tcl script to execute when some other window claims ownership of the selection away from \fIwindow\fR. \fISelection\fR defaults to PRIMARY. .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 .PP On X11 platforms, one of the standard selections available is the \fBSECONDARY\fR selection. Hardly anything uses it, but here is how to read it using Tk: .PP .CS set selContents [\fBselection get\fR \-selection SECONDARY] .CE .PP Many different types of data may be available for a selection; the special type \fBTARGETS\fR allows you to get a list of available types: .PP .CS foreach type [\fBselection get\fR \-type TARGETS] { puts "Selection PRIMARY supports type $type" } .CE .PP To claim the selection, you must first set up a handler to supply the data for the selection. Then you have to claim the selection... .CS # Set up the data handler ready for incoming requests set foo "This is a string with some data in it... blah blah" \fBselection handle\fR \-selection SECONDARY . getData proc getData {offset maxChars} { puts "Retrieving selection starting at $offset" return [string range $::foo $offset [expr {$offset+$maxChars-1}]] } # Now we grab the selection itself puts "Claiming selection" \fBselection own\fR \-command lost \-selection SECONDARY . proc lost {} { puts "Lost selection" } .CE .SH "SEE ALSO" clipboard(n) .SH KEYWORDS clear, format, handler, ICCCM, own, selection, target, type '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/send.n.
︙ | ︙ | |||
26 27 28 29 30 31 32 | contained entirely within the \fIcmd\fR argument. If one or more \fIarg\fRs are present, they are concatenated to form the command to be executed, just as for the \fBeval\fR command. .PP If the initial arguments of the command begin with .QW \- they are treated as options. The following options are currently defined: | < < < | < < < | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | contained entirely within the \fIcmd\fR argument. If one or more \fIarg\fRs are present, they are concatenated to form the command to be executed, just as for the \fBeval\fR command. .PP If the initial arguments of the command begin with .QW \- they are treated as options. The following options are currently defined: .TP \fB\-async\fR Requests asynchronous invocation. In this case the \fBsend\fR command will complete immediately without waiting for \fIcmd\fR to complete in the target application; no result will be available and errors in the sent command will be ignored. If the target application is in the same process as the sending application then the \fB\-async\fR option is ignored. .TP \fB\-displayof\fR \fIpathName\fR Specifies that the target application's main window is on the display of the window given by \fIpathName\fR, instead of the display containing the application's main window. .TP \fB\-\|\-\fR Serves no purpose except to terminate the list of options. This option is needed only if \fIapp\fR could contain a leading .QW \- character. .SH "APPLICATION NAMES" .PP The name of an application is set initially from the name of the |
︙ | ︙ | |||
92 93 94 95 96 97 98 | functionality is provided by the \fBdde\fR command instead. .SH EXAMPLE .PP This script fragment can be used to make an application that only runs once on a particular display. .CS if {[tk appname FoobarApp] ne "FoobarApp"} { | | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | functionality is provided by the \fBdde\fR command instead. .SH EXAMPLE .PP This script fragment can be used to make an application that only runs once on a particular display. .CS if {[tk appname FoobarApp] ne "FoobarApp"} { \fBsend\fR \-async FoobarApp RemoteStart $argv exit } # The command that will be called remotely, which raises # the application main window and opens the requested files proc RemoteStart args { raise . foreach filename $args { |
︙ | ︙ |
Changes to doc/spinbox.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH spinbox n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME spinbox \- Create and manipulate 'spinbox' value spinner widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH spinbox n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME spinbox \- Create and manipulate 'spinbox' value spinner widgets .SH SYNOPSIS \fBspinbox\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-highlightthickness \-repeatinterval \-background \-insertbackground \-selectbackground \-borderwidth \-insertborderwidth \-selectborderwidth \-cursor \-insertontime \-selectforeground \-exportselection \-insertwidth \-takefocus \-font \-insertofftime \-textvariable |
︙ | ︙ | |||
105 106 107 108 109 110 111 | .OP \-values values Values Must be a proper list value. If specified, the spinbox will use these values as to control its contents, starting with the first value. This option has precedence over the \fB\-from\fR and \fB\-to\fR range. .OP \-width width Width Specifies an integer value indicating the desired width of the spinbox window, in average-size characters of the widget's font. | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | .OP \-values values Values Must be a proper list value. If specified, the spinbox will use these values as to control its contents, starting with the first value. This option has precedence over the \fB\-from\fR and \fB\-to\fR range. .OP \-width width Width Specifies an integer value indicating the desired width of the spinbox window, in average-size characters of the widget's font. If the value is negative or zero, the widget picks a size just large enough to hold its current text. .OP \-wrap wrap wrap Must be a proper boolean value. If on, the spinbox will wrap around the values of data in the widget. .BE .SH DESCRIPTION .PP |
︙ | ︙ | |||
164 165 166 167 168 169 170 | The \fB\-validatecommand\fR will be called when the spinbox loses focus. .IP \fBkey\fR 10 The \fB\-validatecommand\fR will be called when the spinbox is edited. .IP \fBall\fR 10 The \fB\-validatecommand\fR will be called for all above conditions. .PP It is possible to perform percent substitutions on the \fB\-validatecommand\fR | | | | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | The \fB\-validatecommand\fR will be called when the spinbox loses focus. .IP \fBkey\fR 10 The \fB\-validatecommand\fR will be called when the spinbox is edited. .IP \fBall\fR 10 The \fB\-validatecommand\fR will be called for all above conditions. .PP It is possible to perform percent substitutions on the \fB\-validatecommand\fR and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. The following substitutions are recognized: .PP .IP \fB%d\fR 5 Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR, or \-1 for focus, forced or textvariable validation. .IP \fB%i\fR 5 Index of char string to be inserted/deleted, if any, otherwise \-1. .IP \fB%P\fR 5 |
︙ | ︙ | |||
209 210 211 212 213 214 215 | \fB\-validate\fR option will also set itself to \fBnone\fR when you edit the spinbox widget from within either the \fB\-validatecommand\fR or the \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the value of the widget during validation and still have the \fB\-validate\fR option set, you should include the command .CS | | | | | | | | | < < < < < < < < < < | < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | \fB\-validate\fR option will also set itself to \fBnone\fR when you edit the spinbox widget from within either the \fB\-validatecommand\fR or the \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the value of the widget during validation and still have the \fB\-validate\fR option set, you should include the command .CS \fI%W config \-validate %v\fR .CE in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you 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 spinbox widget to become out of sync with the \fB\-textvariable\fR. .PP Also, the \fB-validate\fR option will set itself to \fBnone\fR when the spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR and the \fB-validatecommand\fR returns false. For instance .CS \fIspinbox pathName \-from 1 \-to 10 \-validate all \-validatecommand {return 0}\fR .CE will in fact set the \fB-validate\fR option to \fBnone\fR because the default 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. .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" .PP The \fBspinbox\fR command creates a new Tcl command whose name is \fIpathName\fR. This command may be used to invoke various operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. .SS INDICES .PP Many of the widget commands for spinboxes take one or more indices as arguments. An index specifies a particular character in the spinbox's string, in any of the following ways: .TP 12 \fInumber\fR Specifies the character as a numerical index, where 0 corresponds to the first character in the string. .TP 12 \fBanchor\fR Indicates the anchor point for the selection, which is set with the \fBselect from\fR and \fBselect adjust\fR widget commands. .TP 12 \fBend\fR Indicates the character just after the last one in the spinbox's string. This is equivalent to specifying a numerical index equal to the length of the spinbox's string. .TP 12 \fBinsert\fR Indicates the character adjacent to and immediately following the insertion cursor. .TP 12 \fBsel.first\fR Indicates the first character in the selection. It is an error to use this form if the selection is not in the spinbox window. .TP 12 \fBsel.last\fR Indicates the character just after the last one in the selection. It is an error to use this form if the selection is not in the spinbox window. .TP 12 \fB@\fInumber\fR In this form, \fInumber\fR is treated as an x-coordinate in the spinbox's window; the character spanning that x-coordinate is used. For example, .QW \fB@0\fR indicates the left-most character in the window. .LP Abbreviations may be used for any of the forms above, e.g. .QW \fBe\fR or .QW \fBsel.f\fR . In general, out-of-range indices are automatically rounded to the nearest legal value. Indexes support the same simple interpretation as for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. .SS SUBCOMMANDS .PP The following commands are possible for spinbox widgets: .TP \fIpathName \fBbbox \fIindex\fR Returns a list of four numbers describing the bounding box of the character given by \fIindex\fR. The first two elements of the list give the x and y coordinates of the upper-left corner of the screen area covered by the character (in pixels relative to the widget) and the last two elements give the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBspinbox\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBspinbox\fR command. .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? Delete one or more elements of the spinbox. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns an empty string. .TP \fIpathName \fBget\fR Returns the spinbox's string. .TP \fIpathName \fBicursor \fIindex\fR Arrange for the insertion cursor to be displayed just before the character given by \fIindex\fR. Returns an empty string. .TP \fIpathName \fBidentify\fI x y\fR Returns the name of the window element corresponding to coordinates \fIx\fR and \fIy\fR in the spinbox. Return value is one of: \fBnone\fR, \fBbuttondown\fR, \fBbuttonup\fR, \fBentry\fR. .TP \fIpathName \fBindex\fI index\fR Returns the numerical index corresponding to \fIindex\fR. .TP \fIpathName \fBinsert \fIindex string\fR Insert the characters of \fIstring\fR just before the character indicated by \fIindex\fR. Returns an empty string. .TP \fIpathName \fBinvoke\fI element\fR Causes the specified element, either \fBbuttondown\fR or \fBbuttonup\fR, to be invoked, triggering the action associated with it. .TP \fIpathName \fBscan\fR \fIoption args\fR This command is used to implement scanning on spinboxes. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx\fR Records \fIx\fR and the current view in the spinbox window; used in conjunction with later \fBscan dragto\fR commands. Typically this command is associated with a mouse button press in the widget. It returns an empty string. .TP \fIpathName \fBscan dragto \fIx\fR This command computes the difference between its \fIx\fR argument and the \fIx\fR argument to the last \fBscan mark\fR command for the widget. It then adjusts the view left or right by 10 times the difference in x-coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the spinbox at high speed through the window. The return value is an empty string. .RE .TP \fIpathName \fBselection \fIoption arg\fR This command is used to adjust the selection within a spinbox. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection adjust \fIindex\fR Locate the end of the selection nearest to the character given by \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR (i.e. including but not going beyond \fIindex\fR). The other end of the selection is made the anchor point for future \fBselect to\fR commands. If the selection is not currently in the spinbox, then a new selection is created to include the characters between \fIindex\fR and the most recent selection anchor point, inclusive. Returns an empty string. .TP \fIpathName \fBselection clear\fR Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns an empty string. .TP \fIpathName \fBselection element\fR ?\fIelement\fR? Sets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed. .TP \fIpathName \fBselection from \fIindex\fR Set the selection anchor point to just before the character given by \fIindex\fR. Does not change the selection. Returns an empty string. .TP \fIpathName \fBselection present\fR Returns 1 if there is are characters selected in the spinbox, 0 if nothing is selected. .TP \fIpathName \fBselection range \fIstart end\fR Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the spinbox's selection is cleared. .TP \fIpathName \fBselection to \fIindex\fR If \fIindex\fR is before the anchor point, set the selection to the characters from \fIindex\fR up to but not including the anchor point. If \fIindex\fR is the same as the anchor point, do nothing. If \fIindex\fR is after the anchor point, set the selection to the characters from the anchor point up to but not including \fIindex\fR. The anchor point is determined by the most recent \fBselect from\fR or \fBselect adjust\fR command in this widget. If the selection is not in this widget then a new selection is created using the most recent anchor point specified for the widget. Returns an empty string. .RE .TP \fIpathName \fBset\fR ?\fIstring\fR? If \fIstring\fR is specified, the spinbox will try and set it to this value, otherwise it just returns the spinbox's string. If validation is on, it will occur when setting the string. .TP \fIpathName \fBvalidate\fR This command is used to force an evaluation of the \fB\-validatecommand\fR independent of the conditions specified by the \fB\-validate\fR option. This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. .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 spinbox'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 \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 or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation of one of these. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR |
︙ | ︙ |
Changes to doc/sysnotify.n.
1 2 3 4 5 6 7 8 9 | .\" Text automatically generated by txt2man '\" '\" Copyright (c) 2020 Kevin Walzer/WordTech Communications LLC. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk sysnotify n "" Tk "Tk Built-In Commands" .so man.macros | < | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | .\" Text automatically generated by txt2man '\" '\" Copyright (c) 2020 Kevin Walzer/WordTech Communications LLC. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk sysnotify n "" Tk "Tk Built-In Commands" .so man.macros .SH NAME sysnotify \- Creates a notification window with a title and message. .SH SYNOPSIS \fBtk sysnotify\fR \fItitle\fR \fImessage\fR .BE .SH DESCRIPTION .PP The \fBtk sysnotify\fR command creates a platform-specific system notification alert. Its intent is to provide a brief, unobtrusive notification to the user by popping up a window that briefly appears in a corner of the screen. .SH EXAMPLE .PP Here is an example of the \fBtk sysnotify\fR code: .PP .CS tk sysnotify "Alert" \e "This is just a test of the Tk System Notification Code." |
︙ | ︙ |
Changes to doc/systray.n.
1 2 3 4 5 6 7 8 9 | .\" Text automatically generated by txt2man '\" '\" Copyright (c) 2020 Kevin Walzer/WordTech Communications LLC. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk systray n "" Tk "Tk Built-In Commands" .so man.macros | < > | < > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | .\" Text automatically generated by txt2man '\" '\" Copyright (c) 2020 Kevin Walzer/WordTech Communications LLC. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk systray n "" Tk "Tk Built-In Commands" .so man.macros .SH NAME systray \- Creates an icon display in the platform-specific system tray. .SH SYNOPSIS \fBtk systray create \fI\-image image\fR \fI?\-text text\fR? \fI?\-button1 callback?\fR \fI?\-button3 callback?\fR .sp \fBtk systray configure \fI?option? ?value option value ...?\fR .sp \fBtk systray exists\fR .sp \fBtk systray destroy\fR .BE .BE .SH DESCRIPTION .PP .\" METHOD: create The \fBtk systray create\fR command creates an icon in the platform-specific tray. The widget is configured with a Tk image for the icon display, an optional string for display in a tooltip, and optional callbacks that are |
︙ | ︙ |
Changes to doc/text.n.
︙ | ︙ | |||
9 10 11 12 13 14 15 | .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate 'text' hypertext editing widgets .SH SYNOPSIS .nf | | | | | < | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate 'text' hypertext editing widgets .SH SYNOPSIS .nf \fBtext\fR \fIpathName \fR?\fIoptions\fR? \fBtk_textCopy\fR \fIpathName\fR \fBtk_textCut\fR \fIpathName\fR \fBtk_textPaste\fR \fIpathName\fR .SO \-background \-highlightthickness \-relief \-borderwidth \-insertbackground \-selectbackground \-cursor \-insertborderwidth \-selectborderwidth \-exportselection \-insertofftime \-selectforeground \-font \-insertontime \-setgrid \-foreground \-insertwidth \-takefocus |
︙ | ︙ | |||
413 414 415 416 417 418 419 | as determined by the \fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR options for the text widget. However, display options may be associated with individual tags using the .QW "\fIpathName \fBtag configure\fR" widget command. If a character has been tagged, then the display options associated with the tag override the default display style. The following options are currently supported for tags: | < < < < < < < < < < < | | < < < < < < | | < < < < < < < < < < < < | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | as determined by the \fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR options for the text widget. However, display options may be associated with individual tags using the .QW "\fIpathName \fBtag configure\fR" widget command. If a character has been tagged, then the display options associated with the tag override the default display style. The following options are currently supported for tags: .TP \fB\-background \fIcolor\fR . \fIColor\fR specifies the background color to use for characters associated with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-bgstipple \fIbitmap\fR . \fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is specified as an empty string, then a solid fill will be used for the background. .TP \fB\-borderwidth \fIpixels\fR . \fIPixels\fR specifies the width of a border to draw around the tag using any of the forms accepted by \fBTk_GetPixels\fR. This option should be used in conjunction with the \fB\-relief\fR option to provide the desired border. .TP \fB\-elide \fIboolean\fR . \fIElide\fR specifies whether the data should be elided. Elided data (characters, images, embedded windows, etc.) is not displayed and takes no space on screen, but further on behaves just as normal data. .TP \fB\-fgstipple \fIbitmap\fR . \fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing text and other foreground information such as underlines. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is specified as an empty string, then a solid fill will be used. .TP \fB\-font \fIfontName\fR . \fIFontName\fR is the name of a font to use for drawing characters. It may have any of the forms accepted by \fBTk_GetFont\fR. .TP \fB\-foreground \fIcolor\fR . \fIColor\fR specifies the color to use when drawing text and other foreground information such as underlines. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-justify \fIjustify\fR . If the first non-elided character of a display line has a tag for which this option has been specified, then \fIjustify\fR determines how to justify the line. It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR. If a line wraps, then the justification for each line on the display is determined by the first non-elided character of that display line. .TP \fB\-lmargin1 \fIpixels\fR . If the first non-elided character of a text line has a tag for which this option has been specified, then \fIpixels\fR specifies how much the line should be indented from the left edge of the window. \fIPixels\fR may have any of the standard forms for screen distances. If a line of text wraps, this option only applies to the first line on the display; the \fB\-lmargin2\fR option controls the indentation for subsequent lines. .TP \fB\-lmargin2 \fIpixels\fR . If the first non-elided character of a display line has a tag for which this option has been specified, and if the display line is not the first for its text line (i.e., the text line has wrapped), then \fIpixels\fR specifies how much the line should be indented from the left edge of the window. \fIPixels\fR may have any of the standard forms for screen distances. This option is only used when wrapping is enabled, and it only applies to the second and later display lines for a text line. .TP \fB\-lmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not contain characters because they are indented by \fB\-lmargin1\fR or \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 specified as an empty string, then the color used is specified by the \fB-background\fR tag option (or, if this is also unspecified, by the \fB-background\fR widget option). .TP \fB\-offset \fIpixels\fR . \fIPixels\fR specifies an amount by which the text's baseline should be offset vertically from the baseline of the overall line, in pixels. For example, a positive offset can be used for superscripts and a negative offset can be used for subscripts. \fIPixels\fR may have any of the standard forms for screen distances. .TP \fB\-overstrike \fIboolean\fR . Specifies whether or not to draw a horizontal rule through the middle of characters. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP \fB\-overstrikefg \fIcolor\fR . \fIColor\fR specifies the color to use when displaying the overstrike. It may 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 specified by the \fB\-foreground\fR tag option is used. .TP \fB\-relief \fIrelief\fR . \fIRelief\fR specifies the relief style to use for drawing the border, in any of the forms accepted by \fBTk_GetRelief\fR. This option is used in conjunction with the \fB\-borderwidth\fR option to enable to the desired border appearance. .TP \fB\-rmargin \fIpixels\fR . If the first non-elided character of a display line has a tag for which this option has been specified, then \fIpixels\fR specifies how wide a margin to leave between the end of the line and the right edge of the window. \fIPixels\fR may have any of the standard forms for screen distances. This option is only used when wrapping is enabled. If a text line wraps, the right margin for each line on the display is determined by the first non-elided character of that display line. .TP \fB\-rmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not 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 been specified, or if it is specified as an empty string, then the color used is specified by the \fB-background\fR tag option (or, if this is also unspecified, by the \fB-background\fR widget option). .TP \fB\-selectbackground \fIcolor\fR \fIColor\fR specifies the background color to use when displaying selected items. It may 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 specified by the \fB\-background\fR tag option is used. .TP \fB\-selectforeground \fIcolor\fR \fIColor\fR specifies the foreground color to use when displaying selected items. It may 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 specified by the \fB\-foreground\fR tag option is used. .TP \fB\-spacing1 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left above each text line, using any of the standard forms for screen distances. If a line wraps, this option only applies to the first line on the display. .TP \fB\-spacing2 \fIpixels\fR . For lines that wrap, this option specifies how much additional space to leave between the display lines for a single text line. \fIPixels\fR may have any of the standard forms for screen distances. .TP \fB\-spacing3 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left below each text line, using any of the standard forms for screen distances. If a line wraps, this option only applies to the last line on the display. .TP \fB\-tabs \fItabList\fR . \fITabList\fR specifies a set of tab stops in the same form as for the \fB\-tabs\fR option for the text widget. This option only applies to a display line if it applies to the first non-elided character on that display line. If this option is specified as an empty string, it cancels the option, leaving it unspecified for the tag (the default). If the option is specified as a non-empty string that is an empty list, such as \fB\-tags\0{\0}\fR, then it requests default 8-character tabs as described for the \fB\-tags\fR widget option. .TP \fB\-tabstyle \fIstyle\fR . \fIStyle\fR specifies either the \fItabular\fR or \fIwordprocessor\fR style of tabbing to use for the text widget. This option only applies to a display line if it applies to the first non-elided character on that display line. If this option is specified as an empty string, it cancels the option, leaving it unspecified for the tag (the default). .TP \fB\-underline \fIboolean\fR . \fIBoolean\fR specifies whether or not to draw an underline underneath characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP \fB\-underlinefg \fIcolor\fR . \fIColor\fR specifies the color to use when displaying the underline. It may 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 specified by the \fB\-foreground\fR tag option is used. .TP \fB\-wrap \fImode\fR . \fIMode\fR specifies how to handle lines that are wider than the text's window. This option only applies to a display line if it applies to the first non-elided character on that display line. It has the same legal values as the \fB\-wrap\fR option for the text widget: \fBnone\fR, |
︙ | ︙ | |||
722 723 724 725 726 727 728 | unit's worth of index space in the text widget, and it may be referred to either by the name of its embedded window or by its position in the widget's index space. If the range of text containing the embedded window is deleted then the window is destroyed. Similarly if the text widget as a whole is deleted, then the window is destroyed. .PP Eliding an embedded window immediately after scheduling it for creation via | | | < < < < < < | 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 | unit's worth of index space in the text widget, and it may be referred to either by the name of its embedded window or by its position in the widget's index space. If the range of text containing the embedded window is deleted then the window is destroyed. Similarly if the text widget as a whole is deleted, then the window is destroyed. .PP Eliding an embedded window immediately after scheduling it for creation via \fIpathName \fBwindow create \fIindex \fB-create\fR will prevent it from being effectively created. Uneliding an elided embedded window scheduled for creation via \fIpathName \fBwindow create \fIindex \fB-create\fR will automatically trigger the associated creation script. After destroying an elided embedded window, the latter won't get automatically recreated. .PP When an embedded window is added to a text widget with the \fIpathName \fBwindow create\fR widget command, several configuration options may be associated with it. These options may be modified later with the \fIpathName \fBwindow configure\fR widget command. The following options are currently supported: .TP \fB\-align \fIwhere\fR . If the window is not as tall as the line in which it is displayed, this option determines where the window is displayed in the line. \fIWhere\fR must have one of the values \fBtop\fR (align the top of the window with the top of the line), \fBcenter\fR (center the window within the range of the line), \fBbottom\fR (align the bottom of the window with the bottom of the line's area), or \fBbaseline\fR (align the bottom of the window with the baseline of the line). .TP \fB\-create \fIscript\fR . Specifies a Tcl script that may be evaluated to create the window for the annotation. If no \fB\-window\fR option has been specified for the annotation this script will be evaluated when the annotation is about to be displayed on the screen. \fIScript\fR must create a window for the annotation and return the name of that window as its result. Two substitutions will be performed in \fIscript\fR before evaluation. \fI%W\fR will be substituted by the name of the parent text widget, and \fI%%\fR will be substituted by a single \fI%\fR. If the annotation's window should ever be deleted, \fIscript\fR will be evaluated again the next time the annotation is displayed. .TP \fB\-padx \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on each side of the embedded window. It may have any of the usual forms defined for a screen distance. .TP \fB\-pady \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on the top and on the bottom of the embedded window. It may have any of the usual forms defined for a screen distance. .TP \fB\-stretch \fIboolean\fR . If the requested height of the embedded window is less than the height of the line in which it is displayed, this option can be used to specify whether the window should be stretched vertically to fill its line. If the \fB\-pady\fR option has been specified as well, then the requested padding will be retained even if the window is stretched. .TP \fB\-window \fIpathName\fR . Specifies the name of a window to display in the annotation. Note that if a \fIpathName\fR has been set, then later configuring a window to the empty string will not delete the widget corresponding to the old \fIpathName\fR. Rather it will remove the association between the old \fIpathName\fR and the |
︙ | ︙ | |||
807 808 809 810 811 812 813 | space in the text widget, and it may be referred to either by its position in the widget's index space, or the name it is assigned when the image is inserted into the text widget with \fIpathName \fBimage create\fR. If the range of text containing the embedded image is deleted then that copy of the image is removed from the screen. .PP Eliding an embedded image immediately after scheduling it for creation via | | | < < < < < | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 | space in the text widget, and it may be referred to either by its position in the widget's index space, or the name it is assigned when the image is inserted into the text widget with \fIpathName \fBimage create\fR. If the range of text containing the embedded image is deleted then that copy of the image is removed from the screen. .PP Eliding an embedded image immediately after scheduling it for creation via \fIpathName \fBimage create \fIindex \fB-create\fR will prevent it from being effectively created. Uneliding an elided embedded image scheduled for creation via \fIpathName \fBimage create \fIindex \fB-create\fR will automatically trigger the associated creation script. After destroying an elided embedded image, the latter won't get automatically recreated. .PP When an embedded image is added to a text widget with the \fIpathName \fBimage create\fR widget command, a name unique to this instance of the image is returned. This name may then be used to refer to this image instance. The name is taken to be the value of the \fB\-name\fR option (described below). If the \fB\-name\fR option is not provided, the \fB\-image\fR name is used instead. If the \fIimageName\fR is already in use in the text widget, then \fB#\fInn\fR is added to the end of the \fIimageName\fR, where \fInn\fR is an arbitrary integer. This insures the \fIimageName\fR is unique. Once this name is assigned to this instance of the image, it does not change, even though the \fB\-image\fR or \fB\-name\fR values can be changed with \fIpathName \fBimage configure\fR. .PP When an embedded image is added to a text widget with the \fIpathName \fBimage create\fR widget command, several configuration options may be associated with it. These options may be modified later with the \fIpathName \fBimage configure\fR widget command. The following options are currently supported: .TP \fB\-align \fIwhere\fR . If the image is not as tall as the line in which it is displayed, this option determines where the image is displayed in the line. \fIWhere\fR must have one of the values \fBtop\fR (align the top of the image with the top of the line), \fBcenter\fR (center the image within the range of the line), \fBbottom\fR (align the bottom of the image with the bottom of the line's area), or \fBbaseline\fR (align the bottom of the image with the baseline of the line). .TP \fB\-image \fIimage\fR . Specifies the name of the Tk image to display in the annotation. If \fIimage\fR is not a valid Tk image, then an error is returned. .TP \fB\-name \fIImageName\fR . Specifies the name by which this image instance may be referenced in the text widget. If \fIImageName\fR is not supplied, then the name of the Tk image is used instead. If the \fIimageName\fR is already in use, \fI#nn\fR is appended to the end of the name as described above. .TP \fB\-padx \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on each side of the embedded image. It may have any of the usual forms defined for a screen distance. .TP \fB\-pady \fIpixels\fR . \fIPixels\fR specifies the amount of extra space to leave on the top and on the bottom of the embedded image. It may have any of the usual forms defined for a screen distance. .SH "THE SELECTION" |
︙ | ︙ | |||
1016 1017 1018 1019 1020 1021 1022 | creation of peer widgets. .SH "ASYNCHRONOUS UPDATE OF LINE HEIGHTS" .PP In order to maintain a responsive user-experience, the text widget calculates lines metrics (line heights in pixels) asynchronously. Because of this, some commands of the text widget may return wrong results if the asynchronous calculations are not finished at the time of calling. This applies to | | | 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 | creation of peer widgets. .SH "ASYNCHRONOUS UPDATE OF LINE HEIGHTS" .PP In order to maintain a responsive user-experience, the text widget calculates lines metrics (line heights in pixels) asynchronously. Because of this, some commands of the text widget may return wrong results if the asynchronous calculations are not finished at the time of calling. This applies to \fIpathName \fBcount -ypixels\fR and \fIpathName \fByview\fR. .PP Again for performance reasons, it would not be appropriate to let these commands always wait for the end of the update calculation each time they are called. In most use cases of these commands a more or less inaccurate result does not really matter compared to execution speed. .PP In case accurate result is needed (and if the text widget is managed by a |
︙ | ︙ | |||
1098 1099 1100 1101 1102 1103 1104 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIPathName\fR is the name of the command, which is the same as the text widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for text widgets: | < < | < | < < | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 | operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg ...\fR? .CE \fIPathName\fR is the name of the command, which is the same as the text widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for text widgets: .TP \fIpathName \fBbbox \fIindex\fR . Returns a list of four elements describing the screen area of the character given by \fIindex\fR. The first two elements of the list give the x and y coordinates of the upper-left corner of the area occupied by the character, and the last two elements give the width and height of the area. If the character is only partially visible on the screen, then the return value reflects just the visible part. If the character is not visible on the screen then the return value is an empty list. .TP \fIpathName \fBcget\fR \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBtext\fR command. .TP \fIpathName \fBcompare\fR \fIindex1 op index2\fR . Compares the indices given by \fIindex1\fR and \fIindex2\fR according to the relational operator given by \fIop\fR, and returns 1 if the relationship is satisfied and 0 if it is not. \fIOp\fR must be one of the operators <, <=, ==, >=, >, or !=. If \fIop\fR is == then 1 is returned if the two indices refer to 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. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBtext\fR command. .TP \fIpathName \fBcount\fR ?\fIoptions\fR? \fIindex1 index2\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 for each of the possible options). The actual items which are counted depend on the options given. The result is a list of integers, one for the result of |
︙ | ︙ | |||
1203 1204 1205 1206 1207 1208 1209 | The command returns a positive or negative integer corresponding to the number of items counted between the two indices. One such integer is returned for each counting option given, so a list is returned if more than one option was supplied. For example .QW ".text count \-xpixels \-ypixels 1.3 4.5" is perfectly valid and will return a list of two elements. .RE | < < | 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 | The command returns a positive or negative integer corresponding to the number of items counted between the two indices. One such integer is returned for each counting option given, so a list is returned if more than one option was supplied. For example .QW ".text count \-xpixels \-ypixels 1.3 4.5" is perfectly valid and will return a list of two elements. .RE .TP \fIpathName \fBdebug \fR?\fIboolean\fR? . If \fIboolean\fR is specified, then it must have one of the true or false values accepted by Tcl_GetBoolean. If the value is a true one then internal consistency checks will be turned on in the B-tree code associated with text widgets. If \fIboolean\fR has a false value then the debugging checks will be turned off. In either case the command returns an empty string. If \fIboolean\fR is not specified then the command returns \fBon\fR or \fBoff\fR to indicate whether or not debugging is turned on. There is a single debugging switch shared by all text widgets: turning debugging on or off in any widget turns it on or off for all widgets. For widgets with large amounts of text, the consistency checks may cause a noticeable slow-down. .RS .PP When debugging is turned on, the drawing routines of the text widget set the global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR to the lists of indices that are redrawn. The values of these variables are tested by Tk's test suite. .RE .TP \fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR? . Delete a range of characters from the text. If both \fIindex1\fR and \fIindex2\fR are specified, then delete all the characters starting with the one given by \fIindex1\fR and stopping just before \fIindex2\fR (i.e. the character at |
︙ | ︙ | |||
1252 1253 1254 1255 1256 1257 1258 | All indices are first checked for validity before any deletions are made. They are sorted and the text is removed from the last range to the first range so deleted text does not cause an undesired index shifting side-effects. If multiple ranges with the same start index are given, then the longest range is used. If overlapping ranges are given, then they will be merged into spans that do not cause deletion of text outside the given ranges due to text shifted during deletion. | < < < < < < < < < < | 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 | All indices are first checked for validity before any deletions are made. They are sorted and the text is removed from the last range to the first range so deleted text does not cause an undesired index shifting side-effects. If multiple ranges with the same start index are given, then the longest range is used. If overlapping ranges are given, then they will be merged into spans that do not cause deletion of text outside the given ranges due to text shifted during deletion. .TP \fIpathName \fBdlineinfo \fIindex\fR . Returns a list with five elements describing the area occupied by the display line containing \fIindex\fR. The first two elements of the list give the x and y coordinates of the upper-left corner of the area occupied by the line, the third and fourth elements give the width and height of the area, and the fifth element gives the position of the baseline for the line, measured down from the top of the area. All of this information is measured in pixels. If the current wrap mode is \fBnone\fR and the line extends beyond the boundaries of the window, the area returned reflects the entire area of the line, including the portions that are out of the window. If the line is shorter than the full width of the window then the area returned reflects just the portion of the line that is occupied by characters and embedded windows. If the display line containing \fIindex\fR is not visible on the screen then the return value is an empty list. .TP \fIpathName \fBdump \fR?\fIswitches\fR? \fIindex1 \fR?\fIindex2\fR? . Return the contents of the text widget from \fIindex1\fR up to, but not including \fIindex2\fR, including the text and information about marks, tags, and embedded windows. If \fIindex2\fR is not specified, then it defaults to one character past \fIindex1\fR. The information is returned in the following format: .RS .LP \fIkey1 value1 index1 key2 value2 index2\fR ... .LP The possible \fIkey\fR values are \fBtext\fR, \fBmark\fR, \fBtagon\fR, \fBtagoff\fR, \fBimage\fR, and \fBwindow\fR. The corresponding \fIvalue\fR is the text, mark name, tag name, image name, or window name. The \fIindex\fR information is the index of the start of the text, mark, tag transition, image or window. One or more of the following switches (or abbreviations thereof) may be specified to control the dump: .TP \fB\-all\fR . Return information about all elements: text, marks, tags, images and windows. This is the default. .TP \fB\-command \fIcommand\fR . Instead of returning the information as the result of the dump operation, invoke the \fIcommand\fR on each element of the text widget within the range. The command has three arguments appended to it before it is evaluated: the \fIkey\fR, \fIvalue\fR, and \fIindex\fR. .TP \fB\-image\fR . Include information about images in the dump results. .TP \fB\-mark\fR . Include information about marks in the dump results. .TP \fB\-tag\fR . Include information about tag transitions in the dump results. Tag information is returned as \fBtagon\fR and \fBtagoff\fR elements that indicate the begin and end of each range of each tag, respectively. .TP \fB\-text\fR . Include information about text in the dump results. The value is the text up to the next element or the end of range indicated by \fIindex2\fR. A text element does not span newlines. A multi-line block of text that contains no marks or tag transitions will still be dumped as a set of text segments that each end with a newline. The newline is part of the value. .TP \fB\-window\fR . Include information about embedded windows in the dump results. The value of a window is its Tk pathname, unless the window has not been created yet. (It must have a create script.) In this case an empty string is returned, and you must query the window by its index position to get more information. .RE .TP \fIpathName \fBedit \fIoption \fR?\fIarg ...\fR? . This command controls the undo mechanism and the modified flag. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBedit\fR argument. The following forms of the command are currently supported: |
︙ | ︙ | |||
1388 1389 1390 1391 1392 1393 1394 | . Undoes the last edit action when the \fB\-undo\fR option is true, and returns a list of indices indicating what ranges were changed by the undo operation. An edit action is defined as all the insert and delete commands that are recorded on the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the \fB\-undo\fR option is false. .RE | < < | 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 | . Undoes the last edit action when the \fB\-undo\fR option is true, and returns a list of indices indicating what ranges were changed by the undo operation. An edit action is defined as all the insert and delete commands that are recorded on the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the \fB\-undo\fR option is false. .RE .TP \fIpathName \fBget\fR ?\fB\-displaychars\fR? ?\fB\-\-\fR? \fIindex1\fR ?\fIindex2 ...\fR? . Return a range of characters from the text. The return value will be all the characters in the text starting with the one whose index is \fIindex1\fR and ending just before the one whose index is \fIindex2\fR (the character at \fIindex2\fR will not be returned). If \fIindex2\fR is omitted then the single character at \fIindex1\fR is returned. If there are no characters in the specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR is less than or equal to \fIindex1\fR) then an empty string is returned. If the specified range contains embedded windows, no information about them is included in the returned string. If multiple index pairs are given, multiple ranges of text will be returned in a list. Invalid ranges will not be represented with empty strings in the list. The ranges are returned in the order passed to \fIpathName \fBget\fR. If the \fB\-displaychars\fR option is given, then, within each range, only those characters which are not elided will be returned. This may have the effect that some of the returned ranges are empty strings. .TP \fIpathName \fBimage \fIoption \fR?\fIarg ...\fR? . This command is used to manipulate embedded images. The behavior of the command depends on the \fIoption\fR argument that follows the \fBimage\fR argument. The following forms of the command are currently supported: .RS |
︙ | ︙ | |||
1450 1451 1452 1453 1454 1455 1456 | identifier returned. .TP \fIpathName \fBimage names\fR . Returns a list whose elements are the names of all image instances currently embedded in \fIwindow\fR. .RE | < < < | 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 | identifier returned. .TP \fIpathName \fBimage names\fR . Returns a list whose elements are the names of all image instances currently embedded in \fIwindow\fR. .RE .TP \fIpathName \fBindex \fIindex\fR . Returns the position corresponding to \fIindex\fR in the form \fIline.char\fR where \fIline\fR is the line number and \fIchar\fR is the character number. \fIIndex\fR may have any of the forms described under \fBINDICES\fR above. .TP \fIpathName \fBinsert \fIindex chars \fR?\fItagList chars tagList ...\fR? . Inserts all of the \fIchars\fR arguments just before the character at \fIindex\fR. If \fIindex\fR refers to the end of the text (the character after the last newline) then the new text is inserted just before the last newline instead. If there is a single \fIchars\fR argument and no \fItagList\fR, then the new text will receive any tags that are present on both the character before and the character after the insertion point; if a tag is present on only one of these characters then it will not be applied to the new text. If \fItagList\fR is specified then it consists of a list of tag names; the new characters will receive all of the tags in this list and no others, regardless of the tags present around the insertion point. If multiple \fIchars\fR\-\fItagList\fR argument pairs are present, they produce the same effect as if a separate \fIpathName \fBinsert\fR widget command had been issued for each pair, in order. The last \fItagList\fR argument may be omitted. .TP \fIpathName \fBmark \fIoption \fR?\fIarg ...\fR? . This command is used to manipulate marks. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBmark\fR argument. The following forms of the command are currently supported: .RS |
︙ | ︙ | |||
1506 1507 1508 1509 1510 1511 1512 | specified in numerical form, then the search for the next mark begins at that index. If \fIindex\fR is the name of a mark, then the search for the next mark begins immediately after that mark. This can still return a mark at the same position if there are multiple marks at the same index. These semantics mean that the \fBmark next\fR operation can be used to step through all the marks in a text widget in the same order as the mark information returned by the \fIpathName \fBdump\fR operation. If a mark has been set to the special | | | 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 | specified in numerical form, then the search for the next mark begins at that index. If \fIindex\fR is the name of a mark, then the search for the next mark begins immediately after that mark. This can still return a mark at the same position if there are multiple marks at the same index. These semantics mean that the \fBmark next\fR operation can be used to step through all the marks in a text widget in the same order as the mark information returned by the \fIpathName \fBdump\fR operation. If a mark has been set to the special \fBend\fR index, then it appears to be \fIafter\fR \fBend\fR with respect to the \fIpathName \fBmark next\fR operation. An empty string is returned if there are no marks after \fIindex\fR. .TP \fIpathName \fBmark previous \fIindex\fR . Returns the name of the mark at or before \fIindex\fR. If \fIindex\fR is specified in numerical form, then the search for the previous mark begins with |
︙ | ︙ | |||
1538 1539 1540 1541 1542 1543 1544 | . Remove the mark corresponding to each of the \fImarkName\fR arguments. The removed marks will not be usable in indices and will not be returned by future calls to .QW "\fIpathName \fBmark names\fR" . This command returns an empty string. .RE | < < < < | < < | 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 | . Remove the mark corresponding to each of the \fImarkName\fR arguments. The removed marks will not be usable in indices and will not be returned by future calls to .QW "\fIpathName \fBmark names\fR" . This command returns an empty string. .RE .TP \fIpathName \fBpeer \fIoption args\fR . This command is used to create and query widget peers. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBpeer create \fInewPathName\fR ?\fIoptions\fR? . Creates a peer text widget with the given \fInewPathName\fR, and any optional standard configuration options (as for the \fItext\fR command). By default the peer will have the same start and end line as the parent widget, but these can be overridden with the standard configuration options. .TP \fIpathName \fBpeer names\fR . Returns a list of peers of this widget (this does not include the widget itself). The order within this list is undefined. .RE .TP \fIpathName \fBpendingsync\fR Returns 1 if the line heights calculations are not up-to-date, 0 otherwise. .TP \fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR? Replaces the range of characters between \fIindex1\fR and \fIindex2\fR with the given characters and tags. See the section on \fIpathName \fBinsert\fR for an explanation of the handling of the \fItagList...\fR arguments, and the section on \fIpathName \fBdelete\fR for an explanation of the handling of the indices. If \fIindex2\fR corresponds to an index earlier in the text than \fIindex1\fR, an error will be generated. .RS .PP The deletion and insertion are arranged so that no unnecessary scrolling of the window or movement of insertion cursor occurs. In addition the undo/redo stack are correctly modified, if undo operations are active in the text widget. The command returns an empty string. .RE .TP \fIpathName \fBscan \fIoption args\fR . This command is used to implement scanning on texts. It has two forms, depending on \fIoption\fR: .RS .TP |
︙ | ︙ | |||
1605 1606 1607 1608 1609 1610 1611 | This command computes the difference between its \fIx\fR and \fIy\fR arguments and the \fIx\fR and \fIy\fR arguments to the last \fIpathName \fBscan mark\fR command for the widget. It then adjusts the view by 10 times the difference in coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the text at high speed through the window. The return value is an empty string. .RE | < < < < < < < < < < < < < | 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 | This command computes the difference between its \fIx\fR and \fIy\fR arguments and the \fIx\fR and \fIy\fR arguments to the last \fIpathName \fBscan mark\fR command for the widget. It then adjusts the view by 10 times the difference in coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the text at high speed through the window. The return value is an empty string. .RE .TP \fIpathName \fBsearch \fR?\fIswitches\fR? \fIpattern index \fR?\fIstopIndex\fR? . Searches the text in \fIpathName\fR starting at \fIindex\fR for a range of characters that matches \fIpattern\fR. If a match is found, the index of the first character in the match is returned as result; otherwise an empty string is returned. One or more of the following switches (or abbreviations thereof) may be specified to control the search: .RS .TP \fB\-forwards\fR . The search will proceed forward through the text, finding the first matching range starting at or after the position given by \fIindex\fR. This is the default. .TP \fB\-backwards\fR . The search will proceed backward through the text, finding the matching range closest to \fIindex\fR whose first character is before \fIindex\fR (it is not allowed to be at \fIindex\fR). Note that, for a variety of reasons, backwards searches can be substantially slower than forwards searches (particularly when using \fB\-regexp\fR), so it is recommended that performance-critical code use forward searches. .TP \fB\-exact\fR . Use exact matching: the characters in the matching range must be identical to those in \fIpattern\fR. This is the default. .TP \fB\-regexp\fR . Treat \fIpattern\fR as a regular expression and match it against the text using the rules for regular expressions (see the \fBregexp\fR command and the \fBre_syntax\fR page for details). The default matching automatically passes both the \fB\-lineanchor\fR and \fB\-linestop\fR options to the regexp engine (unless \fB\-nolinestop\fR is used), so that \fI^$\fR match beginning and end of line, and \fI.\fR, \fI[^\fR sequences will never match the newline character \fI\en\fR. .TP \fB\-nolinestop\fR . This allows \fI.\fR and \fI[^\fR sequences to match the newline character \fI\en\fR, which they will otherwise not do (see the \fBregexp\fR command for details). This option is only meaningful if \fB\-regexp\fR is also given, and an error will be thrown otherwise. For example, to match the entire text, use .QW "\fIpathName \fBsearch \-nolinestop \-regexp\fR \N'34'.*\N'34' 1.0" . .TP \fB\-nocase\fR . Ignore case differences between the pattern and the text. .TP \fB\-count\fI varName\fR . The argument following \fB\-count\fR gives the name of a variable; if a match is found, the number of index positions between beginning and end of the matching range will be stored in the variable. If there are no embedded images or windows in the matching range (and there are no elided characters if \fB\-elide\fR is not given), this is equivalent to the number of characters matched. In either case, the range \fImatchIdx\fR to \fImatchIdx + $count chars\fR will return the entire matched text. .TP \fB\-all\fR . Find all matches in the given range and return a list of the indices of the first character of each match. If a \fB\-count\fI varName\fR switch is given, then \fIvarName\fR is also set to a list containing one element for each successful match. Note that, even for exact searches, the elements of this list may be different, if there are embedded images, windows or hidden text. Searches with \fB\-all\fR behave very similarly to the Tcl command \fBregexp \-all\fR, in that overlapping matches are not normally returned. For example, applying an \fB\-all\fR search of the pattern .QW \ew+ against .QW "hello there" will just match twice, once for each word, and matching .QW "Z[a\-z]+Z" against .QW ZooZooZoo will just match once. .TP \fB\-overlap\fR . When performing \fB\-all\fR searches, the normal behaviour is that matches which overlap an already-found match will not be returned. This switch changes that behaviour so that all matches which are not totally enclosed within another match are returned. For example, applying an \fB\-overlap\fR search of the pattern .QW \ew+ against .QW "hello there" will just match twice (i.e. no different to just \fB\-all\fR), but matching .QW Z[a\-z]+Z against .QW ZooZooZoo will now match twice. An error will be thrown if this switch is used without \fB\-all\fR. .TP \fB\-strictlimits\fR . When performing any search, the normal behaviour is that the start and stop limits are checked with respect to the start of the matching text. With the \fB\-strictlimits\fR flag, the entire matching range must lie inside the start and stop limits specified for the match to be valid. .TP \fB\-elide\fR . Find elided (hidden) text as well. By default only displayed text is searched. .TP \fB\-\|\-\fR . This switch has no effect except to terminate the list of switches: the next argument will be treated as \fIpattern\fR even if it starts with \fB\-\fR. .PP The matching range may be within a single line of text, or run across multiple |
︙ | ︙ | |||
1749 1750 1751 1752 1753 1754 1755 | beginning or end of the text is reached, the search continues at the other end until the starting location is reached again; if \fIstopIndex\fR is specified, no wrap-around will occur. This means that, for example, if the search is \fB\-forwards\fR but \fIstopIndex\fR is earlier in the text than \fIstartIndex\fR, nothing will ever be found. See \fBKNOWN BUGS\fR below for a number of minor limitations of the \fIpathName \fBsearch\fR command. .RE | < < | < < | < < | 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 | beginning or end of the text is reached, the search continues at the other end until the starting location is reached again; if \fIstopIndex\fR is specified, no wrap-around will occur. This means that, for example, if the search is \fB\-forwards\fR but \fIstopIndex\fR is earlier in the text than \fIstartIndex\fR, nothing will ever be found. See \fBKNOWN BUGS\fR below for a number of minor limitations of the \fIpathName \fBsearch\fR command. .RE .TP \fIpathName \fBsee \fIindex\fR . Adjusts the view in the window so that the character given by \fIindex\fR is completely visible. If \fIindex\fR is already visible then the command does nothing. If \fIindex\fR is a short distance out of view, the command adjusts the view just enough to make \fIindex\fR visible at the edge of the window. If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the window. .TP \fIpathName \fBsync\fR ?\fB-command \fIcommand\fR? Controls the synchronization of the view of the text widget. .RS .TP \fIpathName \fBsync\fR Immediately brings the line metrics up-to-date by forcing computation of any outdated line heights. The command returns immediately if there is no such outdated line heights, otherwise it returns only at the end of the computation. The command returns an empty string. .TP \fIpathName \fBsync -command \fIcommand\fR Schedules \fIcommand\fR to be executed (by the event loop) exactly once as soon as all line heights are up-to-date. If there are no pending line metrics calculations, the scheduling is immediate. The command returns the empty string. \fBbgerror\fR is called on \fIcommand\fR failure. .RE .TP \fIpathName \fBtag \fIoption \fR?\fIarg ...\fR? . This command is used to manipulate tags. The exact behavior of the command depends on the \fIoption\fR argument that follows the \fBtag\fR argument. The following forms of the command are currently supported: .RS |
︙ | ︙ | |||
1922 1923 1924 1925 1926 1927 1928 | starting at \fIindex2\fR will be considered). If several matching ranges exist, the one closest to \fIindex1\fR is chosen. The command's return value is a list containing two elements, which are the index of the first character of the range and the index of the character just after the last one in the range. If no matching range is found then the return value is an empty string. If \fIindex2\fR is not given then it defaults to the beginning of the text. .TP | | | 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 | starting at \fIindex2\fR will be considered). If several matching ranges exist, the one closest to \fIindex1\fR is chosen. The command's return value is a list containing two elements, which are the index of the first character of the range and the index of the character just after the last one in the range. If no matching range is found then the return value is an empty string. If \fIindex2\fR is not given then it defaults to the beginning of the text. .TP \fIpathName\fB tag raise \fItagName \fR?\fIaboveThis\fR? . Changes the priority of tag \fItagName\fR so that it is just higher in priority than the tag whose name is \fIaboveThis\fR. If \fIaboveThis\fR is omitted, then \fItagName\fR's priority is changed to make it highest priority of all tags. .TP \fIpathName \fBtag ranges \fItagName\fR |
︙ | ︙ | |||
1950 1951 1952 1953 1954 1955 1956 | \fIindex2\fR is not affected). A single command may contain any number of \fIindex1\fR\-\fIindex2\fR pairs. If the last \fIindex2\fR is omitted then the tag is removed from the single character at \fIindex1\fR. If there are no characters in the specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR is less than or equal to \fIindex1\fR) then the command has no effect. This command returns an empty string. .RE | < | 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 | \fIindex2\fR is not affected). A single command may contain any number of \fIindex1\fR\-\fIindex2\fR pairs. If the last \fIindex2\fR is omitted then the tag is removed from the single character at \fIindex1\fR. If there are no characters in the specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR is less than or equal to \fIindex1\fR) then the command has no effect. This command returns an empty string. .RE .TP \fIpathName \fBwindow \fIoption \fR?\fIarg ...\fR? . This command is used to manipulate embedded windows. The behavior of the command depends on the \fIoption\fR argument that follows the \fBwindow\fR argument. The following forms of the command are currently supported: .RS |
︙ | ︙ | |||
1991 1992 1993 1994 1995 1996 1997 | information on the options that are supported. Returns an empty string. .TP \fIpathName \fBwindow names\fR . Returns a list whose elements are the names of all windows currently embedded in \fIwindow\fR. .RE | < | 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 | information on the options that are supported. Returns an empty string. .TP \fIpathName \fBwindow names\fR . Returns a list whose elements are the names of all windows currently embedded in \fIwindow\fR. .RE .TP \fIpathName \fBxview \fIoption args\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 |
︙ | ︙ | |||
2037 2038 2039 2040 2041 2042 2043 | pixels are assumed). If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls; if it is \fBpixels\fR then the view adjusts by \fInumber\fR pixels; if it is \fBunits\fR, the view adjusts left or right by \fInumber\fR average-width characters on the display. 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 | < | 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 | pixels are assumed). If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls; if it is \fBpixels\fR then the view adjusts by \fInumber\fR pixels; if it is \fBunits\fR, the view adjusts left or right by \fInumber\fR average-width characters on the display. 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 \fR?\fIargs\fR? . This command is used to query and change the vertical position of the text in the widget's window. It can take any of the following forms: .RS .TP |
︙ | ︙ | |||
2342 2343 2344 2345 2346 2347 2348 | means in the case where the first extra line added results in no match and Tcl's regexp system returns the incorrect code and adding a second extra line would actually match, the text widget will return the wrong result. In practice this is a rare problem, but it can occur, for example: .CS pack [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" | | | | 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 | means in the case where the first extra line added results in no match and Tcl's regexp system returns the incorrect code and adding a second extra line would actually match, the text widget will return the wrong result. In practice this is a rare problem, but it can occur, for example: .CS pack [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" \&.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0 .CE will not find a match when one exists of 19 characters starting from the first .QW b . .PP Whenever one possible match is fully enclosed in another, the search command will attempt to ensure only the larger match is returned. When performing backwards regexp searches it is possible that Tcl will not always achieve this, in the case where a match is preceded by one or more short, non-overlapping matches, all of which are preceded by a large match which actually encompasses all of them. The search algorithm used by the widget does not look back arbitrarily far for a possible match which might cover large portions of the widget. For example: .CS pack [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n" \&.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end .CE matches at .QW 5.0 when a true greedy match would match at .QW 1.0 . Similarly if we add \fB\-all\fR to this case, it matches at all of .QW 5.0 , |
︙ | ︙ |
Changes to doc/tk.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH tk n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk \- Manipulate Tk internal state .SH SYNOPSIS | | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | .TH tk n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk \- Manipulate Tk internal state .SH SYNOPSIS \fBtk\fR \fIoption \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBtk\fR command provides access to miscellaneous elements of Tk's internal state. Most of the information manipulated by this command pertains to the application as a whole, or to a screen or display, rather than to a particular window. The command can take any of a number of different forms depending on the \fIoption\fR argument. The legal forms are: .TP \fBtk appname \fR?\fInewName\fR? . If \fInewName\fR is not specified, this command returns the name of the application (the name that may be used in \fBsend\fR commands to communicate with the application). If \fInewName\fR is specified, then the name of the application |
︙ | ︙ | |||
41 42 43 44 45 46 47 | \fInewName\fR should not start with a capital letter. This will interfere with option processing, since names starting with capitals are assumed to be classes; as a result, Tk may not be able to find some options for the application. If sends have been disabled by deleting the \fBsend\fR command, this command will reenable them and recreate the \fBsend\fR command. | < < < < < < < | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | \fInewName\fR should not start with a capital letter. This will interfere with option processing, since names starting with capitals are assumed to be classes; as a result, Tk may not be able to find some options for the application. If sends have been disabled by deleting the \fBsend\fR command, this command will reenable them and recreate the \fBsend\fR command. .TP \fBtk busy \fIsubcommand\fR ... . This command controls the marking of window hierarchies as .QW busy , rendering them non-interactive while some other operation is proceeding. For more details see the \fBbusy\fR manual page. .TP \fBtk caret \fIwindow \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR? . Sets and queries the caret location for the display of the specified Tk window \fIwindow\fR. The caret is the per-display cursor location used for indicating global focus (e.g. to comply with Microsoft Accessibility guidelines), as well as for location of the over-the-spot XIM (X Input Methods) or Windows IME windows. If no options are specified, the last values used for setting the caret are return in option-value pair format. \fB\-x\fR and \fB\-y\fR represent window-relative coordinates, and \fB\-height\fR is the height of the current cursor location, or the height of the specified \fIwindow\fR if none is given. .TP \fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR? . Returns a positive integer, the number of milliseconds since the last time the user interacted with the system. If the \fB\-displayof\fR option is given then the return value refers to the display of \fIwindow\fR; otherwise it refers to the display of the application's main window. .RS .PP \fBtk inactive\fR will return \-1, if querying the user inactive time is not supported by the system, and in safe interpreters. .PP If the literal string \fBreset\fR is given as an additional argument, the timer is reset and an empty string is returned. Resetting the inactivity time is forbidden in safe interpreters and will throw an error if tried. .RE .TP \fBtk fontchooser \fIsubcommand\fR ... Controls the Tk font selection dialog. For more details see the \fBfontchooser\fR manual page. .TP \fBtk print \fIwindow\fR . The \fBtk print\fR command posts a dialog that allows users to print output from the \fBcanvas\fR and \fBtext\fR widgets. The printing will be done using platform-native APIs and dialogs where available. For more details see the \fBprint\fR manual page. .TP \fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR? . Sets and queries the current scaling factor used by Tk to convert between physical units (for example, points, inches, or millimeters) and pixels. The \fInumber\fR argument is a floating point number that specifies the number of pixels per point on \fIwindow\fR's display. If the \fIwindow\fR argument is |
︙ | ︙ | |||
121 122 123 124 125 126 127 | displayed 1.25 times as large as normal. The initial value for the scaling factor is set when the application starts, based on properties of the installed monitor, but it can be changed at any time. Measurements made after the scaling factor is changed will use the new scaling factor, but it is undefined whether existing widgets will resize themselves dynamically to accommodate the new scaling factor. .RE | < < < < | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | displayed 1.25 times as large as normal. The initial value for the scaling factor is set when the application starts, based on properties of the installed monitor, but it can be changed at any time. Measurements made after the scaling factor is changed will use the new scaling factor, but it is undefined whether existing widgets will resize themselves dynamically to accommodate the new scaling factor. .RE .TP \fBtk sysnotify \fP \fItitle\fP? \fImessage\fP? . The \fBtk sysnotify\fP command creates a platform-specific system notification alert. Its intent is to provide a brief, unobtrusive notification to the user by popping up a window that briefly appears in a corner of the screen. For more details see the \fBsysnotify\fR manual page. .TP \fBtk systray create\fP \fIsubcommand...\fP . The \fBtk systray\fP command creates an icon in the platform-specific tray. For more details see the \fBsystray\fR manual page. .TP \fBtk useinputmethods \fR?\fB\-displayof \fIwindow\fR? ?\fIboolean\fR? . Sets and queries the state of whether Tk should use XIM (X Input Methods) for filtering events. The resulting state is returned. XIM is used in some locales (i.e., Japanese, Korean), to handle special input devices. This feature is only significant on X. If XIM support is not available, this will always return 0. If the \fIwindow\fR argument is omitted, it defaults to the main window. If the \fIboolean\fR argument is omitted, the current state is returned. This is turned on by default for the main display. .TP \fBtk windowingsystem\fR . Returns the current Tk windowing system, one of \fBx11\fR (X11-based), \fBwin32\fR (MS Windows), or \fBaqua\fR (Mac OS X Aqua). .SH "SEE ALSO" busy(n), fontchooser(n), print(n), send(n), sysnotify(n), systray(n), winfo(n) .SH KEYWORDS application name, print, send, sysnotify, systray '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/tk_mac.n.
︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | \fB::tk::mac::standardAboutPanel\fR \fB::tk::mac::useCompatibilityMetrics \fIboolean\fR \fB::tk::mac::CGAntialiasLimit \fIlimit\fR \fB::tk::mac::antialiasedtext \fInumber\fR \fB::tk::mac::useThemedToplevel \fIboolean\fR \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR .fi .BE .SH "EVENT HANDLER CALLBACKS" .PP The Aqua/Mac OS X application environment defines a number of additional 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 the command is absent, no action will be taken. | > < < < < < | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | \fB::tk::mac::standardAboutPanel\fR \fB::tk::mac::useCompatibilityMetrics \fIboolean\fR \fB::tk::mac::CGAntialiasLimit \fIlimit\fR \fB::tk::mac::antialiasedtext \fInumber\fR \fB::tk::mac::useThemedToplevel \fIboolean\fR \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR .fi .BE .SH "EVENT HANDLER CALLBACKS" .PP The Aqua/Mac OS X application environment defines a number of additional 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 the command is absent, no action will be taken. .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 . The default Apple Event handler for kAEShowPreferences, .QW pref . The application menu .QW "Preferences" menu item is only enabled when this proc is defined. Typically this command is used to wrap a specific own preferences command, which pops up a preferences window. Something like: .RS .PP .CS proc ::tk::mac::ShowPreferences {} { setPref } .CE .RE .TP \fB::tk::mac::OpenApplication\fR . If a proc of this name is defined, this proc fill fire when your application is initially opened. It is the default Apple Event handler for kAEOpenApplication, .QW oapp . .TP \fB::tk::mac::ReopenApplication\fR . If a proc of this name is defined it is the default Apple Event handler for kAEReopenApplication, .QW rapp , the Apple Event sent when your application is opened when it is already |
︙ | ︙ | |||
106 107 108 109 110 111 112 | } else { wm deiconify . } raise . } .CE .RE | < < < < < < < | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | } else { wm deiconify . } raise . } .CE .RE .TP \fB::tk::mac::OpenDocument \fIfile...\fR . If a proc of this name is defined it is the default Apple Event handler for kAEOpenDocuments, .QW odoc , the Apple Event sent when your application is asked to open one or more documents (e.g., by drag & drop onto the app or by opening a document of a type associated to the app). The proc should take as arguments paths to the files to be opened, like so: .RS .PP .CS proc ::tk::mac::OpenDocument {args} { foreach f $args {my_open_document $f} } .CE .RE .TP \fB::tk::mac::PrintDocument \fIfile...\fR . If a proc of this name is defined it is the default Apple Event handler for kAEPrintDocuments, .QW pdoc , the Apple Event sent when your application is asked to print a document. It takes a single absolute file path as an argument. .TP \fB::tk::mac::Quit\fR . If a proc of this name is defined it is the default Apple Event handler for kAEQuitApplication, .QW quit , the Apple Event sent when your application is asked to be quit, e.g. via the quit menu item in the application menu, the quit menu item in the Dock menu, or during a logout/restart/shutdown etc. If this is not defined, \fBexit\fR is called instead. .TP \fB::tk::mac::OnHide\fR . If defined, this is called when your application receives a kEventAppHidden event, e.g. via the hide menu item in the application or Dock menus. .TP \fB::tk::mac::OnShow\fR . If defined, this is called when your application receives a kEventAppShown event, e.g. via the show all menu item in the application menu, or by clicking the Dock icon of a hidden application. .TP \fB::tk::mac::ShowHelp\fR . Customizes behavior of Apple Help menu; if this procedure is not defined, the platform-specific standard Help menu item .QW "YourApp Help" 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). .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 |
︙ | ︙ | |||
200 201 202 203 204 205 206 | 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. | < | | | > > < < < < < < | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | 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" .PP The Aqua/Mac OS X defines additional dialogs that applications should support. .TP \fB::tk::mac::standardAboutPanel\fR . Brings the standard Cocoa about panel to the front with information filled in from the application bundle files. The panel displays the application icon and the values associated to the info.plist keys named CFBundleName, CFBundleShortVersionString, NSAboutPanelOptionVersion and 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" .PP There are a number of additional global configuration options that control the details of how Tk renders by default. .TP \fB::tk::mac::useCompatibilityMetrics \fIboolean\fR . Preserves compatibility with older Tk/Aqua metrics; set to \fBfalse\fR for more native spacing. .TP \fB::tk::mac::CGAntialiasLimit \fIlimit\fR . Sets the antialiasing limit; lines thinner that \fIlimit\fR pixels will not be antialiased. Integer, set to 0 by default, making all lines be antialiased. .TP \fB::tk::mac::antialiasedtext \fInumber\fR . Sets anti-aliased text. Controls text antialiasing, possible values for \fInumber\fR are -1 (default, use system default for text AA), 0 (no text AA), 1 (use text AA). .TP \fB::tk::mac::useThemedToplevel \fIboolean\fR . Sets toplevel windows to draw with the modern grayish/ pinstripe Mac background. Equivalent to configuring the toplevel with .QW "\fB\-background systemWindowHeaderBackground\fR" , or to using a \fBttk::frame\fR. .SH "SUPPORT COMMANDS" .TP \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR . Renders native icons and bitmaps in Tk applications (including any image file readable by NSImage). A native bitmap name is interpreted as follows (in order): .RS |
︙ | ︙ | |||
290 291 292 293 294 295 296 | .IP \(bu 3 NSImage url string .IP \(bu 3 4-char OSType of IconServices icon .PP The \fIwidth\fR and \fIheight\fR arguments to \fBtk::mac::iconBitmap\fR define the dimensions of the image to create, and \fI\-kind\fR must be one of: | < < < < < < | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | .IP \(bu 3 NSImage url string .IP \(bu 3 4-char OSType of IconServices icon .PP The \fIwidth\fR and \fIheight\fR arguments to \fBtk::mac::iconBitmap\fR define the dimensions of the image to create, and \fI\-kind\fR must be one of: .TP \fB\-file\fR . icon of file at given path .TP \fB\-fileType\fR . icon of given file type .TP \fB\-osType\fR . icon of given 4-char OSType file type .TP \fB\-systemType\fR . icon for given IconServices 4-char OSType .TP \fB\-namedImage\fR . named NSImage for given name .TP \fB\-imageFile\fR . image at given path .RE .SH "SEE ALSO" bind(n), wm(n) .SH KEYWORDS about dialog, antialiasing, Apple event, icon, NSImage '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/tkerror.n.
︙ | ︙ | |||
14 15 16 17 18 19 20 | .SH SYNOPSIS \fBtkerror \fImessage\fR .BE .SH DESCRIPTION .PP Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to \fBbgerror\fR because the event loop (which is what usually invokes | < < | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | .SH SYNOPSIS \fBtkerror \fImessage\fR .BE .SH DESCRIPTION .PP Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to \fBbgerror\fR because the event loop (which is what usually invokes it) is now part of Tcl. For backward compatibility the \fBbgerror\fR provided by the current Tk version still tries to call \fBtkerror\fR if there is one (or an auto loadable one), so old script defining that error handler should still work, but you should anyhow modify your scripts to use \fBbgerror\fR instead of \fBtkerror\fR because that support for the old name might vanish in the near future. If that call fails, \fBbgerror\fR posts a dialog showing the error and offering to see the stack trace to the user. If you want your own error management you should directly override \fBbgerror\fR instead of \fBtkerror\fR. Documentation for \fBbgerror\fR is available as part of Tcl's documentation. .SH KEYWORDS background error, reporting |
︙ | ︙ |
Changes to doc/tkvars.n.
︙ | ︙ | |||
12 13 14 15 16 17 18 | .SH NAME geometry, tk_library, tk_patchLevel, tk::scalingPct, tk_strictMotif, tk::svgFmt, tk_version \- Variables used or set by Tk .BE .SH DESCRIPTION .PP The following Tcl variables are either set or used by Tk at various times in its execution: | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | .SH NAME geometry, tk_library, tk_patchLevel, tk::scalingPct, tk_strictMotif, tk::svgFmt, tk_version \- Variables used or set by Tk .BE .SH DESCRIPTION .PP The following Tcl variables are either set or used by Tk at various times in its execution: .TP 15 \fBtk_library\fR . This variable holds the file name for a directory containing a library of Tcl scripts related to Tk. These scripts include an initialization file that is normally processed whenever a Tk application starts up, plus other files containing procedures that implement default behaviors |
︙ | ︙ | |||
37 38 39 40 41 42 43 | compiled-in default location, the location of the Tcl library directory, the location of the binary containing the application, and the current working directory. .PP The variable can be modified by an application to switch to a different library. .RE | < < | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | compiled-in default location, the location of the Tcl library directory, the location of the binary containing the application, and the current working directory. .PP The variable can be modified by an application to switch to a different library. .RE .TP \fBtk_patchLevel\fR . Contains a dot-separated sequence of decimal integers giving the current patch level for Tk. The patch level is incremented for each new release or patch, and it uniquely identifies an official version of Tk. .RS .PP This value is normally the same as the result of .QW "\fBpackage require\fR \fBtk\fR" . .RE .TP \fBtk::scalingPct\fR . Tk sets this variable at initialization time to the scaling percentage corresponding to the display's DPI scaling level. This value is at least 100 and is restricted to multiples of 25 (100, 125, 150, 175, 200, 225, ...). The sizes and various attributes of the Tk core and Ttk |
︙ | ︙ | |||
86 87 88 89 90 91 92 | 150, or 175 when running GNOME on Xorg or the Cinnamon desktop). On \fBx11\fR the scaling percentage is computed mostly (but not exclusively) from the value of the X resource Xft.dpi, and, as an additional step, Tk synchronizes the scaling factor used to convert between physical units and pixels with the scaling percentage, with the aid of the \fBtk scaling\fR command. .RE | < < | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | 150, or 175 when running GNOME on Xorg or the Cinnamon desktop). On \fBx11\fR the scaling percentage is computed mostly (but not exclusively) from the value of the X resource Xft.dpi, and, as an additional step, Tk synchronizes the scaling factor used to convert between physical units and pixels with the scaling percentage, with the aid of the \fBtk scaling\fR command. .RE .TP \fBtk_strictMotif\fR . This variable is set to zero by default. If an application sets it to one, then Tk attempts to adhere as closely as possible to Motif look-and-feel standards. For example, active elements such as buttons and scrollbar sliders will not change color when the pointer passes over them. Modern applications should not normally set this variable. .TP \fBtk::svgFmt\fR . This variable is set at Tk initialization time to .RS .RS 4 .PP |
︙ | ︙ | |||
120 121 122 123 124 125 126 | DPI scaling level. .PP Note that any access to this variable is supposed to be strictly read-only! Note also that whenever the scaling factor used to convert between physical units and pixels is changed via \fBtk scaling\fR, the value of the variable \fBtk::svgFmt\fR is automatically updated. .RE | < < < < < | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | DPI scaling level. .PP Note that any access to this variable is supposed to be strictly read-only! Note also that whenever the scaling factor used to convert between physical units and pixels is changed via \fBtk scaling\fR, the value of the variable \fBtk::svgFmt\fR is automatically updated. .RE .TP \fBtk_version\fR . Tk sets this variable in the interpreter for each application. The variable holds the current version number of the Tk library in the form \fImajor\fR.\fIminor\fR. \fIMajor\fR and \fIminor\fR are integers. The major version number increases in any Tk release that includes changes that are not backward compatible (i.e. whenever existing Tk applications and scripts may have to change to work with the new release). The minor version number increases with each new release of Tk, except that it resets to zero whenever the major version number changes. .SS "INTERNAL AND DEBUGGING VARIABLES" .PP These variables should not normally be set by user code. .TP \fBtk::Priv\fR . This variable is an array containing several pieces of information that are private to Tk. The elements of \fBtk::Priv\fR are used by Tk library procedures and default bindings. They should not be accessed by any code outside Tk. .TP \fBtk_textRedraw\fR .TP \fBtk_textRelayout\fR . These variables are set by text widgets when they have debugging turned on. The values written to these variables can be used to test or debug text widget operations. These variables are mostly used by Tk's test suite. .SH "OTHER GLOBAL VARIABLES" The following variables are only guaranteed to exist in \fBwish\fR executables; the Tk library does not define them itself but many Tk environments do. .TP \fBgeometry\fR . If set, contains the user-supplied geometry specification to use for the main Tk window. .SH "SEE ALSO" package(n), tclvars(n), wish(1) .SH KEYWORDS environment, text, variables, version '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/tkwait.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH tkwait n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tkwait \- Wait for variable to change or window to be destroyed .SH SYNOPSIS | < > > < < < < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | .TH tkwait n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tkwait \- Wait for variable to change or window to be destroyed .SH SYNOPSIS \fBtkwait variable \fIname\fR .sp \fBtkwait visibility \fIname\fR .sp \fBtkwait window \fIname\fR .BE .SH DESCRIPTION .PP The \fBtkwait\fR command waits for one of several things to happen, then it returns without taking any other actions. The return value is always an empty string. If the first argument is \fBvariable\fR (or any abbreviation of it) then the second argument is the name of a global variable and the command waits for that variable to be modified. If the first argument is \fBvisibility\fR (or any abbreviation of it) then the second argument is the name of a window and the \fBtkwait\fR command waits for a change in its visibility state (as indicated by the arrival of a VisibilityNotify event). This form is typically used to wait for a newly-created window to appear on the screen before taking some action. If the first argument is \fBwindow\fR (or any abbreviation of it) then the second argument is the name of a window and the \fBtkwait\fR command waits for that window to be destroyed. This form is typically used to wait for a user to finish interacting with a dialog box before using the result of that interaction. .PP While the \fBtkwait\fR command is waiting it processes events in |
︙ | ︙ |
Changes to doc/toplevel.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH toplevel n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME toplevel \- Create and manipulate 'toplevel' main and popup window widgets .SH SYNOPSIS | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | .TH toplevel n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME toplevel \- Create and manipulate 'toplevel' main and popup window widgets .SH SYNOPSIS \fBtoplevel\fR \fIpathName \fR?\fIoptions\fR? .SO \-borderwidth \-highlightcolor \-pady \-cursor \-highlightthickness \-relief \-highlightbackground \-padx \-takefocus .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-background background Background |
︙ | ︙ | |||
64 65 66 67 68 69 70 | things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the \fBconfigure\fR widget command. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the \fBconfigure\fR widget command. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. If this option is negative or zero then the window will not request any size at all. .OP \-menu menu Menu Specifies a menu widget to be used as a menubar. On the Macintosh, the menubar will be displayed across the top of the main monitor. On Microsoft Windows and all UNIX platforms, the menu will appear across the toplevel window as part of the window dressing maintained by the window manager. |
︙ | ︙ | |||
109 110 111 112 113 114 115 | If this option is not specified, the new window will use the default visual for its screen. The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. | | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | If this option is not specified, the new window will use the default visual for its screen. The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. If this option is negative or zero then the window will not request any size at all. .BE .SH DESCRIPTION .PP The \fBtoplevel\fR command creates a new toplevel widget (given by the \fIpathName\fR argument). Additional options, described above, may be specified on the command line |
︙ | ︙ | |||
144 145 146 147 148 149 150 | \fIpathName option \fR?\fIarg ...\fR? .CE .PP \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 determine the exact behavior of the command. The following commands are possible for toplevel widgets: | < < | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | \fIpathName option \fR?\fIarg ...\fR? .CE .PP \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 determine the exact behavior of the command. The following commands are possible for toplevel widgets: .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBtoplevel\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . 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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of this list). If \fIoption\fR is specified |
︙ | ︙ |
Changes to doc/ttk_entry.n.
︙ | ︙ | |||
78 79 80 81 82 83 84 | A script template to evaluate whenever validation is triggered. If set to the empty string (the default), validation is disabled. The script must return a boolean value. See \fBVALIDATION\fR below. .OP \-width width Width Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | A script template to evaluate whenever validation is triggered. If set to the empty string (the default), validation is disabled. The script must return a boolean value. See \fBVALIDATION\fR below. .OP \-width width Width Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. .\" Not in ttk: If the value is negative or zero, the widget picks a .\" Not in ttk: size just large enough to hold its current text. .SH NOTES .PP A portion of the entry may be selected as described below. If an entry is exporting its selection (see the \fB\-exportselection\fR option), then it will observe the standard X11 protocols for handling the selection; entry selections are available as type \fBSTRING\fR. |
︙ | ︙ |
Changes to doc/ttk_image.n.
︙ | ︙ | |||
40 41 42 43 44 45 46 | a single number specifies the same border all the way around the element. See \fBIMAGE STRETCHING\fR, below. .\" OPTION: -height .TP \fB\-height \fIheight\fR . Specifies a minimum height for the element. | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | a single number specifies the same border all the way around the element. See \fBIMAGE STRETCHING\fR, below. .\" OPTION: -height .TP \fB\-height \fIheight\fR . Specifies a minimum height for the element. If negative, the base image's height is used as a default. .\" OPTION: -padding .TP \fB\-padding\fI padding\fR . Specifies the element's interior padding. The padding is a list of up to four length specifications \fIleft top right bottom\fR. |
︙ | ︙ | |||
72 73 74 75 76 77 78 | or .QW e . .\" OPTION: -width .TP \fB\-width \fIwidth\fR . Specifies a minimum width for the element. | | | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | or .QW e . .\" OPTION: -width .TP \fB\-width \fIwidth\fR . Specifies a minimum width for the element. If negative, the base image's width is used as a default. .SH "IMAGE STRETCHING" .PP If the element's allocated parcel is larger than the image, the image will be placed in the parcel based on the \fB\-sticky\fR option. If the image needs to stretch horizontally (i.e., \fB\-sticky ew\fR) or vertically (\fB\-sticky ns\fR), subregions of the image are replicated to fill the parcel |
︙ | ︙ |
Changes to doc/ttk_label.n.
︙ | ︙ | |||
33 34 35 36 37 38 39 | .\" Rewrite this: Specifies the 3-D effect desired for the widget border. Valid values are \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR, and \fBsunken\fR. .OP \-wraplength wrapLength WrapLength Specifies the maximum line length (in pixels). | | | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | .\" Rewrite this: Specifies the 3-D effect desired for the widget border. Valid values are \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR, and \fBsunken\fR. .OP \-wraplength wrapLength WrapLength Specifies the maximum line length (in pixels). If this option is negative or zero, then automatic wrapping is not performed; otherwise the text is split into lines such that no line is longer than the specified value. .SH "WIDGET COMMAND" .PP Label widgets support the standard commands \fBcget\fR, \fBconfigure\fR, \fBidentify element\fR, \fBinstate\fR, |
︙ | ︙ |
Changes to doc/ttk_panedwindow.n.
︙ | ︙ | |||
142 143 144 145 146 147 148 | \fBSash\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-background\fP \fIcolor\fP .br \fB\-bordercolor\fP \fIcolor\fP .br | | | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | \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 |
︙ | ︙ |
Changes to doc/ttk_scrollbar.n.
︙ | ︙ | |||
173 174 175 176 177 178 179 | .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 | | | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | .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 |
︙ | ︙ |
Changes to doc/ttk_treeview.n.
︙ | ︙ | |||
319 320 321 322 323 324 325 | .\" METHOD: identify .TP \fIpathname \fBidentify \fIcomponent x y\fR . Returns a description of the specified \fIcomponent\fR under the point given by \fIx\fR and \fIy\fR, or the empty string if no such \fIcomponent\fR is present at that position. | < < | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | .\" METHOD: identify .TP \fIpathname \fBidentify \fIcomponent x y\fR . Returns a description of the specified \fIcomponent\fR under the point given by \fIx\fR and \fIy\fR, or the empty string if no such \fIcomponent\fR is present at that position. The following subcommands are supported: .RS .TP \fIpathname \fBidentify region \fIx y\fR .RS Returns one of: .IP heading |
︙ | ︙ | |||
382 383 384 385 386 387 388 | . Creates a new item. \fIparent\fR is the item ID of the parent item, or the empty string \fB{}\fR to create a new top-level item. \fIindex\fR is an integer, or the value \fBend\fR, specifying where in the list of \fIparent\fR's children to insert the new item. | | | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | . Creates a new item. \fIparent\fR is the item ID of the parent item, or the empty string \fB{}\fR to create a new top-level item. \fIindex\fR is an integer, or the value \fBend\fR, specifying where in the list of \fIparent\fR's children to insert the new item. If \fIindex\fR is negative or zero, the new node is inserted at the beginning; if \fIindex\fR is greater than or equal to the current number of children, it is inserted at the end. If \fB\-id\fR is specified, it is used as the item identifier; \fIid\fR must not already exist in the tree. Otherwise, a new unique identifier is generated. .RS |
︙ | ︙ | |||
414 415 416 417 418 419 420 | .TP \fIpathname \fBmove \fIitem parent index\fR . Moves \fIitem\fR to position \fIindex\fR in \fIparent\fR's list of children. It is illegal to move an item under one of its descendants. .RS .PP | | | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | .TP \fIpathname \fBmove \fIitem parent index\fR . Moves \fIitem\fR to position \fIindex\fR in \fIparent\fR's list of children. It is illegal to move an item under one of its descendants. .RS .PP If \fIindex\fR is negative or zero, \fIitem\fR is moved to the beginning; if greater than or equal to the number of children, it is moved to the end. .RE .\" METHOD: next .TP \fIpathname \fBnext \fIitem\fR . |
︙ | ︙ | |||
713 714 715 716 717 718 719 | .br \fB\-font\fP \fIfont\fP .br \fB\-foreground\fP \fIcolor\fP .br \fB\-indent\fP \fIamount\fP .RS | | < | < < < < | | < | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | .br \fB\-font\fP \fIfont\fP .br \fB\-foreground\fP \fIcolor\fP .br \fB\-indent\fP \fIamount\fP .RS Specifies how many pixels items are indented from their parents. Defaults to 20. .RE .br \fB\-columnseparatorwidth\fP \fIpixels\fP .br \fB\-rowheight\fP \fIpixels\fP .RS This is the standard height for an item. If \fB\-rowheight\fP is not set by the style, it is set by measuring an item and a cell layout with the style's settings. This thus picks up the font and any focus ring or padding from the theme's layout. The \fB\-rowheight\fP may need to be set to make sure that a row is large enough to contain any images. .PP |
︙ | ︙ |
Changes to doc/winfo.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH winfo n 4.3 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME winfo \- Return window-related information .SH SYNOPSIS | | < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | .TH winfo n 4.3 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME winfo \- Return window-related information .SH SYNOPSIS \fBwinfo\fR \fIoption \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBwinfo\fR command is used to retrieve information about windows managed by Tk. It can take any of a number of different forms, depending on the \fIoption\fR argument. The legal forms are: .TP \fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR Returns a decimal string giving the integer identifier for the atom whose name is \fIname\fR. If no atom exists with the name \fIname\fR then a new one is created. If the \fB\-displayof\fR option is given then the atom is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. .TP \fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR Returns the textual name for the atom whose integer identifier is \fIid\fR. If the \fB\-displayof\fR option is given then the identifier is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. This command is the inverse of the \fBwinfo atom\fR command. It generates an error if no such atom exists. .TP \fBwinfo cells \fIwindow\fR Returns a decimal string giving the number of cells in the color map for \fIwindow\fR. .TP \fBwinfo children \fIwindow\fR Returns a list containing the path names of all the children of \fIwindow\fR. Top-level windows are returned as children of their logical parents. The list is in stacking order, with the lowest window first, except for Top-level windows which are not returned in stacking order. Use the \fBwm stackorder\fR command to query the stacking order of Top-level windows. .TP \fBwinfo class \fIwindow\fR Returns the class name for \fIwindow\fR. .TP \fBwinfo colormapfull \fIwindow\fR Returns 1 if the colormap for \fIwindow\fR is known to be full, 0 otherwise. The colormap for a window is .QW known to be full if the last attempt to allocate a new color on that window failed and this application has not freed any colors in the colormap since the failed allocation. .TP \fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR Returns the path name for the window containing the point given by \fIrootX\fR and \fIrootY\fR. \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e. any form acceptable to \fBTk_GetPixels\fR) in the coordinate system of the root window (if a virtual-root window manager is in use then the coordinate system of the virtual root window is used). If the \fB\-displayof\fR option is given then the coordinates refer to the screen containing \fIwindow\fR; otherwise they refer to the screen of the application's main window. If no window in this application contains the point then an empty 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 than parents and among siblings the highest one in the stacking order is chosen. .TP \fBwinfo depth \fIwindow\fR Returns a decimal string giving the depth of \fIwindow\fR (number of bits per pixel). .TP \fBwinfo exists \fIwindow\fR Returns 1 if there exists a window named \fIwindow\fR, 0 if no such window exists. .TP \fBwinfo fpixels \fIwindow\fR \fInumber\fR Returns a floating-point value giving the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable to \fBTk_GetScreenMM\fR, such as .QW 2.0c or .QW 1i . The return value may be fractional; for an integer value, use \fBwinfo pixels\fR. .TP \fBwinfo geometry \fIwindow\fR Returns the geometry for \fIwindow\fR, in the form \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are in pixels. .TP \fBwinfo height \fIwindow\fR Returns a decimal string giving \fIwindow\fR's height in pixels. When a window is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true height immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fBwinfo reqheight\fR to get the window's requested height instead of its actual height. .TP \fBwinfo id \fIwindow\fR Returns a hexadecimal string giving a low-level platform-specific identifier for \fIwindow\fR. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows HWND. On the Macintosh the value has no meaning outside Tk. .TP \fBwinfo interps \fR?\fB\-displayof \fIwindow\fR? Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for a particular display. If the \fB\-displayof\fR option is given then the return value refers to the display of \fIwindow\fR; otherwise it refers to the display of the application's main window. .TP \fBwinfo ismapped \fIwindow\fR Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise. .TP \fBwinfo manager \fIwindow\fR Returns the name of the geometry manager currently responsible for \fIwindow\fR, or an empty string if \fIwindow\fR is not managed by any geometry manager. The name is usually the name of the Tcl command for the geometry manager, such as \fBpack\fR or \fBplace\fR. If the geometry manager is a widget, such as canvases or text, the name is the widget's class command, such as \fBcanvas\fR. .TP \fBwinfo name \fIwindow\fR Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed to its full path name). The command \fBwinfo name .\fR will return the name of the application. .TP \fBwinfo parent \fIwindow\fR Returns the path name of \fIwindow\fR's parent, or an empty string if \fIwindow\fR is the main window of the application. .TP \fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR Returns the path name of the window whose X identifier is \fIid\fR. \fIId\fR must be a decimal, hexadecimal, or octal integer and must correspond to a window in the invoking application. If the \fB\-displayof\fR option is given then the identifier is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. .TP \fBwinfo pixels \fIwindow\fR \fInumber\fR Returns the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable to \fBTk_GetPixels\fR, such as .QW 2.0c or .QW 1i . The result is rounded to the nearest integer value; for a fractional result, use \fBwinfo fpixels\fR. .TP \fBwinfo pointerx \fIwindow\fR If the mouse pointer is on the same screen as \fIwindow\fR, returns the pointer's x coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is measured in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then -1 is returned. .TP \fBwinfo pointerxy \fIwindow\fR If the mouse pointer is on the same screen as \fIwindow\fR, returns a list with two elements, which are the pointer's x and y coordinates measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then both of the returned coordinates are \-1. .TP \fBwinfo pointery \fIwindow\fR If the mouse pointer is on the same screen as \fIwindow\fR, returns the pointer's y coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then -1 is returned. .TP \fBwinfo reqheight \fIwindow\fR Returns a decimal string giving \fIwindow\fR's requested height, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. .TP \fBwinfo reqwidth \fIwindow\fR Returns a decimal string giving \fIwindow\fR's requested width, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. .TP \fBwinfo rgb \fIwindow color\fR Returns a list containing three decimal values in the range 0 to 65535, which are the red, green, and blue intensities that correspond to \fIcolor\fR in the window given by \fIwindow\fR. \fIColor\fR may be specified in any of the forms acceptable for a color option. .TP \fBwinfo rootx \fIwindow\fR Returns a decimal string giving the x-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). .TP \fBwinfo rooty \fIwindow\fR Returns a decimal string giving the y-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). .TP \fBwinfo screen \fIwindow\fR Returns the name of the screen associated with \fIwindow\fR, in the form \fIdisplayName\fR.\fIscreenIndex\fR. .TP \fBwinfo screencells \fIwindow\fR Returns a decimal string giving the number of cells in the default color map for \fIwindow\fR's screen. .TP \fBwinfo screendepth \fIwindow\fR Returns a decimal string giving the depth of the root window of \fIwindow\fR's screen (number of bits per pixel). .TP \fBwinfo screenheight \fIwindow\fR Returns a decimal string giving the height of \fIwindow\fR's screen, in pixels. .TP \fBwinfo screenmmheight \fIwindow\fR Returns a decimal string giving the height of \fIwindow\fR's screen, in millimeters. .TP \fBwinfo screenmmwidth \fIwindow\fR Returns a decimal string giving the width of \fIwindow\fR's screen, in millimeters. .TP \fBwinfo screenvisual \fIwindow\fR Returns one of the following strings to indicate the default visual class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \fBtruecolor\fR. .TP \fBwinfo screenwidth \fIwindow\fR Returns a decimal string giving the width of \fIwindow\fR's screen, in pixels. .TP \fBwinfo server \fIwindow\fR Returns a string containing information about the server for \fIwindow\fR's display. The exact format of this string may vary from platform to platform. For X servers the string has the form .QW "\fBX\fImajor\fBR\fIminor vendor vendorVersion\fR" where \fImajor\fR and \fIminor\fR are the version and revision numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR is the name of the vendor for the server, and \fIvendorRelease\fR is an integer release number provided by the server. .TP \fBwinfo toplevel \fIwindow\fR Returns the path name of the top-of-hierarchy window containing \fIwindow\fR. In standard Tk this will always be a \fBtoplevel\fR widget, but extensions may create other kinds of top-of-hierarchy widgets. .TP \fBwinfo viewable \fIwindow\fR Returns 1 if \fIwindow\fR and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped. .TP \fBwinfo visual \fIwindow\fR Returns one of the following strings to indicate the visual class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \fBtruecolor\fR. .TP \fBwinfo visualid \fIwindow\fR Returns the X identifier for the visual for \fIwindow\fR. .TP \fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR? Returns a list whose elements describe the visuals available for \fIwindow\fR's screen. Each element consists of a visual class followed by an integer depth. The class has the same form as returned by \fBwinfo visual\fR. The depth gives the number of bits per pixel in the visual. In addition, if the \fBincludeids\fR argument is provided, then the depth is followed by the X identifier for the visual. .TP \fBwinfo vrootheight \fIwindow\fR Returns the height of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the height of \fIwindow\fR's screen. .TP \fBwinfo vrootwidth \fIwindow\fR Returns the width of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the width of \fIwindow\fR's screen. .TP \fBwinfo vrootx \fIwindow\fR Returns the x-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fIwindow\fR. .TP \fBwinfo vrooty \fIwindow\fR Returns the y-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fIwindow\fR. .TP \fBwinfo width \fIwindow\fR Returns a decimal string giving \fIwindow\fR's width in pixels. When a window is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true width immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fBwinfo reqwidth\fR to get the window's requested width instead of its actual width. .TP \fBwinfo x \fIwindow\fR Returns a decimal string giving the x-coordinate, in \fIwindow\fR's parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). .TP \fBwinfo y \fIwindow\fR Returns a decimal string giving the y-coordinate, in \fIwindow\fR's parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). .SH EXAMPLE .PP Print where the mouse pointer is and what window it is currently over: .CS lassign [\fBwinfo pointerxy\fR .] x y puts \-nonewline "Mouse pointer at ($x,$y) which is " set win [\fBwinfo containing\fR $x $y] if {$win eq ""} { puts "over no window" } else { puts "over $win" } .CE .SH KEYWORDS atom, children, class, geometry, height, identifier, information, interpreters, mapped, parent, path name, screen, virtual root, width, window '\" Local Variables: '\" mode: nroff '\" End: |
Changes to doc/wish.1.
︙ | ︙ | |||
10 11 12 13 14 15 16 | .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME wish \- Simple windowing shell .SH SYNOPSIS \fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg ...\fR? .SH OPTIONS | < < < < < < < < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME wish \- Simple windowing shell .SH SYNOPSIS \fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg ...\fR? .SH OPTIONS .IP "\fB\-encoding \fIname\fR" 20 Specifies the encoding of the text stored in \fIfileName\fR. This option is only recognized prior to the \fIfileName\fR argument. .IP "\fB\-colormap \fInew\fR" 20 Specifies that the window should have a new private colormap instead of using the default colormap for the screen. .IP "\fB\-display \fIdisplay\fR" 20 Display (and screen) on which to display window. .IP "\fB\-geometry \fIgeometry\fR" 20 Initial geometry to use for window. If this option is specified, its value is stored in the \fBgeometry\fR global variable of the application's Tcl interpreter. .IP "\fB\-name \fIname\fR" 20 Use \fIname\fR as the title to be displayed in the window, and as the name of the interpreter for \fBsend\fR commands. .IP "\fB\-sync\fR" 20 Execute all X server commands synchronously, so that errors are reported immediately. This will result in much slower execution, but it is useful for debugging. .IP "\fB\-use\fR \fIid\fR" 20 Specifies that the main window for the application is to be embedded in the window whose identifier is \fIid\fR, instead of being created as an independent toplevel window. \fIId\fR must be specified in the same way as the value for the \fB\-use\fR option for toplevel widgets (i.e. it has a form like that returned by the \fBwinfo id\fR command). .RS Note that on some platforms this will only work correctly if \fIid\fR refers to a Tk \fBframe\fR or \fBtoplevel\fR that has its \fB\-container\fR option enabled. .RE .IP "\fB\-visual \fIvisual\fR" 20 Specifies the visual to use for the window. \fIVisual\fR may have any of the forms supported by the \fBTk_GetVisual\fR procedure. .IP "\fB\-\|\-\fR" 20 Pass all remaining arguments through to the script's \fBargv\fR variable without interpreting them. This provides a mechanism for passing arguments such as \fB\-name\fR to a script instead of having \fBwish\fR interpret them. .BE .SH DESCRIPTION |
︙ | ︙ | |||
122 123 124 125 126 127 128 | .PP The class of the application, which is used for purposes such as specifying options with a \fBRESOURCE_MANAGER\fR property or .Xdefaults file, is the same as its name except that the first letter is capitalized. .SH "VARIABLES" .PP | | < < < < < < < < < < | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | .PP The class of the application, which is used for purposes such as specifying options with a \fBRESOURCE_MANAGER\fR property or .Xdefaults file, is the same as its name except that the first letter is capitalized. .SH "VARIABLES" .PP \fBWish\fR sets the following Tcl variables: .TP 15 \fBargc\fR Contains a count of the number of \fIarg\fR arguments (0 if none), not including the options described above. .TP 15 \fBargv\fR Contains a Tcl list whose elements are the \fIarg\fR arguments that follow a \fB\-\|\-\fR option or do not match any of the options described in \fBOPTIONS\fR above, in order, or an empty string if there are no such arguments. .TP 15 \fBargv0\fR Contains \fIfileName\fR if it was specified. Otherwise, contains the name by which \fBwish\fR was invoked. .TP 15 \fBgeometry\fR If the \fB\-geometry\fR option is specified, \fBwish\fR copies its value into this variable. If the variable still exists after \fIfileName\fR has been evaluated, \fBwish\fR uses the value of the variable in a \fBwm geometry\fR command to set the main window's geometry. .TP 15 \fBtcl_interactive\fR Contains 1 if \fBwish\fR is reading commands interactively (\fIfileName\fR was not specified and standard input is a terminal-like device), 0 otherwise. .SH "SCRIPT FILES" .PP If you create a Tcl script in a file whose first line is .CS |
︙ | ︙ | |||
226 227 228 229 230 231 232 | \fBtcl_prompt1\fR exists then it must consist of a Tcl script to output a prompt; instead of outputting a prompt \fBwish\fR will evaluate the script in \fBtcl_prompt1\fR. The variable \fBtcl_prompt2\fR is used in a similar way when a newline is typed but the current command is not yet complete; if \fBtcl_prompt2\fR is not set then no prompt is output for incomplete commands. | < < < < < < < < < < < < < < < < | | 207 208 209 210 211 212 213 214 215 216 217 218 | \fBtcl_prompt1\fR exists then it must consist of a Tcl script to output a prompt; instead of outputting a prompt \fBwish\fR will evaluate the script in \fBtcl_prompt1\fR. The variable \fBtcl_prompt2\fR is used in a similar way when a newline is typed but the current command is not yet complete; if \fBtcl_prompt2\fR is not set then no prompt is output for incomplete commands. .SH "SEE ALSO" tclsh(1), toplevel(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3) .SH KEYWORDS application, argument, interpreter, prompt, script file, shell, toolkit, toplevel |
Changes to doc/wm.n.
︙ | ︙ | |||
8 9 10 11 12 13 14 | .TH wm n 8.5 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME wm \- Communicate with window manager .SH SYNOPSIS | | < < < < < < < < < < < < < < < < < < < > | > > | > > | > > | > > | > > | > > | > > | > > | > > | > > | > > | > > | > > | > < < < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | .TH wm n 8.5 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME wm \- Communicate with window manager .SH SYNOPSIS \fBwm\fR \fIoption window \fR?\fIargs\fR? .BE .SH DESCRIPTION .PP The \fBwm\fR command is used to interact with window managers in order to control such things as the title for a window, its geometry, or the increments in terms of which it may be resized. The \fBwm\fR command can take any of a number of different forms, depending on the \fIoption\fR argument. All of the forms expect at least one additional argument, \fIwindow\fR, which must be the path name of a top-level window. .PP The legal forms for the \fBwm\fR command are: .TP \fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR? . If \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR are all specified, then they will be passed to the window manager and the window manager should use them to enforce a range of acceptable aspect ratios for \fIwindow\fR. The aspect ratio of \fIwindow\fR (width/length) will be constrained to lie between \fIminNumer\fR/\fIminDenom\fR and \fImaxNumer\fR/\fImaxDenom\fR. If \fIminNumer\fR etc. are all specified as empty strings, then any existing aspect ratio restrictions are removed. If \fIminNumer\fR etc. are specified, then the command returns an empty string. Otherwise, it returns a Tcl list containing four elements, which are the current values of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR (if no aspect restrictions are in effect, then an empty string is returned). .TP \fBwm attributes \fIwindow\fR .TP \fBwm attributes \fIwindow\fR ?\fBoption\fR? .TP \fBwm attributes \fIwindow\fR ?\fBoption value option value...\fR? . This subcommand returns or sets platform specific attributes associated with a window. The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows: .RS .PP All platforms support the following attributes (though X11 users should see the notes below): .TP \fB\-alpha\fR . Specifies the alpha transparency level of the toplevel. It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque). Values outside that range will be constrained. Where not supported, the \fB\-alpha\fR value remains at \fB1.0\fR. .TP \fB\-fullscreen\fR . Places the window in a mode that takes up the entire screen, has no borders, and covers the general use area (i.e. Start menu and taskbar on Windows, dock and menubar on OSX, general window decorations on X11). .TP \fB\-topmost\fR . Specifies whether this is a topmost window (displays above all other windows). .PP On Windows, the following attributes may be set. .TP \fB\-disabled\fR . Specifies whether the window is in a disabled state. .TP \fB\-toolwindow\fR . Specifies a toolwindow style window (as defined in the MSDN). .TP \fB\-transparentcolor\fR . Specifies the transparent color index of the toplevel. It takes any color value accepted by \fBTk_GetColor\fR. If the empty string is specified (default), no transparent color is used. This is supported on Windows 2000/XP+. Where not supported, the \fB\-transparentcolor\fR value remains at \fB{}\fR. .PP On MacOS, the following attributes may be set. .TP \fB\-appearance\fR . Specifies whether the window is rendered in "dark mode". Allowed values are \fBauto\fR, \fBaqua\fR and \fBdarkaqua\fR. If the setting is auto then the appearance of the window is controlled by the System Settings. .TP \fB\-class\fR . Specifies whether the underlying Aqua window for a toplevel is an object of the NSWindow class or the NSPanel class. The two allowed values for this option are \fBnswindow\fR and \fBnspanel\fR. It is not possible to change the class of the underlying Aqua window once that window has been instantiated, and attempting to do that is an error. However it is allowed to set this option for a pathname that does not correspond to an existing window. Doing that causes the class name to be cached for later use. When a toplevel with that pathname is eventually created, the cached class name will determine which class is used for the underlying Aqua window. .TP \fB\-isdark\fR . Returns a boolean value which is true if the window is currently in dark mode. .TP \fB\-modified\fR . Specifies the modification state of the window (determines whether the window close widget contains the modification indicator and whether the proxy icon is draggable). .TP \fB\-notify\fR . Specifies process notification state (bouncing of the application dock icon). .TP \fB\-stylemask\fR . Specifies an integer to be assigned as the styleMask of the underlying Aqua window. (See the Apple documentation for styleMask property of the NSWindow class.) The value of this option should be a list of bitnames. Each bit named in the list will be set to 1, and all other bits will be set to 0. The allowed bitnames are: \fBtitled\fR, \fBclosable\fR, \fBminiaturizable\fR, \fBresizable\fR, \fBfullsizecontentview\fR, \fBdocmodal\fR, \fButility\fR, \fBnonactivatingpanel\fR, and \fBHUDwindow\fR. Note that a side effect of setting the fullsizecontentview bit is that the window title bar becomes transparent. .TP \fB\-tabbingid\fR . Controls how tabbed toplevel windows are grouped together. Two tabs in the same group must correspond to toplevels with the same tabbingid, which can be an arbitrary UTF8 string. In the Tk implementation, changing the tabbingid of a toplevel in a tab group will cause it to be moved into a different group, in which all tabs have the new tabbingid or, if the new tabbingid is unique, to become a normal non-tabbed toplevel. It is allowed to set the tabbingid before the toplevel is created. If the pathname provided in the command does not correspond to a toplevel, the value will be cached and used later when the toplevel is actually created. .TP \fB\-tabbingmode\fR . Controls whether a toplevel can be opened as a tab within a tab group. The allowed values are \fBauto\fR, \fBpreferred\fR or \fBdisallowed\fR. A toplevel can be opened as a tab in exactly two situations: if its tabbingmode is \fBpreferred\fR; or if its tabbingmode is \fBauto\fR and the user has selected "prefer tabs when opening documents" in the Desktop and Dock panel of the System Settings application. It is allowed to set the tabbingmode before the toplevel is created. If the pathname provided in the command does not correspond to a toplevel, the value will be cached and used later when the toplevel is actually created. .TP \fB\-titlepath\fR . Specifies the path of the file referenced as the window proxy icon (which can be dragged and dropped in lieu of the file's finder icon). .TP \fB\-transparent\fR . Makes the window content area transparent and turns off the window shadow. For the transparency to be effective, the toplevel background needs to be set to a color with some alpha, e.g. .QW systemTransparent . .PP On X11, the following attributes may be set. These are not supported by all window managers, and will have no effect under older WMs. .\" See https://www.freedesktop.org/wiki/Specifications/wm-spec/ .TP \fB\-type\fR .VS 8.6 Requests that the window should be interpreted by the window manager as being of the specified type(s). This may cause the window to be decorated in a different way or otherwise managed differently, though exactly what happens is entirely up to the window manager. A list of types may be used, in order of preference. The following values are mapped to constants defined in the EWMH specification (using others is possible, but not advised): .RS .TP \fBdesktop\fR . indicates a desktop feature, .TP \fBdock\fR . indicates a dock/panel feature, .TP \fBtoolbar\fR . indicates a toolbar window that should be acting on behalf of another window, as indicated with \fBwm transient\fR, .TP \fBmenu\fR . indicates a torn-off menu that should be acting on behalf of another window, as indicated with \fBwm transient\fR, .TP \fButility\fR . indicates a utility window (e.g., palette or toolbox) that should be acting on behalf of another window, as indicated with \fBwm transient\fR, .TP \fBsplash\fR . indicates a splash screen, displayed during application start up, .TP \fBdialog\fR . indicates a general dialog window, that should be acting on behalf of another window, as indicated with \fBwm transient\fR, .TP \fBdropdown_menu\fR . indicates a menu summoned from a menu bar, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), .TP \fBpopup_menu\fR . indicates a popup menu, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), .TP \fBtooltip\fR . indicates a tooltip window, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), .TP \fBnotification\fR . indicates a window that provides a background notification of some event, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), .TP \fBcombo\fR . indicates the drop-down list of a combobox widget, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), .TP \fBdnd\fR . indicates a window that represents something being dragged, which should usually also be set to be override-redirected (with \fBwm overrideredirect\fR), .TP \fBnormal\fR . indicates a window that has no special interpretation. .RE .VE 8.6 .TP \fB\-zoomed\fR . Requests that the window should be maximized. This is the same as \fBwm state zoomed\fR on Windows and Mac OS X. .PP On X11, changes to window attributes are performed asynchronously. Querying the value of an attribute returns the current state, which will not be the same as the value most recently set if the window manager has not yet processed the request or if it does not support the attribute. .RE .TP \fBwm client \fIwindow\fR ?\fIname\fR? . If \fIname\fR is specified, this command stores \fIname\fR (which should be the name of the host on which the application is executing) in \fIwindow\fR's \fBWM_CLIENT_MACHINE\fR property for use by the window manager or session manager. The command returns an empty string in this case. If \fIname\fR is not specified, the command returns the last name set in a \fBwm client\fR command for \fIwindow\fR. If \fIname\fR is specified as an empty string, the command deletes the \fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR. .TP \fBwm colormapwindows \fIwindow\fR ?\fIwindowList\fR? . This command is used to manipulate the \fBWM_COLORMAP_WINDOWS\fR property, which provides information to the window managers about windows that have private colormaps. .RS |
︙ | ︙ | |||
310 311 312 313 314 315 316 | If \fBwm colormapwindows\fR is not invoked, Tk will automatically set the property for each top-level window to all the internal windows whose colormaps differ from their parents, followed by the top-level itself; the order of the internal windows is undefined. See the ICCCM documentation for more information on the \fBWM_COLORMAP_WINDOWS\fR property. .RE | < < < < < < | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | If \fBwm colormapwindows\fR is not invoked, Tk will automatically set the property for each top-level window to all the internal windows whose colormaps differ from their parents, followed by the top-level itself; the order of the internal windows is undefined. See the ICCCM documentation for more information on the \fBWM_COLORMAP_WINDOWS\fR property. .RE .TP \fBwm command \fIwindow\fR ?\fIvalue\fR? . If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's \fBWM_COMMAND\fR property for use by the window manager or session manager and returns an empty string. \fIValue\fR must have proper list structure; the elements should contain the words of the command used to invoke the application. If \fIvalue\fR is not specified then the command returns the last value set in a \fBwm command\fR command for \fIwindow\fR. If \fIvalue\fR is specified as an empty string, the command deletes the \fBWM_COMMAND\fR property from \fIwindow\fR. .TP \fBwm deiconify \fIwindow\fR . Arrange for \fIwindow\fR to be displayed in normal (non-iconified) form. This is done by mapping the window. If the window has never been mapped then this command will not map the window, but it will ensure that when the window is first mapped it will be displayed in de-iconified form. On Windows, a deiconified window will also be raised and be given the focus (made the active window). Returns an empty string. .TP \fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR? . If \fBactive\fR or \fBpassive\fR is supplied as an optional argument to the command, then it specifies the focus model for \fIwindow\fR. In this case the command returns an empty string. If no additional argument is supplied, then the command returns the current focus model for \fIwindow\fR. .RS .PP An \fBactive\fR focus model means that \fIwindow\fR will claim the input focus for itself or its descendants, even at times when the focus is currently in some other application. \fBPassive\fR means that \fIwindow\fR will never claim the focus for itself: the window manager should give the focus to \fIwindow\fR at appropriate times. However, once the focus has been given to \fIwindow\fR or one of its descendants, the application may re-assign the focus among \fIwindow\fR's descendants. The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR command assumes a passive model of focusing. .RE .TP \fBwm forget \fIwindow\fR . The \fIwindow\fR will be unmapped from the screen and will no longer be managed by \fBwm\fR. Windows created with the \fBtoplevel\fR command will be treated like \fBframe\fR windows once they are no longer managed by \fBwm\fR, however, the \fB\-menu\fR configuration will be remembered and the menus will return once the widget is managed again. .TP \fBwm frame \fIwindow\fR . If \fIwindow\fR has been reparented by the window manager into a decorative frame, the command returns the platform specific window identifier for the outermost frame that contains \fIwindow\fR (the window whose parent is the root or virtual root). If \fIwindow\fR has not been reparented by the window manager then the command returns the platform specific window identifier for \fIwindow\fR. .TP \fBwm geometry \fIwindow\fR ?\fInewGeometry\fR? . If \fInewGeometry\fR is specified, then the geometry of \fIwindow\fR is changed and an empty string is returned. Otherwise the current geometry for \fIwindow\fR is returned (this is the most recent geometry specified either by manual resizing or |
︙ | ︙ | |||
419 420 421 422 423 424 425 | actual size and location of \fIwindow\fR, whereas \fBwm geometry\fR allows both setting and querying of the \fIwindow manager\fR's understanding of the size and location of the window. This can vary significantly, for example to reflect the addition of decorative elements to \fIwindow\fR such as title bars, and window managers are not required to precisely follow the requests made through this command. .RE | < | 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | actual size and location of \fIwindow\fR, whereas \fBwm geometry\fR allows both setting and querying of the \fIwindow manager\fR's understanding of the size and location of the window. This can vary significantly, for example to reflect the addition of decorative elements to \fIwindow\fR such as title bars, and window managers are not required to precisely follow the requests made through this command. .RE .TP \fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR? . This command indicates that \fIwindow\fR is to be managed as a gridded window. It also specifies the relationship between grid units and pixel units. \fIBaseWidth\fR and \fIbaseHeight\fR specify the number of grid |
︙ | ︙ | |||
452 453 454 455 456 457 458 | .PP Otherwise the return value is a Tcl list containing four elements corresponding to the current \fIbaseWidth\fR, \fIbaseHeight\fR, \fIwidthInc\fR, and \fIheightInc\fR; if \fIwindow\fR is not currently gridded, then an empty string is returned. .PP | | < < | | | | | < | 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | .PP Otherwise the return value is a Tcl list containing four elements corresponding to the current \fIbaseWidth\fR, \fIbaseHeight\fR, \fIwidthInc\fR, and \fIheightInc\fR; if \fIwindow\fR is not currently gridded, then an empty string is returned. .PP Note: this command should not be needed very often, since the \fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option provide easier access to the same functionality. .RE .TP \fBwm group \fIwindow\fR ?\fIpathName\fR? . If \fIpathName\fR is specified, it gives the path name for the leader of a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's leader is iconified. \fIPathName\fR may be specified as an empty string to remove \fIwindow\fR from any group association. If \fIpathName\fR is specified then the command returns an empty string; otherwise it returns the path name of \fIwindow\fR's current group leader, or an empty string if \fIwindow\fR is not part of any group. .TP \fBwm iconbadge \fIwindow\fR \fIbadge\fR . Sets a badge for the icon of the \fIwindow\fR. The badge can be a positive integer number, for instance the number of new or unread messages, or an exclamation point denoting attention needed. If the badge is an empty string, the badge image is removed from the application icon. Managing these changes through bindings, such as <FocusIn>, is the responsibility of the developer. .RS .PP On X11, for this command to work, the variable \fB::tk::icons::base_icon($window)\fR must be set to the image that is being used for the window icon of $window. On Windows and X11, the iconphoto images work best at 32x32 or a similar dimension, as the badge images are provided by Tk and drawn to overlay the icon images using native (Windows) API's or Tk rendering. On macOS, the icon badge is rendered by a system API and is not provided by Tk. The icon image itself should be higher-resolution, preferably 512 pixels, to avoid being blurry. .PP The icon badge is intended for display in the Dock (macOS), taskbar (Windows) or app panel (X11). On macOS, the last badge called will be displayed in the Dock, regardless of how many different icon badges may be assigned to different windows. On Windows, the taskbar display depends on whether the taskbar buttons are combined or not (this is an OS setting available to the user): if combined the behavior is the same as on macOS, otherwise each button in the taskbar shows the badge it was assigned. Badge display on macOS is configured in the system preferences. App panel display behavior on X11 will depend on the window manager and/or desktop environment. .RE .TP \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR? . If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details). This bitmap is passed to the window manager to be displayed in \fIwindow\fR's icon, and the command returns an empty string. If |
︙ | ︙ | |||
530 531 532 533 534 535 536 | any file which contains a valid Windows icon is also accepted (usually .ico or .icr files), or any file for which the shell has assigned an icon. Tcl will first test if the file contains an icon, then if it has an assigned icon, and finally, if that fails, test for a bitmap. .RE | < < < < | 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 | any file which contains a valid Windows icon is also accepted (usually .ico or .icr files), or any file for which the shell has assigned an icon. Tcl will first test if the file contains an icon, then if it has an assigned icon, and finally, if that fails, test for a bitmap. .RE .TP \fBwm iconify \fIwindow\fR . Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR has not yet been mapped for the first time, this command will arrange for it to appear in the iconified state when it is eventually mapped. .TP \fBwm iconmask \fIwindow\fR ?\fIbitmap\fR? . If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details). This bitmap is passed to the window manager to be used as a mask in conjunction with the \fBiconbitmap\fR option: where the mask has zeroes no icon will be displayed; where it has ones, the bits from the icon bitmap will be displayed. If an empty string is specified for \fIbitmap\fR then any current icon mask is cancelled for \fIwindow\fR (this is equivalent to specifying a bitmap of all ones). If \fIbitmap\fR is specified then the command returns an empty string. Otherwise it returns the name of the current icon mask associated with \fIwindow\fR, or an empty string if no mask is in effect. .TP \fBwm iconname \fIwindow\fR ?\fInewName\fR? . If \fInewName\fR is specified, then it is passed to the window manager; the window manager should display \fInewName\fR inside the icon associated with \fIwindow\fR. In this case an empty string is returned as result. If \fInewName\fR is not specified then the command returns the current icon name for \fIwindow\fR, or an empty string if no icon name has been specified (in this case the window manager will normally display the window's title, as specified with the \fBwm title\fR command). .TP \fBwm iconphoto \fIwindow\fR ?\fB\-default\fR? \fIimage1\fR ?\fIimage2 ...\fR? . Sets the titlebar icon for \fIwindow\fR based on the named photo images. If \fB\-default\fR is specified, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the time of invocation. If the images are later changed, this is not |
︙ | ︙ | |||
596 597 598 599 600 601 602 | 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 | < < | < < < < < < | 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | 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 .TP \fBwm iconposition \fIwindow\fR ?\fIx y\fR? . If \fIx\fR and \fIy\fR are specified, they are passed to the window manager as a hint about where to position the icon for \fIwindow\fR. In this case an empty string is returned. If \fIx\fR and \fIy\fR are specified as empty strings then any existing icon position hint is cancelled. If neither \fIx\fR nor \fIy\fR is specified, then the command returns a Tcl list containing two values, which are the current icon position hints (if no hints are in effect then an empty string is returned). .TP \fBwm iconwindow \fIwindow\fR ?\fIpathName\fR? . If \fIpathName\fR is specified, it is the path name for a window to use as icon for \fIwindow\fR: when \fIwindow\fR is iconified then \fIpathName\fR will be mapped to serve as icon, and when \fIwindow\fR is de-iconified then \fIpathName\fR will be unmapped again. If \fIpathName\fR is specified as an empty string then any existing icon window association for \fIwindow\fR will be cancelled. If the \fIpathName\fR argument is specified then an empty string is returned. Otherwise the command returns the path name of the current icon window for \fIwindow\fR, or an empty string if there is no icon window currently specified for \fIwindow\fR. Button press events are disabled for \fIwindow\fR as long as it is an icon window; this is needed in order to allow window managers to .QW own those events. Note: not all window managers support the notion of an icon window. .TP \fBwm manage \fIwidget\fR . The \fIwidget\fR specified will become a stand alone top-level window. The window will be decorated with the window managers title bar, etc. Only \fIframe\fR, \fIlabelframe\fR and \fItoplevel\fR widgets can be used with this command. Attempting to pass any other widget type will raise an error. Attempting to manage a \fItoplevel\fR widget is benign and achieves nothing. See also \fBGEOMETRY MANAGEMENT\fR. .TP \fBwm maxsize \fIwindow\fR ?\fIwidth height\fR? . If \fIwidth\fR and \fIheight\fR are specified, they give the maximum permissible dimensions for \fIwindow\fR. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. The window manager will restrict the window's dimensions to be less than or equal to \fIwidth\fR and \fIheight\fR. If \fIwidth\fR and \fIheight\fR are specified, then the command returns an empty string. Otherwise it returns a Tcl list with two elements, which are the maximum width and height currently in effect. The maximum size defaults to the size of the screen. See the sections on geometry management below for more information. .TP \fBwm minsize \fIwindow\fR ?\fIwidth height\fR? . If \fIwidth\fR and \fIheight\fR are specified, they give the minimum permissible dimensions for \fIwindow\fR. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. The window manager will restrict the window's dimensions to be greater than or equal to \fIwidth\fR and \fIheight\fR. If \fIwidth\fR and \fIheight\fR are specified, then the command returns an empty string. Otherwise it returns a Tcl list with two elements, which are the minimum width and height currently in effect. The minimum size defaults to one pixel in each dimension. See the sections on geometry management below for more information. .TP \fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR? . If \fIboolean\fR is specified, it must have a proper boolean form and the override-redirect flag for \fIwindow\fR is set to that value. If \fIboolean\fR is not specified then \fB1\fR or \fB0\fR is returned to indicate whether or not the override-redirect flag is currently set for \fIwindow\fR. Setting the override-redirect flag for a window causes it to be ignored by the window manager; among other things, this means that the window will not be reparented from the root window into a decorative frame and the user will not be able to manipulate the window using the normal window manager mechanisms. .RS .PP Note that the override-redirect flag is only guaranteed to be taken notice of when the window is first mapped or when mapped after the state is changed from withdrawn to normal. Some, but not all, platforms will take notice at additional times. .RE .TP \fBwm positionfrom \fIwindow\fR ?\fIwho\fR? . If \fIwho\fR is specified, it must be either \fBprogram\fR or \fBuser\fR, or an abbreviation of one of these two. It indicates whether \fIwindow\fR's current position was requested by the program or by the user. Many window managers ignore program-requested |
︙ | ︙ | |||
712 713 714 715 716 717 718 | source of the window's current position, or an empty string if no source has been specified yet. Most window managers interpret .QW "no source" as equivalent to \fBprogram\fR. Tk will automatically set the position source to \fBuser\fR when a \fBwm geometry\fR command is invoked, unless the source has been set explicitly to \fBprogram\fR. | < | 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | source of the window's current position, or an empty string if no source has been specified yet. Most window managers interpret .QW "no source" as equivalent to \fBprogram\fR. Tk will automatically set the position source to \fBuser\fR when a \fBwm geometry\fR command is invoked, unless the source has been set explicitly to \fBprogram\fR. .TP \fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR? . This command is used to manage window manager protocols. The \fIname\fR argument in the \fBwm protocol\fR command is the name of an atom corresponding to a window manager protocol. Examples include \fBWM_DELETE_WINDOW\fR or \fBWM_SAVE_YOURSELF\fR or \fBWM_TAKE_FOCUS\fR. |
︙ | ︙ | |||
760 761 762 763 764 765 766 | is not returned). If \fIcommand\fR is specified as an empty string then the atom for \fIname\fR is removed from the \fBWM_PROTOCOLS\fR property of \fIwindow\fR and the handler is destroyed; an empty string is returned. Lastly, if neither \fIname\fR nor \fIcommand\fR is specified, the \fBwm protocol\fR command returns a list of all of the protocols for which handlers are currently defined for \fIwindow\fR. .RE | < < < < < < < | | 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | is not returned). If \fIcommand\fR is specified as an empty string then the atom for \fIname\fR is removed from the \fBWM_PROTOCOLS\fR property of \fIwindow\fR and the handler is destroyed; an empty string is returned. Lastly, if neither \fIname\fR nor \fIcommand\fR is specified, the \fBwm protocol\fR command returns a list of all of the protocols for which handlers are currently defined for \fIwindow\fR. .RE .TP \fBwm resizable \fIwindow\fR ?\fIwidth height\fR? . This command controls whether or not the user may interactively resize a top-level window. If \fIwidth\fR and \fIheight\fR are specified, they are boolean values that determine whether the width and height of \fIwindow\fR may be modified by the user. In this case the command returns an empty string. If \fIwidth\fR and \fIheight\fR are omitted then the command returns a list with two 0/1 elements that indicate whether the width and height of \fIwindow\fR are currently resizable. By default, windows are resizable in both dimensions. If resizing is disabled, then the window's size will be the size from the most recent interactive resize or \fBwm geometry\fR command. If there has been no such operation then the window's natural size will be used. .TP \fBwm sizefrom \fIwindow\fR ?\fIwho\fR? . If \fIwho\fR is specified, it must be either \fBprogram\fR or \fBuser\fR, or an abbreviation of one of these two. It indicates whether \fIwindow\fR's current size was requested by the program or by the user. Some window managers ignore program-requested sizes and ask the user to manually size the window; if \fBuser\fR is specified then the window manager should give the window its specified size without asking the user for assistance. If \fIwho\fR is specified as an empty string, then the current size source is cancelled. If \fIwho\fR is specified, then the command returns an empty string. Otherwise it returns \fBuser\fR or \fBwindow\fR to indicate the source of the window's current size, or an empty string if no source has been specified yet. Most window managers interpret .QW "no source" as equivalent to \fBprogram\fR. .TP \fBwm stackorder \fIwindow\fR ?\fBisabove\fR|\fBisbelow \fIwindow\fR? . The \fBstackorder\fR command returns a list of toplevel windows in stacking order, from lowest to highest. When a single toplevel window is passed, the returned list recursively includes all of the window's children that are toplevels. Only those toplevels that are currently mapped to the screen are returned. The \fBstackorder\fR command can also be used to determine if one toplevel is positioned above or below a second toplevel. When two window arguments separated by either \fBisabove\fR or \fBisbelow\fR are passed, a boolean result indicates whether or not the first window is currently above or below the second window in the stacking order. .TP \fBwm state \fIwindow\fR ?newstate? . If \fInewstate\fR is specified, the window will be set to the new state, otherwise it returns the current state of \fIwindow\fR: either \fBnormal\fR, \fBiconic\fR, \fBwithdrawn\fR, \fBicon\fR, or (Windows and Mac OS X only) \fBzoomed\fR. The difference between \fBiconic\fR and \fBicon\fR is that \fBiconic\fR refers to a window that has been iconified (e.g., with the \fBwm iconify\fR command) while \fBicon\fR refers to a window whose only purpose is to serve as the icon for some other window (via the \fBwm iconwindow\fR command). The \fBicon\fR state cannot be set. .TP \fBwm title \fIwindow\fR ?\fIstring\fR? . If \fIstring\fR is specified, then it will be passed to the window manager for use as the title for \fIwindow\fR (the window manager should display this string in \fIwindow\fR's title bar). In this case the command returns an empty string. If \fIstring\fR is not specified then the command returns the current title for the \fIwindow\fR. The title for a window defaults to its name. .TP \fBwm transient \fIwindow\fR ?\fIcontainer\fR? . If \fIcontainer\fR is specified, then the window manager is informed that \fIwindow\fR is a transient window (e.g. pull-down menu) working on behalf of \fIcontainer\fR (where \fIcontainer\fR is the path name for a top-level window). If \fIcontainer\fR is specified as an empty string then \fIwindow\fR is marked as not being a transient window any more. Otherwise the command returns the path name of \fIwindow\fR's current container, or an empty string if \fIwindow\fR is not currently a transient window. A transient window will mirror state changes in the container and inherit the state of the container when initially mapped. The directed graph with an edge from each transient to its container must be acyclic. In particular, it is an error to attempt to make a window a transient of itself. The window manager may also decorate a transient window differently, removing some features normally present (e.g., minimize and maximize buttons) though this is entirely at the discretion of the window manager. .TP \fBwm withdraw \fIwindow\fR . Arranges for \fIwindow\fR to be withdrawn from the screen. This causes the window to be unmapped and forgotten about by the window manager. If the window has never been mapped, then this command causes the window to be mapped in the withdrawn state. Not all window managers appear to know how to handle windows that are mapped in the withdrawn state. Note: it sometimes seems to be necessary to withdraw a window and then re-map it (e.g. with \fBwm deiconify\fR) to get some window managers to pay attention to changes in window attributes such as group. .SH "GEOMETRY MANAGEMENT" .PP By default a top-level window appears on the screen in its \fInatural size\fR, which is the one determined internally by its |
︙ | ︙ | |||
962 963 964 965 966 967 968 | \fBwm resizable\fR .fixed 0 0 .CE .PP A simple dialog-like window, centred on the screen: .CS # Create and arrange the dialog contents. toplevel .msg | | | | | | | | < | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 | \fBwm resizable\fR .fixed 0 0 .CE .PP A simple dialog-like window, centred on the screen: .CS # Create and arrange the dialog contents. toplevel .msg label .msg.l \-text "This is a very simple dialog demo." button .msg.ok \-text OK \-default active \-command {destroy .msg} pack .msg.ok \-side bottom \-fill x pack .msg.l \-expand 1 \-fill both # Now set the widget up as a centred dialog. # But first, we need the geometry managers to finish setting # up the interior of the dialog, for which we need to run the # event loop with the widget hidden completely... \fBwm withdraw\fR .msg update set x [expr {([winfo screenwidth .]\-[winfo width .msg])/2}] set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}] \fBwm geometry\fR .msg +$x+$y \fBwm transient\fR .msg . \fBwm title\fR .msg "Dialog demo" \fBwm deiconify\fR .msg .CE .SH "SEE ALSO" toplevel(n), winfo(n) .SH KEYWORDS aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager '\" Local Variables: '\" mode: nroff '\" End: |
Changes to generic/tk.decls.
︙ | ︙ | |||
142 143 144 145 146 147 148 | int Tk_ConfigureValue(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags) } declare 29 { int Tk_ConfigureWidget(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, | | | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | int Tk_ConfigureValue(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags) } declare 29 { int Tk_ConfigureWidget(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size argc, const char **argv, void *widgRec, int flags) } declare 30 { void Tk_ConfigureWindow(Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr) } declare 31 { |
︙ | ︙ | |||
322 323 324 325 326 327 328 329 330 331 332 333 334 335 | } declare 75 { void Tk_FreePixmap(Display *display, Pixmap pixmap) } declare 76 { void Tk_FreeTextLayout(Tk_TextLayout textLayout) } declare 78 { GC Tk_GCForColor(XColor *colorPtr, Drawable drawable) } declare 79 { void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight) } declare 80 { | > > > | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | } declare 75 { void Tk_FreePixmap(Display *display, Pixmap pixmap) } declare 76 { void Tk_FreeTextLayout(Tk_TextLayout textLayout) } declare 77 {deprecated {function does nothing, call can be removed}} { void Tk_FreeXId(Display *display, XID xid) } declare 78 { GC Tk_GCForColor(XColor *colorPtr, Drawable drawable) } declare 79 { void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight) } declare 80 { |
︙ | ︙ | |||
468 469 470 471 472 473 474 475 476 477 478 479 480 481 | declare 116 { Tk_Window Tk_IdToWindow(Display *display, Window window) } declare 117 { void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight) } declare 119 { Atom Tk_InternAtom(Tk_Window tkwin, const char *name) } declare 120 { int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y, int width, int height) } | > > > | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | declare 116 { Tk_Window Tk_IdToWindow(Display *display, Window window) } declare 117 { void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight) } declare 118 { int Tk_Init(Tcl_Interp *interp) } declare 119 { Atom Tk_InternAtom(Tk_Window tkwin, const char *name) } declare 120 { int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y, int width, int height) } |
︙ | ︙ | |||
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | void *clientData) } declare 143 { int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags) } declare 146 { int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr) } declare 147 { void Tk_PhotoBlank(Tk_PhotoHandle handle) } declare 149 { void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr) } declare 151 { int Tk_PointToChar(Tk_TextLayout layout, int x, int y) } declare 152 { int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr) } declare 153 { | > > > > > > > > > > > > > > > > > | 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | void *clientData) } declare 143 { int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags) } declare 144 {deprecated {function signature changed}} { void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height) } declare 145 {deprecated {function signature changed}} { void Tk_PhotoPutZoomedBlock_NoComposite(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY) } declare 146 { int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr) } declare 147 { void Tk_PhotoBlank(Tk_PhotoHandle handle) } declare 148 {deprecated {function signature changed}} { void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height ) } declare 149 { void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr) } declare 150 {deprecated {function signature changed}} { void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height) } declare 151 { int Tk_PointToChar(Tk_TextLayout layout, int x, int y) } declare 152 { int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr) } declare 153 { |
︙ | ︙ | |||
590 591 592 593 594 595 596 597 598 599 600 601 602 603 | declare 157 { int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other) } declare 158 { Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr) } declare 160 { const char *Tk_SetAppName(Tk_Window tkwin, const char *name) } declare 161 { void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border) } declare 162 { | > > > | 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | declare 157 { int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other) } declare 158 { Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr) } declare 159 { int Tk_SafeInit(Tcl_Interp *interp) } declare 160 { const char *Tk_SetAppName(Tk_Window tkwin, const char *name) } declare 161 { void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border) } declare 162 { |
︙ | ︙ | |||
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 | int Tk_GetScrollInfoObj(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr) } declare 211 { int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin) } declare 213 { void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr) } declare 214 { int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr) } declare 215 { void Tk_InitConsoleChannels(Tcl_Interp *interp) } declare 217 { void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method) } #declare 218 { # void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr) #} #declare 219 { | > > > > > > > | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 | int Tk_GetScrollInfoObj(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr) } declare 211 { int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin) } declare 212 {nostub {Don't use this function in a stub-enabled extension}} { TCL_NORETURN1 void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp) } declare 213 { void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr) } declare 214 { int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr) } declare 215 { void Tk_InitConsoleChannels(Tcl_Interp *interp) } declare 216 { int Tk_CreateConsoleWindow(Tcl_Interp *interp) } declare 217 { void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method) } #declare 218 { # void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr) #} #declare 219 { |
︙ | ︙ | |||
906 907 908 909 910 911 912 913 914 915 916 917 918 919 | } # New in 8.4a5 # declare 245 { void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height) } declare 248 { int Tk_CollapseMotionEvents(Display *display, int collapse) } # Style engine declare 249 { Tk_StyleEngine Tk_RegisterStyleEngine(const char *name, | > > > > > > > > > > > | 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 | } # New in 8.4a5 # declare 245 { void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height) } declare 246 {deprecated {function signature changed}} { void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule) } declare 247 {deprecated {function signature changed}} { void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule) } declare 248 { int Tk_CollapseMotionEvents(Display *display, int collapse) } # Style engine declare 249 { Tk_StyleEngine Tk_RegisterStyleEngine(const char *name, |
︙ | ︙ | |||
941 942 943 944 945 946 947 948 949 950 951 952 953 954 | } declare 256 { const char *Tk_NameOfStyle(Tk_Style style) } declare 257 { Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } declare 260 { Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable) } declare 261 { void Tk_GetElementSize(Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int width, int height, | > > > > > > | 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 | } declare 256 { const char *Tk_NameOfStyle(Tk_Style style) } declare 257 { Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } declare 258 { Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr) } declare 259 { void Tk_FreeStyleFromObj(Tcl_Obj *objPtr) } declare 260 { Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable) } declare 261 { void Tk_GetElementSize(Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int width, int height, |
︙ | ︙ | |||
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 | void Tk_ResetUserInactiveTime(Display *dpy) } # TIP #264 declare 271 { Tcl_Interp *Tk_Interp(Tk_Window tkwin) } # TIP#580 declare 274 { int Tk_AlwaysShowSelection(Tk_Window tkwin) } declare 275 { unsigned Tk_GetButtonMask(unsigned button) | > > > > > > > > > > > > > > > > > | 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 | void Tk_ResetUserInactiveTime(Display *dpy) } # TIP #264 declare 271 { Tcl_Interp *Tk_Interp(Tk_Window tkwin) } # Now that the Tk 8.2 -> 8.3 transition is long past, use more conventional # means to continue support for extensions using the USE_OLD_IMAGE to # continue use of their string-based Tcl_ImageTypes and Tcl_PhotoImageFormats. # # Note that this restores the usual rules for stub compatibility. Stub-enabled # extensions compiled against 8.5 headers and linked to the 8.5 stub library # will produce a file [load]able into an interp with Tk 8.X, for X >= 5. # It will *not* be [load]able into interps with Tk 8.4 (or Tk 8.2!). # Developers who need to produce a file [load]able into legacy interps must # build against legacy sources. declare 272 { void Tk_CreateOldImageType(const Tk_ImageType *typePtr) } declare 273 { void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) } # TIP#580 declare 274 { int Tk_AlwaysShowSelection(Tk_Window tkwin) } declare 275 { unsigned Tk_GetButtonMask(unsigned button) |
︙ | ︙ | |||
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | } declare 2 win { HWND Tk_GetHWND(Window window) } declare 3 win { Tk_Window Tk_HWNDToWindow(HWND hwnd) } ################################ # Aqua specific functions declare 4 aqua { void TkMacOSXInitAppleEvents(Tcl_Interp *interp) } declare 6 aqua { void TkMacOSXInvalClipRgns(Tk_Window tkwin) } # Stub removed because it just returned NULL. #declare 7 aqua { # void *TkMacOSXGetDrawablePort(Drawable drawable) #} | > > > > > > > > > > > > > > > | 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 | } declare 2 win { HWND Tk_GetHWND(Window window) } declare 3 win { Tk_Window Tk_HWNDToWindow(HWND hwnd) } declare 4 win { void Tk_PointerEvent(HWND hwnd, int x, int y) } declare 5 win { int Tk_TranslateWinEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result) } ################################ # Aqua specific functions # Stub removed because the function no longer exists. #declare 3 aqua { # void TkMacOSXInitMenus(Tcl_Interp *interp) #} declare 4 aqua { void TkMacOSXInitAppleEvents(Tcl_Interp *interp) } declare 5 aqua { void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, int height, int flags) } declare 6 aqua { void TkMacOSXInvalClipRgns(Tk_Window tkwin) } # Stub removed because it just returned NULL. #declare 7 aqua { # void *TkMacOSXGetDrawablePort(Drawable drawable) #} |
︙ | ︙ | |||
1130 1131 1132 1133 1134 1135 1136 | # Public functions that are not accessible via the stubs table. export { const char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact) } export { | | | | 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 | # Public functions that are not accessible via the stubs table. export { const char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact) } export { TCL_NORETURN1 void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp) } export { TCL_NORETURN1 void Tk_MainExW(Tcl_Size argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); } # Local Variables: # mode: tcl # End: |
Changes to generic/tk.h.
︙ | ︙ | |||
13 14 15 16 17 18 19 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifndef _TK #define _TK #include <tcl.h> | | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifndef _TK #define _TK #include <tcl.h> #if (TCL_MAJOR_VERSION < 8) || (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) # error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better #endif #ifndef EXTERN # define EXTERN extern TCL_STORAGE_CLASS #endif /* |
︙ | ︙ | |||
62 63 64 65 66 67 68 | * win/tcl.m4 (not patchlevel) * * You may also need to update some of these files when the numbers change for * the version of Tcl that this release of Tk is compiled against. */ #ifndef TK_MAJOR_VERSION | | | > > | | | | | < | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | * win/tcl.m4 (not patchlevel) * * You may also need to update some of these files when the numbers change for * the version of Tcl that this release of Tk is compiled against. */ #ifndef TK_MAJOR_VERSION # define TK_MAJOR_VERSION 8 #endif #if TK_MAJOR_VERSION != 8 # error "This header-file is for Tk 8 only" #endif #define TK_MINOR_VERSION 7 #define TK_RELEASE_LEVEL TCL_BETA_RELEASE #define TK_RELEASE_SERIAL 1 #define TK_VERSION "8.7" #define TK_PATCH_LEVEL "8.7b1" /* * A special definition used to allow this header file to be included from * windows or mac resource files so that they can obtain version information. * RC_INVOKED is defined by default by the windows RC tool and manually set * for macintosh. * |
︙ | ︙ | |||
141 142 143 144 145 146 147 148 149 150 151 152 153 154 | typedef struct Tk_StyledElement_ *Tk_StyledElement; /* * Additional types exported to clients. */ typedef const char *Tk_Uid; /* *---------------------------------------------------------------------- * * The enum below defines the valid types for Tk configuration options as * implemented by Tk_InitOptions, Tk_SetOptions, etc. */ | > > > > > > > > > | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | typedef struct Tk_StyledElement_ *Tk_StyledElement; /* * Additional types exported to clients. */ typedef const char *Tk_Uid; #if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7) # ifndef Tcl_Size # define Tcl_Size int # endif # define TCL_SIZE_MAX INT_MAX # define TCL_SIZE_MODIFIER "" # define TCL_ENCODING_PROFILE_TCL8 0x01000000 #endif /* *---------------------------------------------------------------------- * * The enum below defines the valid types for Tk configuration options as * implemented by Tk_InitOptions, Tk_SetOptions, etc. */ |
︙ | ︙ | |||
223 224 225 226 227 228 229 | } Tk_OptionSpec; /* * Flag values for Tk_OptionSpec structures. These flags are shared by * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully. */ | | > > > | > | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | } Tk_OptionSpec; /* * Flag values for Tk_OptionSpec structures. These flags are shared by * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully. */ #define TK_OPTION_DONT_SET_DEFAULT (1 << 3) #if TCL_MAJOR_VERSION > 8 # define TK_OPTION_NULL_OK TCL_NULL_OK #else # define TK_OPTION_NULL_OK (1 << 0) #endif #define TK_OPTION_VAR(type) ((sizeof(type) < 2 * sizeof(int)) ? ((int)(sizeof(type)&(sizeof(int)-1))<<6) : (3<<6)) #define TK_OPTION_ENUM_VAR TK_OPTION_VAR(Tk_OptionType) /* * The following structure and function types are used by TK_OPTION_CUSTOM * options; the structure holds pointers to the functions needed by the Tk * option config code to handle a custom option. |
︙ | ︙ | |||
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | Tk_CustomOptionFreeProc *freeProc; /* Function to use to free the internal * representation of an option. */ void *clientData; /* Arbitrary one-word value passed to the * handling procs. */ } Tk_ObjCustomOption; /* * The following two structures are used for error handling. When config * options are being modified, the old values are saved in a Tk_SavedOptions * structure. If an error occurs, then the contents of the structure can be * used to restore all of the old values. The contents of this structure are * for the private use Tk. No-one outside Tk should ever read or write any of * the fields of these structures. */ typedef struct Tk_SavedOption { struct TkOption *optionPtr; /* Points to information that describes the * option. */ Tcl_Obj *valuePtr; /* The old value of the option, in the form of * a Tcl object; may be NULL if the value was * not saved as an object. */ | > > > > > > > > > | | | | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | Tk_CustomOptionFreeProc *freeProc; /* Function to use to free the internal * representation of an option. */ void *clientData; /* Arbitrary one-word value passed to the * handling procs. */ } Tk_ObjCustomOption; /* * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure. * Computes number of bytes from beginning of structure to a given field. */ #if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) && !defined(BUILD_tk) # define Tk_Offset(type, field) ((int) offsetof(type, field)) #endif /* * The following two structures are used for error handling. When config * options are being modified, the old values are saved in a Tk_SavedOptions * structure. If an error occurs, then the contents of the structure can be * used to restore all of the old values. The contents of this structure are * for the private use Tk. No-one outside Tk should ever read or write any of * the fields of these structures. */ typedef struct Tk_SavedOption { struct TkOption *optionPtr; /* Points to information that describes the * option. */ Tcl_Obj *valuePtr; /* The old value of the option, in the form of * a Tcl object; may be NULL if the value was * not saved as an object. */ #if TCL_MAJOR_VERSION < 9 double internalForm; /* The old value of the option, in some * internal representation such as an int or * (XColor *). Valid only if the field * optionPtr->specPtr->objOffset is -1. The * space must be large enough to accommodate a * long double, a double, a long, or a pointer; * right now it looks like a long double (i.e., 16 * bytes) is big enough. Also, using a long double * guarantees that the field is properly aligned * for storing large values. */ #else long double internalForm; #endif } Tk_SavedOption; #ifdef TCL_MEM_DEBUG # define TK_NUM_SAVED_OPTIONS 2 #else # define TK_NUM_SAVED_OPTIONS 20 |
︙ | ︙ | |||
405 406 407 408 409 410 411 | /* * Possible flag values for Tk_ConfigSpec structures. Any bits at or above * TK_CONFIG_USER_BIT may be used by clients for selecting certain entries. * Before changing any values here, coordinate with tkOldConfig.c * (internal-use-only flags are defined there). */ | < > > > > > > > > | 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | /* * Possible flag values for Tk_ConfigSpec structures. Any bits at or above * TK_CONFIG_USER_BIT may be used by clients for selecting certain entries. * Before changing any values here, coordinate with tkOldConfig.c * (internal-use-only flags are defined there). */ #define TK_CONFIG_COLOR_ONLY (1 << 1) #define TK_CONFIG_MONO_ONLY (1 << 2) #define TK_CONFIG_DONT_SET_DEFAULT (1 << 3) #ifndef TK_NO_DEPRECATED # define TK_CONFIG_OPTION_SPECIFIED (1 << 4) #endif /* !TK_NO_DEPRECATED */ #if TCL_MAJOR_VERSION > 8 # define TK_CONFIG_NULL_OK TCL_NULL_OK #else # define TK_CONFIG_NULL_OK (1 << 0) #endif #define TK_CONFIG_USER_BIT 0x100 #endif /* __NO_OLD_CONFIG */ /* * Structure used to specify how to handle argv options. */ |
︙ | ︙ | |||
745 746 747 748 749 750 751 752 753 754 755 756 757 758 | (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED) #define Tk_TopWinHierarchy(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) #define Tk_IsManageable(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) #define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) #define Tk_InternalBorderLeft(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderLeft) #define Tk_InternalBorderRight(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderRight) #define Tk_InternalBorderTop(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderTop) #define Tk_InternalBorderBottom(tkwin) \ | > > > > | 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED) #define Tk_TopWinHierarchy(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) #define Tk_IsManageable(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) #define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) #ifndef TK_NO_DEPRECATED #define Tk_InternalBorderWidth(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderLeft) #endif /* !TK_NO_DEPRECATED */ #define Tk_InternalBorderLeft(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderLeft) #define Tk_InternalBorderRight(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderRight) #define Tk_InternalBorderTop(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderTop) #define Tk_InternalBorderBottom(tkwin) \ |
︙ | ︙ | |||
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | #define TK_ITEM_DONT_REDRAW 2 /* * Records of the following type are used to describe a type of item (e.g. * lines, circles, etc.) that can form part of a canvas widget. */ typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[], int flags); typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Obj *indexString, Tcl_Size *indexPtr); typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height); typedef double (Tk_ItemPointProc)(Tk_Canvas canvas, Tk_Item *itemPtr, double *pointPtr); | > > > > > > > > > > > > > | 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | #define TK_ITEM_DONT_REDRAW 2 /* * Records of the following type are used to describe a type of item (e.g. * lines, circles, etc.) that can form part of a canvas widget. */ #if defined(USE_OLD_CANVAS) && TCL_MAJOR_VERSION < 9 typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size argc, char **argv); typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size argc, char **argv, int flags); typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size argc, char **argv); typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, int beforeThis, char *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, char *indexString, int *indexPtr); #else typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[], int flags); typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Obj *indexString, Tcl_Size *indexPtr); #endif /* USE_OLD_CANVAS */ typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height); typedef double (Tk_ItemPointProc)(Tk_Canvas canvas, Tk_Item *itemPtr, double *pointPtr); |
︙ | ︙ | |||
1056 1057 1058 1059 1060 1061 1062 | Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's * coordinates. */ Tk_ItemDeleteProc *deleteProc; /* Procedure to delete existing item of this * type. */ Tk_ItemDisplayProc *displayProc; /* Procedure to display items of this type. */ | | > > | 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 | Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's * coordinates. */ Tk_ItemDeleteProc *deleteProc; /* Procedure to delete existing item of this * type. */ Tk_ItemDisplayProc *displayProc; /* Procedure to display items of this type. */ int alwaysRedraw; /* Non-zero means displayProc should be called * even when the item has been moved * off-screen. */ Tk_ItemPointProc *pointProc;/* Computes distance from item to a given * point. */ Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside, * or overlapping an area. */ Tk_ItemPostscriptProc *postscriptProc; /* Procedure to write a Postscript description * for items of this type. */ |
︙ | ︙ | |||
1093 1094 1095 1096 1097 1098 1099 | * about a point. */ int reserved2; /* Carefully compatible with */ char *reserved3; /* Jan Nijtmans dash patch */ char *reserved4; } Tk_ItemType; /* | | > | 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | * about a point. */ int reserved2; /* Carefully compatible with */ char *reserved3; /* Jan Nijtmans dash patch */ char *reserved4; } Tk_ItemType; /* * Flag (used in the alwaysRedraw field) to say whether an item supports * point-level manipulation like the line and polygon items. */ #define TK_ALWAYS_REDRAW 1 /* item should be redrawn always*/ #define TK_MOVABLE_POINTS 2 /* item supports point-level manipulation */ #endif /* __NO_OLD_CONFIG */ |
︙ | ︙ | |||
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 | * * Procedure prototypes and structures used for managing images: * *---------------------------------------------------------------------- */ typedef struct Tk_ImageType Tk_ImageType; typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, Tcl_Size objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); typedef void *(Tk_ImageGetProc) (Tk_Window tkwin, void *clientData); typedef void (Tk_ImageDisplayProc) (void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); typedef void (Tk_ImageFreeProc) (void *clientData, Display *display); typedef void (Tk_ImageDeleteProc) (void *clientData); typedef void (Tk_ImageChangedProc) (void *clientData, int x, int y, | > > > > > > | 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 | * * Procedure prototypes and structures used for managing images: * *---------------------------------------------------------------------- */ typedef struct Tk_ImageType Tk_ImageType; #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE) typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, Tcl_Size argc, char **argv, Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); #else typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, Tcl_Size objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); #endif /* USE_OLD_IMAGE */ typedef void *(Tk_ImageGetProc) (Tk_Window tkwin, void *clientData); typedef void (Tk_ImageDisplayProc) (void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); typedef void (Tk_ImageFreeProc) (void *clientData, Display *display); typedef void (Tk_ImageDeleteProc) (void *clientData); typedef void (Tk_ImageChangedProc) (void *clientData, int x, int y, |
︙ | ︙ | |||
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 | /* * Procedure prototypes and structures used in reading and writing photo * images: */ typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat; typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, Tcl_Obj *dataObj, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); /* * The following alternate definitions are used with the Tk8.7 file format * supporting a metadata dict, internal dstring and close file flag */ typedef struct Tk_PhotoImageFormatVersion3 Tk_PhotoImageFormatVersion3; | > > > > > > > > > > > > > > > > > | 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 | /* * Procedure prototypes and structures used in reading and writing photo * images: */ typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat; #ifdef USE_OLD_IMAGE typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName, char *formatString, int *widthPtr, int *heightPtr); typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString, int *widthPtr, int *heightPtr); typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, char *fileName, char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string, char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName, char *formatString, Tk_PhotoImageBlock *blockPtr); typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr); #else typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, Tcl_Obj *dataObj, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); #endif /* USE_OLD_IMAGE */ /* * The following alternate definitions are used with the Tk8.7 file format * supporting a metadata dict, internal dstring and close file flag */ typedef struct Tk_PhotoImageFormatVersion3 Tk_PhotoImageFormatVersion3; |
︙ | ︙ | |||
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 | *---------------------------------------------------------------------- * * The definitions below provide backward compatibility for functions and * types that used to be in Tk but have moved to Tcl. * *---------------------------------------------------------------------- */ /* Removed Tk_Main, use macro instead */ #if defined(_WIN32) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) #else #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 | *---------------------------------------------------------------------- * * The definitions below provide backward compatibility for functions and * types that used to be in Tk but have moved to Tcl. * *---------------------------------------------------------------------- */ #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 #define TK_READABLE TCL_READABLE #define TK_WRITABLE TCL_WRITABLE #define TK_EXCEPTION TCL_EXCEPTION #define TK_DONT_WAIT TCL_DONT_WAIT #define TK_X_EVENTS TCL_WINDOW_EVENTS #define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS #define TK_FILE_EVENTS TCL_FILE_EVENTS #define TK_TIMER_EVENTS TCL_TIMER_EVENTS #define TK_IDLE_EVENTS TCL_IDLE_EVENTS #define TK_ALL_EVENTS TCL_ALL_EVENTS #define Tk_IdleProc Tcl_IdleProc #define Tk_FileProc Tcl_FileProc #define Tk_TimerProc Tcl_TimerProc #define Tk_TimerToken Tcl_TimerToken #define Tk_BackgroundError Tcl_BackgroundError #define Tk_CancelIdleCall Tcl_CancelIdleCall #define Tk_CreateFileHandler Tcl_CreateFileHandler #define Tk_CreateTimerHandler Tcl_CreateTimerHandler #define Tk_DeleteFileHandler Tcl_DeleteFileHandler #define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler #define Tk_DoOneEvent Tcl_DoOneEvent #define Tk_DoWhenIdle Tcl_DoWhenIdle #define Tk_Sleep Tcl_Sleep /* Additional stuff that has moved to Tcl: */ #define Tk_EventuallyFree Tcl_EventuallyFree #define Tk_FreeProc Tcl_FreeProc #define Tk_Preserve Tcl_Preserve #define Tk_Release Tcl_Release /* Related to USE_OLD_IMAGE: */ #define Tk_InitImageArgs(interp, argc, argv) /**/ #endif /* Removed Tk_Main, use macro instead */ #if defined(_WIN32) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) #else #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ |
︙ | ︙ | |||
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | * Platform independent exported procedures and variables. * *---------------------------------------------------------------------- */ #include "tkDecls.h" #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif /* RC_INVOKED */ /* * end block for C++ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 | * Platform independent exported procedures and variables. * *---------------------------------------------------------------------- */ #include "tkDecls.h" #ifdef USE_OLD_IMAGE #undef Tk_CreateImageType #define Tk_CreateImageType Tk_CreateOldImageType #undef Tk_CreatePhotoImageFormat #define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat #endif /* USE_OLD_IMAGE */ /* *---------------------------------------------------------------------- * * Allow users to say that they don't want to alter their source to add extra * arguments to Tk_PhotoPutBlock() et al. * * This goes after the inclusion of the stubbed-decls so that the declarations * of what is actually there can be correct. */ #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 #ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK # ifdef Tk_PhotoPutBlock # undef Tk_PhotoPutBlock # endif # define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite # ifdef Tk_PhotoPutZoomedBlock # undef Tk_PhotoPutZoomedBlock # endif # define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite # define USE_PANIC_ON_PHOTO_ALLOC_FAILURE #else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ # ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE # ifdef Tk_PhotoPutBlock # undef Tk_PhotoPutBlock # endif # define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic # ifdef Tk_PhotoPutZoomedBlock # undef Tk_PhotoPutZoomedBlock # endif # define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic # endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ #endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ #ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE # ifdef Tk_PhotoExpand # undef Tk_PhotoExpand # endif # define Tk_PhotoExpand Tk_PhotoExpand_Panic # ifdef Tk_PhotoSetSize # undef Tk_PhotoSetSize # endif # define Tk_PhotoSetSize Tk_PhotoSetSize_Panic #endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ #endif /* !TK_NO_DEPRECATED */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif /* RC_INVOKED */ /* * end block for C++ |
︙ | ︙ |
Changes to generic/tkBind.c.
︙ | ︙ | |||
5283 5284 5285 5286 5287 5288 5289 | const char *name) /* Name of a keysym. */ { #ifdef REDO_KEYSYM_LOOKUP Tcl_HashEntry *hPtr; #endif /* REDO_KEYSYM_LOOKUP */ int keysym; | | | 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 | const char *name) /* Name of a keysym. */ { #ifdef REDO_KEYSYM_LOOKUP Tcl_HashEntry *hPtr; #endif /* REDO_KEYSYM_LOOKUP */ int keysym; size_t len = TkUtfToUniChar(name, &keysym); if (name[len] == '\0') { if (!Tcl_UniCharIsPrint(keysym)) { /* This form not supported */ } else if ((unsigned)(keysym - 0x21) <= 0x5D) { return (KeySym)keysym; } else if ((unsigned)(keysym - 0xA1) <= 0x5E) { return (KeySym)keysym; |
︙ | ︙ | |||
5367 5368 5369 5370 5371 5372 5373 | } else if (keysym == 0x20AC) { keysym += 0x1000000; } if ((keysym >= 0x1000020) && (keysym <= 0x110FFFF) && ((unsigned)(keysym - 0x100007F) > 0x20)) { char buf[10]; if (Tcl_UniCharIsPrint(keysym-0x1000000)) { | | | 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 | } else if (keysym == 0x20AC) { keysym += 0x1000000; } if ((keysym >= 0x1000020) && (keysym <= 0x110FFFF) && ((unsigned)(keysym - 0x100007F) > 0x20)) { char buf[10]; if (Tcl_UniCharIsPrint(keysym-0x1000000)) { buf[TkUniCharToUtf(keysym - 0x1000000, buf)] = '\0'; } else if (keysym >= 0x1010000) { snprintf(buf, sizeof(buf), "U%08X", (int)(keysym - 0x1000000)); } else { snprintf(buf, sizeof(buf), "U%04X", (int)(keysym - 0x1000000)); } return Tk_GetUid(buf); } |
︙ | ︙ |
Changes to generic/tkBusy.c.
︙ | ︙ | |||
766 767 768 769 770 771 772 | if (Tk_IsMapped(busyPtr->tkRef)) { TkpShowBusyWindow(busyPtr); } else { TkpHideBusyWindow(busyPtr); } if (result == TCL_OK) { | | | 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | if (Tk_IsMapped(busyPtr->tkRef)) { TkpShowBusyWindow(busyPtr); } else { TkpHideBusyWindow(busyPtr); } if (result == TCL_OK) { Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), TCL_INDEX_NONE)); } return result; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
802 803 804 805 806 807 808 | Tk_Window tkwin = (Tk_Window)clientData; Tcl_HashTable *busyTablePtr = &((TkWindow *) tkwin)->mainPtr->busyTable; Busy *busyPtr; Tcl_Obj *objPtr; int index, result = TCL_OK; static const char *const optionStrings[] = { "busywindow", "cget", "configure", "current", "forget", "hold", | | | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | Tk_Window tkwin = (Tk_Window)clientData; Tcl_HashTable *busyTablePtr = &((TkWindow *) tkwin)->mainPtr->busyTable; Busy *busyPtr; Tcl_Obj *objPtr; int index, result = TCL_OK; static const char *const optionStrings[] = { "busywindow", "cget", "configure", "current", "forget", "hold", "status", NULL }; enum options { BUSY_BUSYWINDOW, BUSY_CGET, BUSY_CONFIGURE, BUSY_CURRENT, BUSY_FORGET, BUSY_HOLD, BUSY_STATUS }; if (objc < 2) { |
︙ | ︙ | |||
839 840 841 842 843 844 845 | if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); return TCL_ERROR; } busyPtr = GetBusy(interp, busyTablePtr, objv[2]); if (busyPtr == NULL) { Tcl_ResetResult(interp); | | | | | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 | if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); return TCL_ERROR; } busyPtr = GetBusy(interp, busyTablePtr, objv[2]); if (busyPtr == NULL) { Tcl_ResetResult(interp); return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), TCL_INDEX_NONE)); return TCL_OK; case BUSY_CGET: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "window option"); return TCL_ERROR; } busyPtr = GetBusy(interp, busyTablePtr, objv[2]); |
︙ | ︙ |
Changes to generic/tkButton.c.
︙ | ︙ | |||
779 780 781 782 783 784 785 | { TkButton *butPtr = (TkButton *)clientData; int index; int result; Tcl_Obj *objPtr; if (objc < 2) { | | | 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 | { TkButton *butPtr = (TkButton *)clientData; int index; int result; Tcl_Obj *objPtr; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } result = Tcl_GetIndexFromObjStruct(interp, objv[1], commandNames[butPtr->type], sizeof(char *), "option", 0, &index); if (result != TCL_OK) { return result; } |
︙ | ︙ | |||
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 | if ((butPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(butPtr->tkwin)) { Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->activeBorder); } else { Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->normalBorder); } if (butPtr->borderWidth < 0) { butPtr->borderWidth = 0; } if (butPtr->highlightWidth < 0) { butPtr->highlightWidth = 0; } if (butPtr->padX < 0) { butPtr->padX = 0; } if (butPtr->padY < 0) { butPtr->padY = 0; } if (butPtr->type >= TYPE_CHECK_BUTTON) { Tcl_Obj *valuePtr, *namePtr; if (butPtr->selVarNamePtr == NULL) { butPtr->selVarNamePtr = Tcl_NewStringObj( | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 | if ((butPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(butPtr->tkwin)) { Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->activeBorder); } else { Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->normalBorder); } if (butPtr->wrapLength < 0) { butPtr->wrapLength = 0; if (butPtr->wrapLengthPtr) { Tcl_DecrRefCount(butPtr->wrapLengthPtr); } butPtr->wrapLengthPtr = Tcl_NewIntObj(0); Tcl_IncrRefCount(butPtr->wrapLengthPtr); } if (butPtr->borderWidth < 0) { butPtr->borderWidth = 0; if (butPtr->borderWidthPtr) { Tcl_DecrRefCount(butPtr->borderWidthPtr); } butPtr->borderWidthPtr = Tcl_NewIntObj(0); Tcl_IncrRefCount(butPtr->borderWidthPtr); } if (butPtr->highlightWidth < 0) { butPtr->highlightWidth = 0; if (butPtr->highlightWidthPtr) { Tcl_DecrRefCount(butPtr->highlightWidthPtr); } butPtr->highlightWidthPtr = Tcl_NewIntObj(0); Tcl_IncrRefCount(butPtr->highlightWidthPtr); } if (butPtr->padX < 0) { butPtr->padX = 0; if (butPtr->padXPtr) { Tcl_DecrRefCount(butPtr->padXPtr); } butPtr->padXPtr = Tcl_NewIntObj(0); Tcl_IncrRefCount(butPtr->padXPtr); } if (butPtr->padY < 0) { butPtr->padY = 0; if (butPtr->padYPtr) { Tcl_DecrRefCount(butPtr->padYPtr); } butPtr->padYPtr = Tcl_NewIntObj(0); Tcl_IncrRefCount(butPtr->padYPtr); } if (butPtr->type >= TYPE_CHECK_BUTTON) { Tcl_Obj *valuePtr, *namePtr; if (butPtr->selVarNamePtr == NULL) { butPtr->selVarNamePtr = Tcl_NewStringObj( |
︙ | ︙ | |||
1125 1126 1127 1128 1129 1130 1131 | * appropriate value, initialize the variable if it doesn't exist, * then set a trace on the variable to monitor future changes to * its value. */ valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY); butPtr->flags &= ~SELECTED; | | | | | 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 | * appropriate value, initialize the variable if it doesn't exist, * then set a trace on the variable to monitor future changes to * its value. */ valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY); butPtr->flags &= ~SELECTED; butPtr->flags &= ~TRISTATED; if (valuePtr != NULL) { const char *value = Tcl_GetString(valuePtr); if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) { butPtr->flags |= SELECTED; } else if (strcmp(value, Tcl_GetString(butPtr->tristateValuePtr)) == 0) { butPtr->flags |= TRISTATED; /* * For checkbuttons if the tristate value is the * same as the offvalue then prefer off to tristate */ if (butPtr->offValuePtr && strcmp(value, Tcl_GetString(butPtr->offValuePtr)) == 0) { butPtr->flags &= ~TRISTATED; } } } else { if (Tcl_ObjSetVar2(interp, namePtr, NULL, (butPtr->type == TYPE_CHECK_BUTTON) ? butPtr->offValuePtr : Tcl_NewObj(), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { continue; |
︙ | ︙ | |||
1254 1255 1256 1257 1258 1259 1260 | /* * The button must display the contents of an image or bitmap. */ if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->widthPtr, &butPtr->width) != TCL_OK) { widthError: | | | | 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | /* * The button must display the contents of an image or bitmap. */ if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->widthPtr, &butPtr->width) != TCL_OK) { widthError: Tcl_AddErrorInfo(interp, "\n (processing \"-width\" option)"); continue; } if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->heightPtr, &butPtr->height) != TCL_OK) { heightError: Tcl_AddErrorInfo(interp, "\n (processing \"-height\" option)"); continue; } } else { /* * The button displays an ordinary text string. */ |
︙ | ︙ | |||
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 | goto redraw; } else if (eventPtr->type == DestroyNotify) { DestroyButton(butPtr); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags |= GOT_FOCUS; if (butPtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags &= ~GOT_FOCUS; if (butPtr->highlightWidth > 0) { goto redraw; } } } return; | > > | 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 | goto redraw; } else if (eventPtr->type == DestroyNotify) { DestroyButton(butPtr); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags |= GOT_FOCUS; Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (butPtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags &= ~GOT_FOCUS; Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (butPtr->highlightWidth > 0) { goto redraw; } } } return; |
︙ | ︙ | |||
1652 1653 1654 1655 1656 1657 1658 | value = Tcl_GetString(valuePtr); } if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) { if (butPtr->flags & SELECTED) { return NULL; } butPtr->flags |= SELECTED; | | | | | | | | 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 | value = Tcl_GetString(valuePtr); } if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) { if (butPtr->flags & SELECTED) { return NULL; } butPtr->flags |= SELECTED; butPtr->flags &= ~TRISTATED; } else if (butPtr->offValuePtr && strcmp(value, Tcl_GetString(butPtr->offValuePtr)) == 0) { if (!(butPtr->flags & (SELECTED | TRISTATED))) { return NULL; } butPtr->flags &= ~(SELECTED | TRISTATED); } else if (strcmp(value, Tcl_GetString(butPtr->tristateValuePtr)) == 0) { if (butPtr->flags & TRISTATED) { return NULL; } butPtr->flags |= TRISTATED; butPtr->flags &= ~SELECTED; } else if (butPtr->flags & (SELECTED | TRISTATED)) { butPtr->flags &= ~(SELECTED | TRISTATED); } else { return NULL; } redisplay: |
︙ | ︙ |
Changes to generic/tkCanvArc.c.
︙ | ︙ | |||
230 231 232 233 234 235 236 | sizeof(ArcItem), /* itemSize */ CreateArc, /* createProc */ configSpecs, /* configSpecs */ ConfigureArc, /* configureProc */ ArcCoords, /* coordProc */ DeleteArc, /* deleteProc */ DisplayArc, /* displayProc */ | | | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | sizeof(ArcItem), /* itemSize */ CreateArc, /* createProc */ configSpecs, /* configSpecs */ ConfigureArc, /* configureProc */ ArcCoords, /* coordProc */ DeleteArc, /* deleteProc */ DisplayArc, /* displayProc */ TK_CONFIG_OBJS, /* flags */ ArcToPoint, /* pointProc */ ArcToArea, /* areaProc */ ArcToPostscript, /* postscriptProc */ ScaleArc, /* scaleProc */ TranslateArc, /* translateProc */ NULL, /* indexProc */ NULL, /* icursorProc */ |
︙ | ︙ | |||
448 449 450 451 452 453 454 | Tk_TSOffset *tsoffset; XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | Tk_TSOffset *tsoffset; XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } state = itemPtr->state; /* * A few of the options require additional processing, such as style and |
︙ | ︙ | |||
615 616 617 618 619 620 621 | double chordLen, chordDir[2], chordCen[2], arcCen[2], d, radToDeg, radius; /* * Do nothing if no height has been specified. */ if (arcPtr->height == 0) | | | | | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | double chordLen, chordDir[2], chordCen[2], arcCen[2], d, radToDeg, radius; /* * Do nothing if no height has been specified. */ if (arcPtr->height == 0) return; /* * Calculate the chord length, return early if it is too small. */ chordLen = hypot(arcPtr->endPoint[1] - arcPtr->startPoint[1], arcPtr->startPoint[0] - arcPtr->endPoint[0]); if (chordLen < DBL_EPSILON) { arcPtr->start = arcPtr->extent = arcPtr->height = 0; return; } chordDir[0] = (arcPtr->endPoint[0] - arcPtr->startPoint[0]) / chordLen; chordDir[1] = (arcPtr->endPoint[1] - arcPtr->startPoint[1]) / chordLen; chordCen[0] = (arcPtr->startPoint[0] + arcPtr->endPoint[0]) / 2; chordCen[1] = (arcPtr->startPoint[1] + arcPtr->endPoint[1]) / 2; |
︙ | ︙ |
Changes to generic/tkCanvBmap.c.
︙ | ︙ | |||
124 125 126 127 128 129 130 | sizeof(BitmapItem), /* itemSize */ TkcCreateBitmap, /* createProc */ configSpecs, /* configSpecs */ ConfigureBitmap, /* configureProc */ BitmapCoords, /* coordProc */ DeleteBitmap, /* deleteProc */ DisplayBitmap, /* displayProc */ | | | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | sizeof(BitmapItem), /* itemSize */ TkcCreateBitmap, /* createProc */ configSpecs, /* configSpecs */ ConfigureBitmap, /* configureProc */ BitmapCoords, /* coordProc */ DeleteBitmap, /* deleteProc */ DisplayBitmap, /* displayProc */ TK_CONFIG_OBJS, /* flags */ BitmapToPoint, /* pointProc */ BitmapToArea, /* areaProc */ BitmapToPostscript, /* postscriptProc */ ScaleBitmap, /* scaleProc */ TranslateBitmap, /* translateProc */ NULL, /* indexProc */ NULL, /* icursorProc */ |
︙ | ︙ | |||
320 321 322 323 324 325 326 | XColor *fgColor; XColor *bgColor; Pixmap bitmap; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | XColor *fgColor; XColor *bgColor; Pixmap bitmap; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as those that * determine the graphics context. */ |
︙ | ︙ |
Changes to generic/tkCanvImg.c.
︙ | ︙ | |||
112 113 114 115 116 117 118 | sizeof(ImageItem), /* itemSize */ CreateImage, /* createProc */ configSpecs, /* configSpecs */ ConfigureImage, /* configureProc */ ImageCoords, /* coordProc */ DeleteImage, /* deleteProc */ DisplayImage, /* displayProc */ | | | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | sizeof(ImageItem), /* itemSize */ CreateImage, /* createProc */ configSpecs, /* configSpecs */ ConfigureImage, /* configureProc */ ImageCoords, /* coordProc */ DeleteImage, /* deleteProc */ DisplayImage, /* displayProc */ TK_CONFIG_OBJS, /* flags */ ImageToPoint, /* pointProc */ ImageToArea, /* areaProc */ ImageToPostscript, /* postscriptProc */ ScaleImage, /* scaleProc */ TranslateImage, /* translateProc */ NULL, /* indexProc */ NULL, /* icursorProc */ |
︙ | ︙ | |||
298 299 300 301 302 303 304 | { ImageItem *imgPtr = (ImageItem *) itemPtr; Tk_Window tkwin; Tk_Image image; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | { ImageItem *imgPtr = (ImageItem *) itemPtr; Tk_Window tkwin; Tk_Image image; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * Create the image. Save the old image around and don't free it until * after the new one is allocated. This keeps the reference count from * going to zero so the image doesn't have to be recreated if it hasn't |
︙ | ︙ | |||
718 719 720 721 722 723 724 | } } if (image == NULL) { /* * Image item without actual image specified. */ | | | 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | } } if (image == NULL) { /* * Image item without actual image specified. */ return TCL_OK; } Tk_SizeOfImage(image, &width, &height); /* * Compute the coordinates of the lower-left corner of the image, taking * into account the anchor position for the image. */ |
︙ | ︙ |
Changes to generic/tkCanvLine.c.
︙ | ︙ | |||
230 231 232 233 234 235 236 | sizeof(LineItem), /* itemSize */ CreateLine, /* createProc */ configSpecs, /* configSpecs */ ConfigureLine, /* configureProc */ LineCoords, /* coordProc */ DeleteLine, /* deleteProc */ DisplayLine, /* displayProc */ | | | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | sizeof(LineItem), /* itemSize */ CreateLine, /* createProc */ configSpecs, /* configSpecs */ ConfigureLine, /* configureProc */ LineCoords, /* coordProc */ DeleteLine, /* deleteProc */ DisplayLine, /* displayProc */ TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */ LineToPoint, /* pointProc */ LineToArea, /* areaProc */ LineToPostscript, /* postscriptProc */ ScaleLine, /* scaleProc */ TranslateLine, /* translateProc */ GetLineIndex, /* indexProc */ NULL, /* icursorProc */ |
︙ | ︙ | |||
481 482 483 484 485 486 487 | GC newGC, arrowGC; unsigned long mask; Tk_Window tkwin; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | GC newGC, arrowGC; unsigned long mask; Tk_Window tkwin; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **)objv, (char *)linePtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as graphics * contexts. */ |
︙ | ︙ | |||
700 701 702 703 704 705 706 | TkIncludePoint((Tk_Item *) linePtr, coordPtr); } width = linePtr->outline.width; if (width < 1.0) { width = 1.0; } if (linePtr->arrow != ARROWS_NONE) { | | | | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | TkIncludePoint((Tk_Item *) linePtr, coordPtr); } width = linePtr->outline.width; if (width < 1.0) { width = 1.0; } if (linePtr->arrow != ARROWS_NONE) { if (linePtr->arrow != ARROWS_LAST && linePtr->firstArrowPtr) { TkIncludePoint((Tk_Item *) linePtr, linePtr->firstArrowPtr); } if (linePtr->arrow != ARROWS_FIRST && linePtr->lastArrowPtr) { TkIncludePoint((Tk_Item *) linePtr, linePtr->lastArrowPtr); } } tsoffset = &linePtr->outline.tsoffset; if (tsoffset->flags & TK_OFFSET_INDEX) { coordPtr = linePtr->coordPtr |
︙ | ︙ | |||
1014 1015 1016 1017 1018 1019 1020 | } } for (i=(int)beforeThis; i<length; i++) { newCoordPtr[i+objc] = linePtr->coordPtr[i]; } if (linePtr->coordPtr) { | | | 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | } } for (i=(int)beforeThis; i<length; i++) { newCoordPtr[i+objc] = linePtr->coordPtr[i]; } if (linePtr->coordPtr) { ckfree(linePtr->coordPtr); } linePtr->coordPtr = newCoordPtr; length += objc ; linePtr->numPoints = length / 2; if ((length > 3) && (state != TK_STATE_HIDDEN)) { /* |
︙ | ︙ |
Changes to generic/tkCanvPoly.c.
︙ | ︙ | |||
195 196 197 198 199 200 201 | sizeof(PolygonItem), /* itemSize */ CreatePolygon, /* createProc */ configSpecs, /* configSpecs */ ConfigurePolygon, /* configureProc */ PolygonCoords, /* coordProc */ DeletePolygon, /* deleteProc */ DisplayPolygon, /* displayProc */ | | | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | sizeof(PolygonItem), /* itemSize */ CreatePolygon, /* createProc */ configSpecs, /* configSpecs */ ConfigurePolygon, /* configureProc */ PolygonCoords, /* coordProc */ DeletePolygon, /* deleteProc */ DisplayPolygon, /* displayProc */ TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */ PolygonToPoint, /* pointProc */ PolygonToArea, /* areaProc */ PolygonToPostscript, /* postscriptProc */ ScalePolygon, /* scaleProc */ TranslatePolygon, /* translateProc */ GetPolygonIndex, /* indexProc */ NULL, /* icursorProc */ |
︙ | ︙ | |||
442 443 444 445 446 447 448 | Tk_Window tkwin; XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | Tk_Window tkwin; XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as graphics * contexts. */ |
︙ | ︙ |
Changes to generic/tkCanvPs.c.
︙ | ︙ | |||
232 233 234 235 236 237 238 | psInfo.fileName = NULL; psInfo.channelName = NULL; psInfo.chan = NULL; psInfo.prepass = 0; psInfo.prolog = 1; psInfo.tkwin = tkwin; Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS); | | | | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | psInfo.fileName = NULL; psInfo.channelName = NULL; psInfo.chan = NULL; psInfo.prepass = 0; psInfo.prolog = 1; psInfo.tkwin = tkwin; Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS); result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, (const char **)objv+2, (char *) &psInfo, TK_CONFIG_ARGV_ONLY|TK_CONFIG_OBJS); if (result != TCL_OK) { goto cleanup; } if (psInfo.width == -1) { psInfo.width = Tk_Width(tkwin); } |
︙ | ︙ | |||
903 904 905 906 907 908 909 | if (!imagePtr) { /* * The XGetImage() function is apparently not implemented on this * system. Just skip the pixels, the Postscript will still be * syntactically correct. */ | | | 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | if (!imagePtr) { /* * The XGetImage() function is apparently not implemented on this * system. Just skip the pixels, the Postscript will still be * syntactically correct. */ Tcl_AppendToObj(psObj, "<>", TCL_INDEX_NONE); return; } Tcl_AppendToObj(psObj, "<", TCL_INDEX_NONE); mask = 0x80; value = 0; charsInLine = 0; |
︙ | ︙ |
Changes to generic/tkCanvText.c.
︙ | ︙ | |||
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | * information about how to reclaim storage * for return string. */ { int underline = *(int *)(widgRec + offset); char *p; if (underline == INT_MIN) { p = (char *)""; *freeProcPtr = TCL_STATIC; return p; } else if (underline == INT_MAX) { p = (char *)"end+1"; *freeProcPtr = TCL_STATIC; return p; } else if (underline == -1) { | > > > > | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | * information about how to reclaim storage * for return string. */ { int underline = *(int *)(widgRec + offset); char *p; if (underline == INT_MIN) { #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 p = (char *)"-1"; #else p = (char *)""; #endif *freeProcPtr = TCL_STATIC; return p; } else if (underline == INT_MAX) { p = (char *)"end+1"; *freeProcPtr = TCL_STATIC; return p; } else if (underline == -1) { |
︙ | ︙ | |||
268 269 270 271 272 273 274 | sizeof(TextItem), /* itemSize */ CreateText, /* createProc */ configSpecs, /* configSpecs */ ConfigureText, /* configureProc */ TextCoords, /* coordProc */ DeleteText, /* deleteProc */ DisplayCanvText, /* displayProc */ | | | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | sizeof(TextItem), /* itemSize */ CreateText, /* createProc */ configSpecs, /* configSpecs */ ConfigureText, /* configureProc */ TextCoords, /* coordProc */ DeleteText, /* deleteProc */ DisplayCanvText, /* displayProc */ TK_CONFIG_OBJS, /* flags */ TextToPoint, /* pointProc */ TextToArea, /* areaProc */ TextToPostscript, /* postscriptProc */ ScaleText, /* scaleProc */ TranslateText, /* translateProc */ GetTextIndex, /* indexProc */ SetTextCursor, /* icursorProc */ |
︙ | ︙ | |||
490 491 492 493 494 495 496 | XColor *selBgColorPtr; XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | XColor *selBgColorPtr; XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as graphics * contexts. */ |
︙ | ︙ | |||
586 587 588 589 590 591 592 | /* * If the text was changed, move the selection and insertion indices to * keep them inside the item. */ textPtr->numBytes = strlen(textPtr->text); | | | 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | /* * If the text was changed, move the selection and insertion indices to * keep them inside the item. */ textPtr->numBytes = strlen(textPtr->text); textPtr->numChars = TkNumUtfChars(textPtr->text, textPtr->numBytes); if (textInfoPtr->selItemPtr == itemPtr) { if (textInfoPtr->selectFirst >= textPtr->numChars) { textInfoPtr->selItemPtr = NULL; } else { if (textInfoPtr->selectLast >= textPtr->numChars) { textInfoPtr->selectLast = textPtr->numChars - 1; |
︙ | ︙ | |||
1111 1112 1113 1114 1115 1116 1117 | newStr = (char *)ckalloc(textPtr->numBytes + byteCount + 1); memcpy(newStr, text, byteIndex); strcpy(newStr + byteIndex, string); strcpy(newStr + byteIndex + byteCount, text + byteIndex); ckfree(text); textPtr->text = newStr; | | | 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | newStr = (char *)ckalloc(textPtr->numBytes + byteCount + 1); memcpy(newStr, text, byteIndex); strcpy(newStr + byteIndex, string); strcpy(newStr + byteIndex + byteCount, text + byteIndex); ckfree(text); textPtr->text = newStr; charsAdded = TkNumUtfChars(string, byteCount); textPtr->numChars += charsAdded; textPtr->numBytes += byteCount; /* * Inserting characters invalidates indices such as those for the * selection and cursor. Update the indices appropriately. */ |
︙ | ︙ | |||
1181 1182 1183 1184 1185 1186 1187 | last = textPtr->numChars - 1; } if (first > last) { return; } charsRemoved = last + 1 - first; | | | | 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | last = textPtr->numChars - 1; } if (first > last) { return; } charsRemoved = last + 1 - first; byteIndex = TkUtfAtIndex(text, first) - text; byteCount = TkUtfAtIndex(text + byteIndex, charsRemoved) - (text + byteIndex); newStr = (char *)ckalloc(textPtr->numBytes + 1 - byteCount); memcpy(newStr, text, byteIndex); strcpy(newStr + byteIndex, text + byteIndex + byteCount); ckfree(text); |
︙ | ︙ | |||
1604 1605 1606 1607 1608 1609 1610 | Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; if ((textInfoPtr->selectFirst < 0) || (textInfoPtr->selectFirst > textInfoPtr->selectLast)) { return 0; } text = textPtr->text; | | | | 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 | Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; if ((textInfoPtr->selectFirst < 0) || (textInfoPtr->selectFirst > textInfoPtr->selectLast)) { return 0; } text = textPtr->text; selStart = TkUtfAtIndex(text, textInfoPtr->selectFirst); selEnd = TkUtfAtIndex(selStart, textInfoPtr->selectLast + 1 - textInfoPtr->selectFirst); if (selEnd <= selStart + offset) { return 0; } byteCount = selEnd - selStart - offset; if (byteCount > maxBytes) { byteCount = maxBytes; |
︙ | ︙ |
Changes to generic/tkCanvWind.c.
︙ | ︙ | |||
116 117 118 119 120 121 122 | sizeof(WindowItem), /* itemSize */ CreateWinItem, /* createProc */ configSpecs, /* configSpecs */ ConfigureWinItem, /* configureProc */ WinItemCoords, /* coordProc */ DeleteWinItem, /* deleteProc */ DisplayWinItem, /* displayProc */ | | | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | sizeof(WindowItem), /* itemSize */ CreateWinItem, /* createProc */ configSpecs, /* configSpecs */ ConfigureWinItem, /* configureProc */ WinItemCoords, /* coordProc */ DeleteWinItem, /* deleteProc */ DisplayWinItem, /* displayProc */ TK_ALWAYS_REDRAW|TK_CONFIG_OBJS, /* flags */ WinItemToPoint, /* pointProc */ WinItemToArea, /* areaProc */ WinItemToPostscript, /* postscriptProc */ ScaleWinItem, /* scaleProc */ TranslateWinItem, /* translateProc */ NULL, /* indexProc */ NULL, /* cursorProc */ |
︙ | ︙ | |||
312 313 314 315 316 317 318 | WindowItem *winItemPtr = (WindowItem *) itemPtr; Tk_Window oldWindow; Tk_Window canvasTkwin; oldWindow = winItemPtr->tkwin; canvasTkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, | | | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | WindowItem *winItemPtr = (WindowItem *) itemPtr; Tk_Window oldWindow; Tk_Window canvasTkwin; oldWindow = winItemPtr->tkwin; canvasTkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, (const char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing. */ |
︙ | ︙ | |||
799 800 801 802 803 804 805 | { WindowItem *winItemPtr = (WindowItem *) itemPtr; double x, y; int width, height; Tk_Window tkwin = winItemPtr->tkwin; if (prepass || winItemPtr->tkwin == NULL) { | | | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | { WindowItem *winItemPtr = (WindowItem *) itemPtr; double x, y; int width, height; Tk_Window tkwin = winItemPtr->tkwin; if (prepass || winItemPtr->tkwin == NULL) { return TCL_OK; } width = Tk_Width(tkwin); height = Tk_Height(tkwin); /* * Compute the coordinates of the lower-left corner of the window, taking |
︙ | ︙ |
Changes to generic/tkCanvas.c.
︙ | ︙ | |||
256 257 258 259 260 261 262 263 264 265 266 267 268 269 | static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Size objc, Tcl_Obj *const *objv, Tcl_Obj *newTagObj, Tcl_Size first, TagSearch **searchPtrPtr); static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Obj *const *objv, Tk_Uid uid, int enclosed); static double GridAlign(double coord, double spacing); static void InitCanvas(void); static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr); static Tcl_Obj * ScrollFractions(int screen1, int screen2, int object1, int object2); static int RelinkItems(TkCanvas *canvasPtr, Tcl_Obj *tag, Tk_Item *prevPtr, TagSearch **searchPtrPtr); static void TagSearchExprInit(TagSearchExpr **exprPtrPtr); | > > > | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Size objc, Tcl_Obj *const *objv, Tcl_Obj *newTagObj, Tcl_Size first, TagSearch **searchPtrPtr); static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Obj *const *objv, Tk_Uid uid, int enclosed); static double GridAlign(double coord, double spacing); #if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) static const char** TkGetStringsFromObjs(Tcl_Size objc, Tcl_Obj *const *objv); #endif static void InitCanvas(void); static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr); static Tcl_Obj * ScrollFractions(int screen1, int screen2, int object1, int object2); static int RelinkItems(TkCanvas *canvasPtr, Tcl_Obj *tag, Tk_Item *prevPtr, TagSearch **searchPtrPtr); static void TagSearchExprInit(TagSearchExpr **exprPtrPtr); |
︙ | ︙ | |||
321 322 323 324 325 326 327 | * ---------------------------------------------------------------------- */ static inline int AlwaysRedraw( Tk_Item *itemPtr) { | | > > | | > > > > > > > > > > > > > > | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | * ---------------------------------------------------------------------- */ static inline int AlwaysRedraw( Tk_Item *itemPtr) { return itemPtr->typePtr->alwaysRedraw & 1; } static inline int ItemConfigure( TkCanvas *canvasPtr, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; int result; if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY); } else { #if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); #else const char **args = TkGetStringsFromObjs(objc, objv); result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY); if (args != NULL) { ckfree(args); } #endif } return result; } static inline int ItemConfigInfo( TkCanvas *canvasPtr, Tk_Item *itemPtr, Tcl_Obj *fieldName) |
︙ | ︙ | |||
371 372 373 374 375 376 377 378 379 | Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; int result; if (itemPtr->typePtr->coordProc == NULL) { result = TCL_OK; } else { result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, | > > > > > > > > | > > > > > > | > > > > > > > > > > > > > > | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; int result; if (itemPtr->typePtr->coordProc == NULL) { result = TCL_OK; } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, objv); } else { #if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); #else const char **args = TkGetStringsFromObjs(objc, objv); result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, (Tcl_Obj **) args); if (args != NULL) { ckfree(args); } #endif } return result; } static inline int ItemCreate( TkCanvas *canvasPtr, Tk_Item *itemPtr, /* Warning: incomplete! typePtr field must be * set by this point. */ Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; int result; if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3); } else { #if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); #else const char **args = TkGetStringsFromObjs(objc-3, objv+3); result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, (Tcl_Obj **) args); if (args != NULL) { ckfree(args); } #endif } return result; } static inline void ItemCursor( TkCanvas *canvasPtr, Tk_Item *itemPtr, int index) |
︙ | ︙ | |||
443 444 445 446 447 448 449 | Tcl_Obj *objPtr, Tcl_Size *indexPtr) { Tcl_Interp *interp = canvasPtr->interp; if (itemPtr->typePtr->indexProc == NULL) { return TCL_OK; | | | | > > > > > > > > > > | | > > > > > > > > | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | Tcl_Obj *objPtr, Tcl_Size *indexPtr) { Tcl_Interp *interp = canvasPtr->interp; if (itemPtr->typePtr->indexProc == NULL) { return TCL_OK; } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objPtr, indexPtr); } else { #if defined(TK_NO_DEPRECATED) Tcl_AppendResult(interp, "Flag TK_CONFIG_OBJS is mandatory", (char *)NULL); return TCL_ERROR; #else return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, itemPtr, (Tcl_Obj *) Tcl_GetString(objPtr), indexPtr); #endif } } static inline void ItemInsert( TkCanvas *canvasPtr, Tk_Item *itemPtr, int beforeThis, Tcl_Obj *toInsert) { if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, beforeThis, toInsert); } else { #if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); #else itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, beforeThis, (Tcl_Obj *) Tcl_GetString(toInsert)); #endif } } static inline int ItemOverlap( TkCanvas *canvasPtr, Tk_Item *itemPtr, double rect[]) |
︙ | ︙ | |||
1163 1164 1165 1166 1167 1168 1169 | /* * The TK_MOVABLE_POINTS flag should only be set for types that * support the same semantics of index, dChars and insert methods * as lines and canvases. */ if (itemPtr == NULL || | | | 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 | /* * The TK_MOVABLE_POINTS flag should only be set for types that * support the same semantics of index, dChars and insert methods * as lines and canvases. */ if (itemPtr == NULL || !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) { continue; } result = ItemIndex(canvasPtr, itemPtr, objv[3], &index); if (result != TCL_OK) { break; } |
︙ | ︙ | |||
2257 2258 2259 2260 2261 2262 2263 | int flags) /* Flags to pass to Tk_ConfigureWidget. */ { XGCValues gcValues; GC newGC; Tk_State old_canvas_state=canvasPtr->canvas_state; if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs, | | | | 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 | int flags) /* Flags to pass to Tk_ConfigureWidget. */ { XGCValues gcValues; GC newGC; Tk_State old_canvas_state=canvasPtr->canvas_state; if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs, objc, (const char **) objv, (char *) canvasPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } /* * A few options need special processing, such as setting the background * from a 3-D border and creating a GC for copying bits to the screen. */ |
︙ | ︙ | |||
3192 3193 3194 3195 3196 3197 3198 | Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), canvasPtr->bgBorder, canvasPtr->highlightWidth, canvasPtr->highlightWidth, Tk_Width(tkwin) - 2*canvasPtr->highlightWidth, Tk_Height(tkwin) - 2*canvasPtr->highlightWidth, canvasPtr->borderWidth, canvasPtr->relief); } | | | 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 | Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), canvasPtr->bgBorder, canvasPtr->highlightWidth, canvasPtr->highlightWidth, Tk_Width(tkwin) - 2*canvasPtr->highlightWidth, Tk_Height(tkwin) - 2*canvasPtr->highlightWidth, canvasPtr->borderWidth, canvasPtr->relief); } if (canvasPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(canvasPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (canvasPtr->textInfo.gotFocus) { fgGC = Tk_GCForColor(canvasPtr->highlightColorPtr, Tk_WindowId(tkwin)); |
︙ | ︙ | |||
3296 3297 3298 3299 3300 3301 3302 | CanvasFocusProc(canvasPtr, 0); } } else if (eventPtr->type == UnmapNotify) { Tk_Item *itemPtr; /* * Special hack: if the canvas is unmapped, then must notify all items | | | | 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 | CanvasFocusProc(canvasPtr, 0); } } else if (eventPtr->type == UnmapNotify) { Tk_Item *itemPtr; /* * Special hack: if the canvas is unmapped, then must notify all items * with "alwaysRedraw" set, so that they know that they are no longer * displayed. */ for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL; itemPtr = itemPtr->nextPtr) { if (AlwaysRedraw(itemPtr)) { ItemDisplay(canvasPtr, itemPtr, None, 0, 0, 0, 0); } |
︙ | ︙ | |||
6034 6035 6036 6037 6038 6039 6040 | canvasPtr->yOrigin = yOrigin; canvasPtr->flags |= UPDATE_SCROLLBARS; Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr, canvasPtr->xOrigin, canvasPtr->yOrigin, canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin), canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin)); } | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 | canvasPtr->yOrigin = yOrigin; canvasPtr->flags |= UPDATE_SCROLLBARS; Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr, canvasPtr->xOrigin, canvasPtr->yOrigin, canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin), canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin)); } /* *---------------------------------------------------------------------- * * TkGetStringsFromObjs -- * * Results: * Converts object list into string list. * * Side effects: * Memory is allocated for the objv array, which must be freed using * ckfree() when no longer needed. * *---------------------------------------------------------------------- */ #if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) static const char ** TkGetStringsFromObjs( Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Size i; const char **argv; if (objc <= 0) { return NULL; } argv = (const char **)ckalloc((objc+1) * sizeof(char *)); for (i = 0; i < objc; i++) { argv[i] = Tcl_GetString(objv[i]); } argv[objc] = 0; return argv; } #endif /* *-------------------------------------------------------------- * * Tk_CanvasPsColor -- * * This function is called by individual canvas items when they want to * set a color value for output. Given information about an X color, this |
︙ | ︙ |
Changes to generic/tkCmds.c.
︙ | ︙ | |||
96 97 98 99 100 101 102 | Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const bellOptions[] = { "-displayof", "-nice", NULL }; enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE }; Tk_Window tkwin = (Tk_Window)clientData; | | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *const bellOptions[] = { "-displayof", "-nice", NULL }; enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE }; Tk_Window tkwin = (Tk_Window)clientData; int i; int index, nice = 0; Tk_ErrorHandler handler; if (objc > 4) { wrongArgs: Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window? ?-nice?"); return TCL_ERROR; |
︙ | ︙ | |||
452 453 454 455 456 457 458 | p = (const char *)winPtr->tagPtr[i]; if (*p == '.') { /* * Names starting with "." are malloced rather than Uids, so they * have to be freed. */ | | | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | p = (const char *)winPtr->tagPtr[i]; if (*p == '.') { /* * Names starting with "." are malloced rather than Uids, so they * have to be freed. */ ckfree((char *)p); } } ckfree(winPtr->tagPtr); winPtr->numTags = 0; winPtr->tagPtr = NULL; } |
︙ | ︙ | |||
486 487 488 489 490 491 492 | void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window window; Tk_Window tkwin = (Tk_Window)clientData; | | | 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window window; Tk_Window tkwin = (Tk_Window)clientData; int i; for (i = 1; i < objc; i++) { window = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), tkwin); if (window == NULL) { Tcl_ResetResult(interp); continue; } |
︙ | ︙ | |||
1298 1299 1300 1301 1302 1303 1304 | Tk_WinfoObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int index, x, y, width, height, useX, useY, c_class; | | | 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 | Tk_WinfoObjCmd( void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int index, x, y, width, height, useX, useY, c_class; int skip; const char *string; TkWindow *winPtr; Tk_Window tkwin = (Tk_Window)clientData; static const TkStateMap visualMap[] = { {PseudoColor, "pseudocolor"}, {GrayScale, "grayscale"}, |
︙ | ︙ |
Changes to generic/tkColor.c.
︙ | ︙ | |||
58 59 60 61 62 63 64 | const TkObjType tkColorObjType = { {"color", /* name */ FreeColorObjProc, /* freeIntRepProc */ DupColorObjProc, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL, /* setFromAnyProc */ | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | const TkObjType tkColorObjType = { {"color", /* name */ FreeColorObjProc, /* freeIntRepProc */ DupColorObjProc, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL, /* setFromAnyProc */ TCL_OBJTYPE_V1(TkLengthOne)}, 0 }; /* *---------------------------------------------------------------------- * * Tk_AllocColorFromObj -- |
︙ | ︙ |
Changes to generic/tkConfig.c.
︙ | ︙ | |||
211 212 213 214 215 216 217 | } /* * See if a table has already been created for this template. If so, just * reuse the existing table. */ | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | } /* * See if a table has already been created for this template. If so, just * reuse the existing table. */ hashEntryPtr = Tcl_CreateHashEntry(&tsdPtr->hashTable, (char *)templatePtr, &newEntry); if (!newEntry) { tablePtr = (OptionTable *)Tcl_GetHashValue(hashEntryPtr); tablePtr->refCount++; return (Tk_OptionTable) tablePtr; } |
︙ | ︙ | |||
258 259 260 261 262 263 264 | */ for (specPtr2 = templatePtr, i = 0; ; specPtr2++, i++) { if (specPtr2->type == TK_OPTION_END) { Tcl_Panic("Tk_CreateOptionTable couldn't find synonym"); } if (strcmp(specPtr2->optionName, | | | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | */ for (specPtr2 = templatePtr, i = 0; ; specPtr2++, i++) { if (specPtr2->type == TK_OPTION_END) { Tcl_Panic("Tk_CreateOptionTable couldn't find synonym"); } if (strcmp(specPtr2->optionName, (char *)specPtr->clientData) == 0) { optionPtr->extra.synonymPtr = tablePtr->options + i; break; } } } else { if (specPtr->dbName != NULL) { optionPtr->dbNameUID = Tk_GetUid(specPtr->dbName); |
︙ | ︙ | |||
617 618 619 620 621 622 623 | internalPtr = (char *)recordPtr + specPtr->internalOffset; } else { internalPtr = NULL; } if (savedOptionPtr != NULL) { savedOptionPtr->optionPtr = optionPtr; savedOptionPtr->valuePtr = oldPtr; | | | | | | | | | | | | | | | | | | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | internalPtr = (char *)recordPtr + specPtr->internalOffset; } else { internalPtr = NULL; } if (savedOptionPtr != NULL) { savedOptionPtr->optionPtr = optionPtr; savedOptionPtr->valuePtr = oldPtr; oldInternalPtr = (char *)&savedOptionPtr->internalForm; } else { oldInternalPtr = (char *)&internal.internalForm; } nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)); switch (optionPtr->specPtr->type) { case TK_OPTION_BOOLEAN: { int newBool; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newBool = -1; } else if (Tcl_GetBooleanFromObj(nullOK ? NULL : interp, valuePtr, &newBool) != TCL_OK) { if (nullOK && interp) { Tcl_AppendResult(interp, "expected boolean value or \"\" but got \"", Tcl_GetString(valuePtr), "\"", NULL); } return TCL_ERROR; } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)oldInternalPtr) = *((char *)internalPtr); *((char *)internalPtr) = (char)newBool; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)oldInternalPtr) = *((short *)internalPtr); *((short *)internalPtr) = (short)newBool; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_BOOLEAN"); } } else { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newBool; } } break; } case TK_OPTION_INT: { int newInt; if ((optionPtr->specPtr->flags & TYPE_MASK) == 0) { if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newInt = INT_MIN; } else if (Tcl_GetIntFromObj(nullOK ? NULL : interp, valuePtr, &newInt) != TCL_OK) { invalidIntValue: if (nullOK && interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer or \"\" but got \"%.50s\"", Tcl_GetString(valuePtr))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", (char *)NULL); } return TCL_ERROR; } if (internalPtr != NULL) { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newInt; } } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TYPE_MASK) { Tcl_WideInt newWideInt; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newWideInt = (sizeof(long) > sizeof(int)) ? LONG_MIN : LLONG_MIN; } else if (Tcl_GetWideIntFromObj(nullOK ? NULL : interp, valuePtr, &newWideInt) != TCL_OK) { goto invalidIntValue; } if (internalPtr != NULL) { if (sizeof(long) > sizeof(int)) { *((long *)oldInternalPtr) = *((long *)internalPtr); *((long *)internalPtr) = (long)newWideInt; } else { *((long long *)oldInternalPtr) = *((long long *)internalPtr); *((long long *)internalPtr) = (long long)newWideInt; } } } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_INT"); } break; } |
︙ | ︙ | |||
712 713 714 715 716 717 718 | } if (newIndex < INT_MIN) { newIndex = INT_MIN; } else if (newIndex > INT_MAX) { newIndex = INT_MAX; } if (internalPtr != NULL) { | | | | 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 | } if (newIndex < INT_MIN) { newIndex = INT_MIN; } else if (newIndex > INT_MAX) { newIndex = INT_MAX; } if (internalPtr != NULL) { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = (int)newIndex; } break; } case TK_OPTION_DOUBLE: { double newDbl; if (nullOK && ObjectIsEmpty(valuePtr)) { |
︙ | ︙ | |||
735 736 737 738 739 740 741 | if (Tcl_GetDoubleFromObj(nullOK ? NULL : interp, valuePtr, &newDbl) != TCL_OK) { if (nullOK && interp) { Tcl_Obj *msg = Tcl_NewStringObj("expected floating-point number or \"\" but got \"", TCL_INDEX_NONE); Tcl_AppendLimitedToObj(msg, Tcl_GetString(valuePtr), TCL_INDEX_NONE, 50, ""); Tcl_AppendToObj(msg, "\"", TCL_INDEX_NONE); Tcl_SetObjResult(interp, msg); | | | | | | | 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 | if (Tcl_GetDoubleFromObj(nullOK ? NULL : interp, valuePtr, &newDbl) != TCL_OK) { if (nullOK && interp) { Tcl_Obj *msg = Tcl_NewStringObj("expected floating-point number or \"\" but got \"", TCL_INDEX_NONE); Tcl_AppendLimitedToObj(msg, Tcl_GetString(valuePtr), TCL_INDEX_NONE, 50, ""); Tcl_AppendToObj(msg, "\"", TCL_INDEX_NONE); Tcl_SetObjResult(interp, msg); Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", (char *)NULL); } return TCL_ERROR; } } if (internalPtr != NULL) { *((double *)oldInternalPtr) = *((double *)internalPtr); *((double *)internalPtr) = newDbl; } break; } case TK_OPTION_STRING: { char *newStr; const char *value; Tcl_Size length; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; } if (internalPtr != NULL) { if (valuePtr != NULL) { value = Tcl_GetStringFromObj(valuePtr, &length); newStr = (char *)ckalloc(length + 1); strcpy(newStr, value); } else { newStr = NULL; } *((char **)oldInternalPtr) = *((char **)internalPtr); *((char **)internalPtr) = newStr; } break; } case TK_OPTION_STRING_TABLE: { int newValue; if (nullOK && ObjectIsEmpty(valuePtr)) { |
︙ | ︙ | |||
788 789 790 791 792 793 794 | valuePtr = Tcl_DuplicateObj(valuePtr); Tcl_InvalidateStringRep(valuePtr); } } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { | | | | | | | | | | | | | | | | | | | | | | | | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | valuePtr = Tcl_DuplicateObj(valuePtr); Tcl_InvalidateStringRep(valuePtr); } } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)oldInternalPtr) = *((char *)internalPtr); *((char *)internalPtr) = (char)newValue; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)oldInternalPtr) = *((short *)internalPtr); *((short *)internalPtr) = (short)newValue; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_STRING_TABLE"); } } else { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newValue; } } break; } case TK_OPTION_COLOR: { XColor *newPtr; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newPtr = NULL; } else { newPtr = Tk_AllocColorFromObj(interp, tkwin, valuePtr); if (newPtr == NULL) { return TCL_ERROR; } } if (internalPtr != NULL) { *((XColor **)oldInternalPtr) = *((XColor **)internalPtr); *((XColor **)internalPtr) = newPtr; } break; } case TK_OPTION_FONT: { Tk_Font newFont; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newFont = NULL; } else { newFont = Tk_AllocFontFromObj(interp, tkwin, valuePtr); if (newFont == NULL) { return TCL_ERROR; } } if (internalPtr != NULL) { *((Tk_Font *)oldInternalPtr) = *((Tk_Font *)internalPtr); *((Tk_Font *)internalPtr) = newFont; } break; } case TK_OPTION_STYLE: { Tk_Style newStyle; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newStyle = NULL; } else { newStyle = Tk_AllocStyleFromObj(interp, valuePtr); if (newStyle == NULL) { return TCL_ERROR; } } if (internalPtr != NULL) { *((Tk_Style *)oldInternalPtr) = *((Tk_Style *)internalPtr); *((Tk_Style *)internalPtr) = newStyle; } break; } case TK_OPTION_BITMAP: { Pixmap newBitmap; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newBitmap = None; } else { newBitmap = Tk_AllocBitmapFromObj(interp, tkwin, valuePtr); if (newBitmap == None) { return TCL_ERROR; } } if (internalPtr != NULL) { *((Pixmap *)oldInternalPtr) = *((Pixmap *)internalPtr); *((Pixmap *)internalPtr) = newBitmap; } break; } case TK_OPTION_BORDER: { Tk_3DBorder newBorder; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newBorder = NULL; } else { newBorder = Tk_Alloc3DBorderFromObj(interp, tkwin, valuePtr); if (newBorder == NULL) { return TCL_ERROR; } } if (internalPtr != NULL) { *((Tk_3DBorder *)oldInternalPtr) = *((Tk_3DBorder *)internalPtr); *((Tk_3DBorder *)internalPtr) = newBorder; } break; } case TK_OPTION_RELIEF: { int newRelief; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newRelief = TK_RELIEF_NULL; } else if (Tcl_GetIndexFromObj(interp, valuePtr, tkReliefStrings, "relief", (nullOK ? TCL_NULL_OK : 0), &newRelief) != TCL_OK) { return TCL_ERROR; } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)oldInternalPtr) = *((char *)internalPtr); *((char *)internalPtr) = (char)newRelief; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)oldInternalPtr) = *((short *)internalPtr); *((short *)internalPtr) = (short)newRelief; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_RELIEF"); } } else { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newRelief; } } if (slotPtrPtr != NULL && valuePtr != NULL) { valuePtr = Tcl_DuplicateObj(valuePtr); Tcl_InvalidateStringRep(valuePtr); } break; |
︙ | ︙ | |||
957 958 959 960 961 962 963 | } else if (Tcl_GetIndexFromObj(interp, valuePtr, tkJustifyStrings, "justification", (nullOK ? TCL_NULL_OK : 0), &newJustify) != TCL_OK) { return TCL_ERROR; } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { | | | | | | | | 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 | } else if (Tcl_GetIndexFromObj(interp, valuePtr, tkJustifyStrings, "justification", (nullOK ? TCL_NULL_OK : 0), &newJustify) != TCL_OK) { return TCL_ERROR; } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)oldInternalPtr) = *((char *)internalPtr); *((char *)internalPtr) = (char)newJustify; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)oldInternalPtr) = *((short *)internalPtr); *((short *)internalPtr) = (short)newJustify; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_JUSTIFY"); } } else { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newJustify; } } if (slotPtrPtr != NULL && valuePtr != NULL) { valuePtr = Tcl_DuplicateObj(valuePtr); Tcl_InvalidateStringRep(valuePtr); } break; |
︙ | ︙ | |||
989 990 991 992 993 994 995 | } else if (Tcl_GetIndexFromObj(interp, valuePtr, tkAnchorStrings, "anchor", (nullOK ? TCL_NULL_OK : 0), &newAnchor) != TCL_OK) { return TCL_ERROR; } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { | | | | | | | | | | | | | | | 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | } else if (Tcl_GetIndexFromObj(interp, valuePtr, tkAnchorStrings, "anchor", (nullOK ? TCL_NULL_OK : 0), &newAnchor) != TCL_OK) { return TCL_ERROR; } if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)oldInternalPtr) = *((char *)internalPtr); *((char *)internalPtr) = (char)newAnchor; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)oldInternalPtr) = *((short *)internalPtr); *((short *)internalPtr) = (short)newAnchor; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_JUSTIFY"); } } else { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newAnchor; } } if (slotPtrPtr != NULL && valuePtr != NULL) { valuePtr = Tcl_DuplicateObj(valuePtr); Tcl_InvalidateStringRep(valuePtr); } break; } case TK_OPTION_PIXELS: { int newPixels; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newPixels = INT_MIN; } else if (Tk_GetPixelsFromObj(nullOK ? NULL : interp, tkwin, valuePtr, &newPixels) != TCL_OK) { if (nullOK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance or \"\" but got \"%.50s\"", Tcl_GetString(valuePtr))); Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } if (internalPtr != NULL) { *((int *)oldInternalPtr) = *((int *)internalPtr); *((int *)internalPtr) = newPixels; } break; } case TK_OPTION_WINDOW: { Tk_Window newWin; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newWin = NULL; } else if (TkGetWindowFromObj(interp, tkwin, valuePtr, &newWin) != TCL_OK) { return TCL_ERROR; } if (internalPtr != NULL) { *((Tk_Window *)oldInternalPtr) = *((Tk_Window *)internalPtr); *((Tk_Window *)internalPtr) = newWin; } break; } case TK_OPTION_CUSTOM: { const Tk_ObjCustomOption *custom = optionPtr->extra.custom; if (custom->setProc(custom->clientData, interp, tkwin, &valuePtr, (char *)recordPtr, optionPtr->specPtr->internalOffset, (char *)oldInternalPtr, optionPtr->specPtr->flags) != TCL_OK) { return TCL_ERROR; } break; } default: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad config table: unknown type %d", optionPtr->specPtr->type)); Tcl_SetErrorCode(interp, "TK", "BAD_CONFIG", (char *)NULL); return TCL_ERROR; } /* * Release resources associated with the old value, if we're not returning * it to the caller, then install the new object value into the record. */ |
︙ | ︙ | |||
1267 1268 1269 1270 1271 1272 1273 | tablePtr->refCount++; return bestPtr; error: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown option \"%s\"", name)); | | | 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 | tablePtr->refCount++; return bestPtr; error: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown option \"%s\"", name)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "OPTION", name, (char *)NULL); } return NULL; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
1443 1444 1445 1446 1447 1448 1449 | } if (objc < 2) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", Tcl_GetString(*objv))); | | | 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 | } if (objc < 2) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", Tcl_GetString(*objv))); Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", (char *)NULL); goto error; } } if ((savePtr != NULL) && (lastSavePtr->numItems >= TK_NUM_SAVED_OPTIONS)) { /* * We've run out of space for saving old option values. Allocate |
︙ | ︙ | |||
1566 1567 1568 1569 1570 1571 1572 | */ if (specPtr->objOffset != TCL_INDEX_NONE) { *((Tcl_Obj **) ((char *)savePtr->recordPtr + specPtr->objOffset)) = savePtr->items[i].valuePtr; } if (specPtr->internalOffset != TCL_INDEX_NONE) { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 | */ if (specPtr->objOffset != TCL_INDEX_NONE) { *((Tcl_Obj **) ((char *)savePtr->recordPtr + specPtr->objOffset)) = savePtr->items[i].valuePtr; } if (specPtr->internalOffset != TCL_INDEX_NONE) { char *ptr = (char *)&savePtr->items[i].internalForm; CLANG_ASSERT(internalPtr); switch (specPtr->type) { case TK_OPTION_BOOLEAN: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_BOOLEAN"); } } else { *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_INT: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TYPE_MASK) { if (sizeof(long) > sizeof(int)) { *((long *)internalPtr) = *((long *)ptr); } else { *((long long *)internalPtr) = *((long long *)ptr); } } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_INT"); } } else { *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_INDEX: *((int *)internalPtr) = *((int *)ptr); break; case TK_OPTION_DOUBLE: *((double *)internalPtr) = *((double *)ptr); break; case TK_OPTION_STRING: *((char **)internalPtr) = *((char **)ptr); break; case TK_OPTION_STRING_TABLE: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_STRING_TABLE"); } } else { *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_COLOR: *((XColor **)internalPtr) = *((XColor **)ptr); break; case TK_OPTION_FONT: *((Tk_Font *)internalPtr) = *((Tk_Font *)ptr); break; case TK_OPTION_STYLE: *((Tk_Style *)internalPtr) = *((Tk_Style *)ptr); break; case TK_OPTION_BITMAP: *((Pixmap *)internalPtr) = *((Pixmap *)ptr); break; case TK_OPTION_BORDER: *((Tk_3DBorder *)internalPtr) = *((Tk_3DBorder *)ptr); break; case TK_OPTION_RELIEF: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_RELIEF"); } } else { *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_CURSOR: *((Tk_Cursor *) internalPtr) = *((Tk_Cursor *) ptr); Tk_DefineCursor(savePtr->tkwin, *((Tk_Cursor *) internalPtr)); break; case TK_OPTION_JUSTIFY: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_JUSTIFY"); } } else { *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_ANCHOR: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_ANCHOR"); } } else { *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_PIXELS: *((int *)internalPtr) = *((int *)ptr); break; case TK_OPTION_WINDOW: *((Tk_Window *)internalPtr) = *((Tk_Window *)ptr); break; case TK_OPTION_CUSTOM: { const Tk_ObjCustomOption *custom = optionPtr->extra.custom; if (custom->restoreProc != NULL) { custom->restoreProc(custom->clientData, savePtr->tkwin, (char *)internalPtr, ptr); |
︙ | ︙ | |||
1734 1735 1736 1737 1738 1739 1740 | Tk_FreeSavedOptions(savePtr->nextPtr); ckfree(savePtr->nextPtr); } for (count = savePtr->numItems; count > 0; count--) { savedOptionPtr = &savePtr->items[count-1]; if (savedOptionPtr->optionPtr->flags & OPTION_NEEDS_FREEING) { FreeResources(savedOptionPtr->optionPtr, savedOptionPtr->valuePtr, | | | 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 | Tk_FreeSavedOptions(savePtr->nextPtr); ckfree(savePtr->nextPtr); } for (count = savePtr->numItems; count > 0; count--) { savedOptionPtr = &savePtr->items[count-1]; if (savedOptionPtr->optionPtr->flags & OPTION_NEEDS_FREEING) { FreeResources(savedOptionPtr->optionPtr, savedOptionPtr->valuePtr, (char *)&savedOptionPtr->internalForm, savePtr->tkwin); } if (savedOptionPtr->valuePtr != NULL) { Tcl_DecrRefCount(savedOptionPtr->valuePtr); } } } |
︙ | ︙ | |||
1845 1846 1847 1848 1849 1850 1851 | * form, then use the object form. */ internalFormExists = optionPtr->specPtr->internalOffset != TCL_INDEX_NONE; switch (optionPtr->specPtr->type) { case TK_OPTION_STRING: if (internalFormExists) { | | | | | | | | | | | | | | | | | | 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 | * form, then use the object form. */ internalFormExists = optionPtr->specPtr->internalOffset != TCL_INDEX_NONE; switch (optionPtr->specPtr->type) { case TK_OPTION_STRING: if (internalFormExists) { if (*((char **)internalPtr) != NULL) { ckfree(*((char **)internalPtr)); *((char **)internalPtr) = NULL; } } break; case TK_OPTION_COLOR: if (internalFormExists) { if (*((XColor **)internalPtr) != NULL) { Tk_FreeColor(*((XColor **)internalPtr)); *((XColor **)internalPtr) = NULL; } } else if (objPtr != NULL) { Tk_FreeColorFromObj(tkwin, objPtr); } break; case TK_OPTION_FONT: if (internalFormExists) { Tk_FreeFont(*((Tk_Font *)internalPtr)); *((Tk_Font *)internalPtr) = NULL; } else if (objPtr != NULL) { Tk_FreeFontFromObj(tkwin, objPtr); } break; case TK_OPTION_STYLE: if (internalFormExists) { Tk_FreeStyle(*((Tk_Style *)internalPtr)); *((Tk_Style *)internalPtr) = NULL; } break; case TK_OPTION_BITMAP: if (internalFormExists) { if (*((Pixmap *)internalPtr) != None) { Tk_FreeBitmap(Tk_Display(tkwin), *((Pixmap *)internalPtr)); *((Pixmap *)internalPtr) = None; } } else if (objPtr != NULL) { Tk_FreeBitmapFromObj(tkwin, objPtr); } break; case TK_OPTION_BORDER: if (internalFormExists) { if (*((Tk_3DBorder *)internalPtr) != NULL) { Tk_Free3DBorder(*((Tk_3DBorder *)internalPtr)); *((Tk_3DBorder *)internalPtr) = NULL; } } else if (objPtr != NULL) { Tk_Free3DBorderFromObj(tkwin, objPtr); } break; case TK_OPTION_CURSOR: if (internalFormExists) { |
︙ | ︙ | |||
2126 2127 2128 2129 2130 2131 2132 | if (value != -1) { objPtr = Tcl_NewBooleanObj(value); } break; } case TK_OPTION_INT: { Tcl_WideInt value; | | | | | | | | | | | | | 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 | if (value != -1) { objPtr = Tcl_NewBooleanObj(value); } break; } case TK_OPTION_INT: { Tcl_WideInt value; int nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)); if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TYPE_MASK) { if (sizeof(long) > sizeof(int)) { value = *((long *)internalPtr); if (nullOK && (value == LONG_MIN)) {break;} } else { value = *((long long *)internalPtr); if (nullOK && (value == LLONG_MIN)) {break;} } } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_INT"); } } else { value = *((int *)internalPtr); if (nullOK && (value == INT_MIN)) {break;} } objPtr = Tcl_NewWideIntObj(value); break; } case TK_OPTION_INDEX: if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *)internalPtr) != INT_MIN) { if (*((int *)internalPtr) == INT_MIN) { objPtr = TkNewIndexObj(TCL_INDEX_NONE); } else if (*((int *)internalPtr) == INT_MAX) { objPtr = Tcl_NewStringObj("end+1", TCL_INDEX_NONE); } else if (*((int *)internalPtr) == -1) { objPtr = Tcl_NewStringObj("end", TCL_INDEX_NONE); } else if (*((int *)internalPtr) < 0) { char buf[32]; snprintf(buf, 32, "end%d", 1 + *((int *)internalPtr)); objPtr = Tcl_NewStringObj(buf, TCL_INDEX_NONE); } else { objPtr = Tcl_NewWideIntObj(*((int *)internalPtr)); } } break; case TK_OPTION_DOUBLE: if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || !isnan(*((double *)internalPtr))) { objPtr = Tcl_NewDoubleObj(*((double *)internalPtr)); } break; case TK_OPTION_STRING: objPtr = Tcl_NewStringObj(*((char **)internalPtr), TCL_INDEX_NONE); break; case TK_OPTION_STRING_TABLE: { int value = 0; if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { value = *((signed char *)internalPtr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { value = *((short *)internalPtr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_STRING_TABLE"); } } else { value = *((int *)internalPtr); } if (value >= 0) { objPtr = Tcl_NewStringObj(((char **)optionPtr->specPtr->clientData)[ value], TCL_INDEX_NONE); } break; } case TK_OPTION_COLOR: { XColor *colorPtr = *((XColor **)internalPtr); |
︙ | ︙ | |||
2295 2296 2297 2298 2299 2300 2301 | } if (value != TK_ANCHOR_NULL) { objPtr = Tcl_NewStringObj(Tk_NameOfAnchor(value), TCL_INDEX_NONE); } break; } case TK_OPTION_PIXELS: | | | | 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 | } if (value != TK_ANCHOR_NULL) { objPtr = Tcl_NewStringObj(Tk_NameOfAnchor(value), TCL_INDEX_NONE); } break; } case TK_OPTION_PIXELS: if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *)internalPtr) != INT_MIN) { objPtr = Tcl_NewWideIntObj(*((int *)internalPtr)); } break; case TK_OPTION_WINDOW: { tkwin = *((Tk_Window *)internalPtr); if (tkwin != NULL) { objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), TCL_INDEX_NONE); } break; } case TK_OPTION_CUSTOM: { |
︙ | ︙ |
Changes to generic/tkConsole.c.
︙ | ︙ | |||
218 219 220 221 222 223 224 | ConsoleInfo *info; Tcl_Channel consoleChannel; /* * Ensure that we are getting a compatible version of Tcl. */ | | | | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | ConsoleInfo *info; Tcl_Channel consoleChannel; /* * Ensure that we are getting a compatible version of Tcl. */ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return; } consoleInitPtr = (int *)Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int)); if (*consoleInitPtr) { /* * We've already initialized console channels in this thread. */ |
︙ | ︙ | |||
437 438 439 440 441 442 443 | if (mainWindow) { Tk_CreateEventHandler(mainWindow, StructureNotifyMask, ConsoleEventProc, info); info->refCount++; } Tcl_Preserve(consoleInterp); | | | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | if (mainWindow) { Tk_CreateEventHandler(mainWindow, StructureNotifyMask, ConsoleEventProc, info); info->refCount++; } Tcl_Preserve(consoleInterp); result = Tcl_EvalEx(consoleInterp, "source -encoding utf-8 $tk_library/console.tcl", TCL_INDEX_NONE, TCL_EVAL_GLOBAL); if (result == TCL_ERROR) { Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(consoleInterp, result)); Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp)); } Tcl_Release(consoleInterp); |
︙ | ︙ |
Changes to generic/tkCursor.c.
︙ | ︙ | |||
61 62 63 64 65 66 67 | const TkObjType tkCursorObjType = { {"cursor", /* name */ FreeCursorObjProc, /* freeIntRepProc */ DupCursorObjProc, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL, /* setFromAnyProc */ | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | const TkObjType tkCursorObjType = { {"cursor", /* name */ FreeCursorObjProc, /* freeIntRepProc */ DupCursorObjProc, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL, /* setFromAnyProc */ TCL_OBJTYPE_V1(TkLengthOne)}, 0 }; /* *---------------------------------------------------------------------- * * Tk_AllocCursorFromObj -- |
︙ | ︙ |
Changes to generic/tkDList.h.
︙ | ︙ | |||
436 437 438 439 440 441 442 | } \ \ __TK_DLIST_UNUSED \ static void \ LT##_Free(struct ElemType *elem) \ { \ LT##_Remove(elem); \ | | | 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | } \ \ __TK_DLIST_UNUSED \ static void \ LT##_Free(struct ElemType *elem) \ { \ LT##_Remove(elem); \ ckfree((void *) elem); \ } \ \ __TK_DLIST_UNUSED \ static void \ LT##_RemoveHead(LT *head) \ { \ assert(!LT##_IsEmpty(head)); \ |
︙ | ︙ | |||
504 505 506 507 508 509 510 | LT##_Clear(LT *head) \ { \ struct ElemType *p; \ struct ElemType *next; \ assert(head); \ for (p = head->first; p; p = next) { \ next = LT##_Next(p); \ | | | 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | LT##_Clear(LT *head) \ { \ struct ElemType *p; \ struct ElemType *next; \ assert(head); \ for (p = head->first; p; p = next) { \ next = LT##_Next(p); \ ckfree((void *) p); \ } \ LT##_Init(head); \ } \ \ __TK_DLIST_UNUSED \ static void \ LT##_Traverse(LT *head, LT##_Func func) \ |
︙ | ︙ |
Changes to generic/tkDecls.h.
︙ | ︙ | |||
138 139 140 141 142 143 144 | EXTERN int Tk_ConfigureValue(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 29 */ EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, | | | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | EXTERN int Tk_ConfigureValue(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 29 */ EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size argc, const char **argv, void *widgRec, int flags); /* 30 */ EXTERN void Tk_ConfigureWindow(Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 31 */ EXTERN Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, const char *str, |
︙ | ︙ | |||
284 285 286 287 288 289 290 | EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 75 */ EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap); /* 76 */ EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout); | | > > | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 75 */ EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap); /* 76 */ EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout); /* 77 */ TK_DEPRECATED("function does nothing, call can be removed") void Tk_FreeXId(Display *display, XID xid); /* 78 */ EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable); /* 79 */ EXTERN void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight); /* 80 */ EXTERN Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin, |
︙ | ︙ | |||
407 408 409 410 411 412 413 | EXTERN void Tk_HandleEvent(XEvent *eventPtr); /* 116 */ EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window); /* 117 */ EXTERN void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); | | > | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | EXTERN void Tk_HandleEvent(XEvent *eventPtr); /* 116 */ EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window); /* 117 */ EXTERN void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 118 */ EXTERN int Tk_Init(Tcl_Interp *interp); /* 119 */ EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name); /* 120 */ EXTERN int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y, int width, int height); /* 121 */ EXTERN void Tk_MaintainGeometry(Tk_Window window, |
︙ | ︙ | |||
469 470 471 472 473 474 475 | /* 142 */ EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 143 */ EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); | | > > > > | > > > > > > | > > > | > > > | 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | /* 142 */ EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 143 */ EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 144 */ TK_DEPRECATED("function signature changed") void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 145 */ TK_DEPRECATED("function signature changed") void Tk_PhotoPutZoomedBlock_NoComposite( Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 146 */ EXTERN int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 147 */ EXTERN void Tk_PhotoBlank(Tk_PhotoHandle handle); /* 148 */ TK_DEPRECATED("function signature changed") void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height); /* 149 */ EXTERN void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 150 */ TK_DEPRECATED("function signature changed") void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height); /* 151 */ EXTERN int Tk_PointToChar(Tk_TextLayout layout, int x, int y); /* 152 */ EXTERN int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr); /* 153 */ EXTERN void Tk_PreserveColormap(Display *display, |
︙ | ︙ | |||
506 507 508 509 510 511 512 | int height); /* 157 */ EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 158 */ EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr); | | > | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | int height); /* 157 */ EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 158 */ EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr); /* 159 */ EXTERN int Tk_SafeInit(Tcl_Interp *interp); /* 160 */ EXTERN const char * Tk_SetAppName(Tk_Window tkwin, const char *name); /* 161 */ EXTERN void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border); /* 162 */ EXTERN void Tk_SetClass(Tk_Window tkwin, const char *className); |
︙ | ︙ | |||
655 656 657 658 659 660 661 | /* 210 */ EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 211 */ EXTERN int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); | | > > > | > | 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 | /* 210 */ EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 211 */ EXTERN int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 212 */ EXTERN TCL_NORETURN1 void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 213 */ EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr); /* 214 */ EXTERN int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 215 */ EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp); /* 216 */ EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp); /* 217 */ EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method); /* Slot 218 is reserved */ /* Slot 219 is reserved */ /* 220 */ EXTERN int Tk_GetDash(Tcl_Interp *interp, const char *value, |
︙ | ︙ | |||
757 758 759 760 761 762 763 | int right, int top, int bottom); /* 244 */ EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin, int minWidth, int minHeight); /* 245 */ EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height); | | > > > > | > > > > > | 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | int right, int top, int bottom); /* 244 */ EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin, int minWidth, int minHeight); /* 245 */ EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height); /* 246 */ TK_DEPRECATED("function signature changed") void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 247 */ TK_DEPRECATED("function signature changed") void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 248 */ EXTERN int Tk_CollapseMotionEvents(Display *display, int collapse); /* 249 */ EXTERN Tk_StyleEngine Tk_RegisterStyleEngine(const char *name, Tk_StyleEngine parent); /* 250 */ |
︙ | ︙ | |||
784 785 786 787 788 789 790 | /* 255 */ EXTERN void Tk_FreeStyle(Tk_Style style); /* 256 */ EXTERN const char * Tk_NameOfStyle(Tk_Style style); /* 257 */ EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); | | > | > | 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | /* 255 */ EXTERN void Tk_FreeStyle(Tk_Style style); /* 256 */ EXTERN const char * Tk_NameOfStyle(Tk_Style style); /* 257 */ EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 258 */ EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr); /* 259 */ EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr); /* 260 */ EXTERN Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable); /* 261 */ EXTERN void Tk_GetElementSize(Tk_Style style, Tk_StyledElement element, void *recordPtr, |
︙ | ︙ | |||
833 834 835 836 837 838 839 | Tk_PhotoHandle handle, int width, int height); /* 269 */ EXTERN long Tk_GetUserInactiveTime(Display *dpy); /* 270 */ EXTERN void Tk_ResetUserInactiveTime(Display *dpy); /* 271 */ EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin); | | > | > > | 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 | Tk_PhotoHandle handle, int width, int height); /* 269 */ EXTERN long Tk_GetUserInactiveTime(Display *dpy); /* 270 */ EXTERN void Tk_ResetUserInactiveTime(Display *dpy); /* 271 */ EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin); /* 272 */ EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr); /* 273 */ EXTERN void Tk_CreateOldPhotoImageFormat( const Tk_PhotoImageFormat *formatPtr); /* 274 */ EXTERN int Tk_AlwaysShowSelection(Tk_Window tkwin); /* 275 */ EXTERN unsigned Tk_GetButtonMask(unsigned button); /* 276 */ EXTERN int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, |
︙ | ︙ | |||
924 925 926 927 928 929 930 | void (*tk_ChangeWindowAttributes) (Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 22 */ int (*tk_CharBbox) (Tk_TextLayout layout, Tcl_Size index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 23 */ void (*tk_ClearSelection) (Tk_Window tkwin, Atom selection); /* 24 */ int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer); /* 25 */ int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */ int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 27 */ int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 28 */ | | | 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 | void (*tk_ChangeWindowAttributes) (Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 22 */ int (*tk_CharBbox) (Tk_TextLayout layout, Tcl_Size index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 23 */ void (*tk_ClearSelection) (Tk_Window tkwin, Atom selection); /* 24 */ int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer); /* 25 */ int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */ int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 27 */ int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 28 */ int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size argc, const char **argv, void *widgRec, int flags); /* 29 */ void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */ Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */ Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */ unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object, const char *eventStr, const char *script, int append); /* 33 */ Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */ Tk_ErrorHandler (*tk_CreateErrorHandler) (Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, void *clientData); /* 35 */ void (*tk_CreateEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, void *clientData); /* 36 */ |
︙ | ︙ | |||
972 973 974 975 976 977 978 | void (*tk_FreeCursor) (Display *display, Tk_Cursor cursor); /* 70 */ void (*tk_FreeFont) (Tk_Font f); /* 71 */ void (*tk_FreeGC) (Display *display, GC gc); /* 72 */ void (*tk_FreeImage) (Tk_Image image); /* 73 */ void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 74 */ void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */ void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */ | | | 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 | void (*tk_FreeCursor) (Display *display, Tk_Cursor cursor); /* 70 */ void (*tk_FreeFont) (Tk_Font f); /* 71 */ void (*tk_FreeGC) (Display *display, GC gc); /* 72 */ void (*tk_FreeImage) (Tk_Image image); /* 73 */ void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 74 */ void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */ void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */ TCL_DEPRECATED_API("function does nothing, call can be removed") void (*tk_FreeXId) (Display *display, XID xid); /* 77 */ GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */ void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */ Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */ void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object); /* 81 */ int (*tk_GetAnchor) (Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); /* 82 */ const char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */ const char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object, const char *eventStr); /* 84 */ |
︙ | ︙ | |||
1013 1014 1015 1016 1017 1018 1019 | Tk_Uid (*tk_GetUid) (const char *str); /* 111 */ Visual * (*tk_GetVisual) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *depthPtr, Colormap *colormapPtr); /* 112 */ void (*tk_GetVRootGeometry) (Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 113 */ int (*tk_Grab) (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal); /* 114 */ void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */ Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */ void (*tk_ImageChanged) (Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */ | | | 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 | Tk_Uid (*tk_GetUid) (const char *str); /* 111 */ Visual * (*tk_GetVisual) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *depthPtr, Colormap *colormapPtr); /* 112 */ void (*tk_GetVRootGeometry) (Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 113 */ int (*tk_Grab) (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal); /* 114 */ void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */ Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */ void (*tk_ImageChanged) (Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */ int (*tk_Init) (Tcl_Interp *interp); /* 118 */ Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */ int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */ void (*tk_MaintainGeometry) (Tk_Window window, Tk_Window container, int x, int y, int width, int height); /* 121 */ Tk_Window (*tk_MainWindow) (Tcl_Interp *interp); /* 122 */ void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */ void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, void *clientData); /* 124 */ void (*tk_MapWindow) (Tk_Window tkwin); /* 125 */ |
︙ | ︙ | |||
1039 1040 1041 1042 1043 1044 1045 | const char * (*tk_NameOfImage) (Tk_ImageModel model); /* 137 */ const char * (*tk_NameOfJoinStyle) (int join); /* 138 */ const char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */ const char * (*tk_NameOfRelief) (int relief); /* 140 */ Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */ void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 142 */ int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */ | | | | | | | 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 | const char * (*tk_NameOfImage) (Tk_ImageModel model); /* 137 */ const char * (*tk_NameOfJoinStyle) (int join); /* 138 */ const char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */ const char * (*tk_NameOfRelief) (int relief); /* 140 */ Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */ void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 142 */ int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 145 */ int (*tk_PhotoGetImage) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 146 */ void (*tk_PhotoBlank) (Tk_PhotoHandle handle); /* 147 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoExpand_Panic) (Tk_PhotoHandle handle, int width, int height); /* 148 */ void (*tk_PhotoGetSize) (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 149 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoSetSize_Panic) (Tk_PhotoHandle handle, int width, int height); /* 150 */ int (*tk_PointToChar) (Tk_TextLayout layout, int x, int y); /* 151 */ int (*tk_PostscriptFontName) (Tk_Font tkfont, Tcl_DString *dsPtr); /* 152 */ void (*tk_PreserveColormap) (Display *display, Colormap colormap); /* 153 */ void (*tk_QueueWindowEvent) (XEvent *eventPtr, Tcl_QueuePosition position); /* 154 */ void (*tk_RedrawImage) (Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY); /* 155 */ void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */ int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */ Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, void *arg, void **prevArgPtr); /* 158 */ int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */ const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */ void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */ void (*tk_SetClass) (Tk_Window tkwin, const char *className); /* 162 */ void (*tk_SetGrid) (Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight); /* 163 */ void (*tk_SetInternalBorder) (Tk_Window tkwin, int width); /* 164 */ void (*tk_SetWindowBackground) (Tk_Window tkwin, unsigned long pixel); /* 165 */ void (*tk_SetWindowBackgroundPixmap) (Tk_Window tkwin, Pixmap pixmap); /* 166 */ |
︙ | ︙ | |||
1107 1108 1109 1110 1111 1112 1113 | Tcl_Obj * (*tk_GetOptionValue) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin); /* 205 */ int (*tk_GetJustifyFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Justify *justifyPtr); /* 206 */ int (*tk_GetMMFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 207 */ int (*tk_GetPixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr); /* 208 */ int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */ int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */ int (*tk_InitOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */ | | | | 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 | Tcl_Obj * (*tk_GetOptionValue) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin); /* 205 */ int (*tk_GetJustifyFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Justify *justifyPtr); /* 206 */ int (*tk_GetMMFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 207 */ int (*tk_GetPixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr); /* 208 */ int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */ int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */ int (*tk_InitOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") TCL_NORETURN1 void (*tk_MainEx) (Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */ void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */ int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */ void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */ int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */ void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */ void (*reserved218)(void); void (*reserved219)(void); int (*tk_GetDash) (Tcl_Interp *interp, const char *value, Tk_Dash *dash); /* 220 */ void (*tk_CreateOutline) (Tk_Outline *outline); /* 221 */ void (*tk_DeleteOutline) (Display *display, Tk_Outline *outline); /* 222 */ int (*tk_ConfigOutlineGC) (XGCValues *gcValues, Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 223 */ |
︙ | ︙ | |||
1141 1142 1143 1144 1145 1146 1147 | void (*tk_CreateClientMessageHandler) (Tk_ClientMessageProc *proc); /* 239 */ void (*tk_DeleteClientMessageHandler) (Tk_ClientMessageProc *proc); /* 240 */ Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, const char *screenName); /* 241 */ void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, void *instanceData); /* 242 */ void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */ void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */ void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */ | | | | | | | | 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 | void (*tk_CreateClientMessageHandler) (Tk_ClientMessageProc *proc); /* 239 */ void (*tk_DeleteClientMessageHandler) (Tk_ClientMessageProc *proc); /* 240 */ Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, const char *screenName); /* 241 */ void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, void *instanceData); /* 242 */ void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */ void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */ void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 246 */ TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 247 */ int (*tk_CollapseMotionEvents) (Display *display, int collapse); /* 248 */ Tk_StyleEngine (*tk_RegisterStyleEngine) (const char *name, Tk_StyleEngine parent); /* 249 */ Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */ int (*tk_RegisterStyledElement) (Tk_StyleEngine engine, Tk_ElementSpec *templatePtr); /* 251 */ int (*tk_GetElementId) (const char *name); /* 252 */ Tk_Style (*tk_CreateStyle) (const char *name, Tk_StyleEngine engine, void *clientData); /* 253 */ Tk_Style (*tk_GetStyle) (Tcl_Interp *interp, const char *name); /* 254 */ void (*tk_FreeStyle) (Tk_Style style); /* 255 */ const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */ Tk_Style (*tk_AllocStyleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 257 */ Tk_Style (*tk_GetStyleFromObj) (Tcl_Obj *objPtr); /* 258 */ void (*tk_FreeStyleFromObj) (Tcl_Obj *objPtr); /* 259 */ Tk_StyledElement (*tk_GetStyledElement) (Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable); /* 260 */ void (*tk_GetElementSize) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); /* 261 */ void (*tk_GetElementBox) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 262 */ int (*tk_GetElementBorderWidth) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin); /* 263 */ void (*tk_DrawElement) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state); /* 264 */ int (*tk_PhotoExpand) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 265 */ int (*tk_PhotoPutBlock) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 266 */ int (*tk_PhotoPutZoomedBlock) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 267 */ int (*tk_PhotoSetSize) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 268 */ long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */ void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */ Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */ void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */ int (*tk_AlwaysShowSelection) (Tk_Window tkwin); /* 274 */ unsigned (*tk_GetButtonMask) (unsigned button); /* 275 */ int (*tk_GetDoublePixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 276 */ Tcl_Obj * (*tk_NewWindowObj) (Tk_Window tkwin); /* 277 */ void (*tk_SendVirtualEvent) (Tk_Window tkwin, const char *eventName, Tcl_Obj *detail); /* 278 */ Tcl_Obj * (*tk_FontGetDescription) (Tk_Font tkfont); /* 279 */ void (*tk_CreatePhotoImageFormatVersion3) (const Tk_PhotoImageFormatVersion3 *formatPtr); /* 280 */ |
︙ | ︙ | |||
1354 1355 1356 1357 1358 1359 1360 | (tkStubsPtr->tk_FreeImage) /* 73 */ #define Tk_FreeOptions \ (tkStubsPtr->tk_FreeOptions) /* 74 */ #define Tk_FreePixmap \ (tkStubsPtr->tk_FreePixmap) /* 75 */ #define Tk_FreeTextLayout \ (tkStubsPtr->tk_FreeTextLayout) /* 76 */ | > | | 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 | (tkStubsPtr->tk_FreeImage) /* 73 */ #define Tk_FreeOptions \ (tkStubsPtr->tk_FreeOptions) /* 74 */ #define Tk_FreePixmap \ (tkStubsPtr->tk_FreePixmap) /* 75 */ #define Tk_FreeTextLayout \ (tkStubsPtr->tk_FreeTextLayout) /* 76 */ #define Tk_FreeXId \ (tkStubsPtr->tk_FreeXId) /* 77 */ #define Tk_GCForColor \ (tkStubsPtr->tk_GCForColor) /* 78 */ #define Tk_GeometryRequest \ (tkStubsPtr->tk_GeometryRequest) /* 79 */ #define Tk_Get3DBorder \ (tkStubsPtr->tk_Get3DBorder) /* 80 */ #define Tk_GetAllBindings \ |
︙ | ︙ | |||
1435 1436 1437 1438 1439 1440 1441 | (tkStubsPtr->tk_Grab) /* 114 */ #define Tk_HandleEvent \ (tkStubsPtr->tk_HandleEvent) /* 115 */ #define Tk_IdToWindow \ (tkStubsPtr->tk_IdToWindow) /* 116 */ #define Tk_ImageChanged \ (tkStubsPtr->tk_ImageChanged) /* 117 */ | > | | 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 | (tkStubsPtr->tk_Grab) /* 114 */ #define Tk_HandleEvent \ (tkStubsPtr->tk_HandleEvent) /* 115 */ #define Tk_IdToWindow \ (tkStubsPtr->tk_IdToWindow) /* 116 */ #define Tk_ImageChanged \ (tkStubsPtr->tk_ImageChanged) /* 117 */ #define Tk_Init \ (tkStubsPtr->tk_Init) /* 118 */ #define Tk_InternAtom \ (tkStubsPtr->tk_InternAtom) /* 119 */ #define Tk_IntersectTextLayout \ (tkStubsPtr->tk_IntersectTextLayout) /* 120 */ #define Tk_MaintainGeometry \ (tkStubsPtr->tk_MaintainGeometry) /* 121 */ #define Tk_MainWindow \ |
︙ | ︙ | |||
1486 1487 1488 1489 1490 1491 1492 | (tkStubsPtr->tk_NameOfRelief) /* 140 */ #define Tk_NameToWindow \ (tkStubsPtr->tk_NameToWindow) /* 141 */ #define Tk_OwnSelection \ (tkStubsPtr->tk_OwnSelection) /* 142 */ #define Tk_ParseArgv \ (tkStubsPtr->tk_ParseArgv) /* 143 */ | > | > | > | > | > | | 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 | (tkStubsPtr->tk_NameOfRelief) /* 140 */ #define Tk_NameToWindow \ (tkStubsPtr->tk_NameToWindow) /* 141 */ #define Tk_OwnSelection \ (tkStubsPtr->tk_OwnSelection) /* 142 */ #define Tk_ParseArgv \ (tkStubsPtr->tk_ParseArgv) /* 143 */ #define Tk_PhotoPutBlock_NoComposite \ (tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */ #define Tk_PhotoPutZoomedBlock_NoComposite \ (tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */ #define Tk_PhotoGetImage \ (tkStubsPtr->tk_PhotoGetImage) /* 146 */ #define Tk_PhotoBlank \ (tkStubsPtr->tk_PhotoBlank) /* 147 */ #define Tk_PhotoExpand_Panic \ (tkStubsPtr->tk_PhotoExpand_Panic) /* 148 */ #define Tk_PhotoGetSize \ (tkStubsPtr->tk_PhotoGetSize) /* 149 */ #define Tk_PhotoSetSize_Panic \ (tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */ #define Tk_PointToChar \ (tkStubsPtr->tk_PointToChar) /* 151 */ #define Tk_PostscriptFontName \ (tkStubsPtr->tk_PostscriptFontName) /* 152 */ #define Tk_PreserveColormap \ (tkStubsPtr->tk_PreserveColormap) /* 153 */ #define Tk_QueueWindowEvent \ (tkStubsPtr->tk_QueueWindowEvent) /* 154 */ #define Tk_RedrawImage \ (tkStubsPtr->tk_RedrawImage) /* 155 */ #define Tk_ResizeWindow \ (tkStubsPtr->tk_ResizeWindow) /* 156 */ #define Tk_RestackWindow \ (tkStubsPtr->tk_RestackWindow) /* 157 */ #define Tk_RestrictEvents \ (tkStubsPtr->tk_RestrictEvents) /* 158 */ #define Tk_SafeInit \ (tkStubsPtr->tk_SafeInit) /* 159 */ #define Tk_SetAppName \ (tkStubsPtr->tk_SetAppName) /* 160 */ #define Tk_SetBackgroundFromBorder \ (tkStubsPtr->tk_SetBackgroundFromBorder) /* 161 */ #define Tk_SetClass \ (tkStubsPtr->tk_SetClass) /* 162 */ #define Tk_SetGrid \ |
︙ | ︙ | |||
1617 1618 1619 1620 1621 1622 1623 | (tkStubsPtr->tk_GetPixelsFromObj) /* 208 */ #define Tk_GetReliefFromObj \ (tkStubsPtr->tk_GetReliefFromObj) /* 209 */ #define Tk_GetScrollInfoObj \ (tkStubsPtr->tk_GetScrollInfoObj) /* 210 */ #define Tk_InitOptions \ (tkStubsPtr->tk_InitOptions) /* 211 */ | > | > | | 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 | (tkStubsPtr->tk_GetPixelsFromObj) /* 208 */ #define Tk_GetReliefFromObj \ (tkStubsPtr->tk_GetReliefFromObj) /* 209 */ #define Tk_GetScrollInfoObj \ (tkStubsPtr->tk_GetScrollInfoObj) /* 210 */ #define Tk_InitOptions \ (tkStubsPtr->tk_InitOptions) /* 211 */ #define Tk_MainEx \ (tkStubsPtr->tk_MainEx) /* 212 */ #define Tk_RestoreSavedOptions \ (tkStubsPtr->tk_RestoreSavedOptions) /* 213 */ #define Tk_SetOptions \ (tkStubsPtr->tk_SetOptions) /* 214 */ #define Tk_InitConsoleChannels \ (tkStubsPtr->tk_InitConsoleChannels) /* 215 */ #define Tk_CreateConsoleWindow \ (tkStubsPtr->tk_CreateConsoleWindow) /* 216 */ #define Tk_CreateSmoothMethod \ (tkStubsPtr->tk_CreateSmoothMethod) /* 217 */ /* Slot 218 is reserved */ /* Slot 219 is reserved */ #define Tk_GetDash \ (tkStubsPtr->tk_GetDash) /* 220 */ #define Tk_CreateOutline \ |
︙ | ︙ | |||
1681 1682 1683 1684 1685 1686 1687 | (tkStubsPtr->tk_SetClassProcs) /* 242 */ #define Tk_SetInternalBorderEx \ (tkStubsPtr->tk_SetInternalBorderEx) /* 243 */ #define Tk_SetMinimumRequestSize \ (tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */ #define Tk_SetCaretPos \ (tkStubsPtr->tk_SetCaretPos) /* 245 */ | > | > | > | > | | 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 | (tkStubsPtr->tk_SetClassProcs) /* 242 */ #define Tk_SetInternalBorderEx \ (tkStubsPtr->tk_SetInternalBorderEx) /* 243 */ #define Tk_SetMinimumRequestSize \ (tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */ #define Tk_SetCaretPos \ (tkStubsPtr->tk_SetCaretPos) /* 245 */ #define Tk_PhotoPutBlock_Panic \ (tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */ #define Tk_PhotoPutZoomedBlock_Panic \ (tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 247 */ #define Tk_CollapseMotionEvents \ (tkStubsPtr->tk_CollapseMotionEvents) /* 248 */ #define Tk_RegisterStyleEngine \ (tkStubsPtr->tk_RegisterStyleEngine) /* 249 */ #define Tk_GetStyleEngine \ (tkStubsPtr->tk_GetStyleEngine) /* 250 */ #define Tk_RegisterStyledElement \ (tkStubsPtr->tk_RegisterStyledElement) /* 251 */ #define Tk_GetElementId \ (tkStubsPtr->tk_GetElementId) /* 252 */ #define Tk_CreateStyle \ (tkStubsPtr->tk_CreateStyle) /* 253 */ #define Tk_GetStyle \ (tkStubsPtr->tk_GetStyle) /* 254 */ #define Tk_FreeStyle \ (tkStubsPtr->tk_FreeStyle) /* 255 */ #define Tk_NameOfStyle \ (tkStubsPtr->tk_NameOfStyle) /* 256 */ #define Tk_AllocStyleFromObj \ (tkStubsPtr->tk_AllocStyleFromObj) /* 257 */ #define Tk_GetStyleFromObj \ (tkStubsPtr->tk_GetStyleFromObj) /* 258 */ #define Tk_FreeStyleFromObj \ (tkStubsPtr->tk_FreeStyleFromObj) /* 259 */ #define Tk_GetStyledElement \ (tkStubsPtr->tk_GetStyledElement) /* 260 */ #define Tk_GetElementSize \ (tkStubsPtr->tk_GetElementSize) /* 261 */ #define Tk_GetElementBox \ (tkStubsPtr->tk_GetElementBox) /* 262 */ #define Tk_GetElementBorderWidth \ |
︙ | ︙ | |||
1729 1730 1731 1732 1733 1734 1735 | (tkStubsPtr->tk_PhotoSetSize) /* 268 */ #define Tk_GetUserInactiveTime \ (tkStubsPtr->tk_GetUserInactiveTime) /* 269 */ #define Tk_ResetUserInactiveTime \ (tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */ #define Tk_Interp \ (tkStubsPtr->tk_Interp) /* 271 */ | > | > | | 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 | (tkStubsPtr->tk_PhotoSetSize) /* 268 */ #define Tk_GetUserInactiveTime \ (tkStubsPtr->tk_GetUserInactiveTime) /* 269 */ #define Tk_ResetUserInactiveTime \ (tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */ #define Tk_Interp \ (tkStubsPtr->tk_Interp) /* 271 */ #define Tk_CreateOldImageType \ (tkStubsPtr->tk_CreateOldImageType) /* 272 */ #define Tk_CreateOldPhotoImageFormat \ (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ #define Tk_AlwaysShowSelection \ (tkStubsPtr->tk_AlwaysShowSelection) /* 274 */ #define Tk_GetButtonMask \ (tkStubsPtr->tk_GetButtonMask) /* 275 */ #define Tk_GetDoublePixelsFromObj \ (tkStubsPtr->tk_GetDoublePixelsFromObj) /* 276 */ #define Tk_NewWindowObj \ |
︙ | ︙ | |||
1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 | #define Tk_MakeWindow \ (tkStubsPtr->tk_MakeWindow) /* 290 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #define Tk_GetImageMasterData Tk_GetImageModelData #ifndef MAC_OSX_TK # undef Tk_ClipDrawableToRect #endif | > > > > > > > > > > > > < < | < < | > > | | | | | < < | > > | 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 | #define Tk_MakeWindow \ (tkStubsPtr->tk_MakeWindow) /* 290 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ /* Functions that don't belong in the stub table */ #undef Tk_MainEx #undef Tk_Init #undef Tk_SafeInit #undef Tk_CreateConsoleWindow #undef Tk_FreeXId #define Tk_FreeXId(display,xid) #undef Tk_GetStyleFromObj #undef Tk_FreeStyleFromObj #define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj) #define Tk_FreeStyleFromObj(obj) /* no-op */ #define Tk_GetImageMasterData Tk_GetImageModelData #ifndef MAC_OSX_TK # undef Tk_ClipDrawableToRect #endif #if defined(_WIN32) && defined(UNICODE) # define Tk_MainEx Tk_MainExW EXTERN void Tk_MainExW(Tcl_Size argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif #if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 #undef Tk_PhotoPutBlock_NoComposite #undef Tk_PhotoPutZoomedBlock_NoComposite #undef Tk_PhotoExpand_Panic #undef Tk_PhotoPutBlock_Panic #undef Tk_PhotoPutZoomedBlock_Panic #undef Tk_PhotoSetSize_Panic #undef Tk_CreateOldPhotoImageFormat #endif /* TK_NO_DEPRECATED */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #undef TkUnusedStubEntry #endif /* _TKDECLS */ |
Changes to generic/tkEntry.c.
︙ | ︙ | |||
1312 1313 1314 1315 1316 1317 1318 | /* * Recompute the window's geometry and arrange for it to be * redisplayed. */ Tk_SetInternalBorder(entryPtr->tkwin, entryPtr->borderWidth + entryPtr->highlightWidth); | | | 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 | /* * Recompute the window's geometry and arrange for it to be * redisplayed. */ Tk_SetInternalBorder(entryPtr->tkwin, entryPtr->borderWidth + entryPtr->highlightWidth); if (entryPtr->highlightWidth < 0) { entryPtr->highlightWidth = 0; } entryPtr->inset = entryPtr->highlightWidth + entryPtr->borderWidth + XPAD; break; } if (!error) { |
︙ | ︙ | |||
1994 1995 1996 1997 1998 1999 2000 | /* * Normalize the special character so we can safely duplicate it in * the display string. If we didn't do this, then two malformed * characters might end up looking like one valid UTF character in the * resulting string. */ | | | | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 | /* * Normalize the special character so we can safely duplicate it in * the display string. If we didn't do this, then two malformed * characters might end up looking like one valid UTF character in the * resulting string. */ TkUtfToUniChar(entryPtr->showChar, &ch); size = TkUniCharToUtf(ch, buf); entryPtr->numDisplayBytes = entryPtr->numChars * size; p = (char *)ckalloc(entryPtr->numDisplayBytes + 1); entryPtr->displayString = p; for (i = entryPtr->numChars; i-- > 0; ) { memcpy(p, buf, size); |
︙ | ︙ | |||
2160 2161 2162 2163 2164 2165 2166 | * string). */ { size_t byteIndex, byteCount, newByteCount, oldChars, charsAdded; const char *string; char *newStr; string = entryPtr->string; | | | 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 | * string). */ { size_t byteIndex, byteCount, newByteCount, oldChars, charsAdded; const char *string; char *newStr; string = entryPtr->string; byteIndex = TkUtfAtIndex(string, index) - string; byteCount = strlen(value); if (byteCount == 0) { return TCL_OK; } newByteCount = entryPtr->numBytes + byteCount + 1; newStr = (char *)ckalloc(newByteCount); |
︙ | ︙ | |||
2193 2194 2195 2196 2197 2198 2199 | * result in actually forming valid UTF-8 sequences; the number of * characters added may not be Tcl_NumUtfChars(string, TCL_INDEX_NONE), because of * context. The actual number of characters added is how many characters * are in the string now minus the number that used to be there. */ oldChars = entryPtr->numChars; | | | 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 | * result in actually forming valid UTF-8 sequences; the number of * characters added may not be Tcl_NumUtfChars(string, TCL_INDEX_NONE), because of * context. The actual number of characters added is how many characters * are in the string now minus the number that used to be there. */ oldChars = entryPtr->numChars; entryPtr->numChars = TkNumUtfChars(newStr, TCL_INDEX_NONE); charsAdded = entryPtr->numChars - oldChars; entryPtr->numBytes += byteCount; if (entryPtr->displayString == string) { entryPtr->displayString = newStr; entryPtr->numDisplayBytes = entryPtr->numBytes; } |
︙ | ︙ | |||
2264 2265 2266 2267 2268 2269 2270 | count = entryPtr->numChars - index; } if ((int)count <= 0) { return TCL_OK; } string = entryPtr->string; | | | | 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 | count = entryPtr->numChars - index; } if ((int)count <= 0) { return TCL_OK; } string = entryPtr->string; byteIndex = TkUtfAtIndex(string, index) - string; byteCount = TkUtfAtIndex(string + byteIndex, count) - (string+byteIndex); newByteCount = entryPtr->numBytes + 1 - byteCount; newStr = (char *)ckalloc(newByteCount); memcpy(newStr, string, (size_t) byteIndex); strcpy(newStr + byteIndex, string + byteIndex + byteCount); toDelete = (char *)ckalloc(byteCount + 1); |
︙ | ︙ | |||
2493 2494 2495 2496 2497 2498 2499 | } else { char *tmp = (char *)ckalloc(valueLen + 1); strcpy(tmp, value); entryPtr->string = tmp; } entryPtr->numBytes = valueLen; | | | 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 | } else { char *tmp = (char *)ckalloc(valueLen + 1); strcpy(tmp, value); entryPtr->string = tmp; } entryPtr->numBytes = valueLen; entryPtr->numChars = TkNumUtfChars(value, valueLen); if (entryPtr->displayString == oldSource) { entryPtr->displayString = entryPtr->string; entryPtr->numDisplayBytes = entryPtr->numBytes; } if (entryPtr->selectFirst != TCL_INDEX_NONE) { |
︙ | ︙ | |||
2923 2924 2925 2926 2927 2928 2929 | const char *selStart, *selEnd; if ((entryPtr->selectFirst < 0) || (!entryPtr->exportSelection) || Tcl_IsSafe(entryPtr->interp)) { return -1; } string = entryPtr->displayString; | | | | 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 | const char *selStart, *selEnd; if ((entryPtr->selectFirst < 0) || (!entryPtr->exportSelection) || Tcl_IsSafe(entryPtr->interp)) { return -1; } string = entryPtr->displayString; selStart = TkUtfAtIndex(string, entryPtr->selectFirst); selEnd = TkUtfAtIndex(selStart, entryPtr->selectLast - entryPtr->selectFirst); if (selEnd <= selStart + offset) { return 0; } byteCount = selEnd - selStart - offset; if (byteCount > maxBytes) { byteCount = maxBytes; |
︙ | ︙ | |||
3576 3577 3578 3579 3580 3581 3582 | /* * There's a percent sequence here. Process it. */ before++; /* skip over % */ if (*before != '\0') { | | | | 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 | /* * There's a percent sequence here. Process it. */ before++; /* skip over % */ if (*before != '\0') { before += TkUtfToUniChar(before, &ch); } else { ch = '%'; } if (type == VALIDATE_BUTTON) { /* * -command %-substitution */ switch (ch) { case 's': /* Current string value of spinbox */ string = entryPtr->string; break; case 'd': /* direction, up or down */ string = change; break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->tkwin); break; default: length = TkUniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; } } else { /* * -validatecommand / -invalidcommand %-substitution |
︙ | ︙ | |||
3656 3657 3658 3659 3660 3661 3662 | break; } break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->tkwin); break; default: | | | 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 | break; } break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->tkwin); break; default: length = TkUniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; } } spaceNeeded = Tcl_ScanCountedElement(string, TCL_INDEX_NONE, &cvtFlags); |
︙ | ︙ |
Changes to generic/tkFont.c.
︙ | ︙ | |||
572 573 574 575 576 577 578 | /* * The 'charPtr' arg must be a single Unicode. */ if (charPtr != NULL) { const char *string = Tcl_GetString(charPtr); | | | 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 | /* * The 'charPtr' arg must be a single Unicode. */ if (charPtr != NULL) { const char *string = Tcl_GetString(charPtr); size_t len = TkUtfToUniChar(string, &uniChar); if (len != (size_t)charPtr->length) { resultPtr = Tcl_NewStringObj( "expected a single character but got \"", TCL_INDEX_NONE); Tcl_AppendLimitedToObj(resultPtr, string, TCL_INDEX_NONE, 40, "..."); Tcl_AppendToObj(resultPtr, "\"", TCL_INDEX_NONE); |
︙ | ︙ | |||
1325 1326 1327 1328 1329 1330 1331 | * This is a stale reference: it refers to a TkFont that's no * longer in use. Clear the reference. */ FreeFontObj(objPtr); fontPtr = NULL; } else if (Tk_Screen(tkwin) == fontPtr->screen) { | < | 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 | * This is a stale reference: it refers to a TkFont that's no * longer in use. Clear the reference. */ FreeFontObj(objPtr); fontPtr = NULL; } else if (Tk_Screen(tkwin) == fontPtr->screen) { return (Tk_Font) fontPtr; } } /* * Next, search the list of fonts that have the name we want, to see if * one of them is for the right screen. |
︙ | ︙ | |||
1741 1742 1743 1744 1745 1746 1747 | src = dest = Tcl_DStringValue(dsPtr) + len; upper = 1; for (; *src != '\0'; ) { while (isspace(UCHAR(*src))) { /* INTL: ISO space */ src++; upper = 1; } | | | | 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | src = dest = Tcl_DStringValue(dsPtr) + len; upper = 1; for (; *src != '\0'; ) { while (isspace(UCHAR(*src))) { /* INTL: ISO space */ src++; upper = 1; } src += TkUtfToUniChar(src, &ch); if (upper) { ch = Tcl_UniCharToUpper(ch); upper = 0; } else { ch = Tcl_UniCharToLower(ch); } dest += TkUniCharToUtf(ch, dest); } *dest = '\0'; Tcl_DStringSetLength(dsPtr, dest - Tcl_DStringValue(dsPtr)); family = Tcl_DStringValue(dsPtr) + len; } if (family != Tcl_DStringValue(dsPtr) + len) { Tcl_DStringAppend(dsPtr, family, TCL_INDEX_NONE); |
︙ | ︙ | |||
2009 2010 2011 2012 2013 2014 2015 | } fmPtr = &fontPtr->fm; height = fmPtr->ascent + fmPtr->descent; if (numChars < 0) { | | | 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 | } fmPtr = &fontPtr->fm; height = fmPtr->ascent + fmPtr->descent; if (numChars < 0) { numChars = TkNumUtfChars(string, TCL_INDEX_NONE); } if (wrapLength == 0) { wrapLength = -1; } maxChunks = 1; |
︙ | ︙ | |||
2032 2033 2034 2035 2036 2037 2038 | /* * Divide the string up into simple strings and measure each string. */ curX = 0; | | | 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 | /* * Divide the string up into simple strings and measure each string. */ curX = 0; endp = TkUtfAtIndex(string, numChars); special = string; flags &= TK_IGNORE_TABS | TK_IGNORE_NEWLINES; flags |= TK_WHOLE_WORDS | TK_AT_LEAST_ONE; for (start = string; start < endp; ) { if (start >= special) { /* |
︙ | ︙ | |||
2149 2150 2151 2152 2153 2154 2155 | end = chunkPtr->start + chunkPtr->numBytes; bytesThisChunk = start - end; if (bytesThisChunk > 0) { bytesThisChunk = Tk_MeasureChars(tkfont, end, bytesThisChunk, -1, 0, &chunkPtr->totalWidth); chunkPtr->numBytes += bytesThisChunk; | | | 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 | end = chunkPtr->start + chunkPtr->numBytes; bytesThisChunk = start - end; if (bytesThisChunk > 0) { bytesThisChunk = Tk_MeasureChars(tkfont, end, bytesThisChunk, -1, 0, &chunkPtr->totalWidth); chunkPtr->numBytes += bytesThisChunk; chunkPtr->numChars += TkNumUtfChars(end, bytesThisChunk); chunkPtr->totalWidth += curX; } } wrapLine: flags |= TK_AT_LEAST_ONE; |
︙ | ︙ | |||
2341 2342 2343 2344 2345 2346 2347 | numDisplayChars = chunkPtr->numDisplayChars; if ((numDisplayChars > 0) && (firstChar < numDisplayChars)) { if (firstChar <= 0) { drawX = 0; firstChar = 0; firstByte = chunkPtr->start; } else { | | | | 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 | numDisplayChars = chunkPtr->numDisplayChars; if ((numDisplayChars > 0) && (firstChar < numDisplayChars)) { if (firstChar <= 0) { drawX = 0; firstChar = 0; firstByte = chunkPtr->start; } else { firstByte = TkUtfAtIndex(chunkPtr->start, firstChar); Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start, firstByte - chunkPtr->start, -1, 0, &drawX); } if (lastChar < numDisplayChars) { numDisplayChars = lastChar; } lastByte = TkUtfAtIndex(chunkPtr->start, numDisplayChars); #ifdef TK_DRAW_IN_CONTEXT TkpDrawCharsInContext(display, drawable, gc, layoutPtr->tkfont, chunkPtr->start, chunkPtr->numBytes, firstByte - chunkPtr->start, lastByte - firstByte, x+chunkPtr->x, y+chunkPtr->y); #else /* !TK_DRAW_IN_CONTEXT */ Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont, firstByte, |
︙ | ︙ | |||
2411 2412 2413 2414 2415 2416 2417 | double dx, dy; if (firstChar <= 0) { drawX = 0; firstChar = 0; firstByte = chunkPtr->start; } else { | | | | 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 | double dx, dy; if (firstChar <= 0) { drawX = 0; firstChar = 0; firstByte = chunkPtr->start; } else { firstByte = TkUtfAtIndex(chunkPtr->start, firstChar); Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start, firstByte - chunkPtr->start, -1, 0, &drawX); } if (lastChar < numDisplayChars) { numDisplayChars = lastChar; } lastByte = TkUtfAtIndex(chunkPtr->start, numDisplayChars); #ifdef TK_DRAW_IN_CONTEXT dx = cosA * (chunkPtr->x) + sinA * (chunkPtr->y); dy = -sinA * (chunkPtr->x) + cosA * (chunkPtr->y); if (angle == 0.0) { TkpDrawCharsInContext(display, drawable, gc, layoutPtr->tkfont, chunkPtr->start, chunkPtr->numBytes, firstByte - chunkPtr->start, lastByte - firstByte, |
︙ | ︙ | |||
2671 2672 2673 2674 2675 2676 2677 | * tab or newline char. */ return numChars; } n = Tk_MeasureChars((Tk_Font) fontPtr, chunkPtr->start, chunkPtr->numBytes, x - chunkPtr->x, 0, &dummy); | | | 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 | * tab or newline char. */ return numChars; } n = Tk_MeasureChars((Tk_Font) fontPtr, chunkPtr->start, chunkPtr->numBytes, x - chunkPtr->x, 0, &dummy); return numChars + TkNumUtfChars(chunkPtr->start, n); } numChars += chunkPtr->numChars; lastPtr = chunkPtr; chunkPtr++; i++; } |
︙ | ︙ | |||
2780 2781 2782 2783 2784 2785 2786 | if (chunkPtr->numDisplayChars < 0) { if (index == 0) { x = chunkPtr->x; w = chunkPtr->totalWidth; goto check; } } else if (index < chunkPtr->numChars) { | | | | 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 | if (chunkPtr->numDisplayChars < 0) { if (index == 0) { x = chunkPtr->x; w = chunkPtr->totalWidth; goto check; } } else if (index < chunkPtr->numChars) { end = TkUtfAtIndex(chunkPtr->start, index); if (xPtr != NULL) { Tk_MeasureChars(tkfont, chunkPtr->start, end - chunkPtr->start, -1, 0, &x); x += chunkPtr->x; } if (widthPtr != NULL) { int ch; Tk_MeasureChars(tkfont, end, TkUtfToUniChar(end, &ch), -1, 0, &w); } goto check; } index -= chunkPtr->numChars; chunkPtr++; } if (index != 0) { |
︙ | ︙ | |||
3334 3335 3336 3337 3338 3339 3340 | /* * INTL: We only handle symbols that have an encoding as a glyph * from the standard set defined by Adobe. The rest get punted. * Eventually this should be revised to handle more sophsticiated * international postscript fonts. */ | | | 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 | /* * INTL: We only handle symbols that have an encoding as a glyph * from the standard set defined by Adobe. The rest get punted. * Eventually this should be revised to handle more sophsticiated * international postscript fonts. */ p += TkUtfToUniChar(p, &ch); if ((ch == '(') || (ch == ')') || (ch == '\\') || (ch < 0x20)) { /* * Tricky point: the "03" is necessary in the snprintf below, * so that a full three digits of octal are always generated. * Without the "03", a number following this sequence could be * interpreted by Postscript as part of this sequence. */ |
︙ | ︙ | |||
3855 3856 3857 3858 3859 3860 3861 | maxChunks *= 2; s = offsetof(TextLayout, chunks) + (maxChunks * sizeof(LayoutChunk)); layoutPtr = (TextLayout *)ckrealloc(layoutPtr, s); *layoutPtrPtr = layoutPtr; *maxPtr = maxChunks; } | | | 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 | maxChunks *= 2; s = offsetof(TextLayout, chunks) + (maxChunks * sizeof(LayoutChunk)); layoutPtr = (TextLayout *)ckrealloc(layoutPtr, s); *layoutPtrPtr = layoutPtr; *maxPtr = maxChunks; } numChars = TkNumUtfChars(start, numBytes); chunkPtr = &layoutPtr->chunks[layoutPtr->numChunks]; chunkPtr->start = start; chunkPtr->numBytes = numBytes; chunkPtr->numChars = numChars; chunkPtr->numDisplayChars = numChars; chunkPtr->x = curX; chunkPtr->y = y; |
︙ | ︙ | |||
4303 4304 4305 4306 4307 4308 4309 | *---------------------------------------------------------------------- */ Tcl_Obj * TkDebugFont( Tk_Window tkwin, /* The window in which the font will be used * (not currently used). */ | | | 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 | *---------------------------------------------------------------------- */ Tcl_Obj * TkDebugFont( Tk_Window tkwin, /* The window in which the font will be used * (not currently used). */ const char *name) /* Name of the desired font. */ { TkFont *fontPtr; Tcl_HashEntry *hashPtr; Tcl_Obj *resultPtr, *objPtr; resultPtr = Tcl_NewObj(); hashPtr = Tcl_FindHashEntry( |
︙ | ︙ |
Changes to generic/tkFrame.c.
︙ | ︙ | |||
39 40 41 42 43 44 45 | Tcl_Interp *interp; /* Interpreter associated with widget. Used to * delete widget command. */ Tcl_Command widgetCmd; /* Token for frame's widget command. */ Tk_OptionTable optionTable; /* Table that defines configuration options * available for this widget. */ char *className; /* Class name for widget (from configuration * option). Malloc-ed. */ | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | Tcl_Interp *interp; /* Interpreter associated with widget. Used to * delete widget command. */ Tcl_Command widgetCmd; /* Token for frame's widget command. */ Tk_OptionTable optionTable; /* Table that defines configuration options * available for this widget. */ char *className; /* Class name for widget (from configuration * option). Malloc-ed. */ enum FrameType type; /* Type of widget, such as TYPE_FRAME. */ char *screenName; /* Screen on which widget is created. Non-null * only for top-levels. Malloc-ed, may be * NULL. */ char *visualName; /* Textual description of visual for window, * from -visual option. Malloc-ed, may be * NULL. */ char *colormapName; /* Textual description of colormap for window, |
︙ | ︙ | |||
325 326 327 328 329 330 331 332 333 334 335 336 337 338 | /* * Forward declarations for functions defined later in this file: */ static void ComputeFrameGeometry(Frame *framePtr); static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, Tcl_Size objc, Tcl_Obj *const objv[]); static Tcl_FreeProc DestroyFrame; static void DestroyFramePartly(Frame *framePtr); static void DisplayFrame(void *clientData); static void DrawFrameBackground(Tk_Window tkwin, Pixmap pixmap, int highlightWidth, int borderWidth, Tk_Image bgimg, int bgtile); static void FrameBgImageProc(void *clientData, | > > > | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | /* * Forward declarations for functions defined later in this file: */ static void ComputeFrameGeometry(Frame *framePtr); static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, Tcl_Size objc, Tcl_Obj *const objv[]); static int CreateFrame(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], enum FrameType type, const char *appName); static Tcl_FreeProc DestroyFrame; static void DestroyFramePartly(Frame *framePtr); static void DisplayFrame(void *clientData); static void DrawFrameBackground(Tk_Window tkwin, Pixmap pixmap, int highlightWidth, int borderWidth, Tk_Image bgimg, int bgtile); static void FrameBgImageProc(void *clientData, |
︙ | ︙ | |||
396 397 398 399 400 401 402 | int Tk_FrameObjCmd( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | int Tk_FrameObjCmd( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL); } int Tk_ToplevelObjCmd( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL); } int Tk_LabelframeObjCmd( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL); } /* *-------------------------------------------------------------- * * TkCreateFrame -- * * This function is the old command function for the "frame" and * "toplevel" commands. Now it is used directly by Tk_Init to create a * new main window. See the user documentation for the "frame" and * "toplevel" commands for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *-------------------------------------------------------------- */ int TkCreateFrame( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ Tcl_Size argc, /* Number of arguments. */ const char *const *argv, /* Argument strings. */ int toplevel, /* Non-zero means create a toplevel window, * zero means create a frame. */ const char *appName) /* Should only be non-NULL if there is no main * window associated with the interpreter. * Gives the base name to use for the new * application. */ { int result; Tcl_Size i; Tcl_Obj **objv = (Tcl_Obj **)ckalloc((argc+1) * sizeof(Tcl_Obj **)); for (i=0; i<argc; i++) { objv[i] = Tcl_NewStringObj(argv[i], TCL_INDEX_NONE); Tcl_IncrRefCount(objv[i]); } objv[argc] = NULL; result = CreateFrame(clientData, interp, argc, objv, toplevel ? TYPE_TOPLEVEL : TYPE_FRAME, appName); for (i=0; i<argc; i++) { Tcl_DecrRefCount(objv[i]); } ckfree(objv); return result; } int TkListCreateFrame( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *listObj, /* List of arguments. */ int toplevel, /* Non-zero means create a toplevel window, * zero means create a frame. */ Tcl_Obj *nameObj) /* Should only be non-NULL if there is no main * window associated with the interpreter. * Gives the base name to use for the new * application. */ { Tcl_Size objc; Tcl_Obj **objv; if (TCL_OK != Tcl_ListObjGetElements(interp, listObj, &objc, &objv)) { return TCL_ERROR; } return CreateFrame(clientData, interp, objc, objv, toplevel ? TYPE_TOPLEVEL : TYPE_FRAME, nameObj ? Tcl_GetString(nameObj) : NULL); } static int CreateFrame( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ enum FrameType type, /* What widget type to create. */ const char *appName) /* Should only be non-NULL if there are no * Main window associated with the * interpreter. Gives the base name to use for * the new application. */ { Tk_Window tkwin; Frame *framePtr; |
︙ | ︙ | |||
1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 | #ifndef TK_NO_DOUBLE_BUFFERING /* * In order to avoid screen flashes, this function redraws the frame into * off-screen memory, then copies it back on-screen in a single operation. * This means there's no point in time where the on-screen image has been * cleared. */ pixmap = Tk_GetPixmap(framePtr->display, Tk_WindowId(tkwin), | > > > > | | 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 | #ifndef TK_NO_DOUBLE_BUFFERING /* * In order to avoid screen flashes, this function redraws the frame into * off-screen memory, then copies it back on-screen in a single operation. * This means there's no point in time where the on-screen image has been * cleared. * Also, ensure that the pixmap size is at least 1x1 pixels to prevent * crashes, see [610aa08858]. */ pixmap = Tk_GetPixmap(framePtr->display, Tk_WindowId(tkwin), (Tk_Width(tkwin) > 0 ? Tk_Width(tkwin) : 1), (Tk_Height(tkwin) > 0 ? Tk_Height(tkwin) : 1), Tk_Depth(tkwin)); #else pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ if (framePtr->type != TYPE_LABELFRAME) { /* * Pass to platform specific draw function. In general, it just draws |
︙ | ︙ |
Changes to generic/tkIcu.c.
︙ | ︙ | |||
88 89 90 91 92 93 94 | locale = NULL; } } Tcl_DStringInit(&ds); str = Tcl_GetStringFromObj(objv[1], &len); Tcl_UtfToChar16DString(str, len, &ds); len = Tcl_DStringLength(&ds)/2; | | | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | locale = NULL; } } Tcl_DStringInit(&ds); str = Tcl_GetStringFromObj(objv[1], &len); Tcl_UtfToChar16DString(str, len, &ds); len = Tcl_DStringLength(&ds)/2; Tcl_Size ulen = TkGetCharLength(objv[1]); if (TkGetIntForIndex(objv[2], ulen-1, 0, &idx) != TCL_OK) { Tcl_DStringFree(&ds); Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "ICU", "INDEX", (char *)NULL); return TCL_ERROR; } it = icu_open((UBreakIteratorTypex)(flags&3), locale, |
︙ | ︙ |
Changes to generic/tkImage.c.
︙ | ︙ | |||
127 128 129 130 131 132 133 | ckfree(freePtr); } } /* *---------------------------------------------------------------------- * | | > > > > > > > > > > > > > > > > > > > > > | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | ckfree(freePtr); } } /* *---------------------------------------------------------------------- * * Tk_CreateOldImageType, Tk_CreateImageType -- * * This function is invoked by an image manager to tell Tk about a new * kind of image and the functions that manage the new type. The function * is typically invoked during Tcl_AppInit. * * Results: * None. * * Side effects: * The new image type is entered into a table used in the "image create" * command. * *---------------------------------------------------------------------- */ void Tk_CreateOldImageType( const Tk_ImageType *typePtr) /* Structure describing the type. All of the * fields except "nextPtr" must be filled in * by caller. */ { Tk_ImageType *copyPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { tsdPtr->initialized = 1; Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL); } copyPtr = (Tk_ImageType *)ckalloc(sizeof(Tk_ImageType)); *copyPtr = *typePtr; copyPtr->nextPtr = tsdPtr->oldImageTypeList; tsdPtr->oldImageTypeList = copyPtr; } void Tk_CreateImageType( const Tk_ImageType *typePtr) /* Structure describing the type. All of the * fields except "nextPtr" must be filled in * by caller. */ |
︙ | ︙ |
Changes to generic/tkImgBmap.c.
︙ | ︙ | |||
236 237 238 239 240 241 242 | int flags) /* Flags to pass to Tk_ConfigureWidget, such * as TK_CONFIG_ARGV_ONLY. */ { BitmapInstance *instancePtr; int maskWidth, maskHeight, dummy1, dummy2; if (Tk_ConfigureWidget(modelPtr->interp, Tk_MainWindow(modelPtr->interp), | | | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | int flags) /* Flags to pass to Tk_ConfigureWidget, such * as TK_CONFIG_ARGV_ONLY. */ { BitmapInstance *instancePtr; int maskWidth, maskHeight, dummy1, dummy2; if (Tk_ConfigureWidget(modelPtr->interp, Tk_MainWindow(modelPtr->interp), configSpecs, objc, (const char **) objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } /* * Parse the bitmap and/or mask to create binary data. Make sure that the * bitmap and mask have the same dimensions. */ |
︙ | ︙ | |||
507 508 509 510 511 512 513 | fileName, Tcl_PosixError(interp))); } return NULL; } if (Tcl_SetChannelOption(interp, pi.chan, "-translation", "binary") != TCL_OK) { | < < < < | 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | fileName, Tcl_PosixError(interp))); } return NULL; } if (Tcl_SetChannelOption(interp, pi.chan, "-translation", "binary") != TCL_OK) { return NULL; } } else { pi.chan = NULL; } /* |
︙ | ︙ |
Changes to generic/tkImgGIF.c.
︙ | ︙ | |||
494 495 496 497 498 499 500 | } /* * Get the general colormap information. */ if (Fread(gifConfPtr, buf, 1, 3, chan) != 3) { | > > > > > > | | 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | } /* * Get the general colormap information. */ if (Fread(gifConfPtr, buf, 1, 3, chan) != 3) { /* * Bug [865af0148c]: 3 bytes should be there, but data ended before */ Tcl_SetObjResult(interp, Tcl_NewStringObj( "GIF file truncated", -1)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "TRUNCATED", NULL); return TCL_ERROR; } bitPixel = 2 << (buf[0] & 0x07); if (BitSet(buf[0], LOCALCOLORMAP)) { /* Global Colormap */ if (!ReadColorMap(gifConfPtr, chan, bitPixel, colorMap)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "error reading color map", TCL_INDEX_NONE)); |
︙ | ︙ | |||
700 701 702 703 704 705 706 707 708 709 710 711 712 713 | srcY = 0; } if (height > imageHeight) { height = imageHeight; } if ((width > 0) && (height > 0)) { Tk_PhotoImageBlock block; int transparent = -1; if (gifGraphicControlExtensionBlock.blockPresent) { transparent = gifGraphicControlExtensionBlock.transparent; } /* * Read the data and put it into the photo buffer for display by the | > | 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | srcY = 0; } if (height > imageHeight) { height = imageHeight; } if ((width > 0) && (height > 0)) { unsigned char* pixelPtr; Tk_PhotoImageBlock block; int transparent = -1; if (gifGraphicControlExtensionBlock.blockPresent) { transparent = gifGraphicControlExtensionBlock.transparent; } /* * Read the data and put it into the photo buffer for display by the |
︙ | ︙ | |||
725 726 727 728 729 730 731 | goto error; } block.pitch = block.pixelSize * imageWidth; if (imageHeight > (int)(UINT_MAX/block.pitch)) { goto error; } nBytes = block.pitch * imageHeight; | | | | > | > | | | 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | goto error; } block.pitch = block.pixelSize * imageWidth; if (imageHeight > (int)(UINT_MAX/block.pitch)) { goto error; } nBytes = block.pitch * imageHeight; pixelPtr = (unsigned char*)ckalloc(nBytes); if (pixelPtr) { memset(pixelPtr, 0, nBytes); } block.pixelPtr = pixelPtr; if (ReadImage(gifConfPtr, interp, block.pixelPtr, chan, imageWidth, imageHeight, colorMap, srcX, srcY, BitSet(buf[8], INTERLACE), transparent) != TCL_OK) { ckfree(pixelPtr); goto error; } block.pixelPtr += srcX * block.pixelSize + srcY * block.pitch; if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET) != TCL_OK) { ckfree(pixelPtr); goto error; } ckfree(pixelPtr); } /* * Update the metadata dictionary with current image data */ if (NULL != metadataOutObj) { |
︙ | ︙ | |||
1915 1916 1917 1918 1919 1920 1921 | Tcl_Channel chan = NULL; int result; chan = Tcl_OpenFileChannel(interp, (char *) filename, "w", 0644); if (!chan) { return TCL_ERROR; } | | | | 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 | Tcl_Channel chan = NULL; int result; chan = Tcl_OpenFileChannel(interp, (char *) filename, "w", 0644); if (!chan) { return TCL_ERROR; } if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) { Tcl_Close(NULL, chan); return TCL_ERROR; } result = CommonWriteGIF(interp, chan, WriteToChannel, format, metadataInObj, blockPtr); |
︙ | ︙ |
Changes to generic/tkImgPNG.c.
︙ | ︙ | |||
201 202 203 204 205 206 207 | static int CheckColor(Tcl_Interp *interp, PNGImage *pngPtr); static inline int CheckCRC(Tcl_Interp *interp, PNGImage *pngPtr, unsigned long calculated); static void CleanupPNGImage(PNGImage *pngPtr); static int DecodeLine(Tcl_Interp *interp, PNGImage *pngPtr); static int DecodePNG(Tcl_Interp *interp, PNGImage *pngPtr, Tcl_Obj *fmtObj, Tk_PhotoHandle imageHandle, | | > | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | static int CheckColor(Tcl_Interp *interp, PNGImage *pngPtr); static inline int CheckCRC(Tcl_Interp *interp, PNGImage *pngPtr, unsigned long calculated); static void CleanupPNGImage(PNGImage *pngPtr); static int DecodeLine(Tcl_Interp *interp, PNGImage *pngPtr); static int DecodePNG(Tcl_Interp *interp, PNGImage *pngPtr, Tcl_Obj *fmtObj, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); static int EncodePNG(Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, PNGImage *pngPtr, Tcl_Obj *metadataInObj); static int FileMatchPNG(Tcl_Interp *interp, Tcl_Channel chan, const char *fileName, Tcl_Obj *fmtObj, Tcl_Obj *metadataInObj, int *widthPtr, int *heightPtr, Tcl_Obj *metadataOut); |
︙ | ︙ | |||
2472 2473 2474 2475 2476 2477 2478 | * dimensions and contents may change. * *---------------------------------------------------------------------- */ static int DecodePNG( | | | | | | > > > > | > | 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 | * dimensions and contents may change. * *---------------------------------------------------------------------- */ static int DecodePNG( Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ PNGImage *pngPtr, /* PNG image information record. */ Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo * image to be written to. */ int width, int height, /* Dimensions of block of photo image to be * written to. */ int srcX, int srcY) /* Coordinates of top-left pixel to be used in * image being read. */ { unsigned long chunkType; int result; Tcl_Size chunkSz; unsigned long crc; /* * Parse the PNG signature and IHDR (header) chunk. */ |
︙ | ︙ | |||
2627 2628 2629 2630 2631 2632 2633 | /* * Expand the photo size (if not set by the user) to provide enough space * for the image being parsed. It does not matter if width or height wrap * to negative here: Tk will not shrink the image. */ | | | | 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 | /* * Expand the photo size (if not set by the user) to provide enough space * for the image being parsed. It does not matter if width or height wrap * to negative here: Tk will not shrink the image. */ if (Tk_PhotoExpand(interp, imageHandle, destX + width, destY + height) == TCL_ERROR) { return TCL_ERROR; } /* * A scan line consists of one byte for a filter type, plus the number of * bits per color sample times the number of color samples per pixel. */ |
︙ | ︙ | |||
2782 2783 2784 2785 2786 2787 2788 | ApplyAlpha(pngPtr); /* * Copy the decoded image block into the Tk photo image. */ | > | < | | | < | | 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 | ApplyAlpha(pngPtr); /* * Copy the decoded image block into the Tk photo image. */ pngPtr->block.pixelPtr += srcX * pngPtr->block.pixelSize + srcY * pngPtr->block.pitch; result = Tk_PhotoPutBlock(interp, imageHandle, &pngPtr->block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET); pngPtr->block.pixelPtr -= srcX * pngPtr->block.pixelSize + srcY * pngPtr->block.pitch; return result; } /* *---------------------------------------------------------------------- * * FileMatchPNG -- * |
︙ | ︙ | |||
2858 2859 2860 2861 2862 2863 2864 | * image given by imageHandle. * *---------------------------------------------------------------------- */ static int FileReadPNG( | | | | | < | < | | | 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 | * image given by imageHandle. * *---------------------------------------------------------------------- */ static int FileReadPNG( Tcl_Interp* interp, /* Interpreter to use for reporting errors. */ Tcl_Channel chan, /* The image file, open for reading. */ TCL_UNUSED(const char*), /* The name of the image file. */ Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ TCL_UNUSED(Tcl_Obj*), /* metadata input, may be NULL */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo * image to be written to. */ int width, int height, /* Dimensions of block of photo image to be * written to. */ int srcX, int srcY, /* Coordinates of top-left pixel to be used in * image being read. */ Tcl_Obj* metadataOutObj) /* metadata return dict, may be NULL */ { PNGImage png; int result = TCL_ERROR; result = InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE); if (TCL_OK == result) { result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY, width, height, srcX, srcY); } if (TCL_OK == result && metadataOutObj != NULL && png.DPI != -1) { result = Tcl_DictObjPut(NULL, metadataOutObj, Tcl_NewStringObj("DPI",-1), Tcl_NewDoubleObj(png.DPI)); } |
︙ | ︙ | |||
2964 2965 2966 2967 2968 2969 2970 | * New data is added to the image given by imageHandle. * *---------------------------------------------------------------------- */ static int StringReadPNG( | | | | | | | | | | > | | | 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 | * New data is added to the image given by imageHandle. * *---------------------------------------------------------------------- */ static int StringReadPNG( Tcl_Interp* interp, /* Interpreter to use for reporting errors. */ Tcl_Obj *pObjData, Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ TCL_UNUSED(Tcl_Obj*), /* metadata input, may be NULL */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo * image to be written to. */ int width, int height, /* Dimensions of block of photo image to be * written to. */ int srcX, int srcY, /* Coordinates of top-left pixel to be used in * image being read. */ Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ { PNGImage png; int result = TCL_ERROR; result = InitPNGImage(interp, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE); if (TCL_OK == result) { result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY, width, height, srcX, srcY); } if (TCL_OK == result && metadataOutObj != NULL && png.DPI != -1) { result = Tcl_DictObjPut(NULL, metadataOutObj, Tcl_NewStringObj("DPI",-1), Tcl_NewDoubleObj(png.DPI)); } |
︙ | ︙ | |||
3757 3758 3759 3760 3761 3762 3763 | */ if (InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_DEFLATE) == TCL_ERROR) { goto cleanup; } | < < < < < | | | 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 | */ if (InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_DEFLATE) == TCL_ERROR) { goto cleanup; } if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) { goto cleanup; } /* * Write the raw PNG data out to the file. */ |
︙ | ︙ |
Changes to generic/tkImgPPM.c.
︙ | ︙ | |||
298 299 300 301 302 303 304 | chan = Tcl_OpenFileChannel(interp, fileName, "w", 0666); if (chan == NULL) { return TCL_ERROR; } if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) { | < < < < < | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | chan = Tcl_OpenFileChannel(interp, fileName, "w", 0666); if (chan == NULL) { return TCL_ERROR; } if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) { Tcl_Close(NULL, chan); return TCL_ERROR; } snprintf(header, sizeof(header), "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); Tcl_Write(chan, header, TCL_INDEX_NONE); |
︙ | ︙ |
Changes to generic/tkImgPhoto.c.
︙ | ︙ | |||
135 136 137 138 139 140 141 142 143 144 145 146 147 148 | NULL }; typedef struct { Tk_PhotoImageFormat *formatList; /* Pointer to the first in the list of known * photo image formats.*/ Tk_PhotoImageFormatVersion3 *formatListVersion3; /* Pointer to the first in the list of known * photo image formats in Version3 format.*/ int initialized; /* Set to 1 if we've initialized the * structure. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; | > > > > > | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | NULL }; typedef struct { Tk_PhotoImageFormat *formatList; /* Pointer to the first in the list of known * photo image formats.*/ #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 Tk_PhotoImageFormat *oldFormatList; /* Pointer to the first in the list of known * photo image formats.*/ #endif Tk_PhotoImageFormatVersion3 *formatListVersion3; /* Pointer to the first in the list of known * photo image formats in Version3 format.*/ int initialized; /* Set to 1 if we've initialized the * structure. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; |
︙ | ︙ | |||
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | TCL_UNUSED(void *)) /* not used */ { Tk_PhotoImageFormat *freePtr; Tk_PhotoImageFormatVersion3 *freePtrVersion3; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); while (tsdPtr->formatList != NULL) { freePtr = tsdPtr->formatList; tsdPtr->formatList = tsdPtr->formatList->nextPtr; ckfree((void *)freePtr->name); ckfree(freePtr); } while (tsdPtr->formatListVersion3 != NULL) { freePtrVersion3 = tsdPtr->formatListVersion3; tsdPtr->formatListVersion3 = tsdPtr->formatListVersion3->nextPtr; ckfree((void *)freePtrVersion3->name); ckfree(freePtrVersion3); } } /* *---------------------------------------------------------------------- * | > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | TCL_UNUSED(void *)) /* not used */ { Tk_PhotoImageFormat *freePtr; Tk_PhotoImageFormatVersion3 *freePtrVersion3; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 while (tsdPtr->oldFormatList != NULL) { freePtr = tsdPtr->oldFormatList; tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr; ckfree(freePtr); } #endif while (tsdPtr->formatList != NULL) { freePtr = tsdPtr->formatList; tsdPtr->formatList = tsdPtr->formatList->nextPtr; ckfree((void *)freePtr->name); ckfree(freePtr); } while (tsdPtr->formatListVersion3 != NULL) { freePtrVersion3 = tsdPtr->formatListVersion3; tsdPtr->formatListVersion3 = tsdPtr->formatListVersion3->nextPtr; ckfree((void *)freePtrVersion3->name); ckfree(freePtrVersion3); } } /* *---------------------------------------------------------------------- * * Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat, * Tk_CreatePhotoImageFormatVersion3 -- * * This function is invoked by an image file handler to register a new * photo image format and the functions that handle the new format. The * function is typically invoked during Tcl_AppInit. * * Results: * None. * * Side effects: * The new image file format is entered into a table used in the photo * image "read" and "write" subcommands. * *---------------------------------------------------------------------- */ #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 void Tk_CreateOldPhotoImageFormat( const Tk_PhotoImageFormat *formatPtr) /* Structure describing the format. All of the * fields except "nextPtr" must be filled in * by caller. */ { Tk_PhotoImageFormat *copyPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { tsdPtr->initialized = 1; Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL); } copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat)); *copyPtr = *formatPtr; copyPtr->nextPtr = tsdPtr->oldFormatList; tsdPtr->oldFormatList = copyPtr; } #endif void Tk_CreatePhotoImageFormat( const Tk_PhotoImageFormat *formatPtr) /* Structure describing the format. All of the * fields except "nextPtr" must be filled in * by caller. */ { Tk_PhotoImageFormat *copyPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { tsdPtr->initialized = 1; Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL); } copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat)); *copyPtr = *formatPtr; #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 if (isupper((unsigned char) *formatPtr->name)) { copyPtr->nextPtr = tsdPtr->oldFormatList; tsdPtr->oldFormatList = copyPtr; } else #endif { /* for compatibility with aMSN: make a copy of formatPtr->name */ char *name = (char *)ckalloc(strlen(formatPtr->name) + 1); strcpy(name, formatPtr->name); copyPtr->name = name; copyPtr->nextPtr = tsdPtr->formatList; tsdPtr->formatList = copyPtr; |
︙ | ︙ | |||
616 617 618 619 620 621 622 | "image \"%s\" doesn't exist or is not a photo image", Tcl_GetString(options.name))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO", Tcl_GetString(options.name), (char *)NULL); return TCL_ERROR; } Tk_PhotoGetImage(srcHandle, &block); | | | 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | "image \"%s\" doesn't exist or is not a photo image", Tcl_GetString(options.name))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO", Tcl_GetString(options.name), (char *)NULL); return TCL_ERROR; } Tk_PhotoGetImage(srcHandle, &block); if ((options.fromX > block.width) || (options.fromY > block.height) || (options.fromX2 > block.width) || (options.fromY2 > block.height)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "coordinates for -from option extend outside source image", -1)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_FROM", (char *)NULL); return TCL_ERROR; |
︙ | ︙ | |||
791 792 793 794 795 796 797 798 799 800 801 802 803 804 | matched = 1; if (imageFormat->stringWriteProc != NULL) { stringWriteProc = imageFormat->stringWriteProc; break; } } } if (stringWriteProc == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; imageFormatVersion3 != NULL; imageFormatVersion3 = imageFormatVersion3->nextPtr) { if ((strncasecmp(Tcl_GetString(options.format), imageFormatVersion3->name, | > > > > > > > > > > > > > > > > > | 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 | matched = 1; if (imageFormat->stringWriteProc != NULL) { stringWriteProc = imageFormat->stringWriteProc; break; } } } #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 if (stringWriteProc == NULL) { oldformat = 1; for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL; imageFormat = imageFormat->nextPtr) { if ((strncasecmp(Tcl_GetString(options.format), imageFormat->name, strlen(imageFormat->name)) == 0)) { matched = 1; if (imageFormat->stringWriteProc != NULL) { stringWriteProc = imageFormat->stringWriteProc; break; } } } } #endif if (stringWriteProc == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; imageFormatVersion3 != NULL; imageFormatVersion3 = imageFormatVersion3->nextPtr) { if ((strncasecmp(Tcl_GetString(options.format), imageFormatVersion3->name, |
︙ | ︙ | |||
1046 1047 1048 1049 1050 1051 1052 | chan = Tcl_OpenFileChannel(interp, Tcl_GetString(options.name), "r", 0); if (chan == NULL) { return TCL_ERROR; } if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) { | < < < < < | 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 | chan = Tcl_OpenFileChannel(interp, Tcl_GetString(options.name), "r", 0); if (chan == NULL) { return TCL_ERROR; } if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) { Tcl_Close(NULL, chan); return TCL_ERROR; } if (MatchFileFormat(interp, chan, Tcl_GetString(options.name), options.format, options.metadata, NULL, &imageFormat, |
︙ | ︙ | |||
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 | strlen(imageFormat->name)) == 0)) { matched = 1; if (imageFormat->fileWriteProc != NULL) { break; } } } if (imageFormat == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; imageFormatVersion3 != NULL; imageFormatVersion3 = imageFormatVersion3->nextPtr) { if ((fmtString == NULL) || (strncasecmp(fmtString, imageFormatVersion3->name, | > > > > > > > > > > > > > > > > | 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 | strlen(imageFormat->name)) == 0)) { matched = 1; if (imageFormat->fileWriteProc != NULL) { break; } } } #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 if (imageFormat == NULL) { oldformat = 1; for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL; imageFormat = imageFormat->nextPtr) { if ((fmtString == NULL) || (strncasecmp(fmtString, imageFormat->name, strlen(imageFormat->name)) == 0)) { matched = 1; if (imageFormat->fileWriteProc != NULL) { break; } } } } #endif if (imageFormat == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; imageFormatVersion3 != NULL; imageFormatVersion3 = imageFormatVersion3->nextPtr) { if ((fmtString == NULL) || (strncasecmp(fmtString, imageFormatVersion3->name, |
︙ | ︙ | |||
1969 1970 1971 1972 1973 1974 1975 | oldGamma = modelPtr->gamma; /* * Process the configuration options specified. */ if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs, | | | 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 | oldGamma = modelPtr->gamma; /* * Process the configuration options specified. */ if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs, objc, (const char **)objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { goto errorExit; } /* * Regard the empty string for -file, -data, -format or -metadata as the null value. */ |
︙ | ︙ | |||
2088 2089 2090 2091 2092 2093 2094 | /* * Flag that we want the metadata result dict */ metadataOutObj = Tcl_NewDictObj(); Tcl_IncrRefCount(metadataOutObj); | < < < < | | | 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 | /* * Flag that we want the metadata result dict */ metadataOutObj = Tcl_NewDictObj(); Tcl_IncrRefCount(metadataOutObj); if ((Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) || (MatchFileFormat(interp, chan, modelPtr->fileString, modelPtr->format, modelPtr->metadata, metadataOutObj, &imageFormat, &imageFormatVersion3, &imageWidth, &imageHeight, &oldformat) != TCL_OK)) { Tcl_Close(NULL, chan); goto errorExit; } |
︙ | ︙ | |||
2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 | if (*heightPtr < 1) { *heightPtr = 1; } break; } } } /* * For old and not version 3 format, exit now with success */ if (formatPtr != NULL) { *imageFormatPtr = formatPtr; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 | if (*heightPtr < 1) { *heightPtr = 1; } break; } } } #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 if (formatPtr == NULL) { useoldformat = 1; for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL; formatPtr = formatPtr->nextPtr) { if (formatString != NULL) { if (strncasecmp(formatString, formatPtr->name, strlen(formatPtr->name)) != 0) { continue; } matched = 1; if (formatPtr->fileMatchProc == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "-file option isn't supported for %s images", formatString)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "NOT_FILE_FORMAT", (char *)NULL); return TCL_ERROR; } } if (formatPtr->fileMatchProc != NULL) { (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET); if (formatPtr->fileMatchProc(chan, fileName, (Tcl_Obj *) formatString, widthPtr, heightPtr, interp)) { if (*widthPtr < 1) { *widthPtr = 1; } if (*heightPtr < 1) { *heightPtr = 1; } break; } } } } #endif /* * For old and not version 3 format, exit now with success */ if (formatPtr != NULL) { *imageFormatPtr = formatPtr; |
︙ | ︙ | |||
2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 | if ((formatPtr->stringMatchProc != NULL) && (formatPtr->stringReadProc != NULL) && formatPtr->stringMatchProc(data, formatObj, widthPtr, heightPtr, interp)) { break; } } if (formatPtr == NULL) { useoldformat = 0; for (formatVersion3Ptr = tsdPtr->formatListVersion3; formatVersion3Ptr != NULL; formatVersion3Ptr = formatVersion3Ptr->nextPtr) { if (formatObj != NULL) { | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 | if ((formatPtr->stringMatchProc != NULL) && (formatPtr->stringReadProc != NULL) && formatPtr->stringMatchProc(data, formatObj, widthPtr, heightPtr, interp)) { break; } } #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 if (formatPtr == NULL) { useoldformat = 1; for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL; formatPtr = formatPtr->nextPtr) { if (formatObj != NULL) { if (strncasecmp(formatString, formatPtr->name, strlen(formatPtr->name)) != 0) { continue; } matched = 1; if (formatPtr->stringMatchProc == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "-data option isn't supported for %s images", formatString)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "NOT_DATA_FORMAT", (char *)NULL); return TCL_ERROR; } } if ((formatPtr->stringMatchProc != NULL) && (formatPtr->stringReadProc != NULL) && formatPtr->stringMatchProc( (Tcl_Obj *) Tcl_GetString(data), (Tcl_Obj *) formatString, widthPtr, heightPtr, interp)) { break; } } } #endif if (formatPtr == NULL) { useoldformat = 0; for (formatVersion3Ptr = tsdPtr->formatListVersion3; formatVersion3Ptr != NULL; formatVersion3Ptr = formatVersion3Ptr->nextPtr) { if (formatObj != NULL) { |
︙ | ︙ | |||
4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 | Tk_PhotoGetImage(clientData, &block); block.pixelPtr += y * block.pitch + x * block.pixelSize; return Tk_PostscriptPhoto(interp, &block, psInfo, width, height); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 | Tk_PhotoGetImage(clientData, &block); block.pixelPtr += y * block.pitch + x * block.pixelSize; return Tk_PostscriptPhoto(interp, &block, psInfo, width, height); } /* *---------------------------------------------------------------------- * * Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite -- * * These backward-compatibility functions just exist to fill slots in stubs * table. For the behaviour of *_NoComposite, refer to the corresponding * function without the extra suffix, except that the compositing rule is * always "overlay" and the function always panics on memory-allocation * failure. * *---------------------------------------------------------------------- */ #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 void Tk_PhotoPutBlock_NoComposite( Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height) { if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height, TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) { Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); } } void Tk_PhotoPutZoomedBlock_NoComposite( Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY) { if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height, zoomX, zoomY, subsampleX, subsampleY, TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) { Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); } } /* *---------------------------------------------------------------------- * * Tk_PhotoExpand_Panic, Tk_PhotoPutBlock_Panic, * Tk_PhotoPutZoomedBlock_Panic, Tk_PhotoSetSize_Panic * * Backward compatibility functions for preserving the old behaviour (i.e. * panic on memory allocation failure) so that extensions do not need to be * significantly updated to take account of TIP #116. These call the new * interface (i.e. the interface without the extra suffix), but panic if an * error condition is returned. * *---------------------------------------------------------------------- */ void Tk_PhotoExpand_Panic( Tk_PhotoHandle handle, int width, int height) { if (Tk_PhotoExpand(NULL, handle, width, height) != TCL_OK) { Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); } } void Tk_PhotoPutBlock_Panic( Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule) { if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height, compRule) != TCL_OK) { Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); } } void Tk_PhotoPutZoomedBlock_Panic( Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule) { if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height, zoomX, zoomY, subsampleX, subsampleY, compRule) != TCL_OK) { Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); } } void Tk_PhotoSetSize_Panic( Tk_PhotoHandle handle, int width, int height) { if (Tk_PhotoSetSize(NULL, handle, width, height) != TCL_OK) { Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); } } #endif /* TK_NO_DEPRECATED */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ |
Changes to generic/tkInt.decls.
︙ | ︙ | |||
64 65 66 67 68 69 70 | declare 12 { TkCursor *TkCreateCursorFromData(Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg) } declare 13 { int TkCreateFrame(void *clientData, Tcl_Interp *interp, | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | declare 12 { TkCursor *TkCreateCursorFromData(Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg) } declare 13 { int TkCreateFrame(void *clientData, Tcl_Interp *interp, Tcl_Size argc, const char *const *argv, int toplevel, const char *appName) } declare 14 { Tk_Window TkCreateMainWindow(Tcl_Interp *interp, const char *screenName, const char *baseName) } declare 15 { Time TkCurrentTime(TkDisplay *dispPtr) |
︙ | ︙ | |||
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | } declare 58 { void TkpDisplayWarning(const char *msg, const char *title) } declare 59 { void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name) } declare 61 { TkWindow *TkpGetWrapperWindow(TkWindow *winPtr) } declare 62 { int TkpInit(Tcl_Interp *interp) } declare 63 { void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable) } declare 65 { void TkpMakeMenuWindow(Tk_Window tkwin, int transient) } declare 67 { void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName) } declare 68 { TkDisplay *TkpOpenDisplay(const char *display_name) } declare 69 { | > > > > > > > > > | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | } declare 58 { void TkpDisplayWarning(const char *msg, const char *title) } declare 59 { void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name) } declare 60 {deprecated {renamed to Tk_GetOtherWindow}} { TkWindow *TkpGetOtherWindow(TkWindow *winPtr) } declare 61 { TkWindow *TkpGetWrapperWindow(TkWindow *winPtr) } declare 62 { int TkpInit(Tcl_Interp *interp) } declare 63 { void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable) } declare 64 {deprecated {renamed to Tk_MakeContainer}} { void TkpMakeContainer(Tk_Window tkwin) } declare 65 { void TkpMakeMenuWindow(Tk_Window tkwin, int transient) } declare 66 {deprecated {renamed to Tk_MakeWindow}} { Window TkpMakeWindow(TkWindow *winPtr, Window parent) } declare 67 { void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName) } declare 68 { TkDisplay *TkpOpenDisplay(const char *display_name) } declare 69 { |
︙ | ︙ | |||
256 257 258 259 260 261 262 263 264 265 266 267 268 269 | } declare 72 { int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr) } declare 73 { void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr) } declare 77 { void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } declare 78 { int TkReadBitmapFile(Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return) | > > > > > > > > > | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | } declare 72 { int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr) } declare 73 { void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr) } declare 74 {deprecated {renamed to Tk_SetMainMenubar}} { void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName) } declare 75 {deprecated {renamed to Tk_UseWindow}} { int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) } # # Slot 76 unused (WAS: TkpWindowWasRecentlyDeleted) # declare 77 { void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } declare 78 { int TkReadBitmapFile(Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return) |
︙ | ︙ | |||
280 281 282 283 284 285 286 287 288 289 290 291 292 293 | } declare 82 { void TkSelInit(Tk_Window tkwin) } declare 83 { void TkSelPropProc(XEvent *eventPtr) } declare 86 { KeySym TkStringToKeysym(const char *name) } declare 87 { int TkThickPolyLineToArea(double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr) } | > > > > > > > > > > | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | } declare 82 { void TkSelInit(Tk_Window tkwin) } declare 83 { void TkSelPropProc(XEvent *eventPtr) } # Exported publically as Tk_SetClassProcs in 8.4a2 #declare 84 { # void TkSetClassProcs(Tk_Window tkwin, # TkClassProcs *procs, void *instanceData) #} declare 85 {deprecated {renamed to Tk_SetWindowMenubar}} { void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName) } declare 86 { KeySym TkStringToKeysym(const char *name) } declare 87 { int TkThickPolyLineToArea(double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr) } |
︙ | ︙ | |||
362 363 364 365 366 367 368 369 370 371 372 373 374 375 | } declare 109 { const char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr) } declare 110 { void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont) } declare 112 { void TkpMenuThreadInit(void) } declare 113 { int XClipBox(Region rgn, XRectangle *rect_return) } declare 114 { | > > > > | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | } declare 109 { const char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr) } declare 110 { void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont) } declare 111 {deprecated {renamed to Tk_GetSystemDefault}} { Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin, const char *dbName, const char *className) } declare 112 { void TkpMenuThreadInit(void) } declare 113 { int XClipBox(Region rgn, XRectangle *rect_return) } declare 114 { |
︙ | ︙ | |||
388 389 390 391 392 393 394 | declare 118 { int XSetRegion(Display *display, GC gc, Region rgn) } declare 119 { int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return) } | | | | > > > > | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | declare 118 { int XSetRegion(Display *display, GC gc, Region rgn) } declare 119 { int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return) } declare 121 aqua { Pixmap TkpCreateNativeBitmap(Display *display, const void *source) } declare 122 aqua { void TkpDefineNativeBitmaps(void) } declare 124 aqua { Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height) } declare 135 {deprecated {renamed to Tk_DrawHighlightBorder}} { void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable) } declare 136 { void TkSetFocusWin(TkWindow *winPtr, int force) } declare 137 { void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym, XEvent *eventPtr) |
︙ | ︙ | |||
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | declare 0 x11 { void TkCreateXEventSource(void) } declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 6 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 9 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } # only needed by tktest: declare 38 x11 { | > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 | declare 0 x11 { void TkCreateXEventSource(void) } declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 3 x11 { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } declare 4 x11 { void TkpSync(Display *display) } declare 5 x11 { Window TkUnixContainerId(TkWindow *winPtr) } declare 6 x11 { int TkUnixDoOneXEvent(Tcl_Time *timePtr) } declare 7 x11 { void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) } declare 8 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 9 x11 { void TkWmCleanup(TkDisplay *dispPtr) } declare 10 x11 { void TkSendCleanup(TkDisplay *dispPtr) } declare 12 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } # only needed by tktest: declare 13 x11 { int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) } declare 38 x11 { int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap) } declare 39 x11 { void TkpSync_(Display *display) } declare 40 x11 { Window TkUnixContainerId_(TkWindow *winPtr) } declare 41 x11 { int TkUnixDoOneXEvent_(Tcl_Time *timePtr) } declare 42 x11 { void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar) } declare 43 x11 { void TkWmCleanup_(TkDisplay *dispPtr) } declare 44 x11 { void TkSendCleanup_(TkDisplay *dispPtr) } # only needed by tktest: declare 45 x11 { int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) } ################################ # Windows specific functions declare 0 win { char *TkAlignImageData(XImage *image, int alignment, int bitOrder) } declare 2 win { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 3 win { unsigned long TkpGetMS(void) } |
︙ | ︙ | |||
767 768 769 770 771 772 773 | void TkWinDialogDebug(int debug) } declare 32 win { Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className) } declare 33 win { | | > > > > | 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | void TkWinDialogDebug(int debug) } declare 32 win { Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className) } declare 33 win { int TkWinGetPlatformId(void) } # new for 8.4.1 declare 34 win { void TkWinSetHINSTANCE(HINSTANCE hInstance) } declare 35 win { int TkWinGetPlatformTheme(void) } # Exported through stub table since Tk 8.4.20/8.5.9 declare 36 win { LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } # new for 8.4.20+/8.5.12+, Cygwin only declare 37 win { void TkCreateXEventSource(void) } declare 38 win { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } declare 39 win { void TkpSync(Display *display) } declare 40 win { |
︙ | ︙ | |||
819 820 821 822 823 824 825 | declare 47 win { Tk_Window TkpGetCapture(void) } ################################ # Aqua specific functions | | | | | | | | > | | < > > > > > > > > > > > > > > > > > > > > > > > > > | 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 | declare 47 win { Tk_Window TkpGetCapture(void) } ################################ # Aqua specific functions declare 0 aqua { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 2 aqua { void TkGenerateActivateEvents_(TkWindow *winPtr, int active) } declare 3 aqua { void TkPointerDeadWindow(TkWindow *winPtr) } declare 4 aqua { void TkpSetCapture(TkWindow *winPtr) } declare 5 aqua { void TkpSetCursor(TkpCursor cursor) } declare 6 aqua { void TkpWmSetState(TkWindow *winPtr, int state) } declare 7 aqua { void TkAboutDlg(void) } declare 8 aqua { unsigned int TkMacOSXButtonKeyState(void) } declare 9 aqua { void TkMacOSXClearMenubarActive(void) } declare 10 aqua { int TkMacOSXDispatchMenuEvent(int menuID, int index) } # Now a static function # declare 11 aqua { # void TkMacOSXInstallCursor(int resizeOverride) # } declare 12 aqua { void TkMacOSXHandleTearoffMenu(void) } declare 14 aqua { int TkMacOSXDoHLEvent(void *theEvent) } declare 16 aqua { Window TkMacOSXGetXWindow(void *macWinPtr) } declare 17 aqua { int TkMacOSXGrowToplevel(void *whichWindow, XPoint start) } declare 18 aqua { void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem, int optionKeyPressed) } # removed duplicates from tkPlat table(tk.decls) #declare 19 aqua { # void TkMacOSXInitAppleEvents(Tcl_Interp *interp) #} # #declare 20 aqua { # void TkMacOSXInitMenus(Tcl_Interp *interp) #} declare 21 aqua { void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag) } declare 22 aqua { int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar) } declare 23 aqua { void TkMacOSXMakeRealWindowExist(TkWindow *winPtr) } declare 24 aqua { void *TkMacOSXMakeStippleMap(Drawable d1, Drawable d2) } declare 25 aqua { void TkMacOSXMenuClick(void) } # The corresponding Unregister was not a stub, and this should be static. #declare 26 aqua { # void TkMacOSXRegisterOffScreenWindow(Window window, void *portPtr) #} declare 27 aqua { int TkMacOSXResizable(TkWindow *winPtr) } declare 28 aqua { void TkMacOSXSetHelpMenuItemCount(void) } declare 29 aqua { void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag) } declare 30 aqua { void TkMacOSXSetUpClippingRgn(Drawable drawable) } declare 31 aqua { void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort) } declare 32 aqua { void TkMacOSXUpdateClipRgn(TkWindow *winPtr) } # This was not implemented. Perhaps meant to be OffScreen ? #declare 33 aqua { # void TkMacOSXUnregisterMacWindow(void *portPtr) #} declare 34 aqua { int TkMacOSXUseMenuID(short macID) } declare 35 aqua { Region TkMacOSXVisableClipRgn(TkWindow *winPtr) } declare 36 aqua { |
︙ | ︙ | |||
947 948 949 950 951 952 953 | } declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } declare 52 aqua { void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) } | | > > > | | < > > > > | 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | } declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } declare 52 aqua { void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) } declare 53 aqua { unsigned long TkpGetMS(void) } # For Canvas3d, requested by Sean Woods declare 54 aqua { void *TkMacOSXDrawable(Drawable drawable) } declare 55 aqua { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } ############################################################################## # Define the platform specific internal Xlib interfaces. These functions are # only available on the designated platform. interface tkIntXlib |
︙ | ︙ | |||
1494 1495 1496 1497 1498 1499 1500 | declare 5 macosx { char *XKeysymToString(KeySym k) } declare 6 macosx { Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } declare 7 macosx { | < < < < < < < < < < < < | | | | | < < < < < < < < < | | | | < < < | | | | | | | < < < | | | | | | | < < < | < < < | | | < < < | < < < | | | < < < < | | | < < < < < < < < < | < < < < | | | | | < < < | | | | | | | | | < < < < | | < < < | < < < < < < < < < < | < < < < | | | | | | | | | | | | | | | | | | | | | | > > > > > > > | > > > > | > > | | | > > > > > > > > > > > > > > > > | > > | > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > < < < < < < < < < < < < < < < < > > > > > > > > > > > > | 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 | declare 5 macosx { char *XKeysymToString(KeySym k) } declare 6 macosx { Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } declare 7 macosx { GContext XGContextFromGC(GC g) } # second parameter was of type KeyCode declare 8 macosx { KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) } declare 9 macosx { KeySym XStringToKeysym(_Xconst char *c) } declare 10 macosx { Window XRootWindow(Display *d, int i) } declare 11 macosx { XErrorHandler XSetErrorHandler(XErrorHandler x) } declare 12 macosx { Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 13 macosx { int XBell(Display *d, int i) } declare 14 macosx { int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } declare 15 macosx { int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } declare 16 macosx { int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } declare 17 macosx { int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 18 macosx { int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul) } declare 19 macosx { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } declare 20 macosx { int XDefineCursor(Display *d, Window w, Cursor c) } declare 21 macosx { int XDestroyWindow(Display *d, Window w) } declare 22 macosx { int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 23 macosx { int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 24 macosx { int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 25 macosx { int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 26 macosx { int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } declare 27 macosx { int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 28 macosx { int XFreeColormap(Display *d, Colormap c) } declare 29 macosx { int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } declare 30 macosx { int XFreeModifiermap(XModifierKeymap *x) } declare 31 macosx { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4) } declare 32 macosx { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp) } declare 33 macosx { int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } declare 34 macosx { int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } declare 35 macosx { KeyCode XKeysymToKeycode(Display *d, KeySym k) } declare 36 macosx { int XMapWindow(Display *d, Window w) } declare 37 macosx { int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 38 macosx { int XMoveWindow(Display *d, Window w, int i1, int i2) } declare 39 macosx { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } declare 40 macosx { int XRaiseWindow(Display *d, Window w) } declare 41 macosx { int XRefreshKeyboardMapping(XMappingEvent *x) } declare 42 macosx { int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } declare 43 macosx { int XSelectInput(Display *d, Window w, long l) } declare 44 macosx { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } declare 45 macosx { int XSetIconName(Display *d, Window w, _Xconst char *c) } declare 46 macosx { int XSetInputFocus(Display *d, Window w, int i, Time t) } declare 47 macosx { int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } declare 48 macosx { int XSetWindowBackground(Display *d, Window w, unsigned long ul) } declare 49 macosx { int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } declare 50 macosx { int XSetWindowBorder(Display *d, Window w, unsigned long ul) } declare 51 macosx { int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } declare 52 macosx { int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } declare 53 macosx { int XSetWindowColormap(Display *d, Window w, Colormap c) } declare 54 macosx { int XUngrabKeyboard(Display *d, Time t) } declare 55 macosx { int XUngrabPointer(Display *d, Time t) } declare 56 macosx { int XUnmapWindow(Display *d, Window w) } declare 57 macosx { int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } declare 58 macosx { Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr) } declare 59 macosx { GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values) } declare 60 macosx { int XFreeGC(Display *display, GC gc) } declare 61 macosx { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 62 macosx { int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 63 macosx { int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 64 macosx { int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 65 macosx { int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 66 macosx { int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 67 macosx { int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 68 macosx { int XSetFont(Display *display, GC gc, Font font) } declare 69 macosx { int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 70 macosx { int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 71 macosx { int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 72 macosx { int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 73 macosx { int XSetFunction(Display *display, GC gc, int function) } declare 74 macosx { int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } declare 75 macosx { int _XInitImageFuncPtrs(XImage *image) } declare 76 macosx { XIC XCreateIC(XIM xim, ...) } declare 77 macosx { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return) } declare 78 macosx { void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop) } declare 79 macosx { Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return) } declare 80 macosx { int XDrawSegments(Display *display, Drawable d, GC gc, XSegment *segments, int nsegments) } declare 81 macosx { int XForceScreenSaver(Display *display, int mode) } declare 82 macosx { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 83 macosx { int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 84 macosx { int XClearWindow(Display *d, Window w) } declare 85 macosx { int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y) } declare 86 macosx { int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode) } declare 87 macosx { int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y) } declare 88 macosx { int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out) } declare 89 macosx { int XQueryColors(Display *display, Colormap colormap, XColor *defs_in_out, int ncolors) } declare 90 macosx { Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui) } declare 91 macosx { int XSync(Display *display, Bool discard) } declare 92 macosx { Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3) } declare 93 macosx { int XDeleteProperty(Display *d, Window w, Atom a) } declare 94 macosx { int XFreeCursor(Display *d, Cursor c) } declare 95 macosx { int XGetInputFocus(Display *d, Window *w, int *i) } declare 96 macosx { int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s) } declare 97 macosx { int XNextEvent(Display *d, XEvent *x) } declare 98 macosx { int XPutBackEvent(Display *d, XEvent *x) } declare 99 macosx { int XSetCommand(Display *d, Window w, char **c, int i) } declare 100 macosx { int XWindowEvent(Display *d, Window w, long l, XEvent *x) } declare 101 macosx { Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) } declare 102 macosx { Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) } declare 103 macosx { Status XIconifyWindow(Display *d, Window w, int i) } declare 104 macosx { Status XWithdrawWindow(Display *d, Window w, int i) } declare 105 macosx { XHostAddress *XListHosts(Display *d, int *i, Bool *b) } declare 106 macosx { int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering) } declare 107 macosx { int XFlush(Display *display) } declare 108 macosx { int XGrabServer(Display *display) } declare 109 macosx { int XUngrabServer(Display *display) } declare 110 macosx { int XFree(void *data) } declare 111 macosx { int XNoOp(Display *display) } declare 112 macosx { XAfterFunction XSynchronize(Display *display, Bool onoff) } declare 113 macosx { Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2) } declare 114 macosx { VisualID XVisualIDFromVisual(Visual *visual) } declare 120 macosx { int XOffsetRegion(Region rgn, int dx, int dy) } declare 121 macosx { int XUnionRegion(Region srca, Region srcb, Region dr_return) } declare 122 macosx { Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, Visual *visual, unsigned long value_mask, XSetWindowAttributes *attributes) } declare 129 macosx { int XLowerWindow(Display *d, Window w) } declare 130 macosx { int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } declare 131 macosx { int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } declare 132 macosx { int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) } declare 136 macosx { int XReparentWindow(Display *d, Window w, Window p, int x, int y) } declare 137 macosx { int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h) } declare 138 macosx { Region XPolygonRegion(XPoint *pts, int n, int rule) } declare 139 macosx { int XPointInRegion(Region rgn, int x, int y) } declare 140 macosx { XVaNestedList XVaCreateNestedList(int dummy, ...) } declare 141 macosx { char *XSetICValues(XIC xic, ...) } declare 142 macosx { char *XGetICValues(XIC xic, ...) } declare 143 macosx { void XSetICFocus(XIC xic) } declare 144 macosx { void XDestroyIC(XIC xic) } declare 145 macosx { Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) } declare 146 macosx { Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2) } declare 147 macosx { void XFreeFontSet(Display *display, XFontSet fontset) } declare 148 macosx { int XCloseIM(XIM im) } declare 149 macosx { |
︙ | ︙ |
Changes to generic/tkInt.h.
︙ | ︙ | |||
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | # define TCL_UNUSED(T) T # elif defined(__GNUC__) && (__GNUC__ > 2) # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) # else # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) # endif #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) # define TKFLEXARRAY #elif defined(__GNUC__) && (__GNUC__ > 2) # define TKFLEXARRAY 0 #else # define TKFLEXARRAY 1 #endif /* * Macros used to cast between pointers and integers (e.g. when storing an int * in ClientData), on 64-bit architectures they avoid gcc warning about "cast * to/from pointer from/to integer of different size". */ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | # define TCL_UNUSED(T) T # elif defined(__GNUC__) && (__GNUC__ > 2) # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) # else # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) # endif #endif #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) # define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int, Tcl_DString *))Tcl_UniCharToUtfDString) # define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int, Tcl_DString *))Tcl_UtfToUniCharDString) # define Tcl_Char16ToUtfDString Tcl_UniCharToUtfDString # define Tcl_UtfToChar16DString Tcl_UtfToUniCharDString # define TCL_COMBINE 0 #endif /* Make available UTF-32 versions of the API, even though we compile with TCL_UTF_MAX=3 */ #if TCL_MAJOR_VERSION > 8 # define TkUtfToUniChar (tclStubsPtr->tcl_UtfToUniChar) /* 646 */ # define TkUniCharToUtf (tclStubsPtr->tcl_UniCharToUtf) /* 324 (without TCL_COMBINE) */ # define TkNumUtfChars (tclStubsPtr->tcl_NumUtfChars) /* 669 */ # define TkGetCharLength (tclStubsPtr->tcl_GetCharLength) /* 670 */ # define TkUtfAtIndex (tclStubsPtr->tcl_UtfAtIndex) /* 671 */ #else MODULE_SCOPE Tcl_Size TkUtfToUniChar(const char *, int *); MODULE_SCOPE Tcl_Size TkUniCharToUtf(int, char *); # ifdef USE_TCL_STUBS # define TkNumUtfChars (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ ((Tcl_Size (*)(const char *, Tcl_Size))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[669])) \ : (tclStubsPtr->tcl_NumUtfChars) /* 312 */) # define TkGetCharLength (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ ((Tcl_Size (*)(Tcl_Obj *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[670])) \ : (tclStubsPtr->tcl_GetCharLength) /* 380 */) # define TkUtfAtIndex (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ ((const char *(*)(const char *, Tcl_Size))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[671])) \ : (tclStubsPtr->tcl_UtfAtIndex) /* 325 */) # else # define TkNumUtfChars TclNumUtfChars # define TkGetCharLength TclGetCharLength # define TkUtfAtIndex TclUtfAtIndex # endif #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) # define TKFLEXARRAY #elif defined(__GNUC__) && (__GNUC__ > 2) # define TKFLEXARRAY 0 #else # define TKFLEXARRAY 1 #endif #if !defined(Tcl_GetParent) && (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7) # define Tcl_GetParent Tcl_GetMaster #endif /* * Macros used to cast between pointers and integers (e.g. when storing an int * in ClientData), on 64-bit architectures they avoid gcc warning about "cast * to/from pointer from/to integer of different size". */ |
︙ | ︙ | |||
541 542 543 544 545 546 547 548 549 550 551 552 553 554 | Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */ Tcl_Size refCount; /* Reference count of how many Tk applications * are using this display. Used to clean up * the display when we no longer have any Tk * applications using it. */ Tk_Window warpWindow; Tk_Window warpMainwin; /* For finding the root window for warping * purposes. */ int warpX; int warpY; /* | > > > > > > > > > > > > > > > | 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 | Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */ Tcl_Size refCount; /* Reference count of how many Tk applications * are using this display. Used to clean up * the display when we no longer have any Tk * applications using it. */ /* * The following field were all added for Tk8.3 */ #if TCL_MAJOR_VERSION < 9 #if !defined(TK_NO_DEPRECATED) int mouseButtonState; /* Current mouse button state for this * display. NOT USED as of 8.6.10 */ Window mouseButtonWindow; /* Window the button state was set in, added * in Tk 8.4. */ #else int notused1; XID notused2; #endif /* !TK_NO_DEPRECATED */ #endif Tk_Window warpWindow; Tk_Window warpMainwin; /* For finding the root window for warping * purposes. */ int warpX; int warpY; /* |
︙ | ︙ | |||
913 914 915 916 917 918 919 | typedef struct { XKeyEvent keyEvent; /* The real event from X11. */ #ifdef _WIN32 # ifndef XMaxTransChars # define XMaxTransChars 7 # endif | | < | 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 | typedef struct { XKeyEvent keyEvent; /* The real event from X11. */ #ifdef _WIN32 # ifndef XMaxTransChars # define XMaxTransChars 7 # endif char trans_chars[XMaxTransChars]; /* translated characters */ unsigned char nbytes; #elif !defined(MAC_OSX_TK) char *charValuePtr; /* A pointer to a string that holds the key's * %A substitution text (before backslash * adding), or NULL if that has not been * computed yet. If non-NULL, this string was * allocated with ckalloc(). */ |
︙ | ︙ | |||
936 937 938 939 940 941 942 943 944 945 946 947 948 949 | /* * Flags passed to TkpMakeMenuWindow's 'transient' argument. */ #define TK_MAKE_MENU_TEAROFF 0 /* Only non-transient case. */ #define TK_MAKE_MENU_POPUP 1 #define TK_MAKE_MENU_DROPDOWN 2 /* * The following structure is used with TkMakeEnsemble to create ensemble * commands and optionally to create sub-ensembles. */ #if (TCL_MAJOR_VERSION < 9) && !defined(Tcl_ObjCmdProc2) | > > > > > > > > > > > > | 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | /* * Flags passed to TkpMakeMenuWindow's 'transient' argument. */ #define TK_MAKE_MENU_TEAROFF 0 /* Only non-transient case. */ #define TK_MAKE_MENU_POPUP 1 #define TK_MAKE_MENU_DROPDOWN 2 /* See TIP #494 */ #ifndef TCL_IO_FAILURE # define TCL_IO_FAILURE (-1) #endif /* See TIP #537 */ #ifndef TCL_INDEX_NONE # define TCL_INDEX_NONE (-1) #endif #ifndef TCL_INDEX_END # define TCL_INDEX_END ((Tcl_Size)-2) #endif /* * The following structure is used with TkMakeEnsemble to create ensemble * commands and optionally to create sub-ensembles. */ #if (TCL_MAJOR_VERSION < 9) && !defined(Tcl_ObjCmdProc2) |
︙ | ︙ | |||
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 | Tcl_ObjType objType; size_t version; } TkObjType; #ifndef TCL_OBJTYPE_V0 # define TCL_OBJTYPE_V0 /* just empty */ #endif MODULE_SCOPE const TkObjType tkBorderObjType; MODULE_SCOPE const TkObjType tkBitmapObjType; MODULE_SCOPE const TkObjType tkColorObjType; MODULE_SCOPE const TkObjType tkCursorObjType; MODULE_SCOPE const TkObjType tkFontObjType; MODULE_SCOPE const TkObjType tkStateKeyObjType; | > > > | 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 | Tcl_ObjType objType; size_t version; } TkObjType; #ifndef TCL_OBJTYPE_V0 # define TCL_OBJTYPE_V0 /* just empty */ #endif #ifndef TCL_OBJTYPE_V1 # define TCL_OBJTYPE_V1(lengthProc) /* just empty */ #endif MODULE_SCOPE const TkObjType tkBorderObjType; MODULE_SCOPE const TkObjType tkBitmapObjType; MODULE_SCOPE const TkObjType tkColorObjType; MODULE_SCOPE const TkObjType tkCursorObjType; MODULE_SCOPE const TkObjType tkFontObjType; MODULE_SCOPE const TkObjType tkStateKeyObjType; |
︙ | ︙ | |||
1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 | MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, int c, struct TkFontAttributes *faPtr); MODULE_SCOPE void TkpDrawFrameEx(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); MODULE_SCOPE void TkpShowBusyWindow(TkBusy busy); MODULE_SCOPE void TkpHideBusyWindow(TkBusy busy); MODULE_SCOPE void TkpMakeTransparentWindowExist(Tk_Window tkwin, Window parent); MODULE_SCOPE void TkpCreateBusy(Tk_FakeWin *winPtr, Tk_Window tkRef, Window *parentPtr, Tk_Window tkParent, TkBusy busy); MODULE_SCOPE int TkBackgroundEvalObjv(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv, int flags); MODULE_SCOPE Tcl_Command TkMakeEnsemble(Tcl_Interp *interp, const char *nsname, const char *name, void *clientData, const TkEnsemble *map); MODULE_SCOPE double TkScalingLevel(Tk_Window tkwin); MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp, void *clientData); MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp, void *clientData); MODULE_SCOPE void TkInitEmbeddedConfigurationInformation( Tcl_Interp *interp); MODULE_SCOPE void TkDoWarpWrtWin(TkDisplay *dispPtr); MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr); MODULE_SCOPE void TkRotatePoint(double originX, double originY, double sine, double cosine, double *xPtr, double *yPtr); MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, Tcl_Size, int lastOK, Tcl_Size*); | > > > > > > > > | | > | 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 | MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, int c, struct TkFontAttributes *faPtr); MODULE_SCOPE void TkpDrawFrameEx(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); MODULE_SCOPE void TkpShowBusyWindow(TkBusy busy); MODULE_SCOPE void TkpHideBusyWindow(TkBusy busy); MODULE_SCOPE Tcl_Size TkLengthOne(Tcl_Obj *); MODULE_SCOPE void TkpMakeTransparentWindowExist(Tk_Window tkwin, Window parent); MODULE_SCOPE void TkpCreateBusy(Tk_FakeWin *winPtr, Tk_Window tkRef, Window *parentPtr, Tk_Window tkParent, TkBusy busy); MODULE_SCOPE int TkBackgroundEvalObjv(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv, int flags); MODULE_SCOPE Tcl_Command TkMakeEnsemble(Tcl_Interp *interp, const char *nsname, const char *name, void *clientData, const TkEnsemble *map); MODULE_SCOPE double TkScalingLevel(Tk_Window tkwin); MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp, void *clientData); MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp, void *clientData); MODULE_SCOPE void TkInitEmbeddedConfigurationInformation( Tcl_Interp *interp); MODULE_SCOPE void TkDoWarpWrtWin(TkDisplay *dispPtr); MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr); MODULE_SCOPE int TkListCreateFrame(void *clientData, Tcl_Interp *interp, Tcl_Obj *listObj, int toplevel, Tcl_Obj *nameObj); MODULE_SCOPE void TkRotatePoint(double originX, double originY, double sine, double cosine, double *xPtr, double *yPtr); MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, Tcl_Size, int lastOK, Tcl_Size*); #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) # define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1) # define TK_OPTION_UNDERLINE_DEF(type, field) "-1", TCL_INDEX_NONE, offsetof(type, field), 0, NULL #else # define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value))) # define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL #endif #ifdef _WIN32 #define TkParseColor XParseColor #else MODULE_SCOPE Status TkParseColor (Display * display, Colormap map, const char* spec, |
︙ | ︙ | |||
1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 | MODULE_SCOPE Tcl_ObjCmdProc TkUnsupported1ObjCmd; /* * For Tktest. */ MODULE_SCOPE Tcl_ObjCmdProc SquareObjCmd; #if !(defined(_WIN32) || defined(MAC_OSX_TK)) #define TkplatformtestInit(x) TCL_OK #else MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp); #endif #ifdef __cplusplus | > | 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 | MODULE_SCOPE Tcl_ObjCmdProc TkUnsupported1ObjCmd; /* * For Tktest. */ MODULE_SCOPE Tcl_ObjCmdProc SquareObjCmd; MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp); #if !(defined(_WIN32) || defined(MAC_OSX_TK)) #define TkplatformtestInit(x) TCL_OK #else MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp); #endif #ifdef __cplusplus |
︙ | ︙ |
Changes to generic/tkIntDecls.h.
︙ | ︙ | |||
76 77 78 79 80 81 82 | /* 12 */ EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 13 */ EXTERN int TkCreateFrame(void *clientData, Tcl_Interp *interp, | | | | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | /* 12 */ EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 13 */ EXTERN int TkCreateFrame(void *clientData, Tcl_Interp *interp, Tcl_Size argc, const char *const *argv, int toplevel, const char *appName); /* 14 */ EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp, const char *screenName, const char *baseName); /* 15 */ EXTERN Time TkCurrentTime(TkDisplay *dispPtr); /* 16 */ EXTERN void TkDeleteAllImages(TkMainInfo *mainPtr); |
︙ | ︙ | |||
198 199 200 201 202 203 204 | EXTERN void TkpCloseDisplay(TkDisplay *dispPtr); /* 57 */ EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force); /* 58 */ EXTERN void TkpDisplayWarning(const char *msg, const char *title); /* 59 */ EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name); | | > > | > > | > > | > > > | > > > | 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | EXTERN void TkpCloseDisplay(TkDisplay *dispPtr); /* 57 */ EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force); /* 58 */ EXTERN void TkpDisplayWarning(const char *msg, const char *title); /* 59 */ EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name); /* 60 */ TK_DEPRECATED("renamed to Tk_GetOtherWindow") TkWindow * TkpGetOtherWindow(TkWindow *winPtr); /* 61 */ EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr); /* 62 */ EXTERN int TkpInit(Tcl_Interp *interp); /* 63 */ EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 64 */ TK_DEPRECATED("renamed to Tk_MakeContainer") void TkpMakeContainer(Tk_Window tkwin); /* 65 */ EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient); /* 66 */ TK_DEPRECATED("renamed to Tk_MakeWindow") Window TkpMakeWindow(TkWindow *winPtr, Window parent); /* 67 */ EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName); /* 68 */ EXTERN TkDisplay * TkpOpenDisplay(const char *display_name); /* 69 */ EXTERN int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr); /* 70 */ EXTERN int TkPolygonToArea(double *polyPtr, int numPoints, double *rectPtr); /* 71 */ EXTERN double TkPolygonToPoint(double *polyPtr, int numPoints, double *pointPtr); /* 72 */ EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr); /* 73 */ EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr); /* 74 */ TK_DEPRECATED("renamed to Tk_SetMainMenubar") void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 75 */ TK_DEPRECATED("renamed to Tk_UseWindow") int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* Slot 76 is reserved */ /* 77 */ EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr); /* 78 */ EXTERN int TkReadBitmapFile(Display *display, Drawable d, const char *filename, |
︙ | ︙ | |||
254 255 256 257 258 259 260 | /* 81 */ EXTERN void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr); /* 82 */ EXTERN void TkSelInit(Tk_Window tkwin); /* 83 */ EXTERN void TkSelPropProc(XEvent *eventPtr); /* Slot 84 is reserved */ | | > > > > | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | /* 81 */ EXTERN void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr); /* 82 */ EXTERN void TkSelInit(Tk_Window tkwin); /* 83 */ EXTERN void TkSelPropProc(XEvent *eventPtr); /* Slot 84 is reserved */ /* 85 */ TK_DEPRECATED("renamed to Tk_SetWindowMenubar") void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 86 */ EXTERN KeySym TkStringToKeysym(const char *name); /* 87 */ EXTERN int TkThickPolyLineToArea(double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 88 */ |
︙ | ︙ | |||
315 316 317 318 319 320 321 | Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 109 */ EXTERN const char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 110 */ EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont); | | > > > > > > > > > | > > > > | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 109 */ EXTERN const char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 110 */ EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont); /* 111 */ TK_DEPRECATED("renamed to Tk_GetSystemDefault") Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); /* 112 */ EXTERN void TkpMenuThreadInit(void); /* 113 */ EXTERN int XClipBox(Region rgn, XRectangle *rect_return); /* 114 */ EXTERN Region XCreateRegion(void); /* 115 */ EXTERN int XDestroyRegion(Region rgn); /* 116 */ EXTERN int XIntersectRegion(Region sra, Region srcb, Region dr_return); /* 117 */ EXTERN int XRectInRegion(Region rgn, int x, int y, unsigned int width, unsigned int height); /* 118 */ EXTERN int XSetRegion(Display *display, GC gc, Region rgn); /* 119 */ EXTERN int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return); /* Slot 120 is reserved */ #ifdef MAC_OSX_TK /* AQUA */ /* 121 */ EXTERN Pixmap TkpCreateNativeBitmap(Display *display, const void *source); #endif /* AQUA */ #ifdef MAC_OSX_TK /* AQUA */ /* 122 */ EXTERN void TkpDefineNativeBitmaps(void); #endif /* AQUA */ /* Slot 123 is reserved */ #ifdef MAC_OSX_TK /* AQUA */ /* 124 */ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height); #endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ /* Slot 128 is reserved */ /* Slot 129 is reserved */ /* Slot 130 is reserved */ /* Slot 131 is reserved */ /* Slot 132 is reserved */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ /* 135 */ TK_DEPRECATED("renamed to Tk_DrawHighlightBorder") void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 136 */ EXTERN void TkSetFocusWin(TkWindow *winPtr, int force); /* 137 */ EXTERN void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 138 */ EXTERN KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr); |
︙ | ︙ | |||
559 560 561 562 563 564 565 | void (*tkBindInit) (TkMainInfo *mainPtr); /* 6 */ void (*tkChangeEventWindow) (XEvent *eventPtr, TkWindow *winPtr); /* 7 */ int (*tkClipInit) (Tcl_Interp *interp, TkDisplay *dispPtr); /* 8 */ void (*tkComputeAnchor) (Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int *xPtr, int *yPtr); /* 9 */ void (*reserved10)(void); void (*reserved11)(void); TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */ | | | 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | void (*tkBindInit) (TkMainInfo *mainPtr); /* 6 */ void (*tkChangeEventWindow) (XEvent *eventPtr, TkWindow *winPtr); /* 7 */ int (*tkClipInit) (Tcl_Interp *interp, TkDisplay *dispPtr); /* 8 */ void (*tkComputeAnchor) (Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int *xPtr, int *yPtr); /* 9 */ void (*reserved10)(void); void (*reserved11)(void); TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */ int (*tkCreateFrame) (void *clientData, Tcl_Interp *interp, Tcl_Size argc, const char *const *argv, int toplevel, const char *appName); /* 13 */ Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, const char *screenName, const char *baseName); /* 14 */ Time (*tkCurrentTime) (TkDisplay *dispPtr); /* 15 */ void (*tkDeleteAllImages) (TkMainInfo *mainPtr); /* 16 */ void (*tkDoConfigureNotify) (TkWindow *winPtr); /* 17 */ void (*tkDrawInsetFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable, int padding); /* 18 */ void (*tkEventDeadWindow) (TkWindow *winPtr); /* 19 */ void (*tkFillPolygon) (Tk_Canvas canvas, double *coordPtr, int numPoints, Display *display, Drawable drawable, GC gc, GC outlineGC); /* 20 */ |
︙ | ︙ | |||
606 607 608 609 610 611 612 | int (*tkOvalToArea) (double *ovalPtr, double *rectPtr); /* 53 */ double (*tkOvalToPoint) (double ovalPtr[], double width, int filled, double pointPtr[]); /* 54 */ int (*tkpChangeFocus) (TkWindow *winPtr, int force); /* 55 */ void (*tkpCloseDisplay) (TkDisplay *dispPtr); /* 56 */ void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */ void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */ void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */ | | | | | | | | 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | int (*tkOvalToArea) (double *ovalPtr, double *rectPtr); /* 53 */ double (*tkOvalToPoint) (double ovalPtr[], double width, int filled, double pointPtr[]); /* 54 */ int (*tkpChangeFocus) (TkWindow *winPtr, int force); /* 55 */ void (*tkpCloseDisplay) (TkDisplay *dispPtr); /* 56 */ void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */ void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */ void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */ TCL_DEPRECATED_API("renamed to Tk_GetOtherWindow") TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */ TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */ int (*tkpInit) (Tcl_Interp *interp); /* 62 */ void (*tkpInitializeMenuBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 63 */ TCL_DEPRECATED_API("renamed to Tk_MakeContainer") void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */ void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */ TCL_DEPRECATED_API("renamed to Tk_MakeWindow") Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */ void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */ TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */ int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */ int (*tkPolygonToArea) (double *polyPtr, int numPoints, double *rectPtr); /* 70 */ double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */ int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */ void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */ TCL_DEPRECATED_API("renamed to Tk_SetMainMenubar") void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */ TCL_DEPRECATED_API("renamed to Tk_UseWindow") int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */ void (*reserved76)(void); void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */ int (*tkReadBitmapFile) (Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return); /* 78 */ int (*tkScrollWindow) (Tk_Window tkwin, GC gc, int x, int y, int width, int height, int dx, int dy, Region damageRgn); /* 79 */ void (*tkSelDeadWindow) (TkWindow *winPtr); /* 80 */ void (*tkSelEventProc) (Tk_Window tkwin, XEvent *eventPtr); /* 81 */ void (*tkSelInit) (Tk_Window tkwin); /* 82 */ void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */ void (*reserved84)(void); TCL_DEPRECATED_API("renamed to Tk_SetWindowMenubar") void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */ KeySym (*tkStringToKeysym) (const char *name); /* 86 */ int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */ void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */ void (*tkWmDeadWindow) (TkWindow *winPtr); /* 89 */ TkWindow * (*tkWmFocusToplevel) (TkWindow *winPtr); /* 90 */ void (*tkWmMapWindow) (TkWindow *winPtr); /* 91 */ void (*tkWmNewWindow) (TkWindow *winPtr); /* 92 */ |
︙ | ︙ | |||
657 658 659 660 661 662 663 | int (*tkFindStateNumObj) (Tcl_Interp *interp, Tcl_Obj *optionPtr, const TkStateMap *mapPtr, Tcl_Obj *keyPtr); /* 104 */ Tcl_HashTable * (*tkGetBitmapPredefTable) (void); /* 105 */ TkDisplay * (*tkGetDisplayList) (void); /* 106 */ TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */ int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */ const char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */ void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */ | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | int (*tkFindStateNumObj) (Tcl_Interp *interp, Tcl_Obj *optionPtr, const TkStateMap *mapPtr, Tcl_Obj *keyPtr); /* 104 */ Tcl_HashTable * (*tkGetBitmapPredefTable) (void); /* 105 */ TkDisplay * (*tkGetDisplayList) (void); /* 106 */ TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */ int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */ const char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */ void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */ TCL_DEPRECATED_API("renamed to Tk_GetSystemDefault") Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */ void (*tkpMenuThreadInit) (void); /* 112 */ int (*xClipBox) (Region rgn, XRectangle *rect_return); /* 113 */ Region (*xCreateRegion) (void); /* 114 */ int (*xDestroyRegion) (Region rgn); /* 115 */ int (*xIntersectRegion) (Region sra, Region srcb, Region dr_return); /* 116 */ int (*xRectInRegion) (Region rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */ int (*xSetRegion) (Display *display, GC gc, Region rgn); /* 118 */ int (*xUnionRectWithRegion) (XRectangle *rect, Region src, Region dr_return); /* 119 */ void (*reserved120)(void); #if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved121)(void); #endif /* X11 */ #if defined(_WIN32) /* WIN */ void (*reserved121)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ # if TCL_MAJOR_VERSION < 9 void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */ # endif /* TCL_MAJOR_VERSION < 9 */ Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved122)(void); #endif /* X11 */ #if defined(_WIN32) /* WIN */ void (*reserved122)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ # if TCL_MAJOR_VERSION < 9 void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */ # endif /* TCL_MAJOR_VERSION < 9 */ void (*tkpDefineNativeBitmaps) (void); /* 122 */ #endif /* AQUA */ void (*reserved123)(void); #if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved124)(void); #endif /* X11 */ #if defined(_WIN32) /* WIN */ void (*reserved124)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ # if TCL_MAJOR_VERSION < 9 void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */ # endif /* TCL_MAJOR_VERSION < 9 */ Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */ #endif /* AQUA */ void (*reserved125)(void); void (*reserved126)(void); void (*reserved127)(void); void (*reserved128)(void); void (*reserved129)(void); void (*reserved130)(void); void (*reserved131)(void); void (*reserved132)(void); void (*reserved133)(void); void (*reserved134)(void); TCL_DEPRECATED_API("renamed to Tk_DrawHighlightBorder") void (*tkpDrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 135 */ void (*tkSetFocusWin) (TkWindow *winPtr, int force); /* 136 */ void (*tkpSetKeycodeAndState) (Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 137 */ KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */ void (*tkpInitKeymapInfo) (TkDisplay *dispPtr); /* 139 */ Region (*tkPhotoGetValidRegion) (Tk_PhotoHandle handle); /* 140 */ TkWindow ** (*tkWmStackorderToplevel) (TkWindow *parentPtr); /* 141 */ void (*tkFocusFree) (TkMainInfo *mainPtr); /* 142 */ |
︙ | ︙ | |||
865 866 867 868 869 870 871 | (tkIntStubsPtr->tkpCloseDisplay) /* 56 */ #define TkpClaimFocus \ (tkIntStubsPtr->tkpClaimFocus) /* 57 */ #define TkpDisplayWarning \ (tkIntStubsPtr->tkpDisplayWarning) /* 58 */ #define TkpGetAppName \ (tkIntStubsPtr->tkpGetAppName) /* 59 */ | | > | > < > > | > > | | > | 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 | (tkIntStubsPtr->tkpCloseDisplay) /* 56 */ #define TkpClaimFocus \ (tkIntStubsPtr->tkpClaimFocus) /* 57 */ #define TkpDisplayWarning \ (tkIntStubsPtr->tkpDisplayWarning) /* 58 */ #define TkpGetAppName \ (tkIntStubsPtr->tkpGetAppName) /* 59 */ #define TkpGetOtherWindow \ (tkIntStubsPtr->tkpGetOtherWindow) /* 60 */ #define TkpGetWrapperWindow \ (tkIntStubsPtr->tkpGetWrapperWindow) /* 61 */ #define TkpInit \ (tkIntStubsPtr->tkpInit) /* 62 */ #define TkpInitializeMenuBindings \ (tkIntStubsPtr->tkpInitializeMenuBindings) /* 63 */ #define TkpMakeContainer \ (tkIntStubsPtr->tkpMakeContainer) /* 64 */ #define TkpMakeMenuWindow \ (tkIntStubsPtr->tkpMakeMenuWindow) /* 65 */ #define TkpMakeWindow \ (tkIntStubsPtr->tkpMakeWindow) /* 66 */ #define TkpMenuNotifyToplevelCreate \ (tkIntStubsPtr->tkpMenuNotifyToplevelCreate) /* 67 */ #define TkpOpenDisplay \ (tkIntStubsPtr->tkpOpenDisplay) /* 68 */ #define TkPointerEvent \ (tkIntStubsPtr->tkPointerEvent) /* 69 */ #define TkPolygonToArea \ (tkIntStubsPtr->tkPolygonToArea) /* 70 */ #define TkPolygonToPoint \ (tkIntStubsPtr->tkPolygonToPoint) /* 71 */ #define TkPositionInTree \ (tkIntStubsPtr->tkPositionInTree) /* 72 */ #define TkpRedirectKeyEvent \ (tkIntStubsPtr->tkpRedirectKeyEvent) /* 73 */ #define TkpSetMainMenubar \ (tkIntStubsPtr->tkpSetMainMenubar) /* 74 */ #define TkpUseWindow \ (tkIntStubsPtr->tkpUseWindow) /* 75 */ /* Slot 76 is reserved */ #define TkQueueEventForAllChildren \ (tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */ #define TkReadBitmapFile \ (tkIntStubsPtr->tkReadBitmapFile) /* 78 */ #define TkScrollWindow \ (tkIntStubsPtr->tkScrollWindow) /* 79 */ #define TkSelDeadWindow \ (tkIntStubsPtr->tkSelDeadWindow) /* 80 */ #define TkSelEventProc \ (tkIntStubsPtr->tkSelEventProc) /* 81 */ #define TkSelInit \ (tkIntStubsPtr->tkSelInit) /* 82 */ #define TkSelPropProc \ (tkIntStubsPtr->tkSelPropProc) /* 83 */ /* Slot 84 is reserved */ #define TkSetWindowMenuBar \ (tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */ #define TkStringToKeysym \ (tkIntStubsPtr->tkStringToKeysym) /* 86 */ #define TkThickPolyLineToArea \ (tkIntStubsPtr->tkThickPolyLineToArea) /* 87 */ #define TkWmAddToColormapWindows \ (tkIntStubsPtr->tkWmAddToColormapWindows) /* 88 */ #define TkWmDeadWindow \ |
︙ | ︙ | |||
959 960 961 962 963 964 965 | (tkIntStubsPtr->tkGetMainInfoList) /* 107 */ #define TkGetWindowFromObj \ (tkIntStubsPtr->tkGetWindowFromObj) /* 108 */ #define TkpGetString \ (tkIntStubsPtr->tkpGetString) /* 109 */ #define TkpGetSubFonts \ (tkIntStubsPtr->tkpGetSubFonts) /* 110 */ | > | > > > > > > > | | 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 | (tkIntStubsPtr->tkGetMainInfoList) /* 107 */ #define TkGetWindowFromObj \ (tkIntStubsPtr->tkGetWindowFromObj) /* 108 */ #define TkpGetString \ (tkIntStubsPtr->tkpGetString) /* 109 */ #define TkpGetSubFonts \ (tkIntStubsPtr->tkpGetSubFonts) /* 110 */ #define TkpGetSystemDefault \ (tkIntStubsPtr->tkpGetSystemDefault) /* 111 */ #define TkpMenuThreadInit \ (tkIntStubsPtr->tkpMenuThreadInit) /* 112 */ #define XClipBox \ (tkIntStubsPtr->xClipBox) /* 113 */ #define XCreateRegion \ (tkIntStubsPtr->xCreateRegion) /* 114 */ #define XDestroyRegion \ (tkIntStubsPtr->xDestroyRegion) /* 115 */ #define XIntersectRegion \ (tkIntStubsPtr->xIntersectRegion) /* 116 */ #define XRectInRegion \ (tkIntStubsPtr->xRectInRegion) /* 117 */ #define XSetRegion \ (tkIntStubsPtr->xSetRegion) /* 118 */ #define XUnionRectWithRegion \ (tkIntStubsPtr->xUnionRectWithRegion) /* 119 */ /* Slot 120 is reserved */ #ifdef MAC_OSX_TK /* AQUA */ #define TkpCreateNativeBitmap \ (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */ #endif /* AQUA */ #ifdef MAC_OSX_TK /* AQUA */ #define TkpDefineNativeBitmaps \ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */ #endif /* AQUA */ /* Slot 123 is reserved */ #ifdef MAC_OSX_TK /* AQUA */ #define TkpGetNativeAppBitmap \ (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */ #endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ /* Slot 128 is reserved */ /* Slot 129 is reserved */ /* Slot 130 is reserved */ /* Slot 131 is reserved */ /* Slot 132 is reserved */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ #define TkpDrawHighlightBorder \ (tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */ #define TkSetFocusWin \ (tkIntStubsPtr->tkSetFocusWin) /* 136 */ #define TkpSetKeycodeAndState \ (tkIntStubsPtr->tkpSetKeycodeAndState) /* 137 */ #define TkpGetKeySym \ (tkIntStubsPtr->tkpGetKeySym) /* 138 */ #define TkpInitKeymapInfo \ |
︙ | ︙ | |||
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 | #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS) # undef TkpWillDrawWidget # undef TkpRedrawWidget | > > > > > > > > > > > > > > > > > > > > > > > > > > > > < < < < < < | 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 | #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #undef TkpCmapStressed_ #undef TkpSync_ #undef TkUnixContainerId_ #undef TkUnixDoOneXEvent_ #undef TkUnixSetMenubar_ #undef TkWmCleanup_ #undef TkSendCleanup_ #undef TkpTestsendCmd_ #undef TkSetWindowMenuBar #undef TkpDrawHighlightBorder #undef TkpUseWindow #undef TkpSetMainMenubar #undef TkpGetOtherWindow #undef TkpGetSystemDefault #undef TkpMakeContainer #undef TkpMakeWindow #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION == 8) # define TkSetWindowMenuBar Tk_SetWindowMenubar # define TkpDrawHighlightBorder Tk_DrawHighlightBorder # define TkpUseWindow Tk_UseWindow # define TkpSetMainMenubar Tk_SetMainMenubar # define TkpGetOtherWindow ((TkWindow *(*)(TkWindow *))(void *)Tk_GetOtherWindow) # define TkpGetSystemDefault Tk_GetSystemDefault # define TkpMakeContainer Tk_MakeContainer # define TkpMakeWindow ((Window (*)(TkWindow *, Window))(void *)Tk_MakeWindow) #endif #if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS) # undef TkpWillDrawWidget # undef TkpRedrawWidget # define TkpWillDrawWidget(w) 0 # define TkpRedrawWidget(w) #endif #endif /* _TKINTDECLS */ |
Changes to generic/tkIntPlatDecls.h.
︙ | ︙ | |||
32 33 34 35 36 37 38 | /* * Exported function declarations: */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ | | > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | /* * Exported function declarations: */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN char * TkAlignImageData(XImage *image, int alignment, int bitOrder); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* 3 */ EXTERN unsigned long TkpGetMS(void); /* 4 */ |
︙ | ︙ | |||
109 110 111 112 113 114 115 | EXTERN void TkWinSetForegroundWindow(TkWindow *winPtr); /* 31 */ EXTERN void TkWinDialogDebug(int debug); /* 32 */ EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); /* 33 */ | | < | > | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | EXTERN void TkWinSetForegroundWindow(TkWindow *winPtr); /* 31 */ EXTERN void TkWinDialogDebug(int debug); /* 32 */ EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); /* 33 */ EXTERN int TkWinGetPlatformId(void); /* 34 */ EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); /* 35 */ EXTERN int TkWinGetPlatformTheme(void); /* 36 */ EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 37 */ EXTERN void TkCreateXEventSource(void); /* 38 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ EXTERN void TkpSync(Display *display); /* 40 */ EXTERN Window TkUnixContainerId(TkWindow *winPtr); /* 41 */ |
︙ | ︙ | |||
141 142 143 144 145 146 147 | EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* Slot 46 is reserved */ /* 47 */ EXTERN Tk_Window TkpGetCapture(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ | < | | > > | | | | < | | < | > > | > | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* Slot 46 is reserved */ /* 47 */ EXTERN Tk_Window TkpGetCapture(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents_(TkWindow *winPtr, int active); /* 3 */ EXTERN void TkPointerDeadWindow(TkWindow *winPtr); /* 4 */ EXTERN void TkpSetCapture(TkWindow *winPtr); /* 5 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 6 */ EXTERN void TkpWmSetState(TkWindow *winPtr, int state); /* 7 */ EXTERN void TkAboutDlg(void); /* 8 */ EXTERN unsigned int TkMacOSXButtonKeyState(void); /* 9 */ EXTERN void TkMacOSXClearMenubarActive(void); /* 10 */ EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); /* Slot 11 is reserved */ /* 12 */ EXTERN void TkMacOSXHandleTearoffMenu(void); /* Slot 13 is reserved */ /* 14 */ EXTERN int TkMacOSXDoHLEvent(void *theEvent); /* Slot 15 is reserved */ /* 16 */ EXTERN Window TkMacOSXGetXWindow(void *macWinPtr); /* 17 */ EXTERN int TkMacOSXGrowToplevel(void *whichWindow, XPoint start); /* 18 */ EXTERN void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem, int optionKeyPressed); /* Slot 19 is reserved */ /* Slot 20 is reserved */ /* 21 */ EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag); /* 22 */ EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar); /* 23 */ EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr); /* 24 */ EXTERN void * TkMacOSXMakeStippleMap(Drawable d1, Drawable d2); /* 25 */ EXTERN void TkMacOSXMenuClick(void); /* Slot 26 is reserved */ /* 27 */ EXTERN int TkMacOSXResizable(TkWindow *winPtr); /* 28 */ EXTERN void TkMacOSXSetHelpMenuItemCount(void); /* 29 */ EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag); /* 30 */ EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable); /* 31 */ EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort); /* 32 */ EXTERN void TkMacOSXUpdateClipRgn(TkWindow *winPtr); /* Slot 33 is reserved */ /* 34 */ EXTERN int TkMacOSXUseMenuID(short macID); |
︙ | ︙ | |||
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | /* 50 */ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state); /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* 52 */ EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource(void); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); | > > > > > > > | > | > | > > > > > < < | | > | > | > > | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | /* 50 */ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state); /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* 52 */ EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); /* 53 */ EXTERN unsigned long TkpGetMS(void); /* 54 */ EXTERN void * TkMacOSXDrawable(Drawable drawable); /* 55 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource(void); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* 3 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 4 */ EXTERN void TkpSync(Display *display); /* 5 */ EXTERN Window TkUnixContainerId(TkWindow *winPtr); /* 6 */ EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); /* 7 */ EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); /* 8 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); /* 9 */ EXTERN void TkWmCleanup(TkDisplay *dispPtr); /* 10 */ EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* Slot 11 is reserved */ /* 12 */ EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 13 */ EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ /* Slot 17 is reserved */ /* Slot 18 is reserved */ /* Slot 19 is reserved */ /* Slot 20 is reserved */ |
︙ | ︙ | |||
291 292 293 294 295 296 297 | /* Slot 32 is reserved */ /* Slot 33 is reserved */ /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* 38 */ | | | | | | | | | | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | /* Slot 32 is reserved */ /* Slot 33 is reserved */ /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* 38 */ EXTERN int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap); /* 39 */ EXTERN void TkpSync_(Display *display); /* 40 */ EXTERN Window TkUnixContainerId_(TkWindow *winPtr); /* 41 */ EXTERN int TkUnixDoOneXEvent_(Tcl_Time *timePtr); /* 42 */ EXTERN void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar); /* 43 */ EXTERN void TkWmCleanup_(TkDisplay *dispPtr); /* 44 */ EXTERN void TkSendCleanup_(TkDisplay *dispPtr); /* 45 */ EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); #endif /* X11 */ typedef struct TkIntPlatStubs { int magic; void *hooks; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ unsigned long (*tkpGetMS) (void); /* 3 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ |
︙ | ︙ | |||
347 348 349 350 351 352 353 | void (*tkWinSetWindowPos) (HWND hwnd, HWND siblingHwnd, int pos); /* 26 */ void (*tkWinWmCleanup) (HINSTANCE hInstance); /* 27 */ void (*tkWinXCleanup) (void *clientData); /* 28 */ void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */ void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ void (*tkWinDialogDebug) (int debug); /* 31 */ Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */ | | | > | < | < | > < | > | | | | 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | void (*tkWinSetWindowPos) (HWND hwnd, HWND siblingHwnd, int pos); /* 26 */ void (*tkWinWmCleanup) (HINSTANCE hInstance); /* 27 */ void (*tkWinXCleanup) (void *clientData); /* 28 */ void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */ void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ void (*tkWinDialogDebug) (int debug); /* 31 */ Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */ int (*tkWinGetPlatformId) (void); /* 33 */ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ void (*tkCreateXEventSource) (void); /* 37 */ int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync) (Display *display); /* 39 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ void (*reserved46)(void); Tk_Window (*tkpGetCapture) (void); /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents_) (TkWindow *winPtr, int active); /* 2 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */ void (*tkAboutDlg) (void); /* 7 */ unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ void (*tkMacOSXClearMenubarActive) (void); /* 9 */ int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ void (*reserved11)(void); void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ void (*reserved13)(void); int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */ void (*reserved15)(void); Window (*tkMacOSXGetXWindow) (void *macWinPtr); /* 16 */ int (*tkMacOSXGrowToplevel) (void *whichWindow, XPoint start); /* 17 */ void (*tkMacOSXHandleMenuSelect) (short theMenu, unsigned short theItem, int optionKeyPressed); /* 18 */ void (*reserved19)(void); void (*reserved20)(void); void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */ int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */ void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */ void * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */ void (*tkMacOSXMenuClick) (void); /* 25 */ void (*reserved26)(void); int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */ void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */ void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */ void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */ void (*tkMacOSXSetUpGraphicsPort) (GC gc, void *destPort); /* 31 */ void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */ void (*reserved33)(void); int (*tkMacOSXUseMenuID) (short macID); /* 34 */ Region (*tkMacOSXVisableClipRgn) (TkWindow *winPtr); /* 35 */ void (*tkMacOSXWinBounds) (TkWindow *winPtr, void *geometry); /* 36 */ void (*tkMacOSXWindowOffset) (void *wRef, int *xOffset, int *yOffset); /* 37 */ |
︙ | ︙ | |||
417 418 419 420 421 422 423 424 425 426 427 428 | int (*tkpIsWindowFloating) (void *window); /* 46 */ Tk_Window (*tkpGetCapture) (void); /* 47 */ void (*reserved48)(void); Tk_Window (*tkMacOSXGetContainer) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ | > > > | | > > | | | > | | < < < | | 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | int (*tkpIsWindowFloating) (void *window); /* 46 */ Tk_Window (*tkpGetCapture) (void); /* 47 */ void (*reserved48)(void); Tk_Window (*tkMacOSXGetContainer) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ unsigned long (*tkpGetMS) (void); /* 53 */ void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */ void (*tkpSync) (Display *display); /* 4 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */ void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */ void (*reserved11)(void); int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ int (*tkpTestsendCmd_) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 13 */ void (*reserved14)(void); void (*reserved15)(void); void (*reserved16)(void); void (*reserved17)(void); void (*reserved18)(void); void (*reserved19)(void); void (*reserved20)(void); |
︙ | ︙ | |||
457 458 459 460 461 462 463 | void (*reserved31)(void); void (*reserved32)(void); void (*reserved33)(void); void (*reserved34)(void); void (*reserved35)(void); void (*reserved36)(void); void (*reserved37)(void); | | | | | | | | | | | 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | void (*reserved31)(void); void (*reserved32)(void); void (*reserved33)(void); void (*reserved34)(void); void (*reserved35)(void); void (*reserved36)(void); void (*reserved37)(void); int (*tkpCmapStressed_) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync_) (Display *display); /* 39 */ Window (*tkUnixContainerId_) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent_) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar_) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ void (*tkWmCleanup_) (TkDisplay *dispPtr); /* 43 */ void (*tkSendCleanup_) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ #endif /* X11 */ } TkIntPlatStubs; extern const TkIntPlatStubs *tkIntPlatStubsPtr; #ifdef __cplusplus } #endif #if defined(USE_TK_STUBS) /* * Inline function declarations: */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ #define TkPointerDeadWindow \ (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */ |
︙ | ︙ | |||
546 547 548 549 550 551 552 | (tkIntPlatStubsPtr->tkWinXInit) /* 29 */ #define TkWinSetForegroundWindow \ (tkIntPlatStubsPtr->tkWinSetForegroundWindow) /* 30 */ #define TkWinDialogDebug \ (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ #define TkWinGetMenuSystemDefault \ (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ | | | | > | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | (tkIntPlatStubsPtr->tkWinXInit) /* 29 */ #define TkWinSetForegroundWindow \ (tkIntPlatStubsPtr->tkWinSetForegroundWindow) /* 30 */ #define TkWinDialogDebug \ (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ #define TkWinGetMenuSystemDefault \ (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ #define TkWinGetPlatformId \ (tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */ #define TkWinSetHINSTANCE \ (tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */ #define TkWinGetPlatformTheme \ (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ #define TkWinChildProc \ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #define TkpSync \ (tkIntPlatStubsPtr->tkpSync) /* 39 */ #define TkUnixContainerId \ (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ #define TkUnixDoOneXEvent \ |
︙ | ︙ | |||
576 577 578 579 580 581 582 | #define TkpTestsendCmd \ (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ /* Slot 46 is reserved */ #define TkpGetCapture \ (tkIntPlatStubsPtr->tkpGetCapture) /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ | < < < | > | | | | | | | | > > | < | > | > | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | #define TkpTestsendCmd \ (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ /* Slot 46 is reserved */ #define TkpGetCapture \ (tkIntPlatStubsPtr->tkpGetCapture) /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents_ \ (tkIntPlatStubsPtr->tkGenerateActivateEvents_) /* 2 */ #define TkPointerDeadWindow \ (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ #define TkpSetCapture \ (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */ #define TkpWmSetState \ (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */ #define TkAboutDlg \ (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */ #define TkMacOSXButtonKeyState \ (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ #define TkMacOSXClearMenubarActive \ (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ #define TkMacOSXDispatchMenuEvent \ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ /* Slot 11 is reserved */ #define TkMacOSXHandleTearoffMenu \ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ /* Slot 13 is reserved */ #define TkMacOSXDoHLEvent \ (tkIntPlatStubsPtr->tkMacOSXDoHLEvent) /* 14 */ /* Slot 15 is reserved */ #define TkMacOSXGetXWindow \ (tkIntPlatStubsPtr->tkMacOSXGetXWindow) /* 16 */ #define TkMacOSXGrowToplevel \ (tkIntPlatStubsPtr->tkMacOSXGrowToplevel) /* 17 */ #define TkMacOSXHandleMenuSelect \ (tkIntPlatStubsPtr->tkMacOSXHandleMenuSelect) /* 18 */ /* Slot 19 is reserved */ /* Slot 20 is reserved */ #define TkMacOSXInvalidateWindow \ (tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */ #define TkMacOSXIsCharacterMissing \ (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */ #define TkMacOSXMakeRealWindowExist \ (tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */ #define TkMacOSXMakeStippleMap \ (tkIntPlatStubsPtr->tkMacOSXMakeStippleMap) /* 24 */ #define TkMacOSXMenuClick \ (tkIntPlatStubsPtr->tkMacOSXMenuClick) /* 25 */ /* Slot 26 is reserved */ #define TkMacOSXResizable \ (tkIntPlatStubsPtr->tkMacOSXResizable) /* 27 */ #define TkMacOSXSetHelpMenuItemCount \ (tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */ #define TkMacOSXSetScrollbarGrow \ (tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */ #define TkMacOSXSetUpClippingRgn \ (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */ #define TkMacOSXSetUpGraphicsPort \ (tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */ #define TkMacOSXUpdateClipRgn \ (tkIntPlatStubsPtr->tkMacOSXUpdateClipRgn) /* 32 */ /* Slot 33 is reserved */ #define TkMacOSXUseMenuID \ (tkIntPlatStubsPtr->tkMacOSXUseMenuID) /* 34 */ |
︙ | ︙ | |||
671 672 673 674 675 676 677 678 679 680 681 682 683 684 | (tkIntPlatStubsPtr->tkMacOSXGetContainer) /* 49 */ #define TkGenerateButtonEvent \ (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 50 */ #define TkGenWMDestroyEvent \ (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ #define TkMacOSXSetDrawingEnabled \ (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ | > > > > > > | | > | > > > > > > | > > > > | < | < < < < > > | 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | (tkIntPlatStubsPtr->tkMacOSXGetContainer) /* 49 */ #define TkGenerateButtonEvent \ (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 50 */ #define TkGenWMDestroyEvent \ (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ #define TkMacOSXSetDrawingEnabled \ (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ #define TkMacOSXDrawable \ (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */ #define TkpSync \ (tkIntPlatStubsPtr->tkpSync) /* 4 */ #define TkUnixContainerId \ (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */ #define TkUnixDoOneXEvent \ (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */ #define TkUnixSetMenubar \ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */ #define TkpScanWindowId \ (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ #define TkWmCleanup \ (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ #define TkSendCleanup \ (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */ /* Slot 11 is reserved */ #define TkpWmSetState \ (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ #define TkpTestsendCmd_ \ (tkIntPlatStubsPtr->tkpTestsendCmd_) /* 13 */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ /* Slot 17 is reserved */ /* Slot 18 is reserved */ /* Slot 19 is reserved */ /* Slot 20 is reserved */ |
︙ | ︙ | |||
715 716 717 718 719 720 721 | /* Slot 31 is reserved */ /* Slot 32 is reserved */ /* Slot 33 is reserved */ /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ | | | | | | | | | | | | | | | > | > > > > > > > | | > > > > | 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | /* Slot 31 is reserved */ /* Slot 32 is reserved */ /* Slot 33 is reserved */ /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ #define TkpCmapStressed_ \ (tkIntPlatStubsPtr->tkpCmapStressed_) /* 38 */ #define TkpSync_ \ (tkIntPlatStubsPtr->tkpSync_) /* 39 */ #define TkUnixContainerId_ \ (tkIntPlatStubsPtr->tkUnixContainerId_) /* 40 */ #define TkUnixDoOneXEvent_ \ (tkIntPlatStubsPtr->tkUnixDoOneXEvent_) /* 41 */ #define TkUnixSetMenubar_ \ (tkIntPlatStubsPtr->tkUnixSetMenubar_) /* 42 */ #define TkWmCleanup_ \ (tkIntPlatStubsPtr->tkWmCleanup_) /* 43 */ #define TkSendCleanup_ \ (tkIntPlatStubsPtr->tkSendCleanup_) /* 44 */ #define TkpTestsendCmd \ (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ #endif /* X11 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #undef TkpCmapStressed_ #undef TkpSync_ #undef TkUnixContainerId_ #undef TkUnixDoOneXEvent_ #undef TkUnixSetMenubar_ #undef TkWmCleanup_ #undef TkSendCleanup_ #undef TkpTestsendCmd_ #undef TkGenerateActivateEvents_ #undef TkMacOSXSetUpClippingRgn #undef TkMacOSXIsCharacterMissing #define TkMacOSXIsCharacterMissing(tkfont) ((void)tkfont, 0) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #undef TkWinGetPlatformId #define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */ #endif /* _TKINTPLATDECLS */ |
Changes to generic/tkIntXlibDecls.h.
︙ | ︙ | |||
494 495 496 497 498 499 500 | EXTERN char * XGetAtomName(Display *d, Atom a); /* 5 */ EXTERN char * XKeysymToString(KeySym k); /* 6 */ EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v, int i); /* 7 */ | < < < < < < < < | < < | | | | < < < < < < < | | | | < < | | | | | < < | | | | | | | < < | | < < | | < < | < < < | | | < < < | | | < < < < < < < | < < < | | | | | < < | | | | | | | | | < < < < | | | < < < < < < < < < | < < < < | | | | | | | | | | | | | | | | | | | | | | > > > > > | < < < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > | 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 | EXTERN char * XGetAtomName(Display *d, Atom a); /* 5 */ EXTERN char * XKeysymToString(KeySym k); /* 6 */ EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v, int i); /* 7 */ EXTERN GContext XGContextFromGC(GC g); /* 8 */ EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i); /* 9 */ EXTERN KeySym XStringToKeysym(_Xconst char *c); /* 10 */ EXTERN Window XRootWindow(Display *d, int i); /* 11 */ EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); /* 12 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 13 */ EXTERN int XBell(Display *d, int i); /* 14 */ EXTERN int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 15 */ EXTERN int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 16 */ EXTERN int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x); /* 17 */ EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 18 */ EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 19 */ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 20 */ EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 21 */ EXTERN int XDestroyWindow(Display *d, Window w); /* 22 */ EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 23 */ EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 24 */ EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 25 */ EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 26 */ EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 27 */ EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 28 */ EXTERN int XFreeColormap(Display *d, Colormap c); /* 29 */ EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 30 */ EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 31 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 32 */ EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 33 */ EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t); /* 34 */ EXTERN int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 35 */ EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k); /* 36 */ EXTERN int XMapWindow(Display *d, Window w); /* 37 */ EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 38 */ EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); /* 39 */ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 40 */ EXTERN int XRaiseWindow(Display *d, Window w); /* 41 */ EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); /* 42 */ EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 43 */ EXTERN int XSelectInput(Display *d, Window w, long l); /* 44 */ EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x); /* 45 */ EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); /* 46 */ EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); /* 47 */ EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 48 */ EXTERN int XSetWindowBackground(Display *d, Window w, unsigned long ul); /* 49 */ EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p); /* 50 */ EXTERN int XSetWindowBorder(Display *d, Window w, unsigned long ul); /* 51 */ EXTERN int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p); /* 52 */ EXTERN int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui); /* 53 */ EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); /* 54 */ EXTERN int XUngrabKeyboard(Display *d, Time t); /* 55 */ EXTERN int XUngrabPointer(Display *d, Time t); /* 56 */ EXTERN int XUnmapWindow(Display *d, Window w); /* 57 */ EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 58 */ EXTERN Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 59 */ EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 60 */ EXTERN int XFreeGC(Display *display, GC gc); /* 61 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 62 */ EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 63 */ EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 64 */ EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 65 */ EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 66 */ EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 67 */ EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 68 */ EXTERN int XSetFont(Display *display, GC gc, Font font); /* 69 */ EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 70 */ EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 71 */ EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 72 */ EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 73 */ EXTERN int XSetFunction(Display *display, GC gc, int function); /* 74 */ EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 75 */ EXTERN int _XInitImageFuncPtrs(XImage *image); /* 76 */ EXTERN XIC XCreateIC(XIM xim, ...); /* 77 */ EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 78 */ EXTERN void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop); /* 79 */ EXTERN Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return); /* 80 */ EXTERN int XDrawSegments(Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 81 */ EXTERN int XForceScreenSaver(Display *display, int mode); /* 82 */ EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 83 */ EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 84 */ EXTERN int XClearWindow(Display *d, Window w); /* 85 */ EXTERN int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y); /* 86 */ EXTERN int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 87 */ EXTERN int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 88 */ EXTERN int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out); /* 89 */ EXTERN int XQueryColors(Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 90 */ EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 91 */ EXTERN int XSync(Display *display, Bool discard); /* 92 */ EXTERN Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 93 */ EXTERN int XDeleteProperty(Display *d, Window w, Atom a); /* 94 */ EXTERN int XFreeCursor(Display *d, Cursor c); /* 95 */ EXTERN int XGetInputFocus(Display *d, Window *w, int *i); /* 96 */ EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 97 */ EXTERN int XNextEvent(Display *d, XEvent *x); /* 98 */ EXTERN int XPutBackEvent(Display *d, XEvent *x); /* 99 */ EXTERN int XSetCommand(Display *d, Window w, char **c, int i); /* 100 */ EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); /* 101 */ EXTERN Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x); /* 102 */ EXTERN Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip); /* 103 */ EXTERN Status XIconifyWindow(Display *d, Window w, int i); /* 104 */ EXTERN Status XWithdrawWindow(Display *d, Window w, int i); /* 105 */ EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b); /* 106 */ EXTERN int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 107 */ EXTERN int XFlush(Display *display); /* 108 */ EXTERN int XGrabServer(Display *display); /* 109 */ EXTERN int XUngrabServer(Display *display); /* 110 */ EXTERN int XFree(void *data); /* 111 */ EXTERN int XNoOp(Display *display); /* 112 */ EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); /* 113 */ EXTERN Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 114 */ EXTERN VisualID XVisualIDFromVisual(Visual *visual); /* Slot 115 is reserved */ /* Slot 116 is reserved */ /* Slot 117 is reserved */ /* Slot 118 is reserved */ /* Slot 119 is reserved */ |
︙ | ︙ | |||
822 823 824 825 826 827 828 | int n); /* 131 */ EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n); /* 132 */ EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n); | | < < | < < | < < | > | > > > | > > > | 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 | int n); /* 131 */ EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n); /* 132 */ EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* Slot 133 is reserved */ /* Slot 134 is reserved */ /* Slot 135 is reserved */ /* 136 */ EXTERN int XReparentWindow(Display *d, Window w, Window p, int x, int y); /* 137 */ EXTERN int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h); /* 138 */ EXTERN Region XPolygonRegion(XPoint *pts, int n, int rule); /* 139 */ EXTERN int XPointInRegion(Region rgn, int x, int y); /* 140 */ EXTERN XVaNestedList XVaCreateNestedList(int dummy, ...); /* 141 */ EXTERN char * XSetICValues(XIC xic, ...); /* 142 */ EXTERN char * XGetICValues(XIC xic, ...); /* 143 */ EXTERN void XSetICFocus(XIC xic); /* 144 */ EXTERN void XDestroyIC(XIC xic); /* 145 */ EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 146 */ EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 147 */ EXTERN void XFreeFontSet(Display *display, XFontSet fontset); /* 148 */ EXTERN int XCloseIM(XIM im); /* 149 */ EXTERN Bool XRegisterIMInstantiateCallback(Display *dpy, struct _XrmHashBucketRec *rbd, |
︙ | ︙ | |||
1066 1067 1068 1069 1070 1071 1072 | int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ char * (*xGetAtomName) (Display *d, Atom a); /* 4 */ char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ | < < | < | | | | < < < | | | | < | | | | | < | | | | | | | < | | < | | < | < | | | < | | | < < < | < | | | | | < | | | | | | | | | < | | | < < < < | < | | | | | | | | | | | | | | | | | | | | | | > > | < | > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 | int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ char * (*xGetAtomName) (Display *d, Atom a); /* 4 */ char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ GContext (*xGContextFromGC) (GC g); /* 7 */ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 8 */ KeySym (*xStringToKeysym) (_Xconst char *c); /* 9 */ Window (*xRootWindow) (Display *d, int i); /* 10 */ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ int (*xBell) (Display *d, int i); /* 13 */ int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ int (*xDestroyWindow) (Display *d, Window w); /* 21 */ int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 34 */ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 35 */ int (*xMapWindow) (Display *d, Window w); /* 36 */ int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 37 */ int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 38 */ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 39 */ int (*xRaiseWindow) (Display *d, Window w); /* 40 */ int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 41 */ int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 42 */ int (*xSelectInput) (Display *d, Window w, long l); /* 43 */ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 51 */ int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ int (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ int (*xUngrabPointer) (Display *d, Time t); /* 55 */ int (*xUnmapWindow) (Display *d, Window w); /* 56 */ int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ int (*xFreeGC) (Display *display, GC gc); /* 60 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ XIC (*xCreateIC) (XIM xim, ...); /* 76 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 78 */ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ int (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ int (*xForceScreenSaver) (Display *display, int mode); /* 81 */ int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ int (*xClearWindow) (Display *d, Window w); /* 84 */ int (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ int (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ int (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ int (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ int (*xSync) (Display *display, Bool discard); /* 91 */ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 92 */ int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 93 */ int (*xFreeCursor) (Display *d, Cursor c); /* 94 */ int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 95 */ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 96 */ int (*xNextEvent) (Display *d, XEvent *x); /* 97 */ int (*xPutBackEvent) (Display *d, XEvent *x); /* 98 */ int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 99 */ int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 100 */ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 101 */ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 102 */ Status (*xIconifyWindow) (Display *d, Window w, int i); /* 103 */ Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 104 */ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 105 */ int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 106 */ int (*xFlush) (Display *display); /* 107 */ int (*xGrabServer) (Display *display); /* 108 */ int (*xUngrabServer) (Display *display); /* 109 */ int (*xFree) (void *data); /* 110 */ int (*xNoOp) (Display *display); /* 111 */ XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 113 */ VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ void (*reserved115)(void); void (*reserved116)(void); void (*reserved117)(void); void (*reserved118)(void); void (*reserved119)(void); int (*xOffsetRegion) (Region rgn, int dx, int dy); /* 120 */ int (*xUnionRegion) (Region srca, Region srcb, Region dr_return); /* 121 */ Window (*xCreateWindow) (Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, Visual *visual, unsigned long value_mask, XSetWindowAttributes *attributes); /* 122 */ void (*reserved123)(void); void (*reserved124)(void); void (*reserved125)(void); void (*reserved126)(void); void (*reserved127)(void); void (*reserved128)(void); int (*xLowerWindow) (Display *d, Window w); /* 129 */ int (*xFillArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 130 */ int (*xDrawArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 131 */ int (*xDrawRectangles) (Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* 132 */ void (*reserved133)(void); void (*reserved134)(void); void (*reserved135)(void); int (*xReparentWindow) (Display *d, Window w, Window p, int x, int y); /* 136 */ int (*xPutImage) (Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h); /* 137 */ Region (*xPolygonRegion) (XPoint *pts, int n, int rule); /* 138 */ int (*xPointInRegion) (Region rgn, int x, int y); /* 139 */ XVaNestedList (*xVaCreateNestedList) (int dummy, ...); /* 140 */ char * (*xSetICValues) (XIC xic, ...); /* 141 */ char * (*xGetICValues) (XIC xic, ...); /* 142 */ void (*xSetICFocus) (XIC xic); /* 143 */ void (*xDestroyIC) (XIC xic); /* 144 */ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 145 */ Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 146 */ void (*xFreeFontSet) (Display *display, XFontSet fontset); /* 147 */ int (*xCloseIM) (XIM im); /* 148 */ Bool (*xRegisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 149 */ Bool (*xUnregisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 150 */ char * (*xSetLocaleModifiers) (const char *modifier_list); /* 151 */ XIM (*xOpenIM) (Display *dpy, struct _XrmHashBucketRec *rdb, char *res_name, char *res_class); /* 152 */ char * (*xGetIMValues) (XIM im, ...); /* 153 */ |
︙ | ︙ | |||
1554 1555 1556 1557 1558 1559 1560 | (tkIntXlibStubsPtr->xGetImage) /* 3 */ #define XGetAtomName \ (tkIntXlibStubsPtr->xGetAtomName) /* 4 */ #define XKeysymToString \ (tkIntXlibStubsPtr->xKeysymToString) /* 5 */ #define XCreateColormap \ (tkIntXlibStubsPtr->xCreateColormap) /* 6 */ | < < < < | < < | | | | < < < < < < | | | | < < | | | | | < < | | | | | | | < < | | < < | | < < | < < | | | < < | | | < < < < < < | < < | | | | | < < | | | | | | | | | < < | | | < < < < < < < < | < < | | | | | | | | | | | | | | | | | | | | | | | | > > | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 | (tkIntXlibStubsPtr->xGetImage) /* 3 */ #define XGetAtomName \ (tkIntXlibStubsPtr->xGetAtomName) /* 4 */ #define XKeysymToString \ (tkIntXlibStubsPtr->xKeysymToString) /* 5 */ #define XCreateColormap \ (tkIntXlibStubsPtr->xCreateColormap) /* 6 */ #define XGContextFromGC \ (tkIntXlibStubsPtr->xGContextFromGC) /* 7 */ #define XKeycodeToKeysym \ (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 8 */ #define XStringToKeysym \ (tkIntXlibStubsPtr->xStringToKeysym) /* 9 */ #define XRootWindow \ (tkIntXlibStubsPtr->xRootWindow) /* 10 */ #define XSetErrorHandler \ (tkIntXlibStubsPtr->xSetErrorHandler) /* 11 */ #define XAllocColor \ (tkIntXlibStubsPtr->xAllocColor) /* 12 */ #define XBell \ (tkIntXlibStubsPtr->xBell) /* 13 */ #define XChangeProperty \ (tkIntXlibStubsPtr->xChangeProperty) /* 14 */ #define XChangeWindowAttributes \ (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 15 */ #define XConfigureWindow \ (tkIntXlibStubsPtr->xConfigureWindow) /* 16 */ #define XCopyArea \ (tkIntXlibStubsPtr->xCopyArea) /* 17 */ #define XCopyPlane \ (tkIntXlibStubsPtr->xCopyPlane) /* 18 */ #define XCreateBitmapFromData \ (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 19 */ #define XDefineCursor \ (tkIntXlibStubsPtr->xDefineCursor) /* 20 */ #define XDestroyWindow \ (tkIntXlibStubsPtr->xDestroyWindow) /* 21 */ #define XDrawArc \ (tkIntXlibStubsPtr->xDrawArc) /* 22 */ #define XDrawLines \ (tkIntXlibStubsPtr->xDrawLines) /* 23 */ #define XDrawRectangle \ (tkIntXlibStubsPtr->xDrawRectangle) /* 24 */ #define XFillArc \ (tkIntXlibStubsPtr->xFillArc) /* 25 */ #define XFillPolygon \ (tkIntXlibStubsPtr->xFillPolygon) /* 26 */ #define XFillRectangles \ (tkIntXlibStubsPtr->xFillRectangles) /* 27 */ #define XFreeColormap \ (tkIntXlibStubsPtr->xFreeColormap) /* 28 */ #define XFreeColors \ (tkIntXlibStubsPtr->xFreeColors) /* 29 */ #define XFreeModifiermap \ (tkIntXlibStubsPtr->xFreeModifiermap) /* 30 */ #define XGetGeometry \ (tkIntXlibStubsPtr->xGetGeometry) /* 31 */ #define XGetWindowProperty \ (tkIntXlibStubsPtr->xGetWindowProperty) /* 32 */ #define XGrabKeyboard \ (tkIntXlibStubsPtr->xGrabKeyboard) /* 33 */ #define XGrabPointer \ (tkIntXlibStubsPtr->xGrabPointer) /* 34 */ #define XKeysymToKeycode \ (tkIntXlibStubsPtr->xKeysymToKeycode) /* 35 */ #define XMapWindow \ (tkIntXlibStubsPtr->xMapWindow) /* 36 */ #define XMoveResizeWindow \ (tkIntXlibStubsPtr->xMoveResizeWindow) /* 37 */ #define XMoveWindow \ (tkIntXlibStubsPtr->xMoveWindow) /* 38 */ #define XQueryPointer \ (tkIntXlibStubsPtr->xQueryPointer) /* 39 */ #define XRaiseWindow \ (tkIntXlibStubsPtr->xRaiseWindow) /* 40 */ #define XRefreshKeyboardMapping \ (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 41 */ #define XResizeWindow \ (tkIntXlibStubsPtr->xResizeWindow) /* 42 */ #define XSelectInput \ (tkIntXlibStubsPtr->xSelectInput) /* 43 */ #define XSendEvent \ (tkIntXlibStubsPtr->xSendEvent) /* 44 */ #define XSetIconName \ (tkIntXlibStubsPtr->xSetIconName) /* 45 */ #define XSetInputFocus \ (tkIntXlibStubsPtr->xSetInputFocus) /* 46 */ #define XSetSelectionOwner \ (tkIntXlibStubsPtr->xSetSelectionOwner) /* 47 */ #define XSetWindowBackground \ (tkIntXlibStubsPtr->xSetWindowBackground) /* 48 */ #define XSetWindowBackgroundPixmap \ (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 49 */ #define XSetWindowBorder \ (tkIntXlibStubsPtr->xSetWindowBorder) /* 50 */ #define XSetWindowBorderPixmap \ (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 51 */ #define XSetWindowBorderWidth \ (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 52 */ #define XSetWindowColormap \ (tkIntXlibStubsPtr->xSetWindowColormap) /* 53 */ #define XUngrabKeyboard \ (tkIntXlibStubsPtr->xUngrabKeyboard) /* 54 */ #define XUngrabPointer \ (tkIntXlibStubsPtr->xUngrabPointer) /* 55 */ #define XUnmapWindow \ (tkIntXlibStubsPtr->xUnmapWindow) /* 56 */ #define TkPutImage \ (tkIntXlibStubsPtr->tkPutImage) /* 57 */ #define XParseColor \ (tkIntXlibStubsPtr->xParseColor) /* 58 */ #define XCreateGC \ (tkIntXlibStubsPtr->xCreateGC) /* 59 */ #define XFreeGC \ (tkIntXlibStubsPtr->xFreeGC) /* 60 */ #define XInternAtom \ (tkIntXlibStubsPtr->xInternAtom) /* 61 */ #define XSetBackground \ (tkIntXlibStubsPtr->xSetBackground) /* 62 */ #define XSetForeground \ (tkIntXlibStubsPtr->xSetForeground) /* 63 */ #define XSetClipMask \ (tkIntXlibStubsPtr->xSetClipMask) /* 64 */ #define XSetClipOrigin \ (tkIntXlibStubsPtr->xSetClipOrigin) /* 65 */ #define XSetTSOrigin \ (tkIntXlibStubsPtr->xSetTSOrigin) /* 66 */ #define XChangeGC \ (tkIntXlibStubsPtr->xChangeGC) /* 67 */ #define XSetFont \ (tkIntXlibStubsPtr->xSetFont) /* 68 */ #define XSetArcMode \ (tkIntXlibStubsPtr->xSetArcMode) /* 69 */ #define XSetStipple \ (tkIntXlibStubsPtr->xSetStipple) /* 70 */ #define XSetFillRule \ (tkIntXlibStubsPtr->xSetFillRule) /* 71 */ #define XSetFillStyle \ (tkIntXlibStubsPtr->xSetFillStyle) /* 72 */ #define XSetFunction \ (tkIntXlibStubsPtr->xSetFunction) /* 73 */ #define XSetLineAttributes \ (tkIntXlibStubsPtr->xSetLineAttributes) /* 74 */ #define _XInitImageFuncPtrs \ (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 75 */ #define XCreateIC \ (tkIntXlibStubsPtr->xCreateIC) /* 76 */ #define XGetVisualInfo \ (tkIntXlibStubsPtr->xGetVisualInfo) /* 77 */ #define XSetWMClientMachine \ (tkIntXlibStubsPtr->xSetWMClientMachine) /* 78 */ #define XStringListToTextProperty \ (tkIntXlibStubsPtr->xStringListToTextProperty) /* 79 */ #define XDrawSegments \ (tkIntXlibStubsPtr->xDrawSegments) /* 80 */ #define XForceScreenSaver \ (tkIntXlibStubsPtr->xForceScreenSaver) /* 81 */ #define XDrawLine \ (tkIntXlibStubsPtr->xDrawLine) /* 82 */ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 83 */ #define XClearWindow \ (tkIntXlibStubsPtr->xClearWindow) /* 84 */ #define XDrawPoint \ (tkIntXlibStubsPtr->xDrawPoint) /* 85 */ #define XDrawPoints \ (tkIntXlibStubsPtr->xDrawPoints) /* 86 */ #define XWarpPointer \ (tkIntXlibStubsPtr->xWarpPointer) /* 87 */ #define XQueryColor \ (tkIntXlibStubsPtr->xQueryColor) /* 88 */ #define XQueryColors \ (tkIntXlibStubsPtr->xQueryColors) /* 89 */ #define XQueryTree \ (tkIntXlibStubsPtr->xQueryTree) /* 90 */ #define XSync \ (tkIntXlibStubsPtr->xSync) /* 91 */ #define XTranslateCoordinates \ (tkIntXlibStubsPtr->xTranslateCoordinates) /* 92 */ #define XDeleteProperty \ (tkIntXlibStubsPtr->xDeleteProperty) /* 93 */ #define XFreeCursor \ (tkIntXlibStubsPtr->xFreeCursor) /* 94 */ #define XGetInputFocus \ (tkIntXlibStubsPtr->xGetInputFocus) /* 95 */ #define XmbLookupString \ (tkIntXlibStubsPtr->xmbLookupString) /* 96 */ #define XNextEvent \ (tkIntXlibStubsPtr->xNextEvent) /* 97 */ #define XPutBackEvent \ (tkIntXlibStubsPtr->xPutBackEvent) /* 98 */ #define XSetCommand \ (tkIntXlibStubsPtr->xSetCommand) /* 99 */ #define XWindowEvent \ (tkIntXlibStubsPtr->xWindowEvent) /* 100 */ #define XGetWindowAttributes \ (tkIntXlibStubsPtr->xGetWindowAttributes) /* 101 */ #define XGetWMColormapWindows \ (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 102 */ #define XIconifyWindow \ (tkIntXlibStubsPtr->xIconifyWindow) /* 103 */ #define XWithdrawWindow \ (tkIntXlibStubsPtr->xWithdrawWindow) /* 104 */ #define XListHosts \ (tkIntXlibStubsPtr->xListHosts) /* 105 */ #define XSetClipRectangles \ (tkIntXlibStubsPtr->xSetClipRectangles) /* 106 */ #define XFlush \ (tkIntXlibStubsPtr->xFlush) /* 107 */ #define XGrabServer \ (tkIntXlibStubsPtr->xGrabServer) /* 108 */ #define XUngrabServer \ (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ #define XFree \ (tkIntXlibStubsPtr->xFree) /* 110 */ #define XNoOp \ (tkIntXlibStubsPtr->xNoOp) /* 111 */ #define XSynchronize \ (tkIntXlibStubsPtr->xSynchronize) /* 112 */ #define XLookupColor \ (tkIntXlibStubsPtr->xLookupColor) /* 113 */ #define XVisualIDFromVisual \ (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ /* Slot 115 is reserved */ /* Slot 116 is reserved */ /* Slot 117 is reserved */ /* Slot 118 is reserved */ /* Slot 119 is reserved */ |
︙ | ︙ | |||
1795 1796 1797 1798 1799 1800 1801 | (tkIntXlibStubsPtr->xLowerWindow) /* 129 */ #define XFillArcs \ (tkIntXlibStubsPtr->xFillArcs) /* 130 */ #define XDrawArcs \ (tkIntXlibStubsPtr->xDrawArcs) /* 131 */ #define XDrawRectangles \ (tkIntXlibStubsPtr->xDrawRectangles) /* 132 */ | < | < | < | > | > | > | | 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | (tkIntXlibStubsPtr->xLowerWindow) /* 129 */ #define XFillArcs \ (tkIntXlibStubsPtr->xFillArcs) /* 130 */ #define XDrawArcs \ (tkIntXlibStubsPtr->xDrawArcs) /* 131 */ #define XDrawRectangles \ (tkIntXlibStubsPtr->xDrawRectangles) /* 132 */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ /* Slot 135 is reserved */ #define XReparentWindow \ (tkIntXlibStubsPtr->xReparentWindow) /* 136 */ #define XPutImage \ (tkIntXlibStubsPtr->xPutImage) /* 137 */ #define XPolygonRegion \ (tkIntXlibStubsPtr->xPolygonRegion) /* 138 */ #define XPointInRegion \ (tkIntXlibStubsPtr->xPointInRegion) /* 139 */ #define XVaCreateNestedList \ (tkIntXlibStubsPtr->xVaCreateNestedList) /* 140 */ #define XSetICValues \ (tkIntXlibStubsPtr->xSetICValues) /* 141 */ #define XGetICValues \ (tkIntXlibStubsPtr->xGetICValues) /* 142 */ #define XSetICFocus \ (tkIntXlibStubsPtr->xSetICFocus) /* 143 */ #define XDestroyIC \ (tkIntXlibStubsPtr->xDestroyIC) /* 144 */ #define XCreatePixmapCursor \ (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 145 */ #define XCreateGlyphCursor \ (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 146 */ #define XFreeFontSet \ (tkIntXlibStubsPtr->xFreeFontSet) /* 147 */ #define XCloseIM \ (tkIntXlibStubsPtr->xCloseIM) /* 148 */ #define XRegisterIMInstantiateCallback \ (tkIntXlibStubsPtr->xRegisterIMInstantiateCallback) /* 149 */ #define XUnregisterIMInstantiateCallback \ |
︙ | ︙ |
Changes to generic/tkListbox.c.
︙ | ︙ | |||
111 112 113 114 115 116 117 | * horizontal scrolling (window scrolls * horizontally in increments of this size). * This is an average character size. */ int xOffset; /* The left edge of each string in the listbox * is offset to the left by this many pixels * (0 means no offset, positive means there is * an offset). This is x scrolling information | | | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | * horizontal scrolling (window scrolls * horizontally in increments of this size). * This is an average character size. */ int xOffset; /* The left edge of each string in the listbox * is offset to the left by this many pixels * (0 means no offset, positive means there is * an offset). This is x scrolling information * is not linked to justification. */ /* * Information about what's selected or active, if any. */ Tk_Uid selectMode; /* Selection style: single, browse, multiple, * or extended. This value isn't used in C |
︙ | ︙ | |||
870 871 872 873 874 875 876 | break; } if (index < 0 || index >= (int)listPtr->nElements) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item number \"%s\" out of range", Tcl_GetString(objv[2]))); | | | 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | break; } if (index < 0 || index >= (int)listPtr->nElements) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item number \"%s\" out of range", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", (char *)NULL); result = TCL_ERROR; break; } attrPtr = ListboxGetItemAttributes(interp, listPtr, index); objPtr = Tk_GetOptionValue(interp, (char *) attrPtr, |
︙ | ︙ | |||
907 908 909 910 911 912 913 | break; } if (index < 0 || index >= (int)listPtr->nElements) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item number \"%s\" out of range", Tcl_GetString(objv[2]))); | | | 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | break; } if (index < 0 || index >= (int)listPtr->nElements) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item number \"%s\" out of range", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", (char *)NULL); result = TCL_ERROR; break; } attrPtr = ListboxGetItemAttributes(interp, listPtr, index); if (objc <= 4) { objPtr = Tk_GetOptionInfo(interp, attrPtr, |
︙ | ︙ | |||
1107 1108 1109 1110 1111 1112 1113 | return result; } stringRep = Tcl_GetStringFromObj(el, &stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); | | | | | | | | | | | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | return result; } stringRep = Tcl_GetStringFromObj(el, &stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); if (listPtr->justify == TK_JUSTIFY_LEFT) { x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) - pixelWidth - listPtr->xOffset + GetMaxOffset(listPtr); } else { x = (Tk_Width(tkwin) - pixelWidth)/2 - listPtr->xOffset + GetMaxOffset(listPtr)/2; } y = ((index - listPtr->topIndex)*listPtr->lineHeight) + listPtr->inset + listPtr->selBorderWidth; results[0] = Tcl_NewWideIntObj(x); results[1] = Tcl_NewWideIntObj(y); results[2] = Tcl_NewWideIntObj(pixelWidth); results[3] = Tcl_NewWideIntObj(fm.linespace); Tcl_SetObjResult(interp, Tcl_NewListObj(4, results)); |
︙ | ︙ | |||
2068 2069 2070 2071 2072 2073 2074 | } } /* * Draw the actual text of this item. */ | | | | | | | | | | | | | | | 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 | } } /* * Draw the actual text of this item. */ Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); stringRep = Tcl_GetStringFromObj(curElement, &stringLen); textWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); y += fm.ascent + listPtr->selBorderWidth; if (listPtr->justify == TK_JUSTIFY_LEFT) { x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) - textWidth - listPtr->xOffset + GetMaxOffset(listPtr); } else { x = (Tk_Width(tkwin) - textWidth)/2 - listPtr->xOffset + GetMaxOffset(listPtr)/2; } Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, stringRep, stringLen, x, y); /* * If this is the active element, apply the activestyle to it. */ if ((i == listPtr->active) && (listPtr->flags & GOT_FOCUS)) { |
︙ | ︙ | |||
2765 2766 2767 2768 2769 2770 2771 | /* * The index didn't match any of the named indices; maybe it's an @x,y */ stringRep = Tcl_GetString(indexObj); if (stringRep[0] == '@') { | | | | | 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 | /* * The index didn't match any of the named indices; maybe it's an @x,y */ stringRep = Tcl_GetString(indexObj); if (stringRep[0] == '@') { /* * @x,y index */ int y; char *start; char *rest; start = stringRep + 1; rest = strchr(start, ','); |
︙ | ︙ | |||
2800 2801 2802 2803 2804 2805 2806 | * Everything failed, nothing matched. Throw up an error message. */ badIndex: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad listbox index \"%s\": must be active, anchor, end, @x,y," " or an index", Tcl_GetString(indexObj))); | | | 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 | * Everything failed, nothing matched. Throw up an error message. */ badIndex: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad listbox index \"%s\": must be active, anchor, end, @x,y," " or an index", Tcl_GetString(indexObj))); Tcl_SetErrorCode(interp, "TK", "VALUE", "LISTBOX_INDEX", (char *)NULL); return TCL_ERROR; } /* *---------------------------------------------------------------------- * * ChangeListboxView -- |
︙ | ︙ | |||
3199 3200 3201 3202 3203 3204 3205 | void *clientData) /* Information about listbox widget. */ { Listbox *listPtr = (Listbox *)clientData; if ((listPtr->exportSelection) && (!Tcl_IsSafe(listPtr->interp)) && (listPtr->nElements > 0)) { ListboxSelect(listPtr, 0, listPtr->nElements-1, 0); | | | 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 | void *clientData) /* Information about listbox widget. */ { Listbox *listPtr = (Listbox *)clientData; if ((listPtr->exportSelection) && (!Tcl_IsSafe(listPtr->interp)) && (listPtr->nElements > 0)) { ListboxSelect(listPtr, 0, listPtr->nElements-1, 0); GenerateListboxSelectEvent(listPtr); } } /* *---------------------------------------------------------------------- * * GenerateListboxSelectEvent -- |
︙ | ︙ | |||
3444 3445 3446 3447 3448 3449 3450 | /* * Bwah hahahaha! Puny mortal, you can't unset a -listvar'd variable! */ if (flags & TCL_TRACE_UNSETS) { | | | | | | | | | | | | | | | | | | | | | | 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 | /* * Bwah hahahaha! Puny mortal, you can't unset a -listvar'd variable! */ if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && listPtr->listVarName) { void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, listPtr->listVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ListboxListVarProc, probe); if (probe == (void *)listPtr) { break; } } while (probe); if (probe) { /* * We were able to fetch the unset trace for our * listVarName, 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. */ return NULL; } Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL, listPtr->listObj, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, listPtr->listVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ListboxListVarProc, clientData); return NULL; } |
︙ | ︙ | |||
3646 3647 3648 3649 3650 3651 3652 | */ static int GetMaxOffset( Listbox *listPtr) { int maxOffset; maxOffset = listPtr->maxWidth - | | | | | | | | 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 | */ static int GetMaxOffset( Listbox *listPtr) { int maxOffset; maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; if (maxOffset < 0) { /* * Listbox is larger in width than its largest width item. */ maxOffset = 0; } maxOffset -= maxOffset % listPtr->xScrollUnit; return maxOffset; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to generic/tkMain.c.
︙ | ︙ | |||
159 160 161 162 163 164 165 | * This function initializes the Tk world and then starts interpreting * commands; almost anything could happen, depending on the script being * interpreted. * *---------------------------------------------------------------------- */ | | | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | * This function initializes the Tk world and then starts interpreting * commands; almost anything could happen, depending on the script being * interpreted. * *---------------------------------------------------------------------- */ TCL_NORETURN1 void Tk_MainEx( Tcl_Size argc, /* Number of arguments. */ TCHAR **argv, /* Array of argument strings. */ Tcl_AppInitProc *appInitProc, /* Application-specific initialization * function to call after most initialization * but before starting to execute commands. */ |
︙ | ︙ | |||
185 186 187 188 189 190 191 | ++i; } /* * Ensure that we are getting a compatible version of Tcl. */ | | | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | ++i; } /* * Ensure that we are getting a compatible version of Tcl. */ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { abort(); } else { Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp))); } } #if defined(_WIN32) && !defined(UNICODE) && !defined(STATIC_BUILD) if (tclStubsPtr->tcl_CreateFileHandler) { /* We are running win32 Tk under Cygwin, so let's check * whether the env("DISPLAY") variable or the -display * argument is set. If so, we really want to run the * Tk_MainEx function of libtk8.?.dll, not this one. */ if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { loadCygwinTk: TkCygwinMainEx(argc, argv, appInitProc, interp); /* Only returns when Tk_MainEx() was not found */ } else { Tcl_Size j; |
︙ | ︙ | |||
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | /* * If the application has not already set a startup script, parse the * first few command line arguments to determine the script path and * encoding. */ if (NULL == Tcl_GetStartupScript(NULL)) { /* * Check whether first 3 args (argv[1] - argv[3]) look like * -encoding ENCODING FILENAME * or like * FILENAME * or like * -file FILENAME (ancient history support only, removed with Tcl 9.0) */ /* mind argc is being adjusted as we proceed */ if ((argc >= 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1])) && ('-' != argv[3][0])) { Tcl_Obj *value = NewNativeObj(argv[2]); | > > > | < > > > > > > > > | | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | /* * If the application has not already set a startup script, parse the * first few command line arguments to determine the script path and * encoding. */ if (NULL == Tcl_GetStartupScript(NULL)) { #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 size_t length; #endif /* * Check whether first 3 args (argv[1] - argv[3]) look like * -encoding ENCODING FILENAME * or like * FILENAME * or like * -file FILENAME (ancient history support only, removed with Tcl 9.0) */ /* mind argc is being adjusted as we proceed */ if ((argc >= 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1])) && ('-' != argv[3][0])) { Tcl_Obj *value = NewNativeObj(argv[2]); Tcl_SetStartupScript(NewNativeObj(argv[3]), Tcl_GetString(value)); Tcl_DecrRefCount(value); argc -= 3; i += 3; } else if ((argc >= 1) && ('-' != argv[1][0])) { Tcl_SetStartupScript(NewNativeObj(argv[1]), NULL); argc--; i++; #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 } else if ((argc >= 2) && (length = _tcslen(argv[1])) && (length > 1) && (0 == _tcsncmp(TEXT("-file"), argv[1], length)) && ('-' != argv[2][0])) { Tcl_SetStartupScript(NewNativeObj(argv[2]), NULL); argc -= 2; i += 2; #endif } } path = Tcl_GetStartupScript(&encodingName); if (path == NULL) { appName = NewNativeObj(argv[0]); } else { appName = path; } Tcl_SetVar2Ex(interp, "argv0", NULL, appName, TCL_GLOBAL_ONLY); Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY); argvPtr = Tcl_NewListObj(0, NULL); while (argc--) { Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(argv[i++])); } Tcl_SetVar2Ex(interp, "argv", NULL, argvPtr, TCL_GLOBAL_ONLY); |
︙ | ︙ | |||
304 305 306 307 308 309 310 | if (!is.tty) { struct stat st; nullStdin = fstat(0, &st) || (S_ISCHR(st.st_mode) && !st.st_blocks); } #endif Tcl_SetVar2Ex(interp, "tcl_interactive", NULL, | | | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | if (!is.tty) { struct stat st; nullStdin = fstat(0, &st) || (S_ISCHR(st.st_mode) && !st.st_blocks); } #endif Tcl_SetVar2Ex(interp, "tcl_interactive", NULL, Tcl_NewBooleanObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY); /* * Invoke application-specific initialization. */ if (appInitProc(interp) != TCL_OK) { TkpDisplayWarning(Tcl_GetString(Tcl_GetObjResult(interp)), |
︙ | ︙ |
Changes to generic/tkMenu.c.
︙ | ︙ | |||
274 275 276 277 278 279 280 | DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-postcommand", "postCommand", "Command", DEF_MENU_POST_COMMAND, offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", | | | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-postcommand", "postCommand", "Command", DEF_MENU_POST_COMMAND, offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background", DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0, DEF_MENU_SELECT_MONO, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENU_TAKE_FOCUS, offsetof(TkMenu, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff", |
︙ | ︙ | |||
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | Tcl_WrongNumArgs(interp, 2, objv, "string"); goto error; } if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } if (index < 0) { Tcl_SetObjResult(interp, Tcl_NewObj()); } else { Tcl_SetObjResult(interp, TkNewIndexObj(index)); } break; } case MENU_INSERT: if (objc < 4) { | > > > > | 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 | Tcl_WrongNumArgs(interp, 2, objv, "string"); goto error; } if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } if (index < 0) { #if defined(TK_NO_DEPRECATED) Tcl_SetObjResult(interp, Tcl_NewObj()); #else Tcl_SetObjResult(interp, Tcl_NewStringObj("none", TCL_INDEX_NONE)); #endif } else { Tcl_SetObjResult(interp, TkNewIndexObj(index)); } break; } case MENU_INSERT: if (objc < 4) { |
︙ | ︙ | |||
896 897 898 899 900 901 902 | goto error; } if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) { goto error; } if (objc == 5) { | | | | | | | | 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | goto error; } if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) { goto error; } if (objc == 5) { if (GetMenuIndex(interp, menuPtr, objv[4], 0, &index) != TCL_OK) { goto error; } } /* * Tearoff menus are the same as ordinary menus on the Mac and are * posted differently on Windows than non-tearoffs. TkpPostMenu * does not actually map the menu's window on those platforms, and * popup menus have to be handled specially. Also, menubar menus are * not intended to be posted (bug 1567681, 2160206). */ if (menuPtr->menuType == MENUBAR) { Tcl_AppendResult(interp, "a menubar menu cannot be posted", NULL); return TCL_ERROR; } else if (menuPtr->menuType != TEAROFF_MENU) { result = TkpPostMenu(interp, menuPtr, x, y, index); } else { result = TkpPostTearoffMenu(interp, menuPtr, x, y, index); } break; } case MENU_POSTCASCADE: { |
︙ | ︙ | |||
1004 1005 1006 1007 1008 1009 1010 | * associated with that index. * * Results: * Standard Tcl result. * * Side effects: * Commands may get excecuted; variables may get set; sub-menus may get | | > > > > | | | 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 | * associated with that index. * * Results: * Standard Tcl result. * * Side effects: * Commands may get excecuted; variables may get set; sub-menus may get * posted, the passed menu may be destroyed. * *---------------------------------------------------------------------- */ int TkInvokeMenu( Tcl_Interp *interp, /* The interp that the menu lives in. */ TkMenu *menuPtr, /* The menu we are invoking. */ /* Must be protected by Tcl_Preserve * against freeing by the caller. * Tk Bug [2d3a81c0]. */ Tcl_Size index) /* The zero based index of the item we are * invoking. */ { int result = TCL_OK; TkMenuEntry *mePtr; if (index < 0) { goto done; } |
︙ | ︙ | |||
1193 1194 1195 1196 1197 1198 1199 | /* * Free up all the stuff that requires special handling, then let * Tk_FreeConfigOptions handle all the standard option-related stuff. */ for (i = menuPtr->numEntries; --i >= 0; ) { | | | | | | | | | | | 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 | /* * Free up all the stuff that requires special handling, then let * Tk_FreeConfigOptions handle all the standard option-related stuff. */ for (i = menuPtr->numEntries; --i >= 0; ) { /* * Clean up the hash entry for the menu item ID. * This cannot be postponed until the entry is eventually freed, * because the hash table may already have been deleted by then. */ if (menuPtr->entries[i]->entryPtr) { Tcl_DeleteHashEntry(menuPtr->entries[i]->entryPtr); menuPtr->entries[i]->entryPtr = NULL; } /* * As each menu entry is deleted from the end of the array of entries, * decrement menuPtr->numEntries. Otherwise, the act of deleting menu * entry i will dereference freed memory attempting to queue a redraw * for menu entries (i+1)...numEntries. */ |
︙ | ︙ | |||
1491 1492 1493 1494 1495 1496 1497 | const char *varName = Tcl_GetString(mePtr->namePtr); Tcl_UntraceVar2(menuPtr->interp, varName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, mePtr); } if (mePtr->entryPtr) { | | | | 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 | const char *varName = Tcl_GetString(mePtr->namePtr); Tcl_UntraceVar2(menuPtr->interp, varName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, mePtr); } if (mePtr->entryPtr) { Tcl_DeleteHashEntry(mePtr->entryPtr); mePtr->entryPtr = NULL; } TkpDestroyMenuEntry(mePtr); TkMenuEntryFreeDrawOptions(mePtr); Tk_FreeConfigOptions(mePtr, mePtr->optionTable, menuPtr->tkwin); ckfree(mePtr); } |
︙ | ︙ | |||
2195 2196 2197 2198 2199 2200 2201 | == TCL_OK) { return TCL_OK; } } entryPtr = Tcl_FindHashEntry(&menuPtr->items, string); if (entryPtr) { | | | | | | 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 | == TCL_OK) { return TCL_OK; } } entryPtr = Tcl_FindHashEntry(&menuPtr->items, string); if (entryPtr) { TkMenuEntry *mePtr = (TkMenuEntry *)Tcl_GetHashValue(entryPtr); *indexPtr = mePtr->index; return TCL_OK; } for (i = 0; i < menuPtr->numEntries; i++) { Tcl_Obj *labelPtr = menuPtr->entries[i]->labelPtr; const char *label = (labelPtr == NULL) ? NULL : Tcl_GetString(labelPtr); if ((label != NULL) && (Tcl_StringCaseMatch(label, string, 0))) { *indexPtr = i; return TCL_OK; } } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad menu entry index \"%s\"", string)); Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", (char *)NULL); return TCL_ERROR; } /* *---------------------------------------------------------------------- * * MenuCmdDeletedProc -- |
︙ | ︙ | |||
2403 2404 2405 2406 2407 2408 2409 | } } else { index = menuPtr->numEntries; } if (index < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad menu entry index \"%s\"", Tcl_GetString(indexPtr))); | | | 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 | } } else { index = menuPtr->numEntries; } if (index < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad menu entry index \"%s\"", Tcl_GetString(indexPtr))); Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", (char *)NULL); return TCL_ERROR; } if (menuPtr->tearoff && (index == 0)) { index = 1; } /* |
︙ | ︙ | |||
2425 2426 2427 2428 2429 2430 2431 | offs = 1; /* * Check for a user supplied id */ if (objc % 2 == 0) { | | | | | | | | | 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 | offs = 1; /* * Check for a user supplied id */ if (objc % 2 == 0) { idPtr = objv[offs]; if (Tcl_FindHashEntry(&menuPtr->items, Tcl_GetString(idPtr))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "entry \"%s\" already exists", Tcl_GetString(idPtr))); Tcl_SetErrorCode(interp, "TK", "MENU", "ENTRY_EXISTS", (char *)NULL); return TCL_ERROR; } offs++; } /* * Now we have to add an entry for every instance related to this menu. */ for (menuListPtr = menuPtr->mainMenuPtr; menuListPtr != NULL; menuListPtr = menuListPtr->nextInstancePtr) { |
︙ | ︙ | |||
2469 2470 2471 2472 2473 2474 2475 | if (errorMenuPtr == menuListPtr) { break; } } return TCL_ERROR; } | | | | | | | | | | | | | | | | 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 | if (errorMenuPtr == menuListPtr) { break; } } return TCL_ERROR; } if (idPtr == NULL) { char idbuf[16]; /* Generate an id for the new entry on the main menu */ do { snprintf(idbuf, sizeof(idbuf), "e%03X", ++menuPtr->serial); entryPtr = Tcl_CreateHashEntry( &menuListPtr->items, idbuf, &isNew); } while (!isNew); idPtr = Tcl_NewStringObj(idbuf, TCL_INDEX_NONE); } else { /* Reuse the specified or previously generated id on all clones */ entryPtr = Tcl_CreateHashEntry( &menuListPtr->items, Tcl_GetString(idPtr), &isNew); } Tcl_SetHashValue(entryPtr, mePtr); mePtr->entryPtr = entryPtr; /* * If a menu has cascades, then every instance of the menu has to have * its own parallel cascade structure. So adding an entry to a menu * with clones means that the menu that the entry points to has to be * cloned for every clone the main menu has. This is special case #2 * in the comment at the top of this file. |
︙ | ︙ | |||
2589 2590 2591 2592 2593 2594 2595 | name = Tcl_GetString(mePtr->namePtr); /* * If the variable is being unset, then re-establish the trace. */ if (flags & TCL_TRACE_UNSETS) { | | | | | | | | | | | | | | | | | | | 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 | name = Tcl_GetString(mePtr->namePtr); /* * If the variable is being unset, then re-establish the trace. */ if (flags & TCL_TRACE_UNSETS) { void *probe = NULL; mePtr->entryFlags &= ~ENTRY_SELECTED; do { probe = Tcl_VarTraceInfo(interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, probe); if (probe == (void *)mePtr) { break; } } while (probe); if (probe) { /* * We were able to fetch the unset trace for our * namePtr, 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. */ return NULL; } Tcl_TraceVar2(interp, name, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, clientData); TkpConfigureMenuEntry(mePtr); TkEventuallyRedrawMenu(menuPtr, NULL); return NULL; } |
︙ | ︙ |
Changes to generic/tkMenu.h.
︙ | ︙ | |||
280 281 282 283 284 285 286 | Tcl_Obj *borderPtr; /* Structure used to draw 3-D border and * background for menu. */ Tcl_Obj *borderWidthPtr; /* Width of border around whole menu. */ Tcl_Obj *activeBorderPtr; /* Used to draw background and border for * active element (if any). */ Tcl_Obj *activeBorderWidthPtr; /* Width of border around active element. */ | | | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | Tcl_Obj *borderPtr; /* Structure used to draw 3-D border and * background for menu. */ Tcl_Obj *borderWidthPtr; /* Width of border around whole menu. */ Tcl_Obj *activeBorderPtr; /* Used to draw background and border for * active element (if any). */ Tcl_Obj *activeBorderWidthPtr; /* Width of border around active element. */ Tcl_Obj *reliefPtr; /* 3-d effect: TK_RELIEF_RAISED, etc. */ Tcl_Obj *fontPtr; /* Text font for menu entries. */ Tcl_Obj *fgPtr; /* Foreground color for entries. */ Tcl_Obj *disabledFgPtr; /* Foreground color when disabled. NULL means * use normalFg with a 50% stipple instead. */ Tcl_Obj *activeFgPtr; /* Foreground color for active entry. */ Tcl_Obj *indicatorFgPtr; /* Color for indicators in radio and check * button entries. */ |
︙ | ︙ |
Changes to generic/tkMenuDraw.c.
︙ | ︙ | |||
622 623 624 625 626 627 628 629 630 631 632 633 634 635 | Tcl_Size index; int strictMotif; Tk_Font tkfont; Tk_FontMetrics menuMetrics; int width; int borderWidth; Tk_3DBorder border; menuPtr->menuFlags &= ~REDRAW_PENDING; if ((menuPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } | > | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | Tcl_Size index; int strictMotif; Tk_Font tkfont; Tk_FontMetrics menuMetrics; int width; int borderWidth; Tk_3DBorder border; int relief; menuPtr->menuFlags &= ~REDRAW_PENDING; if ((menuPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } |
︙ | ︙ | |||
727 728 729 730 731 732 733 734 735 | * This has zero width except after menu resizing. */ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, x, y, width, height, 0, TK_RELIEF_FLAT); } Tk_Draw3DRectangle(menuPtr->tkwin, Tk_WindowId(tkwin), border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth, | > | | 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | * This has zero width except after menu resizing. */ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, x, y, width, height, 0, TK_RELIEF_FLAT); } Tk_GetReliefFromObj(NULL, menuPtr->reliefPtr, &relief); Tk_Draw3DRectangle(menuPtr->tkwin, Tk_WindowId(tkwin), border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth, relief); } /* *-------------------------------------------------------------- * * TkMenuEventProc -- * |
︙ | ︙ |
Changes to generic/tkMenubutton.c.
︙ | ︙ | |||
566 567 568 569 570 571 572 | * Recompute the geometry for the button. */ if ((mbPtr->bitmap != None) || (mbPtr->image != NULL)) { if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->widthString, &mbPtr->width) != TCL_OK) { widthError: | | | | 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 | * Recompute the geometry for the button. */ if ((mbPtr->bitmap != None) || (mbPtr->image != NULL)) { if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->widthString, &mbPtr->width) != TCL_OK) { widthError: Tcl_AddErrorInfo(interp, "\n (processing \"-width\" option)"); continue; } if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->heightString, &mbPtr->height) != TCL_OK) { heightError: Tcl_AddErrorInfo(interp, "\n (processing \"-height\" option)"); continue; } } else { if (Tcl_GetInt(interp, mbPtr->widthString, &mbPtr->width) != TCL_OK) { goto widthError; } |
︙ | ︙ |
Changes to generic/tkMessage.c.
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #include "tkInt.h" #include "default.h" /* * A data structure of the following type is kept for each message widget * managed by this file: */ typedef struct { Tk_Window tkwin; /* Window that embodies the message. NULL * means that the window has been destroyed * but the data structures haven't yet been * cleaned up.*/ Tk_OptionTable optionTable; /* Table that defines options available for | > > > > > > > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #include "tkInt.h" #include "default.h" /* * A data structure of the following type is kept for each message widget * managed by this file: */ #ifdef TK_NO_DEPRECATED # undef DEF_MESSAGE_PADX # undef DEF_MESSAGE_PADY # define DEF_MESSAGE_PADX NULL # define DEF_MESSAGE_PADY NULL #endif typedef struct { Tk_Window tkwin; /* Window that embodies the message. NULL * means that the window has been destroyed * but the data structures haven't yet been * cleaned up.*/ Tk_OptionTable optionTable; /* Table that defines options available for |
︙ | ︙ | |||
43 44 45 46 47 48 49 | * including terminating NULL. */ char *textVarName; /* Name of variable (malloc'ed) or NULL. * If non-NULL, message displays the contents * of this variable. */ Tk_3DBorder border; /* Structure used to draw 3-D border and * background. NULL means a border hasn't been * created yet. */ | | | | | < | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | * including terminating NULL. */ char *textVarName; /* Name of variable (malloc'ed) or NULL. * If non-NULL, message displays the contents * of this variable. */ Tk_3DBorder border; /* Structure used to draw 3-D border and * background. NULL means a border hasn't been * created yet. */ Tcl_Obj *borderWidthObj; /* Width of border. */ int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */ Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw * around widget when it has the focus. * 0 means don't draw a highlight. */ XColor *highlightBgColorPtr; /* Color for drawing traversal highlight * area when highlight is off. */ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ Tk_Font tkfont; /* Information about text font, or NULL. */ XColor *fgColorPtr; /* Foreground color in normal mode. */ Tcl_Obj *padXObj, *padYObj; /* Tcl_Obj rep's of padX, padY values. */ Tcl_Obj *widthObj; /* User-requested width, in pixels. 0 means * compute width using aspect ratio. */ int aspect; /* Desired aspect ratio for window * (100*width/height). */ int msgWidth; /* Width in pixels needed to display * message. */ int msgHeight; /* Height in pixels needed to display * message. */ Tk_Anchor anchor; /* Where to position text within window region |
︙ | ︙ | |||
82 83 84 85 86 87 88 | Tk_Cursor cursor; /* Current cursor for window, or None. */ char *takeFocus; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ int flags; /* Various flags; see below for * definitions. */ | < < < < < | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | Tk_Cursor cursor; /* Current cursor for window, or None. */ char *takeFocus; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ int flags; /* Various flags; see below for * definitions. */ } Message; /* * Flag bits for messages: * * REDRAW_PENDING: Non-zero means a DoWhenIdle handler * has already been queued to redraw |
︙ | ︙ | |||
110 111 112 113 114 115 116 | /* * Information used for argv parsing. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR, | | | | | | | | | | | | | | | | | | | | | | | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | /* * Information used for argv parsing. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR, TCL_INDEX_NONE, offsetof(Message, anchor), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT, TCL_INDEX_NONE, offsetof(Message, aspect), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_MESSAGE_BG_COLOR, TCL_INDEX_NONE, offsetof(Message, border), 0, DEF_MESSAGE_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MESSAGE_BORDER_WIDTH, offsetof(Message, borderWidthObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_MESSAGE_FONT, TCL_INDEX_NONE, offsetof(Message, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_MESSAGE_FG, TCL_INDEX_NONE, offsetof(Message, fgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Message, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, offsetof(Message, highlightWidthObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_MESSAGE_JUSTIFY, TCL_INDEX_NONE, offsetof(Message, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", DEF_MESSAGE_PADX, offsetof(Message, padXObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", DEF_MESSAGE_PADY, offsetof(Message, padYObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_MESSAGE_RELIEF, TCL_INDEX_NONE, offsetof(Message, relief), 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MESSAGE_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Message, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", DEF_MESSAGE_TEXT, TCL_INDEX_NONE, offsetof(Message, string), 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", DEF_MESSAGE_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Message, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", DEF_MESSAGE_WIDTH, offsetof(Message, widthObj), TCL_INDEX_NONE, 0, 0 ,0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* * Forward declarations for functions defined later in this file: */ |
︙ | ︙ | |||
443 444 445 446 447 448 449 450 451 452 453 454 455 456 | Message *msgPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ TCL_UNUSED(int)) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; /* * Eliminate any existing trace on a variable monitored by the message. */ if (msgPtr->textVarName != NULL) { Tcl_UntraceVar2(interp, msgPtr->textVarName, NULL, | > | 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | Message *msgPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ TCL_UNUSED(int)) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; int width, borderWidth, highlightWidth, padX, padY; /* * Eliminate any existing trace on a variable monitored by the message. */ if (msgPtr->textVarName != NULL) { Tcl_UntraceVar2(interp, msgPtr->textVarName, NULL, |
︙ | ︙ | |||
490 491 492 493 494 495 496 | /* * A few other options need special processing, such as setting the * background from a 3-D border or handling special defaults that couldn't * be specified to Tk_ConfigureWidget. */ | | > > > > > > > > > > > > > > > > > > | > > | > > > > > > > > > > > > > > > > > > > > > > > > > | 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | /* * A few other options need special processing, such as setting the * background from a 3-D border or handling special defaults that couldn't * be specified to Tk_ConfigureWidget. */ msgPtr->numChars = TkNumUtfChars(msgPtr->string, TCL_INDEX_NONE); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->widthObj, &width); if (width < 0) { if (msgPtr->widthObj) { Tcl_DecrRefCount(msgPtr->widthObj); } msgPtr->widthObj = Tcl_NewIntObj(0); Tcl_IncrRefCount(msgPtr->widthObj); } Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); if (borderWidth < 0) { if (msgPtr->borderWidthObj) { Tcl_DecrRefCount(msgPtr->borderWidthObj); } msgPtr->borderWidthObj = Tcl_NewIntObj(0); Tcl_IncrRefCount(msgPtr->borderWidthObj); } Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); if (highlightWidth < 0) { if (msgPtr->highlightWidthObj) { Tcl_DecrRefCount(msgPtr->highlightWidthObj); } msgPtr->highlightWidthObj = Tcl_NewIntObj(0); Tcl_IncrRefCount(msgPtr->highlightWidthObj); } if (!msgPtr->padXObj) { msgPtr->padXObj = Tcl_NewIntObj(-1); Tcl_IncrRefCount(msgPtr->padXObj); } Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); if (padX < 0) { if (strcmp(Tcl_GetString(msgPtr->padXObj), "-1")) { Tcl_DecrRefCount(msgPtr->padXObj); msgPtr->padXObj = Tcl_NewIntObj(-1); Tcl_IncrRefCount(msgPtr->padXObj); } } if (!msgPtr->padYObj) { msgPtr->padYObj = Tcl_NewIntObj(-1); Tcl_IncrRefCount(msgPtr->padYObj); } Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); if (padY < 0) { if (strcmp(Tcl_GetString(msgPtr->padYObj), "-1")) { Tcl_DecrRefCount(msgPtr->padYObj); msgPtr->padYObj = Tcl_NewIntObj(-1); Tcl_IncrRefCount(msgPtr->padYObj); } } Tk_FreeSavedOptions(&savedOptions); MessageWorldChanged(msgPtr); return TCL_OK; } |
︙ | ︙ | |||
525 526 527 528 529 530 531 | static void MessageWorldChanged( void *instanceData) /* Information about widget. */ { XGCValues gcValues; GC gc = NULL; | < < < < < < < < < < < < < < < < < | 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | static void MessageWorldChanged( void *instanceData) /* Information about widget. */ { XGCValues gcValues; GC gc = NULL; Message *msgPtr = (Message *)instanceData; if (msgPtr->border != NULL) { Tk_SetBackgroundFromBorder(msgPtr->tkwin, msgPtr->border); } gcValues.font = Tk_FontId(msgPtr->tkfont); gcValues.foreground = msgPtr->fgColorPtr->pixel; gc = Tk_GetGC(msgPtr->tkwin, GCForeground | GCFont, &gcValues); if (msgPtr->textGC != NULL) { Tk_FreeGC(msgPtr->display, msgPtr->textGC); } msgPtr->textGC = gc; /* * Recompute the desired geometry for the window, and arrange for the * window to be redisplayed. */ ComputeMessageGeometry(msgPtr); if ((msgPtr->tkwin != NULL) && Tk_IsMapped(msgPtr->tkwin) |
︙ | ︙ | |||
594 595 596 597 598 599 600 601 602 603 | static void ComputeMessageGeometry( Message *msgPtr) /* Information about window. */ { int width, inc, height; int thisWidth, thisHeight, maxWidth; int aspect, lowerBound, upperBound, inset; Tk_FreeTextLayout(msgPtr->textLayout); | > > > | > > > > > > > > > > > | | | | | 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 | static void ComputeMessageGeometry( Message *msgPtr) /* Information about window. */ { int width, inc, height; int thisWidth, thisHeight, maxWidth; int aspect, lowerBound, upperBound, inset; int borderWidth, highlightWidth, padX, padY; Tk_FontMetrics fm; Tk_FreeTextLayout(msgPtr->textLayout); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); Tk_GetFontMetrics(msgPtr->tkfont, &fm); if (padX < 0) { padX = fm.ascent / 2; } if (padY < 0) { padY = fm.ascent / 4; } inset = borderWidth + highlightWidth; /* * Compute acceptable bounds for the final aspect ratio. */ aspect = msgPtr->aspect/10; if (aspect < 5) { aspect = 5; } lowerBound = msgPtr->aspect - aspect; upperBound = msgPtr->aspect + aspect; /* * Do the computation in multiple passes: start off with a very wide * window, and compute its height. Then change the width and try again. * Reduce the size of the change and iterate until dimensions are found * that approximate the desired aspect ratio. Or, if the user gave an * explicit width then just use that. */ Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->widthObj, &width); if (width > 0) { inc = 0; } else { width = WidthOfScreen(Tk_Screen(msgPtr->tkwin))/2; inc = width/2; } for ( ; ; inc /= 2) { msgPtr->textLayout = Tk_ComputeTextLayout(msgPtr->tkfont, msgPtr->string, msgPtr->numChars, width, msgPtr->justify, 0, &thisWidth, &thisHeight); maxWidth = thisWidth + 2 * (inset + padX); height = thisHeight + 2 * (inset + padY); if (inc <= 2) { break; } aspect = (100 * maxWidth) / height; if (aspect < lowerBound) { |
︙ | ︙ | |||
676 677 678 679 680 681 682 | static void DisplayMessage( void *clientData) /* Information about window. */ { Message *msgPtr = (Message *)clientData; Tk_Window tkwin = msgPtr->tkwin; int x, y; | > > > > | > > > > > | > > > > > | | | | | | | | | | | | | | | 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | static void DisplayMessage( void *clientData) /* Information about window. */ { Message *msgPtr = (Message *)clientData; Tk_Window tkwin = msgPtr->tkwin; int x, y; int width, borderWidth, highlightWidth, padX, padY; Tk_FontMetrics fm; Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); Tk_GetFontMetrics(msgPtr->tkfont, &fm); if (padX < 0) { padX = fm.ascent / 2; } if (padY < 0) { padY = fm.ascent / 4; } width = highlightWidth; msgPtr->flags &= ~REDRAW_PENDING; if ((msgPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } if (msgPtr->border != NULL) { width += borderWidth; } if (msgPtr->relief == TK_RELIEF_FLAT) { width = highlightWidth; } Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), msgPtr->border, width, width, Tk_Width(tkwin) - 2 * width, Tk_Height(tkwin) - 2 * width, 0, TK_RELIEF_FLAT); /* * Compute starting y-location for message based on message size and * anchor option. */ TkComputeAnchor(msgPtr->anchor, tkwin, padX, padY, msgPtr->msgWidth, msgPtr->msgHeight, &x, &y); Tk_DrawTextLayout(Tk_Display(tkwin), Tk_WindowId(tkwin), msgPtr->textGC, msgPtr->textLayout, x, y, 0, -1); if (width > highlightWidth) { Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), msgPtr->border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, Tk_Height(tkwin) - 2 * highlightWidth, borderWidth, msgPtr->relief); } if (highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(msgPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (msgPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(msgPtr->highlightColorPtr,Tk_WindowId(tkwin)); Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, Tk_WindowId(tkwin)); } else { Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, highlightWidth, Tk_WindowId(tkwin)); } } } /* *-------------------------------------------------------------- |
︙ | ︙ | |||
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | static void MessageEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { Message *msgPtr = (Message *)clientData; if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) || (eventPtr->type == ConfigureNotify)) { goto redraw; } else if (eventPtr->type == DestroyNotify) { DestroyMessage(clientData); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags |= GOT_FOCUS; | > > | > | | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 | static void MessageEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { Message *msgPtr = (Message *)clientData; int highlightWidth; if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) || (eventPtr->type == ConfigureNotify)) { goto redraw; } else if (eventPtr->type == DestroyNotify) { DestroyMessage(clientData); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags |= GOT_FOCUS; Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); if (highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags &= ~GOT_FOCUS; Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); if (highlightWidth > 0) { goto redraw; } } } return; redraw: |
︙ | ︙ | |||
850 851 852 853 854 855 856 | /* * If the variable is unset, then immediately recreate it unless the whole * interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { | | | | | | | | | | | | | | | | | | | | | | | 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 | /* * If the variable is unset, then immediately recreate it unless the whole * interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && msgPtr->textVarName) { void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MessageTextVarProc, probe); if (probe == (void *)msgPtr) { break; } } while (probe); if (probe) { /* * We were able to fetch the unset trace for our * textVarName, 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. */ return NULL; } Tcl_SetVar2(interp, msgPtr->textVarName, NULL, msgPtr->string, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, msgPtr->textVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MessageTextVarProc, clientData); } return NULL; } value = Tcl_GetVar2(interp, msgPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { value = ""; } if (msgPtr->string != NULL) { ckfree(msgPtr->string); } msgPtr->numChars = TkNumUtfChars(value, TCL_INDEX_NONE); msgPtr->string = (char *)ckalloc(strlen(value) + 1); strcpy(msgPtr->string, value); ComputeMessageGeometry(msgPtr); if ((msgPtr->tkwin != NULL) && Tk_IsMapped(msgPtr->tkwin) && !(msgPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(DisplayMessage, msgPtr); |
︙ | ︙ |
Changes to generic/tkObj.c.
︙ | ︙ | |||
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | static void FreeWindowInternalRep(Tcl_Obj *objPtr); static ThreadSpecificData *GetTypeCache(void); static void UpdateStringOfMM(Tcl_Obj *objPtr); static int SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); /* * The following structure defines the implementation of the "pixel" Tcl * object, used for measuring distances. The pixel object remembers its * initial display-independent settings. */ static const TkObjType pixelObjType = { {"pixel", /* name */ FreePixelInternalRep, /* freeIntRepProc */ DupPixelInternalRep, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL, /* setFromAnyProc */ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > | | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | static void FreeWindowInternalRep(Tcl_Obj *objPtr); static ThreadSpecificData *GetTypeCache(void); static void UpdateStringOfMM(Tcl_Obj *objPtr); static int SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); #if TCL_MAJOR_VERSION < 9 #ifdef __cplusplus extern "C" { #endif #if defined(USE_TCL_STUBS) /* Little hack to eliminate the need for "tclInt.h" here: Just copy a small portion of TclIntStubs, just enough to make it work */ typedef struct TclIntStubs { int magic; void *hooks; void (*dummy[34]) (void); /* dummy entries 0-33, not used */ int (*tclGetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 34 */ } TclIntStubs; extern const TclIntStubs *tclIntStubsPtr; # undef Tcl_GetIntForIndex # define Tcl_GetIntForIndex(interp, obj, max, ptr) ((tclIntStubsPtr->tclGetIntForIndex == NULL)? \ ((int (*)(Tcl_Interp*, Tcl_Obj *, int, int*))(void *)((&(tclStubsPtr->tcl_PkgProvideEx))[645]))((interp), (obj), (max), (ptr)): \ tclIntStubsPtr->tclGetIntForIndex((interp), (obj), (max), (ptr))) #elif TCL_MINOR_VERSION < 7 extern int TclGetIntForIndex(Tcl_Interp*, Tcl_Obj *, int, int*); # define Tcl_GetIntForIndex(interp, obj, max, ptr) TclGetIntForIndex(interp, obj, max, ptr) #endif #ifdef __cplusplus } #endif #endif /* * The following structure defines the implementation of the "pixel" Tcl * object, used for measuring distances. The pixel object remembers its * initial display-independent settings. */ static const TkObjType pixelObjType = { {"pixel", /* name */ FreePixelInternalRep, /* freeIntRepProc */ DupPixelInternalRep, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL, /* setFromAnyProc */ TCL_OBJTYPE_V1(TkLengthOne)}, 0 }; Tcl_Size TkLengthOne( TCL_UNUSED(Tcl_Obj *)) { return 1; } /* * The following structure defines the implementation of the "pixel" Tcl * object, used for measuring distances. The pixel object remembers its * initial display-independent settings. */ static const TkObjType mmObjType = { {"mm", /* name */ FreeMMInternalRep, /* freeIntRepProc */ DupMMInternalRep, /* dupIntRepProc */ UpdateStringOfMM, /* updateStringProc */ NULL, /* setFromAnyProc */ TCL_OBJTYPE_V1(TkLengthOne)}, 0 }; /* * The following structure defines the implementation of the "window" * Tcl object. */ |
︙ | ︙ | |||
244 245 246 247 248 249 250 | int *intPtr, double *dblPtr) /* Places to store resulting pixels. */ { int result, fresh; double d; PixelRep *pixelPtr; static const double bias[] = { | | | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | int *intPtr, double *dblPtr) /* Places to store resulting pixels. */ { int result, fresh; double d; PixelRep *pixelPtr; static const double bias[] = { 1.0, 10.0, 25.4, 0.35277777777777775 /*25.4 / 72.0*/ }; if (objPtr->typePtr != &pixelObjType.objType) { if (Tcl_GetDoubleFromObj(NULL, objPtr, &d) == TCL_OK) { if (dblPtr != NULL) { *dblPtr = d; |
︙ | ︙ | |||
514 515 516 517 518 519 520 | --rest; /* point to the character just before the last space */ } if (rest == string) { error: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", string)); | | | 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | --rest; /* point to the character just before the last space */ } if (rest == string) { error: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", string)); Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } switch (*rest) { case 'm': units = 0; |
︙ | ︙ | |||
602 603 604 605 606 607 608 | Tcl_Obj *objPtr, /* The object from which to get mms. */ double *doublePtr) /* Place to store resulting millimeters. */ { int result; double d; MMRep *mmPtr; static const double bias[] = { | | | 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | Tcl_Obj *objPtr, /* The object from which to get mms. */ double *doublePtr) /* Place to store resulting millimeters. */ { int result; double d; MMRep *mmPtr; static const double bias[] = { 10.0, 25.4, 1.0, 0.35277777777777775 /*25.4 / 72.0*/ }; if (objPtr->typePtr != &mmObjType.objType) { result = SetMMFromAny(interp, objPtr); if (result != TCL_OK) { return result; } |
︙ | ︙ | |||
798 799 800 801 802 803 804 | if (rest > string) { --rest; /* point to the character just before the last space */ } if (rest == string) { error: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", string)); | | | 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 | if (rest > string) { --rest; /* point to the character just before the last space */ } if (rest == string) { error: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", string)); Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); return TCL_ERROR; } switch (*rest) { case 'c': units = 0; break; case 'i': |
︙ | ︙ | |||
1099 1100 1101 1102 1103 1104 1105 | */ if (specObj->typePtr == &pixelObjType.objType) { if (Tk_GetPixelsFromObj(interp, tkwin, specObj, &firstInt) != TCL_OK){ Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad pad value \"%s\": must be positive screen distance", Tcl_GetString(specObj))); | | | | | | 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 | */ if (specObj->typePtr == &pixelObjType.objType) { if (Tk_GetPixelsFromObj(interp, tkwin, specObj, &firstInt) != TCL_OK){ Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad pad value \"%s\": must be positive screen distance", Tcl_GetString(specObj))); Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", (char *)NULL); return TCL_ERROR; } secondInt = firstInt; goto done; } /* * Pad specifications are a list of one or two elements, each of which is * a pixel specification. */ if (Tcl_ListObjGetElements(interp, specObj, &objc, &objv) != TCL_OK) { return TCL_ERROR; } if (objc != 1 && objc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong number of parts to pad specification", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "PARTS", (char *)NULL); return TCL_ERROR; } /* * Parse the first part. */ if (Tk_GetPixelsFromObj(interp, tkwin, objv[0], &firstInt) != TCL_OK || (firstInt < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad pad value \"%s\": must be positive screen distance", Tcl_GetString(objv[0]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", (char *)NULL); return TCL_ERROR; } /* * Parse the second part if it exists, otherwise it is as if it was the * same as the first part. */ if (objc == 1) { secondInt = firstInt; } else if (Tk_GetPixelsFromObj(interp, tkwin, objv[1], &secondInt) != TCL_OK || (secondInt < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad 2nd pad value \"%s\": must be positive screen distance", Tcl_GetString(objv[1]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", (char *)NULL); return TCL_ERROR; } /* * Write the parsed bits back into the receiving variables. */ |
︙ | ︙ |
Changes to generic/tkOldConfig.c.
︙ | ︙ | |||
57 58 59 60 61 62 63 | * a widget record with resources and other parameters. * * Results: * A standard Tcl return value. In case of an error, the interp's result * will hold an error message. * * Side effects: | | | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | * a widget record with resources and other parameters. * * Results: * A standard Tcl return value. In case of an error, the interp's result * will hold an error message. * * Side effects: * The fields of widgRec get filled in with information from argc/argv * and the option database. Old information in widgRec's fields gets * recycled. A copy of the spec-table is taken with (some of) the char* * fields converted into Tk_Uid fields; this copy will be released when * the interpreter terminates. * *-------------------------------------------------------------- */ int Tk_ConfigureWidget( Tcl_Interp *interp, /* Interpreter for error reporting. */ Tk_Window tkwin, /* Window containing widget (needed to set up * X resources). */ const Tk_ConfigSpec *specs, /* Describes legal options. */ Tcl_Size argc, /* Number of elements in argv. */ const char **argv, /* Command-line options. */ void *widgRec, /* Record whose fields are to be modified. * Values must be properly initialized. */ int flags) /* Used to specify additional flags that must * be present in config specs for them to be * considered. Also, may have * TK_CONFIG_ARGV_ONLY set. */ { |
︙ | ︙ | |||
121 122 123 124 125 126 127 | } /* * Pass one: scan through all of the arguments, processing those that * match entries in the specs. */ | | > | > > > > > > > | > | > > > > > > > | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | } /* * Pass one: scan through all of the arguments, processing those that * match entries in the specs. */ for ( ; argc > 0; argc -= 2, argv += 2) { const char *arg; if (flags & TK_CONFIG_OBJS) { arg = Tcl_GetString((Tcl_Obj *) *argv); } else { #if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); #else arg = *argv; #endif } specPtr = FindConfigSpec(interp, staticSpecs, arg, needFlags, hateFlags); if (specPtr == NULL) { return TCL_ERROR; } /* * Process the entry. */ if (argc < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", arg)); Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", (char *)NULL); return TCL_ERROR; } if (flags & TK_CONFIG_OBJS) { arg = Tcl_GetString((Tcl_Obj *) argv[1]); } else { #if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); #else arg = argv[1]; #endif } if (DoConfig(interp, tkwin, specPtr, arg, 0, widgRec) != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (processing \"%.40s\" option)",specPtr->argvName)); return TCL_ERROR; } if (!(flags & TK_CONFIG_ARGV_ONLY)) { specPtr->specFlags |= TK_CONFIG_OPTION_SPECIFIED; |
︙ | ︙ | |||
339 340 341 342 343 344 345 | * Values must be properly initialized. */ { void *ptr; Tk_Uid uid; int nullValue; nullValue = 0; | | | | | | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | * Values must be properly initialized. */ { void *ptr; Tk_Uid uid; int nullValue; nullValue = 0; if ((*value == 0) && (specPtr->specFlags & (TK_CONFIG_NULL_OK|TCL_NULL_OK|1))) { nullValue = 1; } do { if (specPtr->offset < 0) { break; } ptr = (char *)widgRec + specPtr->offset; switch (specPtr->type) { case TK_CONFIG_BOOLEAN: if (Tcl_GetBoolean(interp, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_INT: if (Tcl_GetInt(interp, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_DOUBLE: if (Tcl_GetDouble(interp, value, (double *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_STRING: { char *oldStr, *newStr; if (nullValue) { |
︙ | ︙ | |||
462 463 464 465 466 467 468 | Tk_Free3DBorder(oldBorder); } *((Tk_3DBorder *) ptr) = newBorder; break; } case TK_CONFIG_RELIEF: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); | | | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | Tk_Free3DBorder(oldBorder); } *((Tk_3DBorder *) ptr) = newBorder; break; } case TK_CONFIG_RELIEF: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); if (Tk_GetRelief(interp, uid, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_CURSOR: case TK_CONFIG_ACTIVE_CURSOR: { Tk_Cursor newCursor, oldCursor; |
︙ | ︙ | |||
503 504 505 506 507 508 509 | uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); if (Tk_GetAnchor(interp, uid, (Tk_Anchor *) ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_CAP_STYLE: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); | | | > > | | | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); if (Tk_GetAnchor(interp, uid, (Tk_Anchor *) ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_CAP_STYLE: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); if (Tk_GetCapStyle(interp, uid, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_JOIN_STYLE: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); if (Tk_GetJoinStyle(interp, uid, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_PIXELS: if (nullValue) { *(int *)ptr = INT_MIN; } else if (Tk_GetPixels(interp, tkwin, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_MM: if (Tk_GetScreenMM(interp, tkwin, value, (double *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_WINDOW: { Tk_Window tkwin2; if (nullValue) { |
︙ | ︙ | |||
853 854 855 856 857 858 859 | case TK_CONFIG_CAP_STYLE: result = Tk_NameOfCapStyle(*((int *)ptr)); break; case TK_CONFIG_JOIN_STYLE: result = Tk_NameOfJoinStyle(*((int *)ptr)); break; case TK_CONFIG_PIXELS: | > | | > | 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 | case TK_CONFIG_CAP_STYLE: result = Tk_NameOfCapStyle(*((int *)ptr)); break; case TK_CONFIG_JOIN_STYLE: result = Tk_NameOfJoinStyle(*((int *)ptr)); break; case TK_CONFIG_PIXELS: if ((*(int *)ptr != INT_MIN) || !(specPtr->specFlags & (TK_CONFIG_NULL_OK|TCL_NULL_OK|1))) { snprintf(buffer, 200, "%d", *((int *)ptr)); result = buffer; } break; case TK_CONFIG_MM: Tcl_PrintDouble(interp, *((double *)ptr), buffer); result = buffer; break; case TK_CONFIG_WINDOW: { tkwin = *((Tk_Window *)ptr); |
︙ | ︙ |
Added generic/tkOldTest.c.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | /* * tkOldTest.c -- * * This file contains C command functions for additional Tcl * commands that are used to test Tk's support for legacy * interfaces. These commands are not normally included in Tcl/Tk * applications; they're only used for testing. * * Copyright © 1993-1994 The Regents of the University of California. * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * Contributions by Don Porter, NIST, 2007. (not subject to US copyright) * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #define USE_OLD_IMAGE #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #ifndef USE_TK_STUBS # define USE_TK_STUBS #endif #include "tkInt.h" #ifdef _WIN32 #include "tkWinInt.h" #endif #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) /* * The following data structure represents the model for a test image: */ typedef struct TImageModel { Tk_ImageModel model; /* Tk's token for image model. */ Tcl_Interp *interp; /* Interpreter for application. */ int width, height; /* Dimensions of image. */ char *imageName; /* Name of image (malloc-ed). */ char *varName; /* Name of variable in which to log events for * image (malloc-ed). */ } TImageModel; /* * The following data structure represents a particular use of a particular * test image. */ typedef struct TImageInstance { TImageModel *modelPtr; /* Pointer to model for image. */ XColor *fg; /* Foreground color for drawing in image. */ GC gc; /* Graphics context for drawing in image. */ } TImageInstance; /* * The type record for test images: */ static int ImageCreate(Tcl_Interp *interp, char *name, Tcl_Size argc, char **argv, Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); static void *ImageGet(Tk_Window tkwin, void *clientData); static void ImageDisplay(void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); static void ImageFree(void *clientData, Display *display); static void ImageDelete(void *clientData); static Tk_ImageType imageType = { "oldtest", /* name */ (Tk_ImageCreateProc *) ImageCreate, /* createProc */ ImageGet, /* getProc */ ImageDisplay, /* displayProc */ ImageFree, /* freeProc */ ImageDelete, /* deleteProc */ NULL, /* postscriptPtr */ NULL, /* nextPtr */ NULL }; /* * Forward declarations for functions defined later in this file: */ static Tcl_ObjCmdProc ImageObjCmd; #endif /* *---------------------------------------------------------------------- * * TkOldTestInit -- * * This function performs initialization for the Tk test suite * extensions for testing support for legacy interfaces. * * Results: * Returns a standard Tcl completion code, and leaves an error message in * the interp's result if an error occurs. * * Side effects: * Creates several test commands. * *---------------------------------------------------------------------- */ int TkOldTestInit( Tcl_Interp *dummy) { static int initialized = 0; (void)dummy; if (!initialized) { initialized = 1; #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) Tk_CreateImageType(&imageType); #endif } return TCL_OK; } /* *---------------------------------------------------------------------- * * ImageCreate -- * * This function is called by the Tk image code to create "oldtest" images. * * Results: * A standard Tcl result. * * Side effects: * The data structure for a new image is allocated. * *---------------------------------------------------------------------- */ #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) static int ImageCreate( Tcl_Interp *interp, /* Interpreter for application containing * image. */ char *name, /* Name to use for image. */ Tcl_Size argc, /* Number of arguments. */ char **argv, /* Argument strings for options (doesn't * include image name or type). */ Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ Tk_ImageModel model, /* Token for image, to be used by us in later * callbacks. */ void **clientDataPtr) /* Store manager's token for image here; it * will be returned in later callbacks. */ { TImageModel *timPtr; const char *varName; Tcl_Size i; (void)typePtr; varName = "log"; for (i = 0; i < argc; i += 2) { if (strcmp(argv[i], "-variable") != 0) { Tcl_AppendResult(interp, "bad option name \"", argv[i], "\"", NULL); return TCL_ERROR; } if ((i+1) == argc) { Tcl_AppendResult(interp, "no value given for \"", argv[i], "\" option", NULL); return TCL_ERROR; } varName = argv[i+1]; } timPtr = (TImageModel *)ckalloc(sizeof(TImageModel)); timPtr->model = model; timPtr->interp = interp; timPtr->width = 30; timPtr->height = 15; timPtr->imageName = (char *)ckalloc(strlen(name) + 1); strcpy(timPtr->imageName, name); timPtr->varName = (char *)ckalloc(strlen(varName) + 1); strcpy(timPtr->varName, varName); Tcl_CreateObjCommand(interp, name, ImageObjCmd, timPtr, NULL); *clientDataPtr = timPtr; Tk_ImageChanged(model, 0, 0, 30, 15, 30, 15); return TCL_OK; } /* *---------------------------------------------------------------------- * * ImageObjCmd -- * * This function implements the commands corresponding to individual * images. * * Results: * A standard Tcl result. * * Side effects: * Forces windows to be created. * *---------------------------------------------------------------------- */ static int ImageObjCmd( void *clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { TImageModel *timPtr = (TImageModel *)clientData; int x, y, width, height; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[1]), "changed") == 0) { if (objc != 8) { Tcl_WrongNumArgs(interp, 1, objv, "changed x y width height" " imageWidth imageHeight"); return TCL_ERROR; } if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[4], &width) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[5], &height) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[6], &timPtr->width) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[7], &timPtr->height) != TCL_OK)) { return TCL_ERROR; } Tk_ImageChanged(timPtr->model, x, y, width, height, timPtr->width, timPtr->height); } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), "\": must be changed", NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * ImageGet -- * * This function is called by Tk to set things up for using a test image * in a particular widget. * * Results: * The return value is a token for the image instance, which is used in * future callbacks to ImageDisplay and ImageFree. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void * ImageGet( Tk_Window tkwin, /* Token for window in which image will be * used. */ void *clientData) /* Pointer to TImageModel for image. */ { TImageModel *timPtr = (TImageModel *)clientData; TImageInstance *instPtr; char buffer[100]; XGCValues gcValues; snprintf(buffer, sizeof(buffer), "%s get", timPtr->imageName); Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); instPtr = (TImageInstance *)ckalloc(sizeof(TImageInstance)); instPtr->modelPtr = timPtr; instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000"); gcValues.foreground = instPtr->fg->pixel; instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues); return instPtr; } /* *---------------------------------------------------------------------- * * ImageDisplay -- * * This function is invoked to redisplay part or all of an image in a * given drawable. * * Results: * None. * * Side effects: * The image gets partially redrawn, as an "X" that shows the exact * redraw area. * *---------------------------------------------------------------------- */ static void ImageDisplay( void *clientData, /* Pointer to TImageInstance for image. */ Display *display, /* Display to use for drawing. */ Drawable drawable, /* Where to redraw image. */ int imageX, int imageY, /* Origin of area to redraw, relative to * origin of image. */ int width, int height, /* Dimensions of area to redraw. */ int drawableX, int drawableY) /* Coordinates in drawable corresponding to * imageX and imageY. */ { TImageInstance *instPtr = (TImageInstance *)clientData; char buffer[200 + TCL_INTEGER_SPACE * 6]; snprintf(buffer, sizeof(buffer), "%s display %d %d %d %d %d %d", instPtr->modelPtr->imageName, imageX, imageY, width, height, drawableX, drawableY); Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); if (width > (instPtr->modelPtr->width - imageX)) { width = instPtr->modelPtr->width - imageX; } if (height > (instPtr->modelPtr->height - imageY)) { height = instPtr->modelPtr->height - imageY; } XDrawRectangle(display, drawable, instPtr->gc, drawableX, drawableY, (unsigned) (width-1), (unsigned) (height-1)); XDrawLine(display, drawable, instPtr->gc, drawableX, drawableY, (int) (drawableX + width - 1), (int) (drawableY + height - 1)); XDrawLine(display, drawable, instPtr->gc, drawableX, (int) (drawableY + height - 1), (int) (drawableX + width - 1), drawableY); } /* *---------------------------------------------------------------------- * * ImageFree -- * * This function is called when an instance of an image is no longer * used. * * Results: * None. * * Side effects: * Information related to the instance is freed. * *---------------------------------------------------------------------- */ static void ImageFree( void *clientData, /* Pointer to TImageInstance for instance. */ Display *display) /* Display where image was to be drawn. */ { TImageInstance *instPtr = (TImageInstance *)clientData; char buffer[200]; snprintf(buffer, sizeof(buffer), "%s free", instPtr->modelPtr->imageName); Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tk_FreeColor(instPtr->fg); Tk_FreeGC(display, instPtr->gc); ckfree(instPtr); } /* *---------------------------------------------------------------------- * * ImageDelete -- * * This function is called to clean up a test image when an application * goes away. * * Results: * None. * * Side effects: * Information about the image is deleted. * *---------------------------------------------------------------------- */ static void ImageDelete( void *clientData) /* Pointer to TImageModel for image. When * this function is called, no more instances * exist. */ { TImageModel *timPtr = (TImageModel *)clientData; char buffer[100]; snprintf(buffer, sizeof(buffer), "%s delete", timPtr->imageName); Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tcl_DeleteCommand(timPtr->interp, timPtr->imageName); ckfree(timPtr->imageName); ckfree(timPtr->varName); ckfree(timPtr); } #endif /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to generic/tkOption.c.
︙ | ︙ | |||
877 878 879 880 881 882 883 | priority = strtoul(string, &end, 0); if ((end == string) || (*end != 0) || (priority < 0) || (priority > 100)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad priority level \"%s\": must be " "widgetDefault, startupFile, userDefault, " "interactive, or a number between 0 and 100", string)); | | | 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | priority = strtoul(string, &end, 0); if ((end == string) || (*end != 0) || (priority < 0) || (priority > 100)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad priority level \"%s\": must be " "widgetDefault, startupFile, userDefault, " "interactive, or a number between 0 and 100", string)); Tcl_SetErrorCode(interp, "TK", "VALUE", "PRIORITY", (char *)NULL); return -1; } } return priority; } /* |
︙ | ︙ | |||
961 962 963 964 965 966 967 | */ dst = name = src; while (*src != ':') { if ((*src == '\0') || (*src == '\n')) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing colon on line %d", lineNum)); | | | 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 | */ dst = name = src; while (*src != ':') { if ((*src == '\0') || (*src == '\n')) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing colon on line %d", lineNum)); Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "COLON", (char *)NULL); return TCL_ERROR; } if ((src[0] == '\\') && (src[1] == '\n')) { src += 2; lineNum++; } else { *dst = *src; |
︙ | ︙ | |||
998 999 1000 1001 1002 1003 1004 | } if (*src == '\\' && (src[1] == '\t' || src[1] == ' ')) { src++; } if (*src == '\0') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing value on line %d", lineNum)); | | | | 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 | } if (*src == '\\' && (src[1] == '\t' || src[1] == ' ')) { src++; } if (*src == '\0') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing value on line %d", lineNum)); Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "VALUE", (char *)NULL); return TCL_ERROR; } /* * Parse off the value, squeezing out backslash-newline sequences * along the way. */ dst = value = src; while (*src != '\n') { if (*src == '\0') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing newline on line %d", lineNum)); Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "NEWLINE", (char *)NULL); return TCL_ERROR; } if (*src == '\\'){ if (src[1] == '\n') { src += 2; lineNum++; continue; |
︙ | ︙ | |||
1092 1093 1094 1095 1096 1097 1098 | /* * Prevent file system access in a safe interpreter. */ if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't read options from a file in a safe interpreter", TCL_INDEX_NONE)); | | | 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 | /* * Prevent file system access in a safe interpreter. */ if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't read options from a file in a safe interpreter", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "SAFE", "OPTION_FILE", (char *)NULL); return TCL_ERROR; } realName = Tcl_TranslateFileName(interp, fileName, &newName); if (realName == NULL) { return TCL_ERROR; } |
︙ | ︙ |
Changes to generic/tkPack.c.
︙ | ︙ | |||
118 119 120 121 122 123 124 125 126 127 128 129 130 131 | */ static void ArrangePacking(void *clientData); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); static void PackStructureProc(void *clientData, XEvent *eventPtr); static void Unlink(Packer *packPtr); static int XExpansion(Packer *contentPtr, int cavityWidth); static int YExpansion(Packer *contentPtr, int cavityHeight); /* | > > > > | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | */ static void ArrangePacking(void *clientData); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); #ifndef TK_NO_DEPRECATED static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, Packer *containerPtr, int objc,Tcl_Obj *const objv[]); #endif /* !TK_NO_DEPRECATED */ static void PackStructureProc(void *clientData, XEvent *eventPtr); static void Unlink(Packer *packPtr); static int XExpansion(Packer *contentPtr, int cavityWidth); static int YExpansion(Packer *contentPtr, int cavityHeight); /* |
︙ | ︙ | |||
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; const char *argv2; static const char *const optionStrings[] = { "configure", "content", "forget", "info", "propagate", "slaves", NULL }; static const char *const optionStringsNoDep[] = { "configure", "content", "forget", "info", "propagate", NULL }; enum options { PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; int index; if (objc >= 2) { const char *string = Tcl_GetString(objv[1]); if (string[0] == '.') { | > > > > > > | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; const char *argv2; static const char *const optionStrings[] = { #ifndef TK_NO_DEPRECATED "after", "append", "before", "unpack", #endif /* !TK_NO_DEPRECATED */ "configure", "content", "forget", "info", "propagate", "slaves", NULL }; static const char *const optionStringsNoDep[] = { "configure", "content", "forget", "info", "propagate", NULL }; enum options { #ifndef TK_NO_DEPRECATED PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK, #endif /* !TK_NO_DEPRECATED */ PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; int index; if (objc >= 2) { const char *string = Tcl_GetString(objv[1]); if (string[0] == '.') { |
︙ | ︙ | |||
225 226 227 228 229 230 231 232 233 234 235 | Tcl_GetIndexFromObj(interp, objv[1], optionStringsNoDep, "option", 0, &index); return TCL_ERROR; } argv2 = Tcl_GetString(objv[2]); switch ((enum options) index) { case PACK_CONFIGURE: if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be name of window", argv2)); | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | Tcl_GetIndexFromObj(interp, objv[1], optionStringsNoDep, "option", 0, &index); return TCL_ERROR; } argv2 = Tcl_GetString(objv[2]); switch ((enum options) index) { #ifndef TK_NO_DEPRECATED case PACK_AFTER: { Packer *prevPtr; Tk_Window tkwin2; if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } prevPtr = GetPacker(tkwin2); if (prevPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } return PackAfter(interp, prevPtr, prevPtr->containerPtr, objc-3, objv+3); } case PACK_APPEND: { Packer *containerPtr; Packer *prevPtr; Tk_Window tkwin2; if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } containerPtr = GetPacker(tkwin2); prevPtr = containerPtr->contentPtr; if (prevPtr != NULL) { while (prevPtr->nextPtr != NULL) { prevPtr = prevPtr->nextPtr; } } return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); } case PACK_BEFORE: { Packer *packPtr, *containerPtr; Packer *prevPtr; Tk_Window tkwin2; if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } packPtr = GetPacker(tkwin2); if (packPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } containerPtr = packPtr->containerPtr; prevPtr = containerPtr->contentPtr; if (prevPtr == packPtr) { prevPtr = NULL; } else { for ( ; ; prevPtr = prevPtr->nextPtr) { if (prevPtr == NULL) { Tcl_Panic("\"pack before\" couldn't find predecessor"); } if (prevPtr->nextPtr == packPtr) { break; } } } return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); } #endif /* !TK_NO_DEPRECATED */ case PACK_CONFIGURE: if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be name of window", argv2)); Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", (char *)NULL); return TCL_ERROR; } return ConfigureContent(interp, tkwin, objc-2, objv+2); case PACK_FORGET: { Tk_Window content; Packer *contentPtr; int i; |
︙ | ︙ | |||
271 272 273 274 275 276 277 | if (TkGetWindowFromObj(interp, tkwin, objv[2], &content) != TCL_OK) { return TCL_ERROR; } contentPtr = GetPacker(content); if (contentPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); | | | 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | if (TkGetWindowFromObj(interp, tkwin, objv[2], &content) != TCL_OK) { return TCL_ERROR; } contentPtr = GetPacker(content); if (contentPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } infoObj = Tcl_NewObj(); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-in", TCL_INDEX_NONE), Tk_NewWindowObj(contentPtr->containerPtr->tkwin)); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-anchor", TCL_INDEX_NONE), |
︙ | ︙ | |||
387 388 389 390 391 392 393 394 395 396 397 398 399 400 | contentPtr = contentPtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, Tk_NewWindowObj(contentPtr->tkwin)); } Tcl_SetObjResult(interp, resultObj); break; } } return TCL_OK; } /* *------------------------------------------------------------------------ | > > > > > > > > > > > > > > > > > > > > > > > > > | 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | contentPtr = contentPtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, Tk_NewWindowObj(contentPtr->tkwin)); } Tcl_SetObjResult(interp, resultObj); break; } #ifndef TK_NO_DEPRECATED case PACK_UNPACK: { Tk_Window tkwin2; Packer *packPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); return TCL_ERROR; } if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { return TCL_ERROR; } packPtr = GetPacker(tkwin2); if ((packPtr != NULL) && (packPtr->containerPtr != NULL)) { Tk_ManageGeometry(tkwin2, NULL, NULL); if (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin)) { Tk_UnmaintainGeometry(packPtr->tkwin, packPtr->containerPtr->tkwin); } Unlink(packPtr); Tk_UnmapWindow(packPtr->tkwin); } break; } #endif /* !TK_NO_DEPRECATED */ } return TCL_OK; } /* *------------------------------------------------------------------------ |
︙ | ︙ | |||
972 973 974 975 976 977 978 979 980 981 982 983 984 985 | packPtr->flags = 0; Tcl_SetHashValue(hPtr, packPtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, PackStructureProc, packPtr); return packPtr; } /* *---------------------------------------------------------------------- * * Unlink -- * * Remove a packer from its container's list of content. * | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 | packPtr->flags = 0; Tcl_SetHashValue(hPtr, packPtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, PackStructureProc, packPtr); return packPtr; } /* *------------------------------------------------------------------------ * * PackAfter -- * * This function does most of the real work of adding one or more windows * into the packing order for its container. * * Results: * A standard Tcl return value. * * Side effects: * The geometry of the specified windows may change, both now and again * in the future. * *------------------------------------------------------------------------ */ #ifndef TK_NO_DEPRECATED static int PackAfter( Tcl_Interp *interp, /* Interpreter for error reporting. */ Packer *prevPtr, /* Pack windows in argv just after this * window; NULL means pack as first child of * containerPtr. */ Packer *containerPtr, /* Container in which to pack windows. */ int objc, /* Number of elements in objv. */ Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements: * window name and side against which to * pack. */ { Packer *packPtr; Tk_Window tkwin, ancestor, parent; Tcl_Obj **options; int c; Tcl_Size index, optionCount; /* * Iterate over all of the window specifiers, each consisting of two * arguments. The first argument contains the window name and the * additional arguments contain options such as "top" or "padx 20". */ for ( ; objc > 0; objc -= 2, objv += 2, prevPtr = packPtr) { if (objc < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: window \"%s\" should be followed by options", Tcl_GetString(objv[0]))); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL); return TCL_ERROR; } /* * Find the packer for the window to be packed, and make sure that the * window in which it will be packed is either its or a descendant of * its parent. */ if (TkGetWindowFromObj(interp, containerPtr->tkwin, objv[0], &tkwin) != TCL_OK) { return TCL_ERROR; } parent = Tk_Parent(tkwin); for (ancestor = containerPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) { if (ancestor == parent) { break; } if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) { badWindow: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } } if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) { goto badWindow; } if (tkwin == containerPtr->tkwin) { goto badWindow; } packPtr = GetPacker(tkwin); /* * Process options for this window. */ if (Tcl_ListObjGetElements(interp, objv[1], &optionCount, &options) != TCL_OK) { return TCL_ERROR; } packPtr->side = TOP; packPtr->anchor = TK_ANCHOR_CENTER; packPtr->padX = packPtr->padY = 0; packPtr->padLeft = packPtr->padTop = 0; packPtr->iPadX = packPtr->iPadY = 0; packPtr->flags &= ~(FILLX|FILLY|EXPAND); packPtr->flags |= OLD_STYLE; for (index = 0 ; index < optionCount; index++) { Tcl_Obj *curOptPtr = options[index]; Tcl_Size length; const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length); c = curOpt[0]; if ((c == 't') && (strncmp(curOpt, "top", length)) == 0) { packPtr->side = TOP; } else if ((c == 'b') && (strncmp(curOpt, "bottom", length)) == 0) { packPtr->side = BOTTOM; } else if ((c == 'l') && (strncmp(curOpt, "left", length)) == 0) { packPtr->side = LEFT; } else if ((c == 'r') && (strncmp(curOpt, "right", length)) == 0) { packPtr->side = RIGHT; } else if ((c == 'e') && (strncmp(curOpt, "expand", length)) == 0) { packPtr->flags |= EXPAND; } else if ((c == 'f') && (strcmp(curOpt, "fill")) == 0) { packPtr->flags |= FILLX|FILLY; } else if ((length == 5) && (strcmp(curOpt, "fillx")) == 0) { packPtr->flags |= FILLX; } else if ((length == 5) && (strcmp(curOpt, "filly")) == 0) { packPtr->flags |= FILLY; } else if ((c == 'p') && (strcmp(curOpt, "padx")) == 0) { if (optionCount <= (index+1)) { missingPad: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: \"%s\" option must be" " followed by screen distance", curOpt)); Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", (char *)NULL); return TCL_ERROR; } if (TkParsePadAmount(interp, tkwin, options[index+1], &packPtr->padLeft, &packPtr->padX) != TCL_OK) { return TCL_ERROR; } packPtr->padX /= 2; packPtr->padLeft /= 2; packPtr->iPadX = 0; index++; } else if ((c == 'p') && (strcmp(curOpt, "pady")) == 0) { if (optionCount <= (index+1)) { goto missingPad; } if (TkParsePadAmount(interp, tkwin, options[index+1], &packPtr->padTop, &packPtr->padY) != TCL_OK) { return TCL_ERROR; } packPtr->padY /= 2; packPtr->padTop /= 2; packPtr->iPadY = 0; index++; } else if ((c == 'f') && (length > 1) && (strncmp(curOpt, "frame", length) == 0)) { if (optionCount <= (index+1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args: \"frame\"" " option must be followed by anchor point", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", (char *)NULL); return TCL_ERROR; } if (Tk_GetAnchorFromObj(interp, options[index+1], &packPtr->anchor) != TCL_OK) { return TCL_ERROR; } index++; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad option \"%s\": should be top, bottom, left," " right, expand, fill, fillx, filly, padx, pady, or" " frame", curOpt)); Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", (char *)NULL); return TCL_ERROR; } } if (packPtr != prevPtr) { /* * Unpack this window if it's currently packed. */ if (packPtr->containerPtr != NULL) { if ((packPtr->containerPtr != containerPtr) && (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin))) { Tk_UnmaintainGeometry(packPtr->tkwin, packPtr->containerPtr->tkwin); } Unlink(packPtr); } /* * Add the window in the correct place in its container's packing * order, then make sure that the window is managed by us. */ packPtr->containerPtr = containerPtr; if (prevPtr == NULL) { packPtr->nextPtr = containerPtr->contentPtr; containerPtr->contentPtr = packPtr; } else { packPtr->nextPtr = prevPtr->nextPtr; prevPtr->nextPtr = packPtr; } Tk_ManageGeometry(tkwin, &packerType, packPtr); if (!(containerPtr->flags & DONT_PROPAGATE)) { if (TkSetGeometryContainer(interp, containerPtr->tkwin, "pack") != TCL_OK) { Tk_ManageGeometry(tkwin, NULL, NULL); Unlink(packPtr); return TCL_ERROR; } containerPtr->flags |= ALLOCED_CONTAINER; } } } /* * Arrange for the container to be re-packed at the first idle moment. */ if (containerPtr->abortPtr != NULL) { *containerPtr->abortPtr = 1; } if (!(containerPtr->flags & REQUESTED_REPACK)) { containerPtr->flags |= REQUESTED_REPACK; Tcl_DoWhenIdle(ArrangePacking, containerPtr); } return TCL_OK; } #endif /* !TK_NO_DEPRECATED */ /* *---------------------------------------------------------------------- * * Unlink -- * * Remove a packer from its container's list of content. * |
︙ | ︙ | |||
1104 1105 1106 1107 1108 1109 1110 | if (eventPtr->type == ConfigureNotify) { if ((packPtr->contentPtr != NULL) && !(packPtr->flags & REQUESTED_REPACK)) { packPtr->flags |= REQUESTED_REPACK; Tcl_DoWhenIdle(ArrangePacking, packPtr); } if ((packPtr->containerPtr != NULL) | | | 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 | if (eventPtr->type == ConfigureNotify) { if ((packPtr->contentPtr != NULL) && !(packPtr->flags & REQUESTED_REPACK)) { packPtr->flags |= REQUESTED_REPACK; Tcl_DoWhenIdle(ArrangePacking, packPtr); } if ((packPtr->containerPtr != NULL) && (packPtr->doubleBw != 2*Tk_Changes(packPtr->tkwin)->border_width)) { if (!(packPtr->containerPtr->flags & REQUESTED_REPACK)) { packPtr->doubleBw = 2*Tk_Changes(packPtr->tkwin)->border_width; packPtr->containerPtr->flags |= REQUESTED_REPACK; Tcl_DoWhenIdle(ArrangePacking, packPtr->containerPtr); } } } else if (eventPtr->type == DestroyNotify) { |
︙ | ︙ | |||
1129 1130 1131 1132 1133 1134 1135 | contentPtr->containerPtr = NULL; nextPtr = contentPtr->nextPtr; contentPtr->nextPtr = NULL; } if (packPtr->tkwin != NULL) { TkDisplay *dispPtr = ((TkWindow *) packPtr->tkwin)->dispPtr; | | | 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 | contentPtr->containerPtr = NULL; nextPtr = contentPtr->nextPtr; contentPtr->nextPtr = NULL; } if (packPtr->tkwin != NULL) { TkDisplay *dispPtr = ((TkWindow *) packPtr->tkwin)->dispPtr; Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->packerHashTable, packPtr->tkwin)); } if (packPtr->flags & REQUESTED_REPACK) { Tcl_CancelIdleCall(ArrangePacking, packPtr); } packPtr->tkwin = NULL; |
︙ | ︙ | |||
1239 1240 1241 1242 1243 1244 1245 | if (TkGetWindowFromObj(interp, tkwin, objv[j], &content) != TCL_OK) { return TCL_ERROR; } if (Tk_TopWinHierarchy(content)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\": it's a top-level window", Tcl_GetString(objv[j]))); | | | 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 | if (TkGetWindowFromObj(interp, tkwin, objv[j], &content) != TCL_OK) { return TCL_ERROR; } if (Tk_TopWinHierarchy(content)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\": it's a top-level window", Tcl_GetString(objv[j]))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } contentPtr = GetPacker(content); contentPtr->flags &= ~OLD_STYLE; /* * If the content isn't currently packed, reset all of its configuration |
︙ | ︙ | |||
1265 1266 1267 1268 1269 1270 1271 | } for (i = numWindows; i < objc; i+=2) { if ((i+2) > objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "extra option \"%s\" (option with no value?)", Tcl_GetString(objv[i]))); | | | 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 | } for (i = numWindows; i < objc; i+=2) { if ((i+2) > objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "extra option \"%s\" (option with no value?)", Tcl_GetString(objv[i]))); Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
1287 1288 1289 1290 1291 1292 1293 | prevPtr = GetPacker(other); if (prevPtr->containerPtr == NULL) { notPacked: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", Tcl_GetString(objv[i+1]))); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", | | | 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 | prevPtr = GetPacker(other); if (prevPtr->containerPtr == NULL) { notPacked: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", Tcl_GetString(objv[i+1]))); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } containerPtr = prevPtr->containerPtr; positionGiven = 1; } break; case CONF_ANCHOR: |
︙ | ︙ | |||
1345 1346 1347 1348 1349 1350 1351 | contentPtr->flags = (contentPtr->flags & ~FILLX) | FILLY; } else if (strcmp(string, "both") == 0) { contentPtr->flags |= FILLX|FILLY; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad fill style \"%s\": must be " "none, x, y, or both", string)); | | | 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | contentPtr->flags = (contentPtr->flags & ~FILLX) | FILLY; } else if (strcmp(string, "both") == 0) { contentPtr->flags |= FILLX|FILLY; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad fill style \"%s\": must be " "none, x, y, or both", string)); Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", (char *)NULL); return TCL_ERROR; } break; case CONF_IN: if (j == 0) { if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other) != TCL_OK) { |
︙ | ︙ | |||
1371 1372 1373 1374 1375 1376 1377 | break; case CONF_IPADX: if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp) != TCL_OK) || (tmp < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipadx value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); | | | | 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 | break; case CONF_IPADX: if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp) != TCL_OK) || (tmp < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipadx value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL); return TCL_ERROR; } contentPtr->iPadX = tmp * 2; break; case CONF_IPADY: if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp) != TCL_OK) || (tmp < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipady value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL); return TCL_ERROR; } contentPtr->iPadY = tmp * 2; break; case CONF_PADX: if (TkParsePadAmount(interp, content, objv[i+1], &contentPtr->padLeft, &contentPtr->padX) != TCL_OK) { |
︙ | ︙ | |||
1462 1463 1464 1465 1466 1467 1468 | if (ancestor == parent) { break; } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); | | | | | | | 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 | if (ancestor == parent) { break; } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } } if (content == containerPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside itself", Tcl_GetString(objv[j]))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } /* * Check for management loops. */ for (container = (TkWindow *)containerPtr->tkwin; container != NULL; container = (TkWindow *)TkGetContainer(container)) { if (container == (TkWindow *)content) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't put \"%s\" inside \"%s\": would cause management loop", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); return TCL_ERROR; } } if (containerPtr->tkwin != Tk_Parent(content)) { ((TkWindow *)content)->maintainerPtr = (TkWindow *)containerPtr->tkwin; } |
︙ | ︙ |
Changes to generic/tkPanedWindow.c.
︙ | ︙ | |||
82 83 84 85 86 87 88 | Tk_Window tkwin; /* Window being managed. */ int minSize; /* Minimum size of this pane, on the relevant * axis, in pixels. */ int padx; /* Additional padding requested for pane, in * the x dimension. */ int pady; /* Additional padding requested for pane, in * the y dimension. */ | | | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | Tk_Window tkwin; /* Window being managed. */ int minSize; /* Minimum size of this pane, on the relevant * axis, in pixels. */ int padx; /* Additional padding requested for pane, in * the x dimension. */ int pady; /* Additional padding requested for pane, in * the y dimension. */ Tcl_Obj *widthObj, *heightObj; /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ int width; /* Pane width. */ int height; /* Pane height. */ int sticky; /* Sticky string. */ int x, y; /* Coordinates of the widget. */ int paneWidth, paneHeight; /* Pane dimensions (may be different from |
︙ | ︙ | |||
121 122 123 124 125 126 127 | Tcl_Command widgetCmd; /* Token for square's widget command. */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ Tk_OptionTable paneOpts; /* Token for pane cget table. */ Tk_3DBorder background; /* Background color. */ int borderWidth; /* Value of -borderwidth option. */ int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */ | | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | Tcl_Command widgetCmd; /* Token for square's widget command. */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ Tk_OptionTable paneOpts; /* Token for pane cget table. */ Tk_3DBorder background; /* Background color. */ int borderWidth; /* Value of -borderwidth option. */ int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */ Tcl_Obj *widthObj; /* Tcl_Obj rep for width. */ Tcl_Obj *heightObj; /* Tcl_Obj rep for height. */ int width, height; /* Width and height of the widget. */ enum orient orient; /* Orientation of the widget. */ Tk_Cursor cursor; /* Current cursor for window, or None. */ int resizeOpaque; /* Boolean indicating whether resize should be * opaque or rubberband style. */ int sashRelief; /* Relief used to draw sash. */ int sashWidth; /* Width of each sash, in pixels. */ |
︙ | ︙ | |||
287 288 289 290 291 292 293 | {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", DEF_PANEDWINDOW_HANDLEPAD, TCL_INDEX_NONE, offsetof(PanedWindow, handlePad), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), offsetof(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", | | | 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", DEF_PANEDWINDOW_HANDLEPAD, TCL_INDEX_NONE, offsetof(PanedWindow, handlePad), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), offsetof(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightObj), offsetof(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", DEF_PANEDWINDOW_OPAQUERESIZE, TCL_INDEX_NONE, offsetof(PanedWindow, resizeOpaque), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_PANEDWINDOW_ORIENT, TCL_INDEX_NONE, offsetof(PanedWindow, orient), TK_OPTION_ENUM_VAR, orientStrings, GEOMETRY}, |
︙ | ︙ | |||
322 323 324 325 326 327 328 | {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", DEF_PANEDWINDOW_SASHWIDTH, offsetof(PanedWindow, sashWidthPtr), offsetof(PanedWindow, sashWidth), 0, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle", DEF_PANEDWINDOW_SHOWHANDLE, TCL_INDEX_NONE, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", | | | | | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", DEF_PANEDWINDOW_SASHWIDTH, offsetof(PanedWindow, sashWidthPtr), offsetof(PanedWindow, sashWidth), 0, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle", DEF_PANEDWINDOW_SHOWHANDLE, TCL_INDEX_NONE, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthObj), offsetof(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec paneOptionSpecs[] = { {TK_OPTION_WINDOW, "-after", NULL, NULL, DEF_PANEDWINDOW_PANE_AFTER, TCL_INDEX_NONE, offsetof(Pane, after), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-before", NULL, NULL, DEF_PANEDWINDOW_PANE_BEFORE, TCL_INDEX_NONE, offsetof(Pane, before), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, DEF_PANEDWINDOW_PANE_HEIGHT, offsetof(Pane, heightObj), offsetof(Pane, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", DEF_PANEDWINDOW_PANE_HIDE, TCL_INDEX_NONE, offsetof(Pane, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, DEF_PANEDWINDOW_PANE_MINSIZE, TCL_INDEX_NONE, offsetof(Pane, minSize), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, DEF_PANEDWINDOW_PANE_PADX, TCL_INDEX_NONE, offsetof(Pane, padx), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, DEF_PANEDWINDOW_PANE_PADY, TCL_INDEX_NONE, offsetof(Pane, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, DEF_PANEDWINDOW_PANE_STICKY, TCL_INDEX_NONE, offsetof(Pane, sticky), 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", DEF_PANEDWINDOW_PANE_STRETCH, TCL_INDEX_NONE, offsetof(Pane, stretch), TK_OPTION_ENUM_VAR, stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Pane, widthObj), offsetof(Pane, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* *-------------------------------------------------------------- * |
︙ | ︙ | |||
670 671 672 673 674 675 676 | } } if (resultObj == NULL) { if (i == pwPtr->numPanes) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not managed by this window", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", | | | | | | | | | | | 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | } } if (resultObj == NULL) { if (i == pwPtr->numPanes) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not managed by this window", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", (char *)NULL); } result = TCL_ERROR; } else { Tcl_SetObjResult(interp, resultObj); } break; case PW_PANECONFIGURE: if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "pane ?-option value ...?"); result = TCL_ERROR; break; } resultObj = NULL; if (objc <= 4) { tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), pwPtr->tkwin); if (tkwin == NULL) { /* * Just a plain old bad window; Tk_NameToWindow filled in an * error message for us. */ result = TCL_ERROR; break; } for (i = 0; i < pwPtr->numPanes; i++) { if (pwPtr->panes[i]->tkwin == tkwin) { resultObj = Tk_GetOptionInfo(interp, pwPtr->panes[i], pwPtr->paneOpts, (objc == 4) ? objv[3] : NULL, pwPtr->tkwin); if (resultObj == NULL) { |
︙ | ︙ | |||
795 796 797 798 799 800 801 | } else if (tkwin == pwPtr->tkwin) { /* * A panedwindow cannot manage itself. */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add %s to itself", arg)); | | | | | 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 | } else if (tkwin == pwPtr->tkwin) { /* * A panedwindow cannot manage itself. */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add %s to itself", arg)); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } else if (Tk_IsTopLevel(tkwin)) { /* * A panedwindow cannot manage a toplevel. */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add toplevel %s to %s", arg, Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } else { /* * Make sure the panedwindow is the parent of the pane, * or a descendant of the pane's parent. */ parent = Tk_Parent(tkwin); for (ancestor = pwPtr->tkwin;;ancestor = Tk_Parent(ancestor)) { if (ancestor == parent) { break; } if (Tk_IsTopLevel(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add %s to %s", arg, Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } } } } } firstOptionArg = i; |
︙ | ︙ | |||
883 884 885 886 887 888 889 | * by the panedwindow, throw an error */ if (haveLoc && index == -1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" is not managed by %s", Tk_PathName(tkwin), Tk_PathName(pwPtr->tkwin))); | | | 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | * by the panedwindow, throw an error */ if (haveLoc && index == -1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" is not managed by %s", Tk_PathName(tkwin), Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", (char *)NULL); Tk_FreeConfigOptions(&options, pwPtr->paneOpts, pwPtr->tkwin); return TCL_ERROR; } /* * Allocate an array to hold, in order, the pointers to the pane |
︙ | ︙ | |||
1123 1124 1125 1126 1127 1128 1129 | if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) { return TCL_ERROR; } if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); | | | 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 | if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) { return TCL_ERROR; } if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } panePtr = pwPtr->panes[sash]; coords[0] = Tcl_NewWideIntObj(panePtr->sashx); coords[1] = Tcl_NewWideIntObj(panePtr->sashy); Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords)); |
︙ | ︙ | |||
1146 1147 1148 1149 1150 1151 1152 | if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) { return TCL_ERROR; } if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); | | | 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 | if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) { return TCL_ERROR; } if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } if (objc == 6) { if (Tcl_GetIntFromObj(interp, objv[4], &x) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
1182 1183 1184 1185 1186 1187 1188 | if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) { return TCL_ERROR; } if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); | | | 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 | if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) { return TCL_ERROR; } if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[4], &x) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
1365 1366 1367 1368 1369 1370 1371 | if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); pwPtr->flags |= REDRAW_PENDING; } } else if (eventPtr->type == DestroyNotify) { DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { | | | | | | | | | | | | 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 | if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); pwPtr->flags |= REDRAW_PENDING; } } else if (eventPtr->type == DestroyNotify) { DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { for (i = 0; i < pwPtr->numPanes; i++) { if (!pwPtr->panes[i]->hide) { Tk_UnmapWindow(pwPtr->panes[i]->tkwin); } } } else if (eventPtr->type == MapNotify) { for (i = 0; i < pwPtr->numPanes; i++) { if (!pwPtr->panes[i]->hide) { Tk_MapWindow(pwPtr->panes[i]->tkwin); } } } } /* *---------------------------------------------------------------------- * * PanedWindowCmdDeletedProc -- |
︙ | ︙ | |||
1785 1786 1787 1788 1789 1790 1791 | /* * Compute the total size needed by all the panes and the left-over, * or shortage of space available. */ if (horizontal) { | | | | | | | | | | | | 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 | /* * Compute the total size needed by all the panes and the left-over, * or shortage of space available. */ if (horizontal) { if (panePtr->width > 0) { paneSize = panePtr->width; } else { paneSize = panePtr->paneWidth; } stretchReserve -= paneSize + (2 * panePtr->padx); } else { if (panePtr->height > 0) { paneSize = panePtr->height; } else { paneSize = panePtr->paneHeight; } stretchReserve -= paneSize + (2 * panePtr->pady); } if (IsStretchable(panePtr->stretch,i,first,last) && Tk_IsMapped(pwPtr->tkwin)) { paneDynSize += paneSize; paneDynMinSize += panePtr->minSize; } |
︙ | ︙ | |||
1846 1847 1848 1849 1850 1851 1852 | paneMinSize = panePtr->minSize; /* * Calculate pane width and height. */ if (horizontal) { | | | | | | | | | | | | 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 | paneMinSize = panePtr->minSize; /* * Calculate pane width and height. */ if (horizontal) { if (panePtr->width > 0) { paneSize = panePtr->width; } else { paneSize = panePtr->paneWidth; } pwSize = pwWidth; } else { if (panePtr->height > 0) { paneSize = panePtr->height; } else { paneSize = panePtr->paneHeight; } pwSize = pwHeight; } if (IsStretchable(panePtr->stretch, i, first, last)) { double frac; if (paneDynSize > 0) { frac = (double)paneSize / (double)paneDynSize; |
︙ | ︙ | |||
2487 2488 2489 2490 2491 2492 2493 | case ' ': case ',': case '\t': case '\r': case '\n': break; default: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad stickyness value \"%s\": must be a string" " containing zero or more of n, e, s, and w", Tcl_GetString(*value))); | | | 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 | case ' ': case ',': case '\t': case '\r': case '\n': break; default: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad stickyness value \"%s\": must be a string" " containing zero or more of n, e, s, and w", Tcl_GetString(*value))); Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", (char *)NULL); return TCL_ERROR; } } } if (internalPtr != NULL) { *((int *) oldInternalPtr) = *((int *) internalPtr); |
︙ | ︙ | |||
2903 2904 2905 2906 2907 2908 2909 | return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) { return TCL_ERROR; } | | | | | | | | | | | | 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 | return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) { return TCL_ERROR; } internalBW = Tk_InternalBorderLeft(pwPtr->tkwin); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); if (x > pwWidth) { x = pwWidth; } y = Tk_InternalBorderLeft(pwPtr->tkwin); sashWidth = pwPtr->sashWidth; sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderLeft(pwPtr->tkwin)); } else { if (y < 0) { y = 0; } pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); if (y > pwHeight) { y = pwHeight; } x = Tk_InternalBorderLeft(pwPtr->tkwin); sashHeight = pwPtr->sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - (2 * Tk_InternalBorderLeft(pwPtr->tkwin)); } if (sashWidth < 1) { |
︙ | ︙ |
Changes to generic/tkPkgConfig.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 17 18 | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ /* Note, the definitions in this module are influenced by the following C * preprocessor macros: * * - _WIN32 || __CYGWIN__ The value for the fontsytem key will be * MAC_OSX_TK chosen based on these macros/defines. | > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ /* Note, the definitions in this module are influenced by the following C * preprocessor macros: * * OSCMa = shortcut for "old style configuration macro activates" * NSCMdt = shortcut for "new style configuration macro declares that" * * - TCL_THREADS OSCMa compilation as threaded. * - TCL_MEM_DEBUG OSCMa memory debugging. * * - TCL_CFG_DO64BIT NSCMdt tk is compiled for a 64bit system. * - NDEBUG NSCMdt tk is compiled with symbol info off. * - TCL_CFG_OPTIMIZED NSCMdt tk is compiled with cc optimizations on * - TCL_CFG_PROFILED NSCMdt tk is compiled with profiling info. * * - _WIN32 || __CYGWIN__ The value for the fontsytem key will be * MAC_OSX_TK chosen based on these macros/defines. * HAVE_XFT NSCMdt xft font support was requested. * * - CFG_RUNTIME_* Paths to various stuff at runtime. * - CFG_INSTALL_* Paths to various stuff at installation time. * * - TCL_CFGVAL_ENCODING string containing the encoding used for the * configuration values. */ #include "tkInt.h" #ifndef TCL_CFGVAL_ENCODING #define TCL_CFGVAL_ENCODING "utf-8" #endif /* * Use C preprocessor statements to define the various values for the embedded * configuration information. */ #ifdef TCL_THREADS # define CFG_THREADED "1" #else # define CFG_THREADED "0" #endif #ifdef TCL_MEM_DEBUG # define CFG_MEMDEBUG "1" #else # define CFG_MEMDEBUG "0" #endif #ifdef TCL_CFG_DO64BIT # define CFG_64 "1" #else # define CFG_64 "0" #endif #ifndef NDEBUG # define CFG_DEBUG "1" #else # define CFG_DEBUG "0" #endif #ifdef TCL_CFG_OPTIMIZED # define CFG_OPTIMIZED "1" #else # define CFG_OPTIMIZED "0" #endif #ifdef TCL_CFG_PROFILED # define CFG_PROFILED "1" #else # define CFG_PROFILED "0" #endif #if defined(_WIN32) # define CFG_FONTSYSTEM "gdi" #elif defined(MAC_OSX_TK) # define CFG_FONTSYSTEM "cocoa" #elif defined(HAVE_XFT) # define CFG_FONTSYSTEM "xft" #else # define CFG_FONTSYSTEM "x11" #endif static const Tcl_Config cfg[] = { #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 {"debug", CFG_DEBUG}, {"threaded", CFG_THREADED}, {"profiled", CFG_PROFILED}, {"64bit", CFG_64}, {"optimized", CFG_OPTIMIZED}, {"mem_debug", CFG_MEMDEBUG}, #endif {"fontsystem", CFG_FONTSYSTEM}, /* Runtime paths to various stuff */ #ifdef CFG_RUNTIME_LIBDIR {"libdir,runtime", CFG_RUNTIME_LIBDIR}, #endif |
︙ | ︙ |
Changes to generic/tkPlace.c.
︙ | ︙ | |||
50 51 52 53 54 55 56 | /* * Geometry information for window; where there are both relative and * absolute values for the same attribute (e.g. x and relX) only one of * them is actually used, depending on flags. */ int x, y; /* X and Y pixel coordinates for tkwin. */ | | | | | | | | | | | | | | | | | | | | | | | | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | /* * Geometry information for window; where there are both relative and * absolute values for the same attribute (e.g. x and relX) only one of * them is actually used, depending on flags. */ int x, y; /* X and Y pixel coordinates for tkwin. */ Tcl_Obj *xObj, *yObj; /* Tcl_Obj rep's of x, y coords, to keep pixel * spec. information. */ double relX, relY; /* X and Y coordinates relative to size of * container. */ int width, height; /* Absolute dimensions for tkwin. */ Tcl_Obj *widthObj; /* Tcl_Obj rep of width, to keep pixel * spec. */ Tcl_Obj *heightObj; /* Tcl_Obj rep of height, to keep pixel * spec. */ double relWidth, relHeight; /* Dimensions for tkwin relative to size of * container. */ Tcl_Obj *relWidthObj; Tcl_Obj *relHeightObj; Tk_Anchor anchor; /* Which point on tkwin is placed at the given * position. */ BorderMode borderMode; /* How to treat borders of container window. */ } Content; /* * Type masks for options: */ #define IN_MASK 1 static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", TCL_INDEX_NONE, offsetof(Content, anchor), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", TCL_INDEX_NONE, offsetof(Content, borderMode), TK_OPTION_ENUM_VAR, borderModeStrings, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, NULL, offsetof(Content, heightObj), offsetof(Content, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-in", NULL, NULL, "", TCL_INDEX_NONE, offsetof(Content, inTkwin), 0, 0, IN_MASK}, {TK_OPTION_DOUBLE, "-relheight", NULL, NULL, NULL, offsetof(Content, relHeightObj), offsetof(Content, relHeight), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, NULL, offsetof(Content, relWidthObj), offsetof(Content, relWidth), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0.0", TCL_INDEX_NONE, offsetof(Content, relX), 0, 0, 0}, {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0.0", TCL_INDEX_NONE, offsetof(Content, relY), 0, 0, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, NULL, offsetof(Content, widthObj), offsetof(Content, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", offsetof(Content, xObj), offsetof(Content, x), 0, 0, 0}, {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", offsetof(Content, yObj), offsetof(Content, y), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* * For each container window that has a content managed by the placer there is a * structure of the following form: */ |
︙ | ︙ | |||
622 623 624 625 626 627 628 | Tk_Window containerWin = NULL; TkWindow *container; if (Tk_TopWinHierarchy(tkwin)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use placer on top-level window \"%s\"; use " "wm command instead", Tk_PathName(tkwin))); | | | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | Tk_Window containerWin = NULL; TkWindow *container; if (Tk_TopWinHierarchy(tkwin)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use placer on top-level window \"%s\"; use " "wm command instead", Tk_PathName(tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } contentPtr = CreateContent(tkwin, table); if (Tk_SetOptions(interp, contentPtr, table, objc, objv, contentPtr->tkwin, &savedOptions, &mask) != TCL_OK) { |
︙ | ︙ | |||
662 663 664 665 666 667 668 | if (ancestor == Tk_Parent(contentPtr->tkwin)) { break; } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to \"%s\"", Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); | | | | | | | 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 | if (ancestor == Tk_Parent(contentPtr->tkwin)) { break; } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to \"%s\"", Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); goto error; } } if (contentPtr->tkwin == win) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to itself", Tk_PathName(contentPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); goto error; } /* * Check for management loops. */ for (container = (TkWindow *)win; container != NULL; container = (TkWindow *)TkGetContainer(container)) { if (container == (TkWindow *)contentPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't put \"%s\" inside \"%s\": would cause management loop", Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); goto error; } } if (win != Tk_Parent(contentPtr->tkwin)) { ((TkWindow *)contentPtr->tkwin)->maintainerPtr = (TkWindow *)win; } |
︙ | ︙ | |||
790 791 792 793 794 795 796 | Tcl_ListObjAppendElement(NULL, infoObj, Tk_NewWindowObj(contentPtr->containerPtr->tkwin)); Tcl_AppendToObj(infoObj, " ", TCL_INDEX_NONE); } Tcl_AppendPrintfToObj(infoObj, "-x %d -relx %.4g -y %d -rely %.4g", contentPtr->x, contentPtr->relX, contentPtr->y, contentPtr->relY); | | | | | | 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 | Tcl_ListObjAppendElement(NULL, infoObj, Tk_NewWindowObj(contentPtr->containerPtr->tkwin)); Tcl_AppendToObj(infoObj, " ", TCL_INDEX_NONE); } Tcl_AppendPrintfToObj(infoObj, "-x %d -relx %.4g -y %d -rely %.4g", contentPtr->x, contentPtr->relX, contentPtr->y, contentPtr->relY); if (contentPtr->widthObj) { Tcl_AppendPrintfToObj(infoObj, " -width %d", contentPtr->width); } else { Tcl_AppendToObj(infoObj, " -width {}", TCL_INDEX_NONE); } if (contentPtr->relWidthObj) { Tcl_AppendPrintfToObj(infoObj, " -relwidth %.4g", contentPtr->relWidth); } else { Tcl_AppendToObj(infoObj, " -relwidth {}", TCL_INDEX_NONE); } if (contentPtr->heightObj) { Tcl_AppendPrintfToObj(infoObj, " -height %d", contentPtr->height); } else { Tcl_AppendToObj(infoObj, " -height {}", TCL_INDEX_NONE); } if (contentPtr->relHeightObj) { Tcl_AppendPrintfToObj(infoObj, " -relheight %.4g", contentPtr->relHeight); } else { Tcl_AppendToObj(infoObj, " -relheight {}", TCL_INDEX_NONE); } Tcl_AppendPrintfToObj(infoObj, " -anchor %s -bordermode %s", |
︙ | ︙ | |||
902 903 904 905 906 907 908 | * and location of anchor point within container. */ x1 = contentPtr->x + containerX + (contentPtr->relX*containerWidth); x = (int) (x1 + ((x1 > 0) ? 0.5 : -0.5)); y1 = contentPtr->y + containerY + (contentPtr->relY*containerHeight); y = (int) (y1 + ((y1 > 0) ? 0.5 : -0.5)); | | | | | | | | 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 | * and location of anchor point within container. */ x1 = contentPtr->x + containerX + (contentPtr->relX*containerWidth); x = (int) (x1 + ((x1 > 0) ? 0.5 : -0.5)); y1 = contentPtr->y + containerY + (contentPtr->relY*containerHeight); y = (int) (y1 + ((y1 > 0) ? 0.5 : -0.5)); if ((contentPtr->widthObj) || contentPtr->relWidthObj) { width = 0; if (contentPtr->widthObj) { width += contentPtr->width; } if (contentPtr->relWidthObj) { /* * The code below is a bit tricky. In order to round correctly * when both relX and relWidth are specified, compute the * location of the right edge and round that, then compute * width. If we compute the width and round it, rounding * errors in relX and relWidth accumulate. */ x2 = x1 + (contentPtr->relWidth*containerWidth); tmp = (int) (x2 + ((x2 > 0) ? 0.5 : -0.5)); width += tmp - x; } } else { width = Tk_ReqWidth(contentPtr->tkwin) + 2*Tk_Changes(contentPtr->tkwin)->border_width; } if (contentPtr->heightObj || contentPtr->relHeightObj) { height = 0; if (contentPtr->heightObj) { height += contentPtr->height; } if (contentPtr->relHeightObj) { /* * See note above for rounding errors in width computation. */ y2 = y1 + (contentPtr->relHeight*containerHeight); tmp = (int) (y2 + ((y2 > 0) ? 0.5 : -0.5)); height += tmp - y; |
︙ | ︙ | |||
1011 1012 1013 1014 1015 1016 1017 | if (containerPtr->tkwin == Tk_Parent(contentPtr->tkwin)) { if ((x != Tk_X(contentPtr->tkwin)) || (y != Tk_Y(contentPtr->tkwin)) || (width != Tk_Width(contentPtr->tkwin)) || (height != Tk_Height(contentPtr->tkwin))) { Tk_MoveResizeWindow(contentPtr->tkwin, x, y, width, height); } | | | | | 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 | if (containerPtr->tkwin == Tk_Parent(contentPtr->tkwin)) { if ((x != Tk_X(contentPtr->tkwin)) || (y != Tk_Y(contentPtr->tkwin)) || (width != Tk_Width(contentPtr->tkwin)) || (height != Tk_Height(contentPtr->tkwin))) { Tk_MoveResizeWindow(contentPtr->tkwin, x, y, width, height); } if (abort) { break; } /* * Don't map the content unless the container is mapped: the content will * get mapped later, when the container is mapped. */ if (Tk_IsMapped(containerPtr->tkwin)) { |
︙ | ︙ | |||
1180 1181 1182 1183 1184 1185 1186 | PlaceRequestProc( void *clientData, /* Pointer to our record for content. */ TCL_UNUSED(Tk_Window)) /* Window that changed its desired size. */ { Content *contentPtr = (Content *)clientData; Container *containerPtr; | | | | | | | | | 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 | PlaceRequestProc( void *clientData, /* Pointer to our record for content. */ TCL_UNUSED(Tk_Window)) /* Window that changed its desired size. */ { Content *contentPtr = (Content *)clientData; Container *containerPtr; if ((contentPtr->widthObj || contentPtr->relWidthObj) && (contentPtr->heightObj || contentPtr->relHeightObj)) { /* * Send a ConfigureNotify to indicate that the size change * request was rejected. */ TkDoConfigureNotify((TkWindow *)(contentPtr->tkwin)); return; } containerPtr = contentPtr->containerPtr; if (containerPtr == NULL) { return; } if (!(containerPtr->flags & PARENT_RECONFIG_PENDING)) { |
︙ | ︙ |
Changes to generic/tkPlatDecls.h.
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd); /* 1 */ EXTERN HINSTANCE Tk_GetHINSTANCE(void); /* 2 */ EXTERN HWND Tk_GetHWND(Window window); /* 3 */ EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ /* 4 */ EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); | > > > > > > | > > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd); /* 1 */ EXTERN HINSTANCE Tk_GetHINSTANCE(void); /* 2 */ EXTERN HWND Tk_GetHWND(Window window); /* 3 */ EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd); /* 4 */ EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y); /* 5 */ EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ /* 4 */ EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); /* 5 */ EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 6 */ EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin); /* Slot 7 is reserved */ /* 8 */ EXTERN void * TkMacOSXGetRootControl(Drawable drawable); /* 9 */ EXTERN void Tk_MacOSXSetupTkNotifier(void); |
︙ | ︙ | |||
82 83 84 85 86 87 88 89 90 91 92 93 94 95 | void *hooks; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*reserved0)(void); void (*reserved1)(void); void (*reserved2)(void); void (*reserved3)(void); void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ | > > | | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | void *hooks; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */ void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */ int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*reserved0)(void); void (*reserved1)(void); void (*reserved2)(void); void (*reserved3)(void); void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ void (*reserved7)(void); void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */ int (*tk_MacOSXIsAppInFront) (void); /* 10 */ Tk_Window (*tk_MacOSXGetTkWindow) (void *w); /* 11 */ void * (*tk_MacOSXGetCGContextForDrawable) (Drawable drawable); /* 12 */ |
︙ | ︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ #define Tk_GetHINSTANCE \ (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ #define Tk_GetHWND \ (tkPlatStubsPtr->tk_GetHWND) /* 2 */ #define Tk_HWNDToWindow \ (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ #define TkMacOSXInitAppleEvents \ (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ | > > > > | > | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ #define Tk_GetHINSTANCE \ (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ #define Tk_GetHWND \ (tkPlatStubsPtr->tk_GetHWND) /* 2 */ #define Tk_HWNDToWindow \ (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ #define Tk_PointerEvent \ (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ #define Tk_TranslateWinEvent \ (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ #define TkMacOSXInitAppleEvents \ (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ #define TkGenWMConfigureEvent_ \ (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 5 */ #define TkMacOSXInvalClipRgns \ (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */ /* Slot 7 is reserved */ #define TkMacOSXGetRootControl \ (tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */ #define Tk_MacOSXSetupTkNotifier \ (tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */ |
︙ | ︙ | |||
166 167 168 169 170 171 172 173 174 175 | #ifdef __cplusplus } #endif #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl #endif /* _TKPLATDECLS */ | > | 181 182 183 184 185 186 187 188 189 190 191 | #ifdef __cplusplus } #endif #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #undef TkGenWMConfigureEvent_ #define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl #endif /* _TKPLATDECLS */ |
Changes to generic/tkRectOval.c.
︙ | ︙ | |||
167 168 169 170 171 172 173 | sizeof(RectOvalItem), /* itemSize */ CreateRectOval, /* createProc */ configSpecs, /* configSpecs */ ConfigureRectOval, /* configureProc */ RectOvalCoords, /* coordProc */ DeleteRectOval, /* deleteProc */ DisplayRectOval, /* displayProc */ | | | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | sizeof(RectOvalItem), /* itemSize */ CreateRectOval, /* createProc */ configSpecs, /* configSpecs */ ConfigureRectOval, /* configureProc */ RectOvalCoords, /* coordProc */ DeleteRectOval, /* deleteProc */ DisplayRectOval, /* displayProc */ TK_CONFIG_OBJS, /* flags */ RectToPoint, /* pointProc */ RectToArea, /* areaProc */ RectOvalToPostscript, /* postscriptProc */ ScaleRectOval, /* scaleProc */ TranslateRectOval, /* translateProc */ NULL, /* indexProc */ NULL, /* icursorProc */ |
︙ | ︙ | |||
192 193 194 195 196 197 198 | sizeof(RectOvalItem), /* itemSize */ CreateRectOval, /* createProc */ configSpecs, /* configSpecs */ ConfigureRectOval, /* configureProc */ RectOvalCoords, /* coordProc */ DeleteRectOval, /* deleteProc */ DisplayRectOval, /* displayProc */ | | | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | sizeof(RectOvalItem), /* itemSize */ CreateRectOval, /* createProc */ configSpecs, /* configSpecs */ ConfigureRectOval, /* configureProc */ RectOvalCoords, /* coordProc */ DeleteRectOval, /* deleteProc */ DisplayRectOval, /* displayProc */ TK_CONFIG_OBJS, /* flags */ OvalToPoint, /* pointProc */ OvalToArea, /* areaProc */ RectOvalToPostscript, /* postscriptProc */ ScaleRectOval, /* scaleProc */ TranslateRectOval, /* translateProc */ NULL, /* indexProc */ NULL, /* cursorProc */ |
︙ | ︙ | |||
412 413 414 415 416 417 418 | XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, | | | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | XColor *color; Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } state = itemPtr->state; /* * A few of the options require additional processing, such as graphics * contexts. |
︙ | ︙ |
Changes to generic/tkScrollbar.c.
︙ | ︙ | |||
53 54 55 56 57 58 59 | {TK_CONFIG_STRING, "-command", "command", "Command", DEF_SCROLLBAR_COMMAND, offsetof(TkScrollbar, command), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_SCROLLBAR_CURSOR, offsetof(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth", "BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH, | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | {TK_CONFIG_STRING, "-command", "command", "Command", DEF_SCROLLBAR_COMMAND, offsetof(TkScrollbar, command), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_SCROLLBAR_CURSOR, offsetof(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth", "BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH, offsetof(TkScrollbar, elementBorderWidth), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCROLLBAR_HIGHLIGHT_BG, offsetof(TkScrollbar, highlightBgColorPtr), 0, NULL}, {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_SCROLLBAR_HIGHLIGHT, offsetof(TkScrollbar, highlightColorPtr), 0, NULL}, {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", |
︙ | ︙ | |||
174 175 176 177 178 179 180 181 182 183 184 185 186 187 | scrollPtr->inset = 0; scrollPtr->elementBorderWidth = -1; scrollPtr->arrowLength = 0; scrollPtr->sliderFirst = 0; scrollPtr->sliderLast = 0; scrollPtr->activeField = 0; scrollPtr->activeRelief = TK_RELIEF_RAISED; scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; scrollPtr->cursor = NULL; scrollPtr->takeFocus = NULL; scrollPtr->flags = 0; if (ConfigureScrollbar(interp, scrollPtr, objc-2, objv+2, 0) != TCL_OK) { | > > > > > > | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | scrollPtr->inset = 0; scrollPtr->elementBorderWidth = -1; scrollPtr->arrowLength = 0; scrollPtr->sliderFirst = 0; scrollPtr->sliderLast = 0; scrollPtr->activeField = 0; scrollPtr->activeRelief = TK_RELIEF_RAISED; #ifndef TK_NO_DEPRECATED scrollPtr->totalUnits = 0; scrollPtr->windowUnits = 0; scrollPtr->firstUnit = 0; scrollPtr->lastUnit = 0; #endif /* TK_NO_DEPRECATED */ scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; scrollPtr->cursor = NULL; scrollPtr->takeFocus = NULL; scrollPtr->flags = 0; if (ConfigureScrollbar(interp, scrollPtr, objc-2, objv+2, 0) != TCL_OK) { |
︙ | ︙ | |||
368 369 370 371 372 373 374 375 376 377 378 379 380 381 | case COMMAND_GET: { Tcl_Obj *resObjs[4]; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "get"); goto error; } resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction); resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction); Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs)); break; } case COMMAND_IDENTIFY: { int x, y; | > > > > > > > > > > | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | case COMMAND_GET: { Tcl_Obj *resObjs[4]; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "get"); goto error; } #ifndef TK_NO_DEPRECATED if (scrollPtr->flags & OLD_STYLE_COMMANDS) { resObjs[0] = Tcl_NewWideIntObj(scrollPtr->totalUnits); resObjs[1] = Tcl_NewWideIntObj(scrollPtr->windowUnits); resObjs[2] = Tcl_NewWideIntObj(scrollPtr->firstUnit); resObjs[3] = Tcl_NewWideIntObj(scrollPtr->lastUnit); Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs)); break; } #endif /* TK_NO_DEPRECATED */ resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction); resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction); Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs)); break; } case COMMAND_IDENTIFY: { int x, y; |
︙ | ︙ | |||
419 420 421 422 423 424 425 426 427 428 429 430 431 432 | if (last < scrollPtr->firstFraction) { scrollPtr->lastFraction = scrollPtr->firstFraction; } else if (last > 1.0) { scrollPtr->lastFraction = 1.0; } else { scrollPtr->lastFraction = last; } } else { Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction"); goto error; } TkpComputeScrollbarGeometry(scrollPtr); TkScrollbarEventuallyRedraw(scrollPtr); break; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | if (last < scrollPtr->firstFraction) { scrollPtr->lastFraction = scrollPtr->firstFraction; } else if (last > 1.0) { scrollPtr->lastFraction = 1.0; } else { scrollPtr->lastFraction = last; } #ifndef TK_NO_DEPRECATED scrollPtr->flags &= ~OLD_STYLE_COMMANDS; } else if (objc == 6) { int totalUnits, windowUnits, firstUnit, lastUnit; if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) { goto error; } if (totalUnits < 0) { totalUnits = 0; } if (Tcl_GetIntFromObj(interp, objv[3], &windowUnits) != TCL_OK) { goto error; } if (windowUnits < 0) { windowUnits = 0; } if (Tcl_GetIntFromObj(interp, objv[4], &firstUnit) != TCL_OK) { goto error; } if (Tcl_GetIntFromObj(interp, objv[5], &lastUnit) != TCL_OK) { goto error; } if (totalUnits > 0) { if (lastUnit < firstUnit) { lastUnit = firstUnit; } } else { firstUnit = lastUnit = 0; } scrollPtr->totalUnits = totalUnits; scrollPtr->windowUnits = windowUnits; scrollPtr->firstUnit = firstUnit; scrollPtr->lastUnit = lastUnit; if (scrollPtr->totalUnits == 0) { scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 1.0; } else { scrollPtr->firstFraction = ((double) firstUnit)/totalUnits; scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits; } scrollPtr->flags |= OLD_STYLE_COMMANDS; #endif /* !TK_NO_DEPRECATED */ } else { Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction"); goto error; } TkpComputeScrollbarGeometry(scrollPtr); TkScrollbarEventuallyRedraw(scrollPtr); break; |
︙ | ︙ | |||
469 470 471 472 473 474 475 | /* Information about widget; may or may not * already have values for some fields. */ Tcl_Size objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, objc, | | > > > > > > | 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | /* Information about widget; may or may not * already have values for some fields. */ Tcl_Size objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, objc, (const char **)objv, (char *) scrollPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } /* * A few options need special processing, such as setting the background * from a 3-D border. */ if (scrollPtr->command != NULL) { scrollPtr->commandSize = (int) strlen(scrollPtr->command); } else { scrollPtr->commandSize = 0; } if (scrollPtr->highlightWidth < 0) { scrollPtr->highlightWidth = 0; } if (scrollPtr->elementBorderWidth < 0) { scrollPtr->elementBorderWidth = -1; } /* * Configure platform specific options. */ TkpConfigureScrollbar(scrollPtr); |
︙ | ︙ |
Changes to generic/tkScrollbar.h.
︙ | ︙ | |||
92 93 94 95 96 97 98 99 100 101 102 103 104 105 | * command. This information can now be provided in two ways: the "old" * form (totalUnits, windowUnits, firstUnit, and lastUnit), or the "new" * form (firstFraction and lastFraction). FirstFraction and lastFraction * will always be valid, but the old-style information is only valid if * the OLD_STYLE_COMMANDS flag is 1. */ double firstFraction; /* Position of first visible thing in window, * specified as a fraction between 0 and * 1.0. */ double lastFraction; /* Position of last visible thing in window, * specified as a fraction between 0 and * 1.0. */ | > > > > > > > > > > > > > > > > | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | * command. This information can now be provided in two ways: the "old" * form (totalUnits, windowUnits, firstUnit, and lastUnit), or the "new" * form (firstFraction and lastFraction). FirstFraction and lastFraction * will always be valid, but the old-style information is only valid if * the OLD_STYLE_COMMANDS flag is 1. */ #ifndef TK_NO_DEPRECATED int totalUnits; /* Total dimension of application, in units. * Valid only if the OLD_STYLE_COMMANDS flag * is set. */ int windowUnits; /* Maximum number of units that can be * displayed in the window at once. Valid only * if the OLD_STYLE_COMMANDS flag is set. */ int firstUnit; /* Number of last unit visible in * application's window. Valid only if the * OLD_STYLE_COMMANDS flag is set. */ int lastUnit; /* Index of last unit visible in window. * Valid only if the OLD_STYLE_COMMANDS flag * isn't set. */ #else int dummy1,dummy2,dummy3,dummy4; /* sizeof(TkScrollbar) should not depend on TK_NO_DEPRECATED */ #endif /* TK_NO_DEPRECATED */ double firstFraction; /* Position of first visible thing in window, * specified as a fraction between 0 and * 1.0. */ double lastFraction; /* Position of last visible thing in window, * specified as a fraction between 0 and * 1.0. */ |
︙ | ︙ | |||
137 138 139 140 141 142 143 144 145 146 147 148 149 150 | * ".t yview 40", instead of * ".t yview scroll 2 lines", for example. * GOT_FOCUS: Non-zero means this window has the input * focus. */ #define REDRAW_PENDING 1 #define GOT_FOCUS 4 /* * Declaration of scrollbar class functions structure * and default scrollbar width, for use in configSpec. */ | > > > | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | * ".t yview 40", instead of * ".t yview scroll 2 lines", for example. * GOT_FOCUS: Non-zero means this window has the input * focus. */ #define REDRAW_PENDING 1 #ifndef TK_NO_DEPRECATED # define OLD_STYLE_COMMANDS 2 #endif /* TK_NO_DEPRECATED */ #define GOT_FOCUS 4 /* * Declaration of scrollbar class functions structure * and default scrollbar width, for use in configSpec. */ |
︙ | ︙ |
Changes to generic/tkSelect.c.
︙ | ︙ | |||
711 712 713 714 715 716 717 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); | | | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objs[0], clearOptionStrings, "option", 0, &clearIndex) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
771 772 773 774 775 776 777 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); | | | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objs[0], getOptionStrings, "option", 0, &getIndex) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
849 850 851 852 853 854 855 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); | | | 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objs[0],handleOptionStrings, "option", 0, &handleIndex) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
936 937 938 939 940 941 942 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); | | | 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 | string = Tcl_GetString(objs[0]); if (string[0] != '-') { break; } if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objs[0], ownOptionStrings, "option", 0, &ownIndex) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
1397 1398 1399 1400 1401 1402 1403 | /* * Update the partial character information for the next retrieval if * the command has not been deleted. */ if (cmdInfoPtr->interp != NULL) { if (length <= maxBytes) { | | | | | 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 | /* * Update the partial character information for the next retrieval if * the command has not been deleted. */ if (cmdInfoPtr->interp != NULL) { if (length <= maxBytes) { cmdInfoPtr->charOffset += TkNumUtfChars(string, TCL_INDEX_NONE); cmdInfoPtr->buffer[0] = '\0'; } else { int ch = 0; p = string; string += count; numChars = 0; while (p < string) { p += TkUtfToUniChar(p, &ch); numChars++; } cmdInfoPtr->charOffset += numChars; length = p - string; if (length > 0) { strncpy(cmdInfoPtr->buffer, string, length); } |
︙ | ︙ |
Changes to generic/tkSquare.c.
︙ | ︙ | |||
19 20 21 22 23 24 25 | #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #ifndef USE_TK_STUBS # define USE_TK_STUBS #endif #include "tkInt.h" | < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #ifndef USE_TK_STUBS # define USE_TK_STUBS #endif #include "tkInt.h" /* * A data structure of the following type is kept for each square widget * managed by this file: */ typedef struct { |
︙ | ︙ | |||
50 51 52 53 54 55 56 | Tcl_Obj *borderWidthPtr; /* Width of 3-D border around whole widget. */ Tcl_Obj *bgBorderPtr; Tcl_Obj *fgBorderPtr; Tcl_Obj *reliefPtr; GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ | | | | | | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | Tcl_Obj *borderWidthPtr; /* Width of 3-D border around whole widget. */ Tcl_Obj *bgBorderPtr; Tcl_Obj *fgBorderPtr; Tcl_Obj *reliefPtr; GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ Tcl_Obj *doubleBufferPtr; /* Non-zero means double-buffer redisplay with * pixmap; zero means draw straight onto the * display. */ int updatePending; /* Non-zero means a call to SquareDisplay has * already been scheduled. */ } Square; /* * Information used for argv parsing. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", "#d9d9d9", offsetof(Square, bgBorderPtr), TCL_INDEX_NONE, 0, "white", 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", "2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", "1", offsetof(Square, doubleBufferPtr), TCL_INDEX_NONE, 0 , NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", "#b03060", offsetof(Square, fgBorderPtr), TCL_INDEX_NONE, 0, "black", 0}, {TK_OPTION_PIXELS, "-posx", "posx", "PosX", "0", offsetof(Square, xPtr), TCL_INDEX_NONE, 0, NULL, 0}, |
︙ | ︙ | |||
276 277 278 279 280 281 282 | squarePtr->optionTable, objc - 2, objv + 2, squarePtr->tkwin, NULL, NULL); if (result == TCL_OK) { result = SquareConfigure(interp, squarePtr); } if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); | | | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | squarePtr->optionTable, objc - 2, objv + 2, squarePtr->tkwin, NULL, NULL); if (result == TCL_OK) { result = SquareConfigure(interp, squarePtr); } if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } } if (resultObjPtr != NULL) { Tcl_SetObjResult(interp, resultObjPtr); } } Tcl_Release(squarePtr); |
︙ | ︙ | |||
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | static int SquareConfigure( TCL_UNUSED(Tcl_Interp *), /* Used for error reporting. */ Square *squarePtr) /* Information about widget. */ { int borderWidth; Tk_3DBorder bgBorder; /* * Set the background for the window and create a graphics context for use * during redisplay. */ bgBorder = Tk_Get3DBorderFromObj(squarePtr->tkwin, squarePtr->bgBorderPtr); Tk_SetWindowBackground(squarePtr->tkwin, Tk_3DBorderColor(bgBorder)->pixel); | > > | | | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | static int SquareConfigure( TCL_UNUSED(Tcl_Interp *), /* Used for error reporting. */ Square *squarePtr) /* Information about widget. */ { int borderWidth; Tk_3DBorder bgBorder; int doubleBuffer; /* * Set the background for the window and create a graphics context for use * during redisplay. */ bgBorder = Tk_Get3DBorderFromObj(squarePtr->tkwin, squarePtr->bgBorderPtr); Tk_SetWindowBackground(squarePtr->tkwin, Tk_3DBorderColor(bgBorder)->pixel); Tcl_GetBooleanFromObj(NULL, squarePtr->doubleBufferPtr, &doubleBuffer); if ((squarePtr->gc == NULL) && doubleBuffer) { XGCValues gcValues; gcValues.function = GXcopy; gcValues.graphics_exposures = False; squarePtr->gc = Tk_GetGC(squarePtr->tkwin, GCFunction|GCGraphicsExposures, &gcValues); } /* * Register the desired geometry for the window. Then arrange for the * window to be redisplayed. */ Tk_GeometryRequest(squarePtr->tkwin, 200, 150); Tk_GetPixelsFromObj(NULL, squarePtr->tkwin, squarePtr->borderWidthPtr, &borderWidth); Tk_SetInternalBorder(squarePtr->tkwin, borderWidth); if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } KeepInWindow(squarePtr); return TCL_OK; } /* *-------------------------------------------------------------- |
︙ | ︙ | |||
381 382 383 384 385 386 387 | XEvent *eventPtr) /* Information about event. */ { Square *squarePtr = (Square *)clientData; if (eventPtr->type == Expose) { if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); | | | | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | XEvent *eventPtr) /* Information about event. */ { Square *squarePtr = (Square *)clientData; if (eventPtr->type == Expose) { if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } } else if (eventPtr->type == ConfigureNotify) { KeepInWindow(squarePtr); if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } } else if (eventPtr->type == DestroyNotify) { if (squarePtr->tkwin != NULL) { Tk_FreeConfigOptions(squarePtr, squarePtr->optionTable, squarePtr->tkwin); if (squarePtr->gc != NULL) { Tk_FreeGC(squarePtr->display, squarePtr->gc); |
︙ | ︙ | |||
472 473 474 475 476 477 478 479 | { Square *squarePtr = (Square *)clientData; Tk_Window tkwin = squarePtr->tkwin; Pixmap pm = None; Drawable d; int borderWidth, size, relief; Tk_3DBorder bgBorder, fgBorder; | > | > | | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | { Square *squarePtr = (Square *)clientData; Tk_Window tkwin = squarePtr->tkwin; Pixmap pm = None; Drawable d; int borderWidth, size, relief; Tk_3DBorder bgBorder, fgBorder; int doubleBuffer; squarePtr->updatePending = 0; if (!Tk_IsMapped(tkwin)) { return; } /* * Create a pixmap for double-buffering, if necessary. */ Tcl_GetBooleanFromObj(NULL, squarePtr->doubleBufferPtr, &doubleBuffer); if (doubleBuffer) { pm = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), DefaultDepthOfScreen(Tk_Screen(tkwin))); d = pm; } else { d = Tk_WindowId(tkwin); } |
︙ | ︙ | |||
517 518 519 520 521 522 523 | Tk_Fill3DRectangle(tkwin, d, fgBorder, squarePtr->x, squarePtr->y, size, size, borderWidth, TK_RELIEF_RAISED); /* * If double-buffered, copy to the screen and release the pixmap. */ | | | 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | Tk_Fill3DRectangle(tkwin, d, fgBorder, squarePtr->x, squarePtr->y, size, size, borderWidth, TK_RELIEF_RAISED); /* * If double-buffered, copy to the screen and release the pixmap. */ if (doubleBuffer) { XCopyArea(Tk_Display(tkwin), pm, Tk_WindowId(tkwin), squarePtr->gc, 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin), 0, 0); Tk_FreePixmap(Tk_Display(tkwin), pm); } } |
︙ | ︙ |
Changes to generic/tkStubInit.c.
︙ | ︙ | |||
35 36 37 38 39 40 41 42 43 44 | MODULE_SCOPE const TkStubs tkStubs; /* * Remove macro that might interfere with the definition below. */ #undef TkPutImage #undef XPutImage | > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > | > | | < < < | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | MODULE_SCOPE const TkStubs tkStubs; /* * Remove macro that might interfere with the definition below. */ #undef Tk_MainEx #undef Tk_FreeXId #undef Tk_FreeStyleFromObj #undef Tk_GetStyleFromObj #undef TkWinGetPlatformId #undef TkPutImage #undef XPutImage #define TkMacOSXSetUpClippingRgn (void (*)(Drawable))(void *)doNothing #undef TkMacOSXIsCharacterMissing #define TkMacOSXIsCharacterMissing (int (*)(Tk_Font, unsigned int))(void *)doNothing #if defined(_WIN32) && !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 # define Tk_TranslateWinEvent TkTranslateWinEvent # define Tk_PointerEvent TkWinPointerEvent #define TkWinGetPlatformId winGetPlatformId static int TkWinGetPlatformId(void) { return 2; } #else # define Tk_TranslateWinEvent 0 # define Tk_PointerEvent 0 # define TkWinGetPlatformId 0 #endif #if defined(TK_NO_DEPRECATED) || (TCL_MAJOR_VERSION > 8) # define TkSetWindowMenuBar 0 # define TkpDrawHighlightBorder 0 # define TkpUseWindow 0 # define TkpSetMainMenubar 0 # define TkpGetOtherWindow 0 # define TkpGetSystemDefault 0 # define TkpMakeContainer 0 # define TkpMakeWindow 0 #endif static int doNothing(void) { /* dummy implementation, no need to do anything */ return 0; } #if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 #define Tk_MainEx 0 #define Tk_FreeXId 0 #define Tk_FreeStyleFromObj 0 #define Tk_GetStyleFromObj 0 #define TkWinGetPlatformId 0 #define Tk_PhotoPutBlock_NoComposite 0 #define Tk_PhotoPutZoomedBlock_NoComposite 0 #define Tk_PhotoExpand_Panic 0 #define Tk_PhotoPutBlock_Panic 0 #define Tk_PhotoPutZoomedBlock_Panic 0 #define Tk_PhotoSetSize_Panic 0 #define Tk_CreateOldPhotoImageFormat 0 #else #define Tk_FreeXId ((void (*)(Display *, XID))(void *)doNothing) #define Tk_FreeStyleFromObj ((void (*)(Tcl_Obj *))(void *)doNothing) #define Tk_GetStyleFromObj getStyleFromObj static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) { return Tk_AllocStyleFromObj(NULL, obj); } #endif /* !TK_NO_DEPRECATED */ #define TkpCmapStressed_ TkpCmapStressed #define TkpSync_ TkpSync #define TkUnixContainerId_ TkUnixContainerId #define TkUnixDoOneXEvent_ TkUnixDoOneXEvent #define TkUnixSetMenubar_ TkUnixSetMenubar #define TkWmCleanup_ TkWmCleanup #define TkSendCleanup_ TkSendCleanup #define TkpTestsendCmd_ TkpTestsendCmd #define TkGenWMConfigureEvent_ TkGenWMConfigureEvent #define TkGenerateActivateEvents_ TkGenerateActivateEvents #define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable #if !defined(MAC_OSX_TK) # undef TkpWillDrawWidget # undef TkpRedrawWidget # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) # define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing) #endif #ifdef _WIN32 int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) { |
︙ | ︙ | |||
292 293 294 295 296 297 298 | TkOvalToArea, /* 53 */ TkOvalToPoint, /* 54 */ TkpChangeFocus, /* 55 */ TkpCloseDisplay, /* 56 */ TkpClaimFocus, /* 57 */ TkpDisplayWarning, /* 58 */ TkpGetAppName, /* 59 */ | | | | | | | | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | TkOvalToArea, /* 53 */ TkOvalToPoint, /* 54 */ TkpChangeFocus, /* 55 */ TkpCloseDisplay, /* 56 */ TkpClaimFocus, /* 57 */ TkpDisplayWarning, /* 58 */ TkpGetAppName, /* 59 */ TkpGetOtherWindow, /* 60 */ TkpGetWrapperWindow, /* 61 */ TkpInit, /* 62 */ TkpInitializeMenuBindings, /* 63 */ TkpMakeContainer, /* 64 */ TkpMakeMenuWindow, /* 65 */ TkpMakeWindow, /* 66 */ TkpMenuNotifyToplevelCreate, /* 67 */ TkpOpenDisplay, /* 68 */ TkPointerEvent, /* 69 */ TkPolygonToArea, /* 70 */ TkPolygonToPoint, /* 71 */ TkPositionInTree, /* 72 */ TkpRedirectKeyEvent, /* 73 */ TkpSetMainMenubar, /* 74 */ TkpUseWindow, /* 75 */ 0, /* 76 */ TkQueueEventForAllChildren, /* 77 */ TkReadBitmapFile, /* 78 */ TkScrollWindow, /* 79 */ TkSelDeadWindow, /* 80 */ TkSelEventProc, /* 81 */ TkSelInit, /* 82 */ TkSelPropProc, /* 83 */ 0, /* 84 */ TkSetWindowMenuBar, /* 85 */ TkStringToKeysym, /* 86 */ TkThickPolyLineToArea, /* 87 */ TkWmAddToColormapWindows, /* 88 */ TkWmDeadWindow, /* 89 */ TkWmFocusToplevel, /* 90 */ TkWmMapWindow, /* 91 */ TkWmNewWindow, /* 92 */ |
︙ | ︙ | |||
343 344 345 346 347 348 349 | TkFindStateNumObj, /* 104 */ TkGetBitmapPredefTable, /* 105 */ TkGetDisplayList, /* 106 */ TkGetMainInfoList, /* 107 */ TkGetWindowFromObj, /* 108 */ TkpGetString, /* 109 */ TkpGetSubFonts, /* 110 */ | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | TkFindStateNumObj, /* 104 */ TkGetBitmapPredefTable, /* 105 */ TkGetDisplayList, /* 106 */ TkGetMainInfoList, /* 107 */ TkGetWindowFromObj, /* 108 */ TkpGetString, /* 109 */ TkpGetSubFonts, /* 110 */ TkpGetSystemDefault, /* 111 */ TkpMenuThreadInit, /* 112 */ XClipBox, /* 113 */ XCreateRegion, /* 114 */ XDestroyRegion, /* 115 */ XIntersectRegion, /* 116 */ XRectInRegion, /* 117 */ XSetRegion, /* 118 */ XUnionRectWithRegion, /* 119 */ 0, /* 120 */ #if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 121 */ #endif /* X11 */ #if defined(_WIN32) /* WIN */ 0, /* 121 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ # if TCL_MAJOR_VERSION < 9 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */ # endif /* TCL_MAJOR_VERSION < 9 */ TkpCreateNativeBitmap, /* 121 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 122 */ #endif /* X11 */ #if defined(_WIN32) /* WIN */ 0, /* 122 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ # if TCL_MAJOR_VERSION < 9 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */ # endif /* TCL_MAJOR_VERSION < 9 */ TkpDefineNativeBitmaps, /* 122 */ #endif /* AQUA */ 0, /* 123 */ #if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 124 */ #endif /* X11 */ #if defined(_WIN32) /* WIN */ 0, /* 124 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ # if TCL_MAJOR_VERSION < 9 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */ # endif /* TCL_MAJOR_VERSION < 9 */ TkpGetNativeAppBitmap, /* 124 */ #endif /* AQUA */ 0, /* 125 */ 0, /* 126 */ 0, /* 127 */ 0, /* 128 */ 0, /* 129 */ 0, /* 130 */ 0, /* 131 */ 0, /* 132 */ 0, /* 133 */ 0, /* 134 */ TkpDrawHighlightBorder, /* 135 */ TkSetFocusWin, /* 136 */ TkpSetKeycodeAndState, /* 137 */ TkpGetKeySym, /* 138 */ TkpInitKeymapInfo, /* 139 */ TkPhotoGetValidRegion, /* 140 */ TkWmStackorderToplevel, /* 141 */ TkFocusFree, /* 142 */ |
︙ | ︙ | |||
426 427 428 429 430 431 432 | TkDebugPhotoStringMatchDef, /* 187 */ }; static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ | | | 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | TkDebugPhotoStringMatchDef, /* 187 */ }; static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ TkpGetMS, /* 3 */ TkPointerDeadWindow, /* 4 */ TkpPrintWindowId, /* 5 */ TkpScanWindowId, /* 6 */ TkpSetCapture, /* 7 */ |
︙ | ︙ | |||
459 460 461 462 463 464 465 | TkWinSetWindowPos, /* 26 */ TkWinWmCleanup, /* 27 */ TkWinXCleanup, /* 28 */ TkWinXInit, /* 29 */ TkWinSetForegroundWindow, /* 30 */ TkWinDialogDebug, /* 31 */ TkWinGetMenuSystemDefault, /* 32 */ | | | | | | < | > < | > | | | | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | TkWinSetWindowPos, /* 26 */ TkWinWmCleanup, /* 27 */ TkWinXCleanup, /* 28 */ TkWinXInit, /* 29 */ TkWinSetForegroundWindow, /* 30 */ TkWinDialogDebug, /* 31 */ TkWinGetMenuSystemDefault, /* 32 */ TkWinGetPlatformId, /* 33 */ TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ TkCreateXEventSource, /* 37 */ TkpCmapStressed, /* 38 */ TkpSync, /* 39 */ TkUnixContainerId, /* 40 */ TkUnixDoOneXEvent, /* 41 */ TkUnixSetMenubar, /* 42 */ TkWmCleanup, /* 43 */ TkSendCleanup, /* 44 */ TkpTestsendCmd, /* 45 */ 0, /* 46 */ TkpGetCapture, /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ TkGenerateActivateEvents, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents_, /* 2 */ TkPointerDeadWindow, /* 3 */ TkpSetCapture, /* 4 */ TkpSetCursor, /* 5 */ TkpWmSetState, /* 6 */ TkAboutDlg, /* 7 */ TkMacOSXButtonKeyState, /* 8 */ TkMacOSXClearMenubarActive, /* 9 */ TkMacOSXDispatchMenuEvent, /* 10 */ 0, /* 11 */ TkMacOSXHandleTearoffMenu, /* 12 */ 0, /* 13 */ TkMacOSXDoHLEvent, /* 14 */ 0, /* 15 */ TkMacOSXGetXWindow, /* 16 */ TkMacOSXGrowToplevel, /* 17 */ TkMacOSXHandleMenuSelect, /* 18 */ 0, /* 19 */ 0, /* 20 */ TkMacOSXInvalidateWindow, /* 21 */ TkMacOSXIsCharacterMissing, /* 22 */ TkMacOSXMakeRealWindowExist, /* 23 */ TkMacOSXMakeStippleMap, /* 24 */ TkMacOSXMenuClick, /* 25 */ 0, /* 26 */ TkMacOSXResizable, /* 27 */ TkMacOSXSetHelpMenuItemCount, /* 28 */ TkMacOSXSetScrollbarGrow, /* 29 */ TkMacOSXSetUpClippingRgn, /* 30 */ TkMacOSXSetUpGraphicsPort, /* 31 */ TkMacOSXUpdateClipRgn, /* 32 */ 0, /* 33 */ TkMacOSXUseMenuID, /* 34 */ TkMacOSXVisableClipRgn, /* 35 */ TkMacOSXWinBounds, /* 36 */ TkMacOSXWindowOffset, /* 37 */ |
︙ | ︙ | |||
529 530 531 532 533 534 535 536 537 538 539 540 | TkpIsWindowFloating, /* 46 */ TkpGetCapture, /* 47 */ 0, /* 48 */ TkMacOSXGetContainer, /* 49 */ TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ TkMacOSXSetDrawingEnabled, /* 52 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ | > > > | | | | | | | | | | | 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 | TkpIsWindowFloating, /* 46 */ TkpGetCapture, /* 47 */ 0, /* 48 */ TkMacOSXGetContainer, /* 49 */ TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ TkMacOSXSetDrawingEnabled, /* 52 */ TkpGetMS, /* 53 */ TkMacOSXDrawable, /* 54 */ TkpScanWindowId, /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ TkpCmapStressed, /* 3 */ TkpSync, /* 4 */ TkUnixContainerId, /* 5 */ TkUnixDoOneXEvent, /* 6 */ TkUnixSetMenubar, /* 7 */ TkpScanWindowId, /* 8 */ TkWmCleanup, /* 9 */ TkSendCleanup, /* 10 */ 0, /* 11 */ TkpWmSetState, /* 12 */ TkpTestsendCmd_, /* 13 */ 0, /* 14 */ 0, /* 15 */ 0, /* 16 */ 0, /* 17 */ 0, /* 18 */ 0, /* 19 */ 0, /* 20 */ |
︙ | ︙ | |||
569 570 571 572 573 574 575 | 0, /* 31 */ 0, /* 32 */ 0, /* 33 */ 0, /* 34 */ 0, /* 35 */ 0, /* 36 */ 0, /* 37 */ | | | | | | | | | 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | 0, /* 31 */ 0, /* 32 */ 0, /* 33 */ 0, /* 34 */ 0, /* 35 */ 0, /* 36 */ 0, /* 37 */ TkpCmapStressed_, /* 38 */ TkpSync_, /* 39 */ TkUnixContainerId_, /* 40 */ TkUnixDoOneXEvent_, /* 41 */ TkUnixSetMenubar_, /* 42 */ TkWmCleanup_, /* 43 */ TkSendCleanup_, /* 44 */ TkpTestsendCmd, /* 45 */ #endif /* X11 */ }; static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, |
︙ | ︙ | |||
752 753 754 755 756 757 758 | XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ XGetImage, /* 3 */ XGetAtomName, /* 4 */ XKeysymToString, /* 5 */ XCreateColormap, /* 6 */ | < < | < | | | | < < < | | | | < | | | | | < | | | | | | | < | | < | | < | < | | | < | | | > > > > > | > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 | XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ XGetImage, /* 3 */ XGetAtomName, /* 4 */ XKeysymToString, /* 5 */ XCreateColormap, /* 6 */ XGContextFromGC, /* 7 */ XKeycodeToKeysym, /* 8 */ XStringToKeysym, /* 9 */ XRootWindow, /* 10 */ XSetErrorHandler, /* 11 */ XAllocColor, /* 12 */ XBell, /* 13 */ XChangeProperty, /* 14 */ XChangeWindowAttributes, /* 15 */ XConfigureWindow, /* 16 */ XCopyArea, /* 17 */ XCopyPlane, /* 18 */ XCreateBitmapFromData, /* 19 */ XDefineCursor, /* 20 */ XDestroyWindow, /* 21 */ XDrawArc, /* 22 */ XDrawLines, /* 23 */ XDrawRectangle, /* 24 */ XFillArc, /* 25 */ XFillPolygon, /* 26 */ XFillRectangles, /* 27 */ XFreeColormap, /* 28 */ XFreeColors, /* 29 */ XFreeModifiermap, /* 30 */ XGetGeometry, /* 31 */ XGetWindowProperty, /* 32 */ XGrabKeyboard, /* 33 */ XGrabPointer, /* 34 */ XKeysymToKeycode, /* 35 */ XMapWindow, /* 36 */ XMoveResizeWindow, /* 37 */ XMoveWindow, /* 38 */ XQueryPointer, /* 39 */ XRaiseWindow, /* 40 */ XRefreshKeyboardMapping, /* 41 */ XResizeWindow, /* 42 */ XSelectInput, /* 43 */ XSendEvent, /* 44 */ XSetIconName, /* 45 */ XSetInputFocus, /* 46 */ XSetSelectionOwner, /* 47 */ XSetWindowBackground, /* 48 */ XSetWindowBackgroundPixmap, /* 49 */ XSetWindowBorder, /* 50 */ XSetWindowBorderPixmap, /* 51 */ XSetWindowBorderWidth, /* 52 */ XSetWindowColormap, /* 53 */ XUngrabKeyboard, /* 54 */ XUngrabPointer, /* 55 */ XUnmapWindow, /* 56 */ TkPutImage, /* 57 */ XParseColor, /* 58 */ XCreateGC, /* 59 */ XFreeGC, /* 60 */ XInternAtom, /* 61 */ XSetBackground, /* 62 */ XSetForeground, /* 63 */ XSetClipMask, /* 64 */ XSetClipOrigin, /* 65 */ XSetTSOrigin, /* 66 */ XChangeGC, /* 67 */ XSetFont, /* 68 */ XSetArcMode, /* 69 */ XSetStipple, /* 70 */ XSetFillRule, /* 71 */ XSetFillStyle, /* 72 */ XSetFunction, /* 73 */ XSetLineAttributes, /* 74 */ _XInitImageFuncPtrs, /* 75 */ XCreateIC, /* 76 */ XGetVisualInfo, /* 77 */ XSetWMClientMachine, /* 78 */ XStringListToTextProperty, /* 79 */ XDrawSegments, /* 80 */ XForceScreenSaver, /* 81 */ XDrawLine, /* 82 */ XFillRectangle, /* 83 */ XClearWindow, /* 84 */ XDrawPoint, /* 85 */ XDrawPoints, /* 86 */ XWarpPointer, /* 87 */ XQueryColor, /* 88 */ XQueryColors, /* 89 */ XQueryTree, /* 90 */ XSync, /* 91 */ XTranslateCoordinates, /* 92 */ XDeleteProperty, /* 93 */ XFreeCursor, /* 94 */ XGetInputFocus, /* 95 */ XmbLookupString, /* 96 */ XNextEvent, /* 97 */ XPutBackEvent, /* 98 */ XSetCommand, /* 99 */ XWindowEvent, /* 100 */ XGetWindowAttributes, /* 101 */ XGetWMColormapWindows, /* 102 */ XIconifyWindow, /* 103 */ XWithdrawWindow, /* 104 */ XListHosts, /* 105 */ XSetClipRectangles, /* 106 */ XFlush, /* 107 */ XGrabServer, /* 108 */ XUngrabServer, /* 109 */ XFree, /* 110 */ XNoOp, /* 111 */ XSynchronize, /* 112 */ XLookupColor, /* 113 */ XVisualIDFromVisual, /* 114 */ 0, /* 115 */ 0, /* 116 */ 0, /* 117 */ 0, /* 118 */ 0, /* 119 */ XOffsetRegion, /* 120 */ XUnionRegion, /* 121 */ XCreateWindow, /* 122 */ 0, /* 123 */ 0, /* 124 */ 0, /* 125 */ 0, /* 126 */ 0, /* 127 */ 0, /* 128 */ XLowerWindow, /* 129 */ XFillArcs, /* 130 */ XDrawArcs, /* 131 */ XDrawRectangles, /* 132 */ 0, /* 133 */ 0, /* 134 */ 0, /* 135 */ XReparentWindow, /* 136 */ XPutImage, /* 137 */ XPolygonRegion, /* 138 */ XPointInRegion, /* 139 */ XVaCreateNestedList, /* 140 */ XSetICValues, /* 141 */ XGetICValues, /* 142 */ XSetICFocus, /* 143 */ XDestroyIC, /* 144 */ XCreatePixmapCursor, /* 145 */ XCreateGlyphCursor, /* 146 */ XFreeFontSet, /* 147 */ XCloseIM, /* 148 */ XRegisterIMInstantiateCallback, /* 149 */ XUnregisterIMInstantiateCallback, /* 150 */ XSetLocaleModifiers, /* 151 */ XOpenIM, /* 152 */ XGetIMValues, /* 153 */ |
︙ | ︙ | |||
915 916 917 918 919 920 921 922 923 924 925 926 927 928 | TCL_STUB_MAGIC, 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ Tk_HWNDToWindow, /* 3 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ 0, /* 0 */ 0, /* 1 */ 0, /* 2 */ 0, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ | > > | | 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 | TCL_STUB_MAGIC, 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ Tk_HWNDToWindow, /* 3 */ Tk_PointerEvent, /* 4 */ Tk_TranslateWinEvent, /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ 0, /* 0 */ 0, /* 1 */ 0, /* 2 */ 0, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ TkGenWMConfigureEvent_, /* 5 */ TkMacOSXInvalClipRgns, /* 6 */ 0, /* 7 */ TkMacOSXGetRootControl, /* 8 */ Tk_MacOSXSetupTkNotifier, /* 9 */ Tk_MacOSXIsAppInFront, /* 10 */ Tk_MacOSXGetTkWindow, /* 11 */ Tk_MacOSXGetCGContextForDrawable, /* 12 */ |
︙ | ︙ | |||
1024 1025 1026 1027 1028 1029 1030 | Tk_FreeCursor, /* 70 */ Tk_FreeFont, /* 71 */ Tk_FreeGC, /* 72 */ Tk_FreeImage, /* 73 */ Tk_FreeOptions, /* 74 */ Tk_FreePixmap, /* 75 */ Tk_FreeTextLayout, /* 76 */ | | | 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 | Tk_FreeCursor, /* 70 */ Tk_FreeFont, /* 71 */ Tk_FreeGC, /* 72 */ Tk_FreeImage, /* 73 */ Tk_FreeOptions, /* 74 */ Tk_FreePixmap, /* 75 */ Tk_FreeTextLayout, /* 76 */ Tk_FreeXId, /* 77 */ Tk_GCForColor, /* 78 */ Tk_GeometryRequest, /* 79 */ Tk_Get3DBorder, /* 80 */ Tk_GetAllBindings, /* 81 */ Tk_GetAnchor, /* 82 */ Tk_GetAtomName, /* 83 */ Tk_GetBinding, /* 84 */ |
︙ | ︙ | |||
1065 1066 1067 1068 1069 1070 1071 | Tk_GetUid, /* 111 */ Tk_GetVisual, /* 112 */ Tk_GetVRootGeometry, /* 113 */ Tk_Grab, /* 114 */ Tk_HandleEvent, /* 115 */ Tk_IdToWindow, /* 116 */ Tk_ImageChanged, /* 117 */ | | | 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 | Tk_GetUid, /* 111 */ Tk_GetVisual, /* 112 */ Tk_GetVRootGeometry, /* 113 */ Tk_Grab, /* 114 */ Tk_HandleEvent, /* 115 */ Tk_IdToWindow, /* 116 */ Tk_ImageChanged, /* 117 */ Tk_Init, /* 118 */ Tk_InternAtom, /* 119 */ Tk_IntersectTextLayout, /* 120 */ Tk_MaintainGeometry, /* 121 */ Tk_MainWindow, /* 122 */ Tk_MakeWindowExist, /* 123 */ Tk_ManageGeometry, /* 124 */ Tk_MapWindow, /* 125 */ |
︙ | ︙ | |||
1091 1092 1093 1094 1095 1096 1097 | Tk_NameOfImage, /* 137 */ Tk_NameOfJoinStyle, /* 138 */ Tk_NameOfJustify, /* 139 */ Tk_NameOfRelief, /* 140 */ Tk_NameToWindow, /* 141 */ Tk_OwnSelection, /* 142 */ Tk_ParseArgv, /* 143 */ | | | | | | | 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 | Tk_NameOfImage, /* 137 */ Tk_NameOfJoinStyle, /* 138 */ Tk_NameOfJustify, /* 139 */ Tk_NameOfRelief, /* 140 */ Tk_NameToWindow, /* 141 */ Tk_OwnSelection, /* 142 */ Tk_ParseArgv, /* 143 */ Tk_PhotoPutBlock_NoComposite, /* 144 */ Tk_PhotoPutZoomedBlock_NoComposite, /* 145 */ Tk_PhotoGetImage, /* 146 */ Tk_PhotoBlank, /* 147 */ Tk_PhotoExpand_Panic, /* 148 */ Tk_PhotoGetSize, /* 149 */ Tk_PhotoSetSize_Panic, /* 150 */ Tk_PointToChar, /* 151 */ Tk_PostscriptFontName, /* 152 */ Tk_PreserveColormap, /* 153 */ Tk_QueueWindowEvent, /* 154 */ Tk_RedrawImage, /* 155 */ Tk_ResizeWindow, /* 156 */ Tk_RestackWindow, /* 157 */ Tk_RestrictEvents, /* 158 */ Tk_SafeInit, /* 159 */ Tk_SetAppName, /* 160 */ Tk_SetBackgroundFromBorder, /* 161 */ Tk_SetClass, /* 162 */ Tk_SetGrid, /* 163 */ Tk_SetInternalBorder, /* 164 */ Tk_SetWindowBackground, /* 165 */ Tk_SetWindowBackgroundPixmap, /* 166 */ |
︙ | ︙ | |||
1159 1160 1161 1162 1163 1164 1165 | Tk_GetOptionValue, /* 205 */ Tk_GetJustifyFromObj, /* 206 */ Tk_GetMMFromObj, /* 207 */ Tk_GetPixelsFromObj, /* 208 */ Tk_GetReliefFromObj, /* 209 */ Tk_GetScrollInfoObj, /* 210 */ Tk_InitOptions, /* 211 */ | | | | 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 | Tk_GetOptionValue, /* 205 */ Tk_GetJustifyFromObj, /* 206 */ Tk_GetMMFromObj, /* 207 */ Tk_GetPixelsFromObj, /* 208 */ Tk_GetReliefFromObj, /* 209 */ Tk_GetScrollInfoObj, /* 210 */ Tk_InitOptions, /* 211 */ Tk_MainEx, /* 212 */ Tk_RestoreSavedOptions, /* 213 */ Tk_SetOptions, /* 214 */ Tk_InitConsoleChannels, /* 215 */ Tk_CreateConsoleWindow, /* 216 */ Tk_CreateSmoothMethod, /* 217 */ 0, /* 218 */ 0, /* 219 */ Tk_GetDash, /* 220 */ Tk_CreateOutline, /* 221 */ Tk_DeleteOutline, /* 222 */ Tk_ConfigOutlineGC, /* 223 */ |
︙ | ︙ | |||
1193 1194 1195 1196 1197 1198 1199 | Tk_CreateClientMessageHandler, /* 239 */ Tk_DeleteClientMessageHandler, /* 240 */ Tk_CreateAnonymousWindow, /* 241 */ Tk_SetClassProcs, /* 242 */ Tk_SetInternalBorderEx, /* 243 */ Tk_SetMinimumRequestSize, /* 244 */ Tk_SetCaretPos, /* 245 */ | | | | | | | | 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 | Tk_CreateClientMessageHandler, /* 239 */ Tk_DeleteClientMessageHandler, /* 240 */ Tk_CreateAnonymousWindow, /* 241 */ Tk_SetClassProcs, /* 242 */ Tk_SetInternalBorderEx, /* 243 */ Tk_SetMinimumRequestSize, /* 244 */ Tk_SetCaretPos, /* 245 */ Tk_PhotoPutBlock_Panic, /* 246 */ Tk_PhotoPutZoomedBlock_Panic, /* 247 */ Tk_CollapseMotionEvents, /* 248 */ Tk_RegisterStyleEngine, /* 249 */ Tk_GetStyleEngine, /* 250 */ Tk_RegisterStyledElement, /* 251 */ Tk_GetElementId, /* 252 */ Tk_CreateStyle, /* 253 */ Tk_GetStyle, /* 254 */ Tk_FreeStyle, /* 255 */ Tk_NameOfStyle, /* 256 */ Tk_AllocStyleFromObj, /* 257 */ Tk_GetStyleFromObj, /* 258 */ Tk_FreeStyleFromObj, /* 259 */ Tk_GetStyledElement, /* 260 */ Tk_GetElementSize, /* 261 */ Tk_GetElementBox, /* 262 */ Tk_GetElementBorderWidth, /* 263 */ Tk_DrawElement, /* 264 */ Tk_PhotoExpand, /* 265 */ Tk_PhotoPutBlock, /* 266 */ Tk_PhotoPutZoomedBlock, /* 267 */ Tk_PhotoSetSize, /* 268 */ Tk_GetUserInactiveTime, /* 269 */ Tk_ResetUserInactiveTime, /* 270 */ Tk_Interp, /* 271 */ Tk_CreateOldImageType, /* 272 */ Tk_CreateOldPhotoImageFormat, /* 273 */ Tk_AlwaysShowSelection, /* 274 */ Tk_GetButtonMask, /* 275 */ Tk_GetDoublePixelsFromObj, /* 276 */ Tk_NewWindowObj, /* 277 */ Tk_SendVirtualEvent, /* 278 */ Tk_FontGetDescription, /* 279 */ Tk_CreatePhotoImageFormatVersion3, /* 280 */ |
︙ | ︙ |
Changes to generic/tkTest.c.
︙ | ︙ | |||
204 205 206 207 208 209 210 | int Tktest_Init( Tcl_Interp *interp) /* Interpreter for application. */ { static int initialized = 0; | | | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | int Tktest_Init( Tcl_Interp *interp) /* Interpreter for application. */ { static int initialized = 0; if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return TCL_ERROR; } if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) { return TCL_ERROR; } /* |
︙ | ︙ | |||
267 268 269 270 271 272 273 274 275 276 277 278 279 280 | * Create test image type. */ if (!initialized) { initialized = 1; Tk_CreateImageType(&imageType); } /* * And finally add any platform specific test commands. */ return TkplatformtestInit(interp); } | > > > > > > > > | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | * Create test image type. */ if (!initialized) { initialized = 1; Tk_CreateImageType(&imageType); } /* * Enable testing of legacy interfaces. */ if (TkOldTestInit(interp) != TCL_OK) { return TCL_ERROR; } /* * And finally add any platform specific test commands. */ return TkplatformtestInit(interp); } |
︙ | ︙ |
Changes to generic/tkText.c.
︙ | ︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #define DInfo TkDInfo #endif #ifdef _WIN32 #include "tkWinInt.h" #endif #include "tkText.h" /* * Used to avoid having to allocate and deallocate arrays on the fly for * commonly used functions. Must be > 0. */ | > > > > > > > > > > | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #define DInfo TkDInfo #endif #ifdef _WIN32 #include "tkWinInt.h" #endif /* * For compatibility with Tk 4.0 through 8.4.x, we allow tabs to be * mis-specified with non-increasing values. These are converted into tabs * which are the equivalent of at least a character width apart. */ #if (TK_MAJOR_VERSION < 9) #define _TK_ALLOW_DECREASING_TABS #endif #include "tkText.h" /* * Used to avoid having to allocate and deallocate arrays on the fly for * commonly used functions. Must be > 0. */ |
︙ | ︙ | |||
218 219 220 221 222 223 224 | {TK_OPTION_STRING, "-tabs", "tabs", "Tabs", DEF_TEXT_TABS, offsetof(TkText, tabOptionPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-tabstyle", "tabStyle", "TabStyle", DEF_TEXT_TABSTYLE, TCL_INDEX_NONE, offsetof(TkText, tabStyle), TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", | | | | | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | {TK_OPTION_STRING, "-tabs", "tabs", "Tabs", DEF_TEXT_TABS, offsetof(TkText, tabOptionPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-tabstyle", "tabStyle", "TabStyle", DEF_TEXT_TABSTYLE, TCL_INDEX_NONE, offsetof(TkText, tabStyle), TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_TEXT_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(TkText, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-undo", "undo", "Undo", DEF_TEXT_UNDO, TCL_INDEX_NONE, offsetof(TkText, undo), TK_OPTION_DONT_SET_DEFAULT, 0 , 0}, {TK_OPTION_INT, "-width", "width", "Width", DEF_TEXT_WIDTH, TCL_INDEX_NONE, offsetof(TkText, width), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-wrap", "wrap", "Wrap", DEF_TEXT_WRAP, TCL_INDEX_NONE, offsetof(TkText, wrapMode), TK_OPTION_ENUM_VAR, tkTextWrapStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", DEF_TEXT_XSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", DEF_TEXT_YSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, yScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0} }; /* * These three typedefs, the structure and the SearchPerform, SearchCore * functions below are used for line-based searches of the text widget, and, |
︙ | ︙ | |||
609 610 611 612 613 614 615 616 617 618 619 620 621 622 | /* * Note: it is important that textPtr->selTagPtr is NULL before this * initial call. */ textPtr->selTagPtr = TkTextCreateTag(textPtr, "sel", NULL); Tk_GetRelief(interp, DEF_TEXT_SELECT_RELIEF, &textPtr->selTagPtr->relief); textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &startIndex); textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex); /* * Create the option table for this widget class. If it has already been * created, the cached pointer will be returned. | > > > | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 | /* * Note: it is important that textPtr->selTagPtr is NULL before this * initial call. */ textPtr->selTagPtr = TkTextCreateTag(textPtr, "sel", NULL); textPtr->selTagPtr->reliefString = (char *) ckalloc(sizeof(DEF_TEXT_SELECT_RELIEF)); strcpy(textPtr->selTagPtr->reliefString, DEF_TEXT_SELECT_RELIEF); Tk_GetRelief(interp, DEF_TEXT_SELECT_RELIEF, &textPtr->selTagPtr->relief); textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &startIndex); textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex); /* * Create the option table for this widget class. If it has already been * created, the cached pointer will be returned. |
︙ | ︙ | |||
1444 1445 1446 1447 1448 1449 1450 | */ int deleteInsertOffset, insertLength, indexFromLine, indexFromByteOffset; Tcl_Size j; insertLength = 0; for (j = 4; j < objc; j += 2) { | | | 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 | */ int deleteInsertOffset, insertLength, indexFromLine, indexFromByteOffset; Tcl_Size j; insertLength = 0; for (j = 4; j < objc; j += 2) { insertLength += TkGetCharLength(objv[j]); } /* * Calculate 'deleteInsertOffset' as an offset we will apply * to the insertion point after this operation. */ |
︙ | ︙ | |||
2219 2220 2221 2222 2223 2224 2225 | */ if (textPtr->tabArrayPtr != NULL) { ckfree(textPtr->tabArrayPtr); textPtr->tabArrayPtr = NULL; } if (textPtr->tabOptionPtr != NULL) { | | | 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 | */ if (textPtr->tabArrayPtr != NULL) { ckfree(textPtr->tabArrayPtr); textPtr->tabArrayPtr = NULL; } if (textPtr->tabOptionPtr != NULL) { textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr, textPtr->tabOptionPtr); if (textPtr->tabArrayPtr == NULL) { Tcl_AddErrorInfo(interp,"\n (while processing -tabs option)"); Tk_RestoreSavedOptions(&savedOptions); return TCL_ERROR; } } |
︙ | ︙ | |||
2264 2265 2266 2267 2268 2269 2270 | || (textPtr->selTagPtr->rMargin != INT_MIN) || (textPtr->selTagPtr->spacing1 != INT_MIN) || (textPtr->selTagPtr->spacing2 != INT_MIN) || (textPtr->selTagPtr->spacing3 != INT_MIN) || (textPtr->selTagPtr->tabStringPtr != NULL) || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR) || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR) | | > > | 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 | || (textPtr->selTagPtr->rMargin != INT_MIN) || (textPtr->selTagPtr->spacing1 != INT_MIN) || (textPtr->selTagPtr->spacing2 != INT_MIN) || (textPtr->selTagPtr->spacing3 != INT_MIN) || (textPtr->selTagPtr->tabStringPtr != NULL) || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR) || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR) || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_CHAR) || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_NONE) || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_WORD)) { textPtr->selTagPtr->affectsDisplay = 1; textPtr->selTagPtr->affectsDisplayGeometry = 1; } if ((textPtr->selTagPtr->border != NULL) || (textPtr->selTagPtr->selBorder != NULL) || (textPtr->selTagPtr->relief != TK_RELIEF_NULL) || (textPtr->selTagPtr->bgStipple != None) |
︙ | ︙ | |||
4074 4075 4076 4077 4078 4079 4080 | if ((segPtr->typePtr == &tkTextCharType) && (searchSpecPtr->searchElide || !TkTextIsElided(textPtr, &curIndex, NULL))) { if (leftToScan < segPtr->size) { if (searchSpecPtr->exact) { index += leftToScan; } else { | | | | 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 | if ((segPtr->typePtr == &tkTextCharType) && (searchSpecPtr->searchElide || !TkTextIsElided(textPtr, &curIndex, NULL))) { if (leftToScan < segPtr->size) { if (searchSpecPtr->exact) { index += leftToScan; } else { index += TkNumUtfChars(segPtr->body.chars, leftToScan); } } else if (searchSpecPtr->exact) { index += segPtr->size; } else { index += TkNumUtfChars(segPtr->body.chars, -1); } } leftToScan -= segPtr->size; } return index; } |
︙ | ︙ | |||
4204 4205 4206 4207 4208 4209 4210 | } if (lenPtr != NULL) { if (searchSpecPtr->exact) { Tcl_GetString(theLine); *lenPtr = theLine->length; } else { | | | 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 | } if (lenPtr != NULL) { if (searchSpecPtr->exact) { Tcl_GetString(theLine); *lenPtr = theLine->length; } else { *lenPtr = TkGetCharLength(theLine); } } return linePtr; } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
4274 4275 4276 4277 4278 4279 4280 | * Calculate the character count, which may need augmenting if there are * embedded windows or elided text. */ if (searchSpecPtr->exact) { const char *startOfLine = Tcl_GetString(theLine); | | | 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 | * Calculate the character count, which may need augmenting if there are * embedded windows or elided text. */ if (searchSpecPtr->exact) { const char *startOfLine = Tcl_GetString(theLine); numChars = TkNumUtfChars(startOfLine + matchOffset, matchLength); } else { numChars = matchLength; } /* * If we're using strict limits checking, ensure that the match with its * full length fits inside the given range. |
︙ | ︙ | |||
4333 4334 4335 4336 4337 4338 4339 | if (segPtr->typePtr != &tkTextCharType) { matchOffset += segPtr->size; } else if (!searchSpecPtr->searchElide && TkTextIsElided(textPtr, &curIndex, NULL)) { if (searchSpecPtr->exact) { matchOffset += segPtr->size; } else { | | | | 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 | if (segPtr->typePtr != &tkTextCharType) { matchOffset += segPtr->size; } else if (!searchSpecPtr->searchElide && TkTextIsElided(textPtr, &curIndex, NULL)) { if (searchSpecPtr->exact) { matchOffset += segPtr->size; } else { matchOffset += TkNumUtfChars(segPtr->body.chars, -1); } } else { if (searchSpecPtr->exact) { leftToScan -= (int)segPtr->size; } else { leftToScan -= TkNumUtfChars(segPtr->body.chars, -1); } } curIndex.byteIndex += segPtr->size; } if (segPtr == NULL && leftToScan >= 0) { /* * This will only happen if we are eliding newlines. |
︙ | ︙ | |||
4424 4425 4426 4427 4428 4429 4430 | * Anything we didn't count in the search needs adding. */ numChars += segPtr->size; continue; } else if (!searchSpecPtr->searchElide && TkTextIsElided(textPtr, &curIndex, NULL)) { | | | | 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 | * Anything we didn't count in the search needs adding. */ numChars += segPtr->size; continue; } else if (!searchSpecPtr->searchElide && TkTextIsElided(textPtr, &curIndex, NULL)) { numChars += TkNumUtfChars(segPtr->body.chars, -1); continue; } if (searchSpecPtr->exact) { leftToScan -= segPtr->size; } else { leftToScan -= TkNumUtfChars(segPtr->body.chars, -1); } } /* * Now store the count result, if it is wanted. */ |
︙ | ︙ | |||
4474 4475 4476 4477 4478 4479 4480 | * *---------------------------------------------------------------------- */ TkTextTabArray * TkTextGetTabs( Tcl_Interp *interp, /* Used for error reporting. */ | | | 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 | * *---------------------------------------------------------------------- */ TkTextTabArray * TkTextGetTabs( Tcl_Interp *interp, /* Used for error reporting. */ const TkText *textPtr, /* Information about the text widget. */ Tcl_Obj *stringPtr) /* Description of the tab stops. See the text * manual entry for details. */ { Tcl_Size objc, i, count; Tcl_Obj **objv; TkTextTabArray *tabArrayPtr; TkTextTab *tabPtr; |
︙ | ︙ | |||
4525 4526 4527 4528 4529 4530 4531 | int index; /* * This will round fractional pixels above 0.5 upwards, and otherwise * downwards, to find the right integer pixel position. */ | | | > > > > > > > > > > > > > > > | | 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 | int index; /* * This will round fractional pixels above 0.5 upwards, and otherwise * downwards, to find the right integer pixel position. */ if (Tk_GetPixelsFromObj(interp, textPtr->tkwin, objv[i], &tabPtr->location) != TCL_OK) { goto error; } if (tabPtr->location <= 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tab stop \"%s\" is not at a positive distance", Tcl_GetString(objv[i]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL); goto error; } prevStop = lastStop; if (Tk_GetDoublePixelsFromObj(interp, textPtr->tkwin, objv[i], &lastStop) != TCL_OK) { goto error; } if (i > 0 && (tabPtr->location <= (tabPtr-1)->location)) { /* * This tab is actually to the left of the previous one, which is * illegal. */ #ifdef _TK_ALLOW_DECREASING_TABS /* * Force the tab to be a typical character width to the right of * the previous one, and update the 'lastStop' with the changed * position. */ if (textPtr->charWidth > 0) { tabPtr->location = (tabPtr-1)->location + textPtr->charWidth; } else { tabPtr->location = (tabPtr-1)->location + 8; } lastStop = tabPtr->location; #else Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tabs must be monotonically increasing, but \"%s\" is " "smaller than or equal to the previous tab", Tcl_GetString(objv[i]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL); goto error; #endif /* _TK_ALLOW_DECREASING_TABS */ } tabArrayPtr->numTabs++; /* * See if there is an explicit alignment in the next list element. * Otherwise just use "left". */ tabPtr->alignment = LEFT; if ((i+1) == objc) { continue; } /* * There may be a more efficient way of getting this. */ TkUtfToUniChar(Tcl_GetString(objv[i+1]), &ch); if (!Tcl_UniCharIsAlpha(ch)) { continue; } i += 1; if (Tcl_GetIndexFromObjStruct(interp, objv[i], tabOptionStrings, sizeof(char *), "tab alignment", 0, &index) != TCL_OK) { |
︙ | ︙ | |||
6161 6162 6163 6164 6165 6166 6167 | if (searchSpecPtr->backwards) { alreadySearchOffset = p - startOfLine - 1; if (alreadySearchOffset < 0) { break; } } else { firstOffset = p - startOfLine + | | | 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 | if (searchSpecPtr->backwards) { alreadySearchOffset = p - startOfLine - 1; if (alreadySearchOffset < 0) { break; } } else { firstOffset = p - startOfLine + TkUtfToUniChar(startOfLine+matchOffset,&ch); } } } while (searchSpecPtr->all); } else { int maxExtraLines = 0; int matches = 0; int lastNonOverlap = -1; |
︙ | ︙ |
Changes to generic/tkText.h.
︙ | ︙ | |||
168 169 170 171 172 173 174 | * type. */ struct TkTextSegment *nextPtr; /* Next in list of segments for this line, or * NULL for end of list. */ Tcl_Size size; /* Size of this segment (# of bytes of index * space it occupies). */ union { | > > | | | > | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | * type. */ struct TkTextSegment *nextPtr; /* Next in list of segments for this line, or * NULL for end of list. */ Tcl_Size size; /* Size of this segment (# of bytes of index * space it occupies). */ union { /* The TKFLEXARRAY macro - unfortunately - doesn't work inside a union. */ #if defined(__GNUC__) && (__GNUC__ > 2) char chars[0]; /* Characters that make up character info. */ #else /* Actual length varies to hold as many */ char chars[1]; /* characters as needed. See [dacd18294b] */ #endif TkTextToggle toggle; /* Information about tag toggle. */ TkTextMark mark; /* Information about mark. */ TkTextEmbWindow ew; /* Information about embedded window. */ TkTextEmbImage ei; /* Information about embedded image. */ } body; } TkTextSegment; |
︙ | ︙ | |||
338 339 340 341 342 343 344 | * specifies an override. */ Tk_3DBorder border; /* Used for drawing background. NULL means no * value specified here. */ int borderWidth; /* Width of 3-D border for background. */ Tcl_Obj *borderWidthPtr; /* Width of 3-D border for background. */ | < < < < | < < | < < < < < < < | < < < < < < | < < < < < < < < < < < < < < < < < < < < < | | < < < < | < < | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | * specifies an override. */ Tk_3DBorder border; /* Used for drawing background. NULL means no * value specified here. */ int borderWidth; /* Width of 3-D border for background. */ Tcl_Obj *borderWidthPtr; /* Width of 3-D border for background. */ char *reliefString; /* -relief option string (malloc-ed). NULL * means option not specified. */ int relief; /* 3-D relief for background. */ Pixmap bgStipple; /* Stipple bitmap for background. None means * no value specified here. */ XColor *fgColor; /* Foreground color for text. NULL means no * value specified here. */ Tk_Font tkfont; /* Font for displaying text. NULL means no * value specified here. */ Pixmap fgStipple; /* Stipple bitmap for text and other * foreground stuff. None means no value * specified here.*/ char *justifyString; /* -justify option string (malloc-ed). NULL * means option not specified. */ Tk_Justify justify; /* How to justify text: TK_JUSTIFY_CENTER, * TK_JUSTIFY_LEFT, or TK_JUSTIFY_RIGHT. * Only valid if justifyString is non-NULL. */ char *lMargin1String; /* -lmargin1 option string (malloc-ed). NULL * means option not specified. */ int lMargin1; /* Left margin for first display line of each * text line, in pixels. INT_MIN means option not specified. */ char *lMargin2String; /* -lmargin2 option string (malloc-ed). NULL * means option not specified. */ int lMargin2; /* Left margin for second and later display lines * of each text line, in pixels. INT_MIN means option not specified. */ Tk_3DBorder lMarginColor; /* Used for drawing background in left margins. * This is used for both lmargin1 and lmargin2. * NULL means no value specified here. */ char *offsetString; /* -offset option string (malloc-ed). NULL * means option not specified. */ int offset; /* Vertical offset of text's baseline from * baseline of line. Used for superscripts and * subscripts. INT_MIN means option not specified. */ char *overstrikeString; /* -overstrike option string (malloc-ed). NULL * means option not specified. */ int overstrike; /* > 0 means draw horizontal line through * middle of text. -1 means not specified. */ XColor *overstrikeColor; /* Color for the overstrike. NULL means same * color as foreground. */ char *rMarginString; /* -rmargin option string (malloc-ed). NULL * means option not specified. */ int rMargin; /* Right margin for text, in pixels. INT_MIN means option not specified. */ Tk_3DBorder rMarginColor; /* Used for drawing background in right margin. * NULL means no value specified here. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for * text line. INT_MIN means option not specified. */ char *spacing2String; /* -spacing2 option string (malloc-ed). NULL * means option not specified. */ int spacing2; /* Extra spacing between display lines for the * same text line. INT_MIN means option not specified. */ char *spacing3String; /* -spacing3 option string (malloc-ed). NULL * means option not specified. */ int spacing3; /* Extra spacing below last display line for * text line. INT_MIN means option not specified. */ Tcl_Obj *tabStringPtr; /* -tabs option string. NULL means option not * specified. */ struct TkTextTabArray *tabArrayPtr; /* Info about tabs for tag (malloc-ed) or * NULL. Corresponds to tabString. */ TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR, TK_TEXT_TABSTYLE_WORDPROCESSOR * or TK_TEXT_TABSTYLE_NONE. (if not specified)*/ char *underlineString; /* -underline option string (malloc-ed). NULL * means option not specified. */ int underline; /* > 0 means draw underline underneath * text. -1 means not specified. */ XColor *underlineColor; /* Color for the underline. NULL means same * color as foreground. */ TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * Must be TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD, * TEXT_WRAPMODE_NONE, or TEXT_WRAPMODE_NULL to * use wrapmode for whole widget. */ char *elideString; /* -elide option string (malloc-ed). NULL * means option not specified. */ int elide; /* > 0 means that data under this tag * should not be displayed. -1 means not specified. */ int affectsDisplay; /* Non-zero means that this tag affects the * way information is displayed on the screen * (so need to redisplay if tag changes). */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ |
︙ | ︙ | |||
640 641 642 643 644 645 646 | /* * Keep track of all the peers */ struct TkText *peers; Tcl_Size undoMarkId; /* Counts undo marks temporarily used during | | | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 | /* * Keep track of all the peers */ struct TkText *peers; Tcl_Size undoMarkId; /* Counts undo marks temporarily used during undo and redo operations. */ } TkSharedText; /* * The following enum is used to define a type for the -insertunfocussed * option of the Text widget. */ |
︙ | ︙ | |||
818 819 820 821 822 823 824 | TkTextTag **curTagArrayPtr; /* Pointer to array of tags for current mark, * or NULL if none. */ /* * Miscellaneous additional information: */ | < | | | < < < < < | 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 | TkTextTag **curTagArrayPtr; /* Pointer to array of tags for current mark, * or NULL if none. */ /* * Miscellaneous additional information: */ char *takeFocus; /* Value of -takeFocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ char *xScrollCmd; /* Prefix of command to issue to update * horizontal scrollbar when view changes. */ char *yScrollCmd; /* Prefix of command to issue to update * vertical scrollbar when view changes. */ int flags; /* Miscellaneous flags; see below for * definitions. */ Tk_OptionTable optionTable; /* Token representing the configuration * specifications. */ Tcl_Size refCount; /* Number of cached TkTextIndex objects * refering to us. */ int insertCursorType; /* 0 = standard insertion cursor, 1 = block |
︙ | ︙ | |||
853 854 855 856 857 858 859 | * enabled. */ int maxUndo; /* The maximum depth of the undo stack * expressed as the maximum number of compound * statements. */ int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to | | | 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 | * enabled. */ int maxUndo; /* The maximum depth of the undo stack * expressed as the maximum number of compound * statements. */ int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to * date */ } TkText; /* * Flag values for TkText records: * * GOT_SELECTION: Non-zero means we've already claimed the * selection. |
︙ | ︙ | |||
1129 1130 1131 1132 1133 1134 1135 | Tcl_Obj *idxPtr, TkTextIndex *indexPtr); MODULE_SCOPE int TkTextSharedGetObjIndex(Tcl_Interp *interp, TkSharedText *sharedTextPtr, Tcl_Obj *idxPtr, TkTextIndex *indexPtr); MODULE_SCOPE const TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *objPtr); MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp, | | | 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 | Tcl_Obj *idxPtr, TkTextIndex *indexPtr); MODULE_SCOPE int TkTextSharedGetObjIndex(Tcl_Interp *interp, TkSharedText *sharedTextPtr, Tcl_Obj *idxPtr, TkTextIndex *indexPtr); MODULE_SCOPE const TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *objPtr); MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp, const TkText *textPtr, Tcl_Obj *stringPtr); MODULE_SCOPE void TkTextFindDisplayLineEnd(TkText *textPtr, TkTextIndex *indexPtr, int end, int *xOffset); MODULE_SCOPE void TkTextIndexBackChars(const TkText *textPtr, const TkTextIndex *srcPtr, int count, TkTextIndex *dstPtr, TkTextCountType type); MODULE_SCOPE int TkTextIndexCmp(const TkTextIndex *index1Ptr, const TkTextIndex *index2Ptr); |
︙ | ︙ |
Changes to generic/tkTextBTree.c.
︙ | ︙ | |||
2015 2016 2017 2018 2019 2020 2021 | if (nodePtr2 == NULL) { Tcl_Panic("TkBTreeLinesTo couldn't find node"); } index += nodePtr2->numLines; } } if (textPtr != NULL) { | | | | | | | | | | | | | | | | | | | | | | | | | | 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 | if (nodePtr2 == NULL) { Tcl_Panic("TkBTreeLinesTo couldn't find node"); } index += nodePtr2->numLines; } } if (textPtr != NULL) { /* * The index to return must be relative to textPtr, not to the entire * tree. Take care to never return a negative index when linePtr * denotes a line before -startline, or an index larger than the * number of lines in textPtr when linePtr is a line past -endline. */ int indexStart, indexEnd; if (textPtr->start != NULL) { indexStart = TkBTreeLinesTo(NULL, textPtr->start); } else { indexStart = 0; } if (textPtr->end != NULL) { indexEnd = TkBTreeLinesTo(NULL, textPtr->end); } else { indexEnd = TkBTreeNumLines(textPtr->sharedTextPtr->tree, NULL); } if (index < indexStart) { index = 0; } else if (index > indexEnd) { index = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr); } else { index -= indexStart; } } return index; } /* *---------------------------------------------------------------------- * |
︙ | ︙ |
Changes to generic/tkTextDisp.c.
︙ | ︙ | |||
138 139 140 141 142 143 144 | * later display lines of each text line. */ Tk_3DBorder lMarginColor; /* Color of left margins (1 and 2). */ int offset; /* Offset in pixels of baseline, relative to * baseline of line. */ int overstrike; /* Non-zero means draw overstrike through * text. */ XColor *overstrikeColor; /* Foreground color for overstrike through | | | | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | * later display lines of each text line. */ Tk_3DBorder lMarginColor; /* Color of left margins (1 and 2). */ int offset; /* Offset in pixels of baseline, relative to * baseline of line. */ int overstrike; /* Non-zero means draw overstrike through * text. */ XColor *overstrikeColor; /* Foreground color for overstrike through * text. */ int rMargin; /* Right margin, in pixels. */ Tk_3DBorder rMarginColor; /* Color of right margin. */ int spacing1; /* Spacing above first dline in text line. */ int spacing2; /* Spacing between lines of dline. */ int spacing3; /* Spacing below last dline in text line. */ TkTextTabArray *tabArrayPtr;/* Locations and types of tab stops (may be * NULL). */ TkTextTabStyle tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR * or TK_TEXT_TABSTYLE_WORDPROCESSOR. */ int underline; /* Non-zero means draw underline underneath * text. */ XColor *underlineColor; /* Foreground color for underline underneath * text. */ int elide; /* Zero means draw text, otherwise not. */ TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * One of TEXT_WRAPMODE_CHAR, * TEXT_WRAPMODE_NONE or TEXT_WRAPMODE_WORD.*/ } StyleValues; /* |
︙ | ︙ | |||
210 211 212 213 214 215 216 | * decided to redraw the window. This can corrupt the data that a test is * trying to collect. So we don't write to the logging variables when the * drawing procedure is being run that way. Other systems can always log. */ #define LOG(toVar,what) \ if (OK_TO_LOG) \ | | | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | * decided to redraw the window. This can corrupt the data that a test is * trying to collect. So we don't write to the logging variables when the * drawing procedure is being run that way. Other systems can always log. */ #define LOG(toVar,what) \ if (OK_TO_LOG) \ Tcl_SetVar2(textPtr->interp, toVar, NULL, (what), \ TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT) #define CLEAR(var) \ if (OK_TO_LOG) \ Tcl_SetVar2(interp, var, NULL, "", TCL_GLOBAL_ONLY) /* * The following structure describes one line of the display, which may be |
︙ | ︙ | |||
251 252 253 254 255 256 257 | * This is included in height and baseline. */ int spaceBelow; /* How much extra space was added to the * bottom of the line because of spacing * options. This is included in height. */ Tk_3DBorder lMarginColor; /* Background color of the area corresponding * to the left margin of the display line. */ int lMarginWidth; /* Pixel width of the area corresponding to | | | | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | * This is included in height and baseline. */ int spaceBelow; /* How much extra space was added to the * bottom of the line because of spacing * options. This is included in height. */ Tk_3DBorder lMarginColor; /* Background color of the area corresponding * to the left margin of the display line. */ int lMarginWidth; /* Pixel width of the area corresponding to * the left margin. */ Tk_3DBorder rMarginColor; /* Background color of the area corresponding * to the right margin of the display line. */ int rMarginWidth; /* Pixel width of the area corresponding to * the right margin. */ int length; /* Total length of line, in pixels. */ TkTextDispChunk *chunkPtr; /* Pointer to first chunk in list of all of * those that are displayed on this line of * the screen. */ struct DLine *nextPtr; /* Next in list of all display lines for this * window. The list is sorted in order from * top to bottom. Note: the next DLine doesn't |
︙ | ︙ | |||
569 570 571 572 573 574 575 | static Tcl_Size ElideMeasureProc(TkTextDispChunk *chunkPtr, int x); static void DisplayDLine(TkText *textPtr, DLine *dlPtr, DLine *prevPtr, Pixmap pixmap); static void DisplayLineBackground(TkText *textPtr, DLine *dlPtr, DLine *prevPtr, Pixmap pixmap); static void DisplayText(void *clientData); static DLine * FindDLine(TkText *textPtr, DLine *dlPtr, | | | 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | static Tcl_Size ElideMeasureProc(TkTextDispChunk *chunkPtr, int x); static void DisplayDLine(TkText *textPtr, DLine *dlPtr, DLine *prevPtr, Pixmap pixmap); static void DisplayLineBackground(TkText *textPtr, DLine *dlPtr, DLine *prevPtr, Pixmap pixmap); static void DisplayText(void *clientData); static DLine * FindDLine(TkText *textPtr, DLine *dlPtr, const TkTextIndex *indexPtr); static void FreeDLines(TkText *textPtr, DLine *firstPtr, DLine *lastPtr, int action); static void FreeStyle(TkText *textPtr, TextStyle *stylePtr); static TextStyle * GetStyle(const TkText *textPtr, const TkTextIndex *indexPtr); static void GetXView(Tcl_Interp *interp, const TkText *textPtr, int report); static void GetYView(Tcl_Interp *interp, TkText *textPtr, |
︙ | ︙ | |||
618 619 620 621 622 623 624 | TkText *textPtr, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); static void AsyncUpdateLineMetrics(void *clientData); static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync); static void AsyncUpdateYScrollbar(void *clientData); static int IsStartOfNotMergedLine(const TkText *textPtr, | | | 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | TkText *textPtr, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); static void AsyncUpdateLineMetrics(void *clientData); static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync); static void AsyncUpdateYScrollbar(void *clientData); static int IsStartOfNotMergedLine(const TkText *textPtr, const TkTextIndex *indexPtr); /* * Result values returned by TextGetScrollInfoObj: */ #define TKTEXT_SCROLL_MOVETO 1 #define TKTEXT_SCROLL_PAGES 2 |
︙ | ︙ | |||
819 820 821 822 823 824 825 | styleValues.tabArrayPtr = textPtr->tabArrayPtr; styleValues.tabStyle = textPtr->tabStyle; styleValues.wrapMode = textPtr->wrapMode; styleValues.elide = 0; isSelected = 0; for (i = 0 ; i < numTags; i++) { | | | | | | | | | | | | | | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 | styleValues.tabArrayPtr = textPtr->tabArrayPtr; styleValues.tabStyle = textPtr->tabStyle; styleValues.wrapMode = textPtr->wrapMode; styleValues.elide = 0; isSelected = 0; for (i = 0 ; i < numTags; i++) { if (textPtr->selTagPtr == tagPtrs[i]) { isSelected = 1; break; } } for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; XColor *fgColor; tagPtr = tagPtrs[i]; border = tagPtr->border; fgColor = tagPtr->fgColor; /* * If this is the selection tag, and inactiveSelBorder is NULL (the * default on Windows), then we need to skip it if we don't have the * focus. */ if ((tagPtr == textPtr->selTagPtr) && !(textPtr->flags & GOT_FOCUS)) { if (textPtr->inactiveSelBorder == NULL #ifdef MAC_OSX_TK /* Don't show inactive selection in disabled widgets. */ || textPtr->state == TK_TEXT_STATE_DISABLED #endif ) { continue; } border = textPtr->inactiveSelBorder; } if ((tagPtr->selBorder != NULL) && (isSelected)) { border = tagPtr->selBorder; } if ((tagPtr->selFgColor != NULL) && isSelected) { fgColor = tagPtr->selFgColor; } if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; } if ((tagPtr->borderWidthPtr != NULL) && (Tcl_GetString(tagPtr->borderWidthPtr)[0] != '\0') |
︙ | ︙ | |||
924 925 926 927 928 929 930 | styleValues.offset = tagPtr->offset; offsetPrio = tagPtr->priority; } if ((tagPtr->overstrike >= 0) && (tagPtr->priority > overstrikePrio)) { styleValues.overstrike = tagPtr->overstrike > 0; overstrikePrio = tagPtr->priority; | | | | | | | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | styleValues.offset = tagPtr->offset; offsetPrio = tagPtr->priority; } if ((tagPtr->overstrike >= 0) && (tagPtr->priority > overstrikePrio)) { styleValues.overstrike = tagPtr->overstrike > 0; overstrikePrio = tagPtr->priority; if (tagPtr->overstrikeColor != NULL) { styleValues.overstrikeColor = tagPtr->overstrikeColor; } else if (fgColor != NULL) { styleValues.overstrikeColor = fgColor; } } if ((tagPtr->rMargin != INT_MIN) && (tagPtr->priority > rMarginPrio)) { styleValues.rMargin = tagPtr->rMargin; rMarginPrio = tagPtr->priority; } if ((tagPtr->rMarginColor != NULL) |
︙ | ︙ | |||
970 971 972 973 974 975 976 | styleValues.tabStyle = tagPtr->tabStyle; tabStylePrio = tagPtr->priority; } if ((tagPtr->underline >= 0) && (tagPtr->priority > underlinePrio)) { styleValues.underline = tagPtr->underline > 0; underlinePrio = tagPtr->priority; | | | | | | | | | 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 | styleValues.tabStyle = tagPtr->tabStyle; tabStylePrio = tagPtr->priority; } if ((tagPtr->underline >= 0) && (tagPtr->priority > underlinePrio)) { styleValues.underline = tagPtr->underline > 0; underlinePrio = tagPtr->priority; if (tagPtr->underlineColor != NULL) { styleValues.underlineColor = tagPtr->underlineColor; } else if (fgColor != NULL) { styleValues.underlineColor = fgColor; } } if ((tagPtr->elide >= 0) && (tagPtr->priority > elidePrio)) { styleValues.elide = tagPtr->elide > 0; elidePrio = tagPtr->priority; } if (((tagPtr->wrapMode == TEXT_WRAPMODE_CHAR) || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE) || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) && (tagPtr->priority > wrapPrio)) { styleValues.wrapMode = tagPtr->wrapMode; wrapPrio = tagPtr->priority; } } if (tagPtrs != NULL) { ckfree(tagPtrs); } |
︙ | ︙ | |||
1472 1473 1474 1475 1476 1477 1478 | } else { /* * Beginning of display line. */ x = chunkPtr->stylePtr->sValuePtr->lMargin2; } | | | 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 | } else { /* * Beginning of display line. */ x = chunkPtr->stylePtr->sValuePtr->lMargin2; } dlPtr->lMarginWidth = x; if (wrapMode == TEXT_WRAPMODE_NONE) { maxX = -1; } else { maxX = textPtr->dInfoPtr->maxX - textPtr->dInfoPtr->x - rMargin; if (maxX < x) { maxX = x; |
︙ | ︙ | |||
1787 1788 1789 1790 1791 1792 1793 | dlPtr->spaceBelow = sValuePtr->spacing2/2; } dlPtr->height += dlPtr->spaceAbove + dlPtr->spaceBelow; dlPtr->baseline += dlPtr->spaceAbove; dlPtr->lMarginColor = sValuePtr->lMarginColor; dlPtr->rMarginColor = sValuePtr->rMarginColor; if (wrapMode != TEXT_WRAPMODE_NONE) { | | | 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 | dlPtr->spaceBelow = sValuePtr->spacing2/2; } dlPtr->height += dlPtr->spaceAbove + dlPtr->spaceBelow; dlPtr->baseline += dlPtr->spaceAbove; dlPtr->lMarginColor = sValuePtr->lMarginColor; dlPtr->rMarginColor = sValuePtr->rMarginColor; if (wrapMode != TEXT_WRAPMODE_NONE) { dlPtr->rMarginWidth = rMargin; } /* * Recompute line length: may have changed because of justification. */ dlPtr->length = lastChunkPtr->x + lastChunkPtr->width; |
︙ | ︙ | |||
2095 2096 2097 2098 2099 2100 2101 | spaceLeft = maxY - y; if (dInfoPtr->dLinePtr == NULL) { /* * No lines have been laid out. This must be an empty peer * widget. */ | | | | | 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 | spaceLeft = maxY - y; if (dInfoPtr->dLinePtr == NULL) { /* * No lines have been laid out. This must be an empty peer * widget. */ lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr) - 1; bytesToCount = INT_MAX; } else { lineNum = TkBTreeLinesTo(textPtr, dInfoPtr->dLinePtr->index.linePtr); bytesToCount = dInfoPtr->dLinePtr->index.byteIndex; if (bytesToCount == 0) { bytesToCount = INT_MAX; lineNum--; |
︙ | ︙ | |||
2484 2485 2486 2487 2488 2489 2490 | DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap); /* * Third, draw the background color of the left and right margins. */ if (dlPtr->lMarginColor != NULL) { | | | | | | | | 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 | DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap); /* * Third, draw the background color of the left and right margins. */ if (dlPtr->lMarginColor != NULL) { Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y, dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset, dlPtr->height, 0, TK_RELIEF_FLAT); } if (dlPtr->rMarginColor != NULL) { Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->rMarginColor, dInfoPtr->maxX - dlPtr->rMarginWidth + dInfoPtr->curXPixelOffset, y, dlPtr->rMarginWidth, dlPtr->height, 0, TK_RELIEF_FLAT); } /* * Make another pass through all of the chunks to redraw the insertion * cursor, if it is visible on this line. Must do it here rather than in * the foreground pass below because otherwise a wide insertion cursor * will obscure the character to its left. |
︙ | ︙ | |||
2716 2717 2718 2719 2720 2721 2722 | if ((leftX + xOffset) < -(sValuePtr->borderWidth)) { leftX = -sValuePtr->borderWidth - xOffset; } if ((rightX - leftX) > 32767) { rightX = leftX + 32767; } | | | | | | | | | | 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 | if ((leftX + xOffset) < -(sValuePtr->borderWidth)) { leftX = -sValuePtr->borderWidth - xOffset; } if ((rightX - leftX) > 32767) { rightX = leftX + 32767; } /* * Prevent the borders from leaking on adjacent characters, * which would happen for too large border width. */ bw = sValuePtr->borderWidth; if (leftX + sValuePtr->borderWidth > rightX) { bw = rightX - leftX; } XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC, leftX + xOffset, y, (unsigned int) (rightX - leftX), (unsigned int) dlPtr->height); if (sValuePtr->relief != TK_RELIEF_FLAT) { Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, leftX + xOffset, y, bw, dlPtr->height, 1, |
︙ | ︙ | |||
2831 2832 2833 2834 2835 2836 2837 | * matches the current line on one side of the change but not on the * other, we have to draw an L-shaped piece of bevel. */ matchRight = (nextPtr2 != NULL) && SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr); if (matchLeft && !matchRight) { | | | | | | | | | | | 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 | * matches the current line on one side of the change but not on the * other, we have to draw an L-shaped piece of bevel. */ matchRight = (nextPtr2 != NULL) && SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr); if (matchLeft && !matchRight) { bw = sValuePtr->borderWidth; if (rightX2 - sValuePtr->borderWidth < leftX) { bw = rightX2 - leftX; } if (sValuePtr->relief != TK_RELIEF_FLAT) { Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, rightX2 - bw + xOffset, y, bw, sValuePtr->borderWidth, 0, sValuePtr->relief); } leftX = rightX2 - bw; leftXIn = 0; } else if (!matchLeft && matchRight && (sValuePtr->relief != TK_RELIEF_FLAT)) { bw = sValuePtr->borderWidth; if (rightX2 + sValuePtr->borderWidth > rightX) { bw = rightX - rightX2; } Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, rightX2 + xOffset, y, bw, sValuePtr->borderWidth, 1, sValuePtr->relief); Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border, leftX + xOffset, y, rightX2 + bw - leftX, sValuePtr->borderWidth, leftXIn, 0, 1, sValuePtr->relief); |
︙ | ︙ | |||
2941 2942 2943 2944 2945 2946 2947 | } continue; } matchRight = (nextPtr2 != NULL) && SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr); if (matchLeft && !matchRight) { | | | | | | | | | | 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 | } continue; } matchRight = (nextPtr2 != NULL) && SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr); if (matchLeft && !matchRight) { bw = sValuePtr->borderWidth; if (rightX2 - sValuePtr->borderWidth < leftX) { bw = rightX2 - leftX; } if (sValuePtr->relief != TK_RELIEF_FLAT) { Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, rightX2 - bw + xOffset, y + dlPtr->height - sValuePtr->borderWidth, bw, sValuePtr->borderWidth, 0, sValuePtr->relief); } leftX = rightX2 - bw; leftXIn = 1; } else if (!matchLeft && matchRight && (sValuePtr->relief != TK_RELIEF_FLAT)) { bw = sValuePtr->borderWidth; if (rightX2 + sValuePtr->borderWidth > rightX) { bw = rightX - rightX2; } Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, rightX2 + xOffset, y + dlPtr->height - sValuePtr->borderWidth, bw, sValuePtr->borderWidth, 1, sValuePtr->relief); Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border, leftX + xOffset, y + dlPtr->height - sValuePtr->borderWidth, |
︙ | ︙ | |||
3018 3019 3020 3021 3022 3023 3024 | TkText *textPtr = (TkText *)clientData; TextDInfo *dInfoPtr = textPtr->dInfoPtr; int lineNum; dInfoPtr->lineUpdateTimer = NULL; if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED) | | | 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 | TkText *textPtr = (TkText *)clientData; TextDInfo *dInfoPtr = textPtr->dInfoPtr; int lineNum; dInfoPtr->lineUpdateTimer = NULL; if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED) || !Tk_IsMapped(textPtr->tkwin)) { /* * The widget has been deleted, or is not mapped. Don't do anything. */ if (textPtr->refCount-- <= 1) { ckfree(textPtr); } |
︙ | ︙ | |||
3078 3079 3080 3081 3082 3083 3084 | * We have looped over all lines, so we're done. We must release our * refCount on the widget (the timer token was already set to NULL * above). If there is a registered aftersync command, run that first. * Cancel any pending idle task which would try to run the command * after the afterSyncCmd pointer had been set to NULL. */ | | | | | | | | | | | | | | | | | | 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 | * We have looped over all lines, so we're done. We must release our * refCount on the widget (the timer token was already set to NULL * above). If there is a registered aftersync command, run that first. * Cancel any pending idle task which would try to run the command * after the afterSyncCmd pointer had been set to NULL. */ if (textPtr->afterSyncCmd) { int code; Tcl_CancelIdleCall(TkTextRunAfterSyncCmd, textPtr); Tcl_Preserve(textPtr->interp); code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); if (code == TCL_ERROR) { Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); Tcl_BackgroundException(textPtr->interp, TCL_ERROR); } Tcl_Release(textPtr->interp); Tcl_DecrRefCount(textPtr->afterSyncCmd); textPtr->afterSyncCmd = NULL; } /* * Fire the <<WidgetViewSync>> event since the widget view is in sync * with its internal data (actually it will be after the next trip * through the event loop, because the widget redraws at idle-time). */ GenerateWidgetViewSyncEvent(textPtr, 1); if (textPtr->refCount-- <= 1) { ckfree(textPtr); } return; } |
︙ | ︙ | |||
3214 3215 3216 3217 3218 3219 3220 | * everything in the range (which may take a * while). */ { TkTextLine *linePtr = NULL; int count = 0; int totalLines = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr); int fullUpdateRequested = (lineNum == 0 && | | | | 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 | * everything in the range (which may take a * while). */ { TkTextLine *linePtr = NULL; int count = 0; int totalLines = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr); int fullUpdateRequested = (lineNum == 0 && endLine == totalLines && doThisMuch == -1); if (totalLines == 0) { /* * Empty peer widget. */ return endLine; |
︙ | ︙ | |||
3394 3395 3396 3397 3398 3399 3400 | * If we were requested to update the entire range, then also update * the scrollbar. */ GetYView(textPtr->interp, textPtr, 1); } if (fullUpdateRequested) { | | | 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 | * If we were requested to update the entire range, then also update * the scrollbar. */ GetYView(textPtr->interp, textPtr, 1); } if (fullUpdateRequested) { GenerateWidgetViewSyncEvent(textPtr, 1); } return lineNum; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
3770 3771 3772 3773 3774 3775 3776 | * line merges with a following logical line * (because the eol is elided). */ { DLine *dlPtr; int pixelHeight; if (tkTextDebug) { | | | | | | | | | | | | | | | | | | | 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 | * line merges with a following logical line * (because the eol is elided). */ { DLine *dlPtr; int pixelHeight; if (tkTextDebug) { int oldtkTextDebug = tkTextDebug; /* * Check that the indexPtr we are given really is at the start of a * display line. The gymnastics with tkTextDebug is to prevent * failure of a test suite test, that checks that lines are rendered * exactly once. TkTextFindDisplayLineEnd is used here for checking * indexPtr but it calls LayoutDLine/FreeDLine which makes the * counting wrong. The debug mode shall therefore be switched off * when calling TkTextFindDisplayLineEnd. */ TkTextIndex indexPtr2 = *indexPtr; tkTextDebug = 0; TkTextFindDisplayLineEnd(textPtr, &indexPtr2, 0, NULL); tkTextDebug = oldtkTextDebug; if (TkTextIndexCmp(&indexPtr2,indexPtr) != 0) { Tcl_Panic("CalculateDisplayLineHeight called with bad indexPtr"); } } /* * Special case for artificial last line. May be better to move this * inside LayoutDLine. */ |
︙ | ︙ | |||
3866 3867 3868 3869 3870 3871 3872 | * Find the index denoting the closest position being at the same time * the start of a logical line above indexPtr and the start of a display * line. */ index = *indexPtr; while (1) { | | | | | | | | | 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 | * Find the index denoting the closest position being at the same time * the start of a logical line above indexPtr and the start of a display * line. */ index = *indexPtr; while (1) { TkTextFindDisplayLineEnd(textPtr, &index, 0, NULL); if (index.byteIndex == 0) { break; } TkTextIndexBackBytes(textPtr, &index, 1, &index); alreadyStartOfLine = 0; } pixelHeight = TkBTreePixelsTo(textPtr, index.linePtr); /* * Shortcut to avoid layout of a superfluous display line. We know there * is nothing more to add up to the height if the index we were given was * already on the first display line of a logical line. */ if (alreadyStartOfLine) { return pixelHeight; } /* * Iterate through display lines, starting at the logical line belonging * to index, adding up the pixel height of each such display line as we * go along, until we go past 'indexPtr'. */ |
︙ | ︙ | |||
3905 3906 3907 3908 3909 3910 3911 | * adjusting linePtr->pixelHeight), then the code might not quite work * as intended, specifically the 'linePtr->pixelHeight == pixelHeight' * test below this while loop. */ height = CalculateDisplayLineHeight(textPtr, &index, &bytes, NULL); | | | | | | 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 | * adjusting linePtr->pixelHeight), then the code might not quite work * as intended, specifically the 'linePtr->pixelHeight == pixelHeight' * test below this while loop. */ height = CalculateDisplayLineHeight(textPtr, &index, &bytes, NULL); TkTextIndexForwBytes(textPtr, &index, bytes, &index); compare = TkTextIndexCmp(&index,indexPtr); if (compare > 0) { return pixelHeight; } if (height > 0) { pixelHeight += height; } if (compare == 0) { return pixelHeight; } } } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
4016 4017 4018 4019 4020 4021 4022 | * Currently this call doesn't have many side-effects. However, if in * the future we change the code so there are side-effects (such as * adjusting linePtr->pixelHeight), then the code might not quite work * as intended, specifically the 'linePtr->pixelHeight == pixelHeight' * test below this while loop. */ | | | | | | | | | | | | | | | | | | | | | | | | | 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 | * Currently this call doesn't have many side-effects. However, if in * the future we change the code so there are side-effects (such as * adjusting linePtr->pixelHeight), then the code might not quite work * as intended, specifically the 'linePtr->pixelHeight == pixelHeight' * test below this while loop. */ height = CalculateDisplayLineHeight(textPtr, indexPtr, &bytes, &logicalLines); if (height > 0) { pixelHeight += height; displayLines++; } mergedLines += logicalLines; if (TkTextIndexForwBytes(textPtr, indexPtr, bytes, indexPtr)) { break; } if (mergedLines == 0) { if (indexPtr->linePtr != linePtr) { /* * If we reached the end of the logical line, then either way * we don't have a partial calculation. */ partialCalc = 0; break; } } else { if (IsStartOfNotMergedLine(textPtr, indexPtr)) { /* * We've ended a logical line. */ partialCalc = 0; break; } /* * We must still be on the same wrapped line, on a new logical * line merged with the logical line 'linePtr'. */ } if (partialCalc && displayLines > 50 && mergedLines == 0) { /* * Only calculate 50 display lines at a time, to avoid huge * delays. In any case it is very rare that a single line wraps 50 * times! * * If we have any merged lines, we must complete the full logical |
︙ | ︙ | |||
4410 4411 4412 4413 4414 4415 4416 | Tk_Draw3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), textPtr->border, textPtr->highlightWidth, textPtr->highlightWidth, Tk_Width(textPtr->tkwin) - 2*textPtr->highlightWidth, Tk_Height(textPtr->tkwin) - 2*textPtr->highlightWidth, textPtr->borderWidth, textPtr->relief); | | | 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 | Tk_Draw3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), textPtr->border, textPtr->highlightWidth, textPtr->highlightWidth, Tk_Width(textPtr->tkwin) - 2*textPtr->highlightWidth, Tk_Height(textPtr->tkwin) - 2*textPtr->highlightWidth, textPtr->borderWidth, textPtr->relief); if (textPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(textPtr->highlightBgColorPtr, Tk_WindowId(textPtr->tkwin)); if (textPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(textPtr->highlightColorPtr, Tk_WindowId(textPtr->tkwin)); |
︙ | ︙ | |||
4645 4646 4647 4648 4649 4650 4651 | * clear REDRAW_PENDING here, just in case the scroll function does * something that requires redisplay. */ doScrollbars: if (textPtr->flags & UPDATE_SCROLLBARS) { textPtr->flags &= ~UPDATE_SCROLLBARS; | | | | 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 | * clear REDRAW_PENDING here, just in case the scroll function does * something that requires redisplay. */ doScrollbars: if (textPtr->flags & UPDATE_SCROLLBARS) { textPtr->flags &= ~UPDATE_SCROLLBARS; if (textPtr->yScrollCmd != NULL) { GetYView(textPtr->interp, textPtr, 1); } if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* * The widget has been deleted. Don't do anything. */ goto end; } /* * Update the horizontal scrollbar, if any. */ if (textPtr->xScrollCmd != NULL) { GetXView(textPtr->interp, textPtr, 1); } } end: Tcl_Release(interp); } |
︙ | ︙ | |||
4902 4903 4904 4905 4906 4907 4908 | * the end of the first non elided text line after this line end). */ rounded = *index1Ptr; rounded.byteIndex = 0; notBegin = 0; while (!IsStartOfNotMergedLine(textPtr, &rounded) && notBegin) { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 | * the end of the first non elided text line after this line end). */ rounded = *index1Ptr; rounded.byteIndex = 0; notBegin = 0; while (!IsStartOfNotMergedLine(textPtr, &rounded) && notBegin) { notBegin = !TkTextIndexBackBytes(textPtr, &rounded, 1, &rounded); rounded.byteIndex = 0; } /* * 'rounded' now points to the start of a display line as well as the * real (non elided) start of a logical line, and this index is the * closest before index1Ptr. */ firstPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); if (firstPtr == NULL) { /* * index1Ptr pertains to no display line, i.e this index is after * the last display line. Since index2Ptr is after index1Ptr, there * is no display line to free/redisplay and we can return early. */ return; } rounded = *index2Ptr; linePtr = index2Ptr->linePtr; do { linePtr = TkBTreeNextLine(textPtr, linePtr); if (linePtr == NULL) { break; } rounded.linePtr = linePtr; rounded.byteIndex = 0; } while (!IsStartOfNotMergedLine(textPtr, &rounded)); if (linePtr == NULL) { lastPtr = NULL; } else { /* * 'rounded' now points to the start of a display line as well as the * start of a logical line not merged with its previous line, and * this index is the closest after index2Ptr. */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); /* * At least one display line is supposed to change. This makes the * redisplay OK in case the display line we expect to get here was * unlinked by a previous call to TkTextChanged and the text widget * did not update before reaching this point. This happens for * instance when moving the cursor up one line. * Note that lastPtr != NULL here, otherwise we would have returned * earlier when we tested for firstPtr being NULL. */ if (lastPtr == firstPtr) { lastPtr = lastPtr->nextPtr; } } /* * Delete all the DLines from firstPtr up to but not including lastPtr. */ FreeDLines(textPtr, firstPtr, lastPtr, DLINE_UNLINK); |
︙ | ︙ | |||
5143 5144 5145 5146 5147 5148 5149 | */ if (IsStartOfNotMergedLine(textPtr, curIndexPtr)) { dlPtr = FindDLine(textPtr, dlPtr, curIndexPtr); } else { TkTextIndex tmp = *curIndexPtr; | | | | 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 | */ if (IsStartOfNotMergedLine(textPtr, curIndexPtr)) { dlPtr = FindDLine(textPtr, dlPtr, curIndexPtr); } else { TkTextIndex tmp = *curIndexPtr; TkTextIndexBackBytes(textPtr, &tmp, 1, &tmp); dlPtr = FindDLine(textPtr, dlPtr, &tmp); } if (dlPtr == NULL) { break; } /* * Find the first DLine structure that's past the end of the range. */ if (!TkBTreeNextTag(&search)) { endIndexPtr = index2Ptr; } else { curIndexPtr = &search.curIndex; endIndexPtr = curIndexPtr; } endPtr = FindDLine(textPtr, dlPtr, endIndexPtr); if ((endPtr != NULL) && (TkTextIndexCmp(&endPtr->index,endIndexPtr) < 0)) { endPtr = endPtr->nextPtr; } /* * Delete all of the display lines in the range, so that they'll be * re-layed out and redrawn. */ |
︙ | ︙ | |||
5323 5324 5325 5326 5327 5328 5329 | if (dInfoPtr->lineUpdateTimer == NULL) { textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, textPtr); inSync = 0; } | | | 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 | if (dInfoPtr->lineUpdateTimer == NULL) { textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, textPtr); inSync = 0; } GenerateWidgetViewSyncEvent(textPtr, inSync); } } /* *---------------------------------------------------------------------- * * TkTextSetYView -- |
︙ | ︙ | |||
5399 5400 5401 5402 5403 5404 5405 | * The specified position must go at the top of the screen. Just leave * all the DLine's alone: we may be able to reuse some of the * information that's currently on the screen without redisplaying it * all. */ textPtr->topIndex = *indexPtr; | | | | | 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 | * The specified position must go at the top of the screen. Just leave * all the DLine's alone: we may be able to reuse some of the * information that's currently on the screen without redisplaying it * all. */ textPtr->topIndex = *indexPtr; if (!IsStartOfNotMergedLine(textPtr, indexPtr)) { TkTextFindDisplayLineEnd(textPtr, &textPtr->topIndex, 0, NULL); } dInfoPtr->newTopPixelOffset = pickPlace; goto scheduleUpdate; } /* * We have to pick where to display the index. First, bring the display * information up to date and see if the index will be completely visible |
︙ | ︙ | |||
5424 5425 5426 5427 5428 5429 5430 | if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) { /* * Part of the line hangs off the bottom of the screen; pretend * the whole line is off-screen. */ dlPtr = NULL; | | | | | | | | | | | | | | | | | | 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 | if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) { /* * Part of the line hangs off the bottom of the screen; pretend * the whole line is off-screen. */ dlPtr = NULL; } else { if (TkTextIndexCmp(&dlPtr->index, indexPtr) <= 0) { if (dInfoPtr->dLinePtr == dlPtr && dInfoPtr->topPixelOffset != 0) { /* * It is on the top line, but that line is hanging off the top * of the screen. Change the top overlap to zero and update. */ dInfoPtr->newTopPixelOffset = 0; goto scheduleUpdate; } /* * The line is already on screen, with no need to scroll. */ return; } } } /* * The desired line isn't already on-screen. Figure out what it means to * be "close" to the top or bottom of the screen. Close means within 1/3 * of the screen height or within three lines, whichever is greater. * |
︙ | ︙ | |||
5505 5506 5507 5508 5509 5510 5511 | /* * If the window height is smaller than the line height, prefer to make * the top of the line visible. */ if (dInfoPtr->maxY - dInfoPtr->y < lineHeight) { | | | 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 | /* * If the window height is smaller than the line height, prefer to make * the top of the line visible. */ if (dInfoPtr->maxY - dInfoPtr->y < lineHeight) { bottomY = lineHeight; } /* * Our job now is to arrange the display so that indexPtr appears as low * on the screen as possible but with its bottom no lower than bottomY. * BottomY is the bottom of the window if the desired line is just below * the current screen, otherwise it is a half-line lower than the center |
︙ | ︙ | |||
5641 5642 5643 5644 5645 5646 5647 | * through srcPtr (bytesToCount is non-infinite to accomplish this). * Make a list of all the display lines in backwards order (the lowest * DLine on the screen is first in the list). */ index.linePtr = TkBTreeFindLine(srcPtr->tree, textPtr, lineNum); index.byteIndex = 0; | | | | | | | | | | | | | | | | | 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 | * through srcPtr (bytesToCount is non-infinite to accomplish this). * Make a list of all the display lines in backwards order (the lowest * DLine on the screen is first in the list). */ index.linePtr = TkBTreeFindLine(srcPtr->tree, textPtr, lineNum); index.byteIndex = 0; TkTextFindDisplayLineEnd(textPtr, &index, 0, NULL); lineNum = TkBTreeLinesTo(textPtr, index.linePtr); lowestPtr = NULL; do { dlPtr = LayoutDLine(textPtr, &index); dlPtr->nextPtr = lowestPtr; lowestPtr = dlPtr; TkTextIndexForwBytes(textPtr, &index, dlPtr->byteCount, &index); bytesToCount -= dlPtr->byteCount; } while (bytesToCount>0 && index.linePtr==dlPtr->index.linePtr); /* * Scan through the display lines to see if we've covered enough * vertical distance. If so, save the starting index for the line at * the desired location. If distance was zero to start with then we * simply get the first index on the same display line as the original * index. */ for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) { distance -= dlPtr->height; if (distance <= 0) { *dstPtr = dlPtr->index; /* * dstPtr is the start of a display line that is or is not * the start of a logical line. If it is the start of a * logical line, we must check whether this line is merged * with the previous logical line, and if so we must adjust * dstPtr to the start of the display line since a display * line start needs to be returned. */ if (!IsStartOfNotMergedLine(textPtr, dstPtr)) { TkTextFindDisplayLineEnd(textPtr, dstPtr, 0, NULL); } if (overlap != NULL) { *overlap = -distance; } break; } } /* |
︙ | ︙ | |||
5810 5811 5812 5813 5814 5815 5816 | /* * Call a chunk-specific function to find the horizontal range of the * character within the chunk. chunkPtr is NULL if trying to see in elided * region. */ if (chunkPtr != NULL) { | | | | | | | | | | | | | | | | | | | | | | | | | | 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 | /* * Call a chunk-specific function to find the horizontal range of the * character within the chunk. chunkPtr is NULL if trying to see in elided * region. */ if (chunkPtr != NULL) { chunkPtr->bboxProc(textPtr, chunkPtr, byteCount, dlPtr->y + dlPtr->spaceAbove, dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow, dlPtr->baseline - dlPtr->spaceAbove, &x, &y, &width, &height); delta = x - dInfoPtr->curXPixelOffset; oneThird = lineWidth/3; if (delta < 0) { if (delta < -oneThird) { dInfoPtr->newXPixelOffset = x - lineWidth/2; } else { dInfoPtr->newXPixelOffset += delta; } } else { delta -= lineWidth - width; if (delta <= 0) { return TCL_OK; } if (delta > oneThird) { dInfoPtr->newXPixelOffset = x - lineWidth/2; } else { dInfoPtr->newXPixelOffset += delta; } } } dInfoPtr->flags |= DINFO_OUT_OF_DATE; if (!(dInfoPtr->flags & REDRAW_PENDING)) { dInfoPtr->flags |= REDRAW_PENDING; Tcl_DoWhenIdle(DisplayText, textPtr); } return TCL_OK; |
︙ | ︙ | |||
6071 6072 6073 6074 6075 6076 6077 | && (index.linePtr == dlPtr->index.linePtr)); for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) { offset++; if (offset == 0) { textPtr->topIndex = dlPtr->index; | | | | | | | | | | | | | | | | | | | 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 | && (index.linePtr == dlPtr->index.linePtr)); for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) { offset++; if (offset == 0) { textPtr->topIndex = dlPtr->index; /* * topIndex is the start of a logical line. However, if * the eol of the previous logical line is elided, then * topIndex may be elsewhere than the first character of * a display line, which is unwanted. Adjust to the start * of the display line, if needed. * topIndex is the start of a display line that is or is * not the start of a logical line. If it is the start of * a logical line, we must check whether this line is * merged with the previous logical line, and if so we * must adjust topIndex to the start of the display line. */ if (!IsStartOfNotMergedLine(textPtr, &textPtr->topIndex)) { TkTextFindDisplayLineEnd(textPtr, &textPtr->topIndex, 0, NULL); } break; } } /* * Discard the display lines, then either return or prepare for * the next display line to lay out. */ |
︙ | ︙ | |||
6526 6527 6528 6529 6530 6531 6532 | } if (FP_EQUAL_SCALE(first, dInfoPtr->xScrollFirst, dInfoPtr->maxLength) && FP_EQUAL_SCALE(last, dInfoPtr->xScrollLast, dInfoPtr->maxLength)) { return; } dInfoPtr->xScrollFirst = first; dInfoPtr->xScrollLast = last; | | | | 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 | } if (FP_EQUAL_SCALE(first, dInfoPtr->xScrollFirst, dInfoPtr->maxLength) && FP_EQUAL_SCALE(last, dInfoPtr->xScrollLast, dInfoPtr->maxLength)) { return; } dInfoPtr->xScrollFirst = first; dInfoPtr->xScrollLast = last; if (textPtr->xScrollCmd != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; Tcl_DString buf; buf1[0] = ' '; buf2[0] = ' '; Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, textPtr->xScrollCmd, TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (horizontal scrolling command executed by text)"); |
︙ | ︙ | |||
6811 6812 6813 6814 6815 6816 6817 | if (FP_EQUAL_SCALE(first, dInfoPtr->yScrollFirst, totalPixels) && FP_EQUAL_SCALE(last, dInfoPtr->yScrollLast, totalPixels)) { return; } dInfoPtr->yScrollFirst = first; dInfoPtr->yScrollLast = last; | | | | 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 | if (FP_EQUAL_SCALE(first, dInfoPtr->yScrollFirst, totalPixels) && FP_EQUAL_SCALE(last, dInfoPtr->yScrollLast, totalPixels)) { return; } dInfoPtr->yScrollFirst = first; dInfoPtr->yScrollLast = last; if (textPtr->yScrollCmd != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; Tcl_DString buf; buf1[0] = ' '; buf2[0] = ' '; Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, textPtr->yScrollCmd, TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE); Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (vertical scrolling command executed by text)"); |
︙ | ︙ | |||
6918 6919 6920 6921 6922 6923 6924 | * The display line containing the desired index is such that the index * of the first character of this display line is at or before the * desired index, and the index of the first character of the next * display line is after the desired index. */ while (TkTextIndexCmp(&dlPtr->index,indexPtr) < 0) { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 | * The display line containing the desired index is such that the index * of the first character of this display line is at or before the * desired index, and the index of the first character of the next * display line is after the desired index. */ while (TkTextIndexCmp(&dlPtr->index,indexPtr) < 0) { dlPtrPrev = dlPtr; dlPtr = dlPtr->nextPtr; if (dlPtr == NULL) { /* * We're past the last display line, either because the desired * index lies past the visible text, or because the desired index * is on the last display line. */ indexPtr2 = dlPtrPrev->index; TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, &indexPtr2); if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { /* * The desired index is on the last display line. * --> return this display line. */ dlPtr = dlPtrPrev; } else { /* * The desired index is past the visible text. There is no * display line displaying something at the desired index. * --> return NULL. */ } break; } if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) { /* * If we're here then we would normally expect that: * dlPtrPrev->index <= indexPtr < dlPtr->index * i.e. we have found the searched display line being dlPtr. * However it is possible that some DLines were unlinked * previously, leading to a situation where going through * the list of display lines skips display lines that did * exist just a moment ago. */ indexPtr2 = dlPtrPrev->index; TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, &indexPtr2); if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { /* * Confirmed: * dlPtrPrev->index <= indexPtr < dlPtr->index * --> return dlPtrPrev. */ dlPtr = dlPtrPrev; } else { /* * The last (rightmost) index shown by dlPtrPrev is still * before the desired index. This may be because there was * previously a display line between dlPtrPrev and dlPtr * and this display line has been unlinked. * --> return dlPtr. */ } break; } } return dlPtr; } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
7007 7008 7009 7010 7011 7012 7013 | IsStartOfNotMergedLine( const TkText *textPtr, /* Widget record for text widget. */ const TkTextIndex *indexPtr) /* Index to check. */ { TkTextIndex indexPtr2; if (indexPtr->byteIndex != 0) { | | | | | | | | | | | | | | 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 | IsStartOfNotMergedLine( const TkText *textPtr, /* Widget record for text widget. */ const TkTextIndex *indexPtr) /* Index to check. */ { TkTextIndex indexPtr2; if (indexPtr->byteIndex != 0) { /* * Not the start of a logical line. */ return 0; } if (TkTextIndexBackBytes(textPtr, indexPtr, 1, &indexPtr2)) { /* * indexPtr is the first index of the text widget. */ return 1; } if (!TkTextIsElided(textPtr, &indexPtr2, NULL)) { /* * The eol of the line just before indexPtr is elided. */ return 1; } return 0; } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
7198 7199 7200 7201 7202 7203 7204 | */ if (TkTextIndexForwBytes(NULL,indexPtr,chunkPtr->numBytes,indexPtr)) { /* * We've reached the end of the text. */ | | | | 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 | */ if (TkTextIndexForwBytes(NULL,indexPtr,chunkPtr->numBytes,indexPtr)) { /* * We've reached the end of the text. */ TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, COUNT_INDICES); return; } if (chunkPtr->nextPtr == NULL) { /* * We've reached the end of the display line. */ TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, COUNT_INDICES); return; } chunkPtr = chunkPtr->nextPtr; } /* * If the chunk has more than one byte in it, ask it which character is at |
︙ | ︙ | |||
7430 7431 7432 7433 7434 7435 7436 | /* * Last character in display line. Give it all the space up to the * line. */ if (charWidthPtr != NULL) { *charWidthPtr = dInfoPtr->maxX - *xPtr; | | | | | 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 | /* * Last character in display line. Give it all the space up to the * line. */ if (charWidthPtr != NULL) { *charWidthPtr = dInfoPtr->maxX - *xPtr; if (*charWidthPtr > textPtr->charWidth) { *charWidthPtr = textPtr->charWidth; } } if (*xPtr > dInfoPtr->maxX) { *xPtr = dInfoPtr->maxX; } *widthPtr = dInfoPtr->maxX - *xPtr; } else { if (charWidthPtr != NULL) { |
︙ | ︙ | |||
7699 7700 7701 7702 7703 7704 7705 | bytesThatFit = CharChunkMeasureChars(chunkPtr, p, maxBytes, 0, -1, chunkPtr->x, maxX, TK_ISOLATE_END, &nextX); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ if (bytesThatFit + 1 <= maxBytes) { if ((bytesThatFit == 0) && noCharsYet) { int ch; | | | 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 | bytesThatFit = CharChunkMeasureChars(chunkPtr, p, maxBytes, 0, -1, chunkPtr->x, maxX, TK_ISOLATE_END, &nextX); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ if (bytesThatFit + 1 <= maxBytes) { if ((bytesThatFit == 0) && noCharsYet) { int ch; int chLen = TkUtfToUniChar(p, &ch); #ifdef TK_LAYOUT_WITH_BASE_CHUNKS bytesThatFit = CharChunkMeasureChars(chunkPtr, line, lineOffset+chLen, lineOffset, -1, chunkPtr->x, -1, 0, &nextX); #else /* !TK_LAYOUT_WITH_BASE_CHUNKS */ bytesThatFit = CharChunkMeasureChars(chunkPtr, p, chLen, 0, -1, |
︙ | ︙ | |||
7721 7722 7723 7724 7725 7726 7727 | * if there is at least one pixel of space left on the line. Just * give the space character whatever space is left. */ nextX = maxX; bytesThatFit++; } | | | | | | | | | | | | | | | | 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 | * if there is at least one pixel of space left on the line. Just * give the space character whatever space is left. */ nextX = maxX; bytesThatFit++; } if (wrapMode == TEXT_WRAPMODE_WORD) { while (p[bytesThatFit] == ' ') { /* * Space characters that would go at the beginning of the * next line are allocated to the current line. This gives * the effect of trimming white spaces that would otherwise * be seen at the beginning of wrapped lines. * Note that testing for '\t' is useless here because the * chunk always includes at most one trailing \t, see * LayoutDLine. */ bytesThatFit++; } } if (p[bytesThatFit] == '\n') { /* * A newline character takes up no space, so if the previous * character fits then so does the newline. */ bytesThatFit++; |
︙ | ︙ |
Changes to generic/tkTextIndex.c.
︙ | ︙ | |||
41 42 43 44 45 46 47 | TkTextIndex *indexPtr); static const char * StartEnd(TkText *textPtr, const char *string, TkTextIndex *indexPtr); static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr, TkText *textPtr, const char *string, TkTextIndex *indexPtr, int *canCachePtr); static int IndexCountBytesOrdered(const TkText *textPtr, | | | > > > > > > > > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | TkTextIndex *indexPtr); static const char * StartEnd(TkText *textPtr, const char *string, TkTextIndex *indexPtr); static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr, TkText *textPtr, const char *string, TkTextIndex *indexPtr, int *canCachePtr); static int IndexCountBytesOrdered(const TkText *textPtr, const TkTextIndex *indexPtr1, const TkTextIndex *indexPtr2); #if defined(USE_TCL_STUBS) && (TCL_MAJOR_VERSION < 9) # undef Tcl_UtfPrev # define Tcl_UtfPrev (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[656])) \ : ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[331]))) #endif /* * The "textindex" Tcl_Obj definition: */ static void DupTextIndexInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr); |
︙ | ︙ | |||
439 440 441 442 443 444 445 | * that byteIndex falls on a character boundary. If the index * falls in the middle of a UTF-8 character, it will be * adjusted to the end of that UTF-8 character. */ start = segPtr->body.chars + (byteIndex - index); p = Tcl_UtfPrev(start, segPtr->body.chars); | | | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | * that byteIndex falls on a character boundary. If the index * falls in the middle of a UTF-8 character, it will be * adjusted to the end of that UTF-8 character. */ start = segPtr->body.chars + (byteIndex - index); p = Tcl_UtfPrev(start, segPtr->body.chars); p += TkUtfToUniChar(p, &ch); indexPtr->byteIndex += p - start; } break; } index += segPtr->size; } return indexPtr; |
︙ | ︙ | |||
482 483 484 485 486 487 488 | * of text). */ int charIndex, /* Index of desired character. */ TkTextIndex *indexPtr) /* Structure to fill in. */ { TkTextSegment *segPtr; char *p, *start, *end; int index, offset; | | | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | * of text). */ int charIndex, /* Index of desired character. */ TkTextIndex *indexPtr) /* Structure to fill in. */ { TkTextSegment *segPtr; char *p, *start, *end; int index, offset; int ch = 0; indexPtr->tree = tree; if (lineIndex < 0) { lineIndex = 0; charIndex = 0; } if (charIndex < 0) { |
︙ | ︙ | |||
529 530 531 532 533 534 535 | end = start + segPtr->size; for (p = start; p < end; p += offset) { if (charIndex == 0) { indexPtr->byteIndex = index; return indexPtr; } charIndex--; | | | 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | end = start + segPtr->size; for (p = start; p < end; p += offset) { if (charIndex == 0) { indexPtr->byteIndex = index; return indexPtr; } charIndex--; offset = TkUtfToUniChar(p, &ch); index += offset; } } else { if (charIndex < (int)segPtr->size) { indexPtr->byteIndex = index; break; } |
︙ | ︙ | |||
1117 1118 1119 1120 1121 1122 1123 | linePtr = TkBTreeNextLine(NULL, linePtr); segPtr = linePtr->segPtr; } if (numBytes <= segPtr->size) { break; } if (segPtr->typePtr == &tkTextCharType) { | | | | 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 | linePtr = TkBTreeNextLine(NULL, linePtr); segPtr = linePtr->segPtr; } if (numBytes <= segPtr->size) { break; } if (segPtr->typePtr == &tkTextCharType) { charIndex += TkNumUtfChars(segPtr->body.chars, segPtr->size); } else { charIndex += segPtr->size; } numBytes -= segPtr->size; } if (segPtr->typePtr == &tkTextCharType) { charIndex += TkNumUtfChars(segPtr->body.chars, numBytes); } else { charIndex += numBytes; } return snprintf(string, TK_POS_CHARS, "%d.%" TCL_SIZE_MODIFIER "d", TkBTreeLinesTo(textPtr, indexPtr->linePtr) + 1, charIndex); } |
︙ | ︙ | |||
1375 1376 1377 1378 1379 1380 1381 | TkTextFindDisplayLineEnd(textPtr, indexPtr, 1, NULL); TkTextIndexForwChars(textPtr, indexPtr, 1, indexPtr, COUNT_DISPLAY_INDICES); } } else { TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, &xOffset); while (count-- > 0) { | | | | | | | | | | | | | | 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 | TkTextFindDisplayLineEnd(textPtr, indexPtr, 1, NULL); TkTextIndexForwChars(textPtr, indexPtr, 1, indexPtr, COUNT_DISPLAY_INDICES); } } else { TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, &xOffset); while (count-- > 0) { TkTextIndex indexPtr2; /* * Go to the beginning of the line, then backward one * char/byte to get to the end of the previous line. */ TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, NULL); TkTextIndexBackChars(textPtr, indexPtr, 1, &indexPtr2, COUNT_DISPLAY_INDICES); /* * If we couldn't go to the previous line, then we wanted to go before the start of the text: arrange for returning the first index of the first display line. */ if (!TkTextIndexCmp(indexPtr, &indexPtr2)) { xOffset = 0; break; } *indexPtr = indexPtr2; } } TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, NULL); /* * This call assumes indexPtr is the beginning of a display line * and moves it to the 'xOffset' position of that line, which is * just what we want. */ |
︙ | ︙ | |||
1653 1654 1655 1656 1657 1658 1659 | } } if (!elide) { if (segPtr->typePtr == &tkTextCharType) { start = segPtr->body.chars + byteOffset; end = segPtr->body.chars + segPtr->size; | | | 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 | } } if (!elide) { if (segPtr->typePtr == &tkTextCharType) { start = segPtr->body.chars + byteOffset; end = segPtr->body.chars + segPtr->size; for (p = start; p < end; p += TkUtfToUniChar(p, &ch)) { if (charCount == 0) { dstPtr->byteIndex += (p - start); goto forwardCharDone; } charCount--; } } else if (type & COUNT_INDICES) { |
︙ | ︙ | |||
1745 1746 1747 1748 1749 1750 1751 | * at which to stop the count. */ { Tcl_Size byteCount, offset; TkTextSegment *segPtr, *segPtr1; TkTextLine *linePtr; if (indexPtr1->linePtr == indexPtr2->linePtr) { | | | | | | | | | | | 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 | * at which to stop the count. */ { Tcl_Size byteCount, offset; TkTextSegment *segPtr, *segPtr1; TkTextLine *linePtr; if (indexPtr1->linePtr == indexPtr2->linePtr) { return indexPtr2->byteIndex - indexPtr1->byteIndex; } /* * indexPtr2 is on a line strictly after the line containing indexPtr1. * Add up: * bytes between indexPtr1 and end of its line * bytes in lines strictly between indexPtr1 and indexPtr2 * bytes between start of the indexPtr2 line and indexPtr2 */ segPtr1 = TkTextIndexToSeg(indexPtr1, &offset); byteCount = -offset; for (segPtr = segPtr1; segPtr != NULL; segPtr = segPtr->nextPtr) { byteCount += segPtr->size; } linePtr = TkBTreeNextLine(textPtr, indexPtr1->linePtr); while (linePtr != indexPtr2->linePtr) { for (segPtr = linePtr->segPtr; segPtr != NULL; segPtr = segPtr->nextPtr) { byteCount += segPtr->size; } linePtr = TkBTreeNextLine(textPtr, linePtr); if (linePtr == NULL) { Tcl_Panic("TextIndexCountBytesOrdered ran out of lines"); } } byteCount += indexPtr2->byteIndex; return byteCount; } |
︙ | ︙ | |||
1936 1937 1938 1939 1940 1941 1942 | while (i && (*str < 0xC0)) { i--; str++; } count += byteLen - i; if (i) { | | | 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 | while (i && (*str < 0xC0)) { i--; str++; } count += byteLen - i; if (i) { count += TkNumUtfChars(segPtr->body.chars + byteOffset + (byteLen - i), i); } } else { if (type & COUNT_INDICES) { Tcl_Size byteLen = segPtr->size - byteOffset; if (segPtr == seg2Ptr) { |
︙ | ︙ | |||
2198 2199 2200 2201 2202 2203 2204 | if (charCount == 0) { dstPtr->byteIndex -= (end - p); goto backwardCharDone; } if (p == start) { break; } | < < < | 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 | if (charCount == 0) { dstPtr->byteIndex -= (end - p); goto backwardCharDone; } if (p == start) { break; } if (charCount != 0) { charCount--; } } } else { if (type & COUNT_INDICES) { if (charCount <= segSize) { |
︙ | ︙ | |||
2385 2386 2387 2388 2389 2390 2391 | segPtr = TkTextIndexToSeg(indexPtr, &offset); while (1) { int chSize = 1; if (segPtr->typePtr == &tkTextCharType) { int ch; | | | 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 | segPtr = TkTextIndexToSeg(indexPtr, &offset); while (1) { int chSize = 1; if (segPtr->typePtr == &tkTextCharType) { int ch; chSize = TkUtfToUniChar(segPtr->body.chars + offset, &ch); if (!Tcl_UniCharIsWordChar(ch)) { break; } firstChar = 0; } offset += chSize; indexPtr->byteIndex += chSize; |
︙ | ︙ | |||
2430 2431 2432 2433 2434 2435 2436 | segPtr = TkTextIndexToSeg(indexPtr, &offset); while (1) { int chSize = 1; if (segPtr->typePtr == &tkTextCharType) { int ch; | | | 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 | segPtr = TkTextIndexToSeg(indexPtr, &offset); while (1) { int chSize = 1; if (segPtr->typePtr == &tkTextCharType) { int ch; TkUtfToUniChar(segPtr->body.chars + offset, &ch); if (!Tcl_UniCharIsWordChar(ch)) { break; } if (offset + 1 > 1) { chSize = (segPtr->body.chars + offset - Tcl_UtfPrev(segPtr->body.chars + offset, segPtr->body.chars)); |
︙ | ︙ |
Changes to generic/tkTextMark.c.
︙ | ︙ | |||
297 298 299 300 301 302 303 | * If this is the insertion point that's being moved, be sure to force * a display update at the old position. Also, don't let the insertion * cursor be after the final newline of the file. */ if (markPtr == textPtr->insertMarkPtr) { TkTextIndex index, index2; | | | | | | | | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | * If this is the insertion point that's being moved, be sure to force * a display update at the old position. Also, don't let the insertion * cursor be after the final newline of the file. */ if (markPtr == textPtr->insertMarkPtr) { TkTextIndex index, index2; int nblines; TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index); TkTextIndexForwChars(NULL, &index, 1, &index2, COUNT_INDICES); /* * While we wish to redisplay, no heights have changed, so no need * to call TkTextInvalidateLineMetrics. */ TkTextChanged(NULL, textPtr, &index, &index2); /* * The number of lines in the widget is zero if and only if it is * a partial peer with -startline == -endline, i.e. an empty * peer. In this case the mark shall be set exactly at the given * index, and not one character backwards (bug 3487407). */ nblines = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr); if ((TkBTreeLinesTo(textPtr, indexPtr->linePtr) == nblines) && (nblines > 0)) { TkTextIndexBackChars(NULL,indexPtr, 1, &insertIndex, COUNT_INDICES); indexPtr = &insertIndex; |
︙ | ︙ | |||
432 433 434 435 436 437 438 | TkText *textPtr, /* Text widget containing mark. */ const char *name, /* Name of mark. */ TkTextIndex *indexPtr) /* Index information gets stored here. */ { TkTextSegment *segPtr; if (textPtr == NULL) { | | | 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | TkText *textPtr, /* Text widget containing mark. */ const char *name, /* Name of mark. */ TkTextIndex *indexPtr) /* Index information gets stored here. */ { TkTextSegment *segPtr; if (textPtr == NULL) { return TCL_ERROR; } if (!strcmp(name, "insert")) { segPtr = textPtr->insertMarkPtr; } else if (!strcmp(name, "current")) { segPtr = textPtr->currentMarkPtr; } else { |
︙ | ︙ | |||
745 746 747 748 749 750 751 | } /* * These two marks are not in the hash table */ if (markPtr->body.mark.textPtr->insertMarkPtr == markPtr) { | | | 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | } /* * These two marks are not in the hash table */ if (markPtr->body.mark.textPtr->insertMarkPtr == markPtr) { return; } if (markPtr->body.mark.textPtr->currentMarkPtr == markPtr) { return; } /* * Make sure that the mark is still present in the text's mark hash table. |
︙ | ︙ | |||
929 930 931 932 933 934 935 | */ for (prevPtr = NULL, seg2Ptr = index.linePtr->segPtr; seg2Ptr != NULL && seg2Ptr != segPtr; seg2Ptr = seg2Ptr->nextPtr) { if (seg2Ptr->typePtr == &tkTextRightMarkType || seg2Ptr->typePtr == &tkTextLeftMarkType) { | | | | | | | | | | | | 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | */ for (prevPtr = NULL, seg2Ptr = index.linePtr->segPtr; seg2Ptr != NULL && seg2Ptr != segPtr; seg2Ptr = seg2Ptr->nextPtr) { if (seg2Ptr->typePtr == &tkTextRightMarkType || seg2Ptr->typePtr == &tkTextLeftMarkType) { if (seg2Ptr->body.mark.hPtr == NULL) { if (seg2Ptr != textPtr->currentMarkPtr && seg2Ptr != textPtr->insertMarkPtr) { /* * This is an insert or current mark from a * peer of textPtr. */ continue; } } prevPtr = seg2Ptr; } } if (prevPtr != NULL) { Tcl_Obj *markName = GetMarkName(textPtr, prevPtr); if (markName != NULL) { |
︙ | ︙ |
Changes to generic/tkTextTag.c.
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkInt.h" #include "tkText.h" #include "default.h" static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, offsetof(TkTextTag, borderWidthPtr), offsetof(TkTextTag, borderWidth), TK_OPTION_NULL_OK, 0, 0}, | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkInt.h" #include "tkText.h" #include "default.h" /* This struct can be used for booleans, relief and pixels */ typedef struct { char *string; int value; } IntStruct; typedef struct { char *string; Tk_Justify value; } JustifyStruct; static int ObjectIsEmpty( Tcl_Obj *objPtr) /* Object to test. May be NULL. */ { if (objPtr == NULL) { return 1; } if (objPtr->bytes == NULL) { Tcl_GetString(objPtr); } return (objPtr->length == 0); } #define OPTION_NONNEG (1 << 10) static int SetPixels( TCL_UNUSED(void *), Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, Tcl_Size internalOffset, char *oldInternalPtr, int flags) { IntStruct pixel = {NULL, INT_MIN}; IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset); int nullOK = (flags & TK_OPTION_NULL_OK); if (!nullOK || !ObjectIsEmpty(*value)) { if (Tk_GetPixelsFromObj(nullOK ? NULL : interp, tkwin, *value, &pixel.value) != TCL_OK) { if (nullOK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance or \"\" but got \"%.50s\"", Tcl_GetString(*value))); Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } if ((flags & OPTION_NONNEG) && pixel.value < 0) { pixel.value = 0; } pixel.string = (char *)ckalloc((*value)->length + 1); strcpy(pixel.string, (*value)->bytes); } *((char **)oldInternalPtr) = NULL; *internalPtr = pixel; return TCL_OK; }; static int SetBoolean( TCL_UNUSED(void *), Tcl_Interp *interp, TCL_UNUSED(Tk_Window), Tcl_Obj **value, char *recordPtr, Tcl_Size internalOffset, char *oldInternalPtr, int flags) { IntStruct booleanVal = {NULL, -1}; IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset); int nullOK = (flags & TK_OPTION_NULL_OK); if (!nullOK || !ObjectIsEmpty(*value)) { if (Tcl_GetBooleanFromObj(nullOK ? NULL : interp, *value, &booleanVal.value) != TCL_OK) { if (nullOK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected boolean value or \"\" but got \"%s\"", Tcl_GetString(*value))); } return TCL_ERROR; } booleanVal.string = (char *)ckalloc((*value)->length + 1); strcpy(booleanVal.string, (*value)->bytes); } *((char **)oldInternalPtr) = NULL; *internalPtr = booleanVal; return TCL_OK; }; static int SetRelief( TCL_UNUSED(void *), Tcl_Interp *interp, TCL_UNUSED(Tk_Window), Tcl_Obj **value, char *recordPtr, Tcl_Size internalOffset, char *oldInternalPtr, int flags) { IntStruct relief = {NULL, TK_RELIEF_NULL}; IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset); int nullOK = (flags & TK_OPTION_NULL_OK); if (!nullOK || !ObjectIsEmpty(*value)) { if (Tk_GetReliefFromObj(nullOK ? NULL : interp, *value, &relief.value) != TCL_OK) { if (nullOK) { Tcl_AppendResult(interp, "bad relief \"", Tcl_GetString(*value), "\": must be flat, groove, raised, ridge, solid, sunken, or \"\"", (char *)NULL); } return TCL_ERROR; } relief.string = (char *)ckalloc((*value)->length + 1); strcpy(relief.string, (*value)->bytes); } *((char **)oldInternalPtr) = NULL; *internalPtr = relief; return TCL_OK; }; static int SetJustify( TCL_UNUSED(void *), Tcl_Interp *interp, TCL_UNUSED(Tk_Window), Tcl_Obj **value, char *recordPtr, Tcl_Size internalOffset, char *oldInternalPtr, int flags) { JustifyStruct justify = {NULL, TK_JUSTIFY_NULL}; JustifyStruct *internalPtr = (JustifyStruct *)(recordPtr + internalOffset); int nullOK = (flags & TK_OPTION_NULL_OK); if (!nullOK || !ObjectIsEmpty(*value)) { if (Tk_GetJustifyFromObj(nullOK ? NULL : interp, *value, &justify.value) != TCL_OK) { if (nullOK) { Tcl_AppendResult(interp, "bad justification \"", Tcl_GetString(*value), "\": must be left, right, center, or \"\"", (char *)NULL); } return TCL_ERROR; } justify.string = (char *)ckalloc((*value)->length + 1); strcpy(justify.string, (*value)->bytes); } *((char **)oldInternalPtr) = NULL; *internalPtr = justify; return TCL_OK; }; static Tcl_Obj *GetStruct( TCL_UNUSED(void *), TCL_UNUSED(Tk_Window), char *recordPtr, Tcl_Size internalOffset) { char **structPtr = (char **)(recordPtr + internalOffset); if (*structPtr == NULL || **structPtr == '\0') { return Tcl_NewObj(); } return Tcl_NewStringObj(*structPtr, TCL_INDEX_NONE); }; static void FreeStruct( TCL_UNUSED(void *), TCL_UNUSED(Tk_Window), char *internalPtr) { char **structPtr = (char **)internalPtr; if (*structPtr) { ckfree(*structPtr); *structPtr = NULL; } }; static const Tk_ObjCustomOption pixelsOption = { "pixels", /* name */ SetPixels, /* setProc */ GetStruct, /* getProc */ NULL, /* restoreProc */ FreeStruct, /* freeProc */ 0 }; static const Tk_ObjCustomOption booleanOption = { "boolean", /* name */ SetBoolean, /* setProc */ GetStruct, /* getProc */ NULL, /* restoreProc */ FreeStruct, /* freeProc */ 0 }; static const Tk_ObjCustomOption justifyOption = { "justify", /* name */ SetJustify, /* setProc */ GetStruct, /* getProc */ NULL, /* restoreProc */ FreeStruct, /* freeProc */ 0 }; static const Tk_ObjCustomOption reliefOption = { "relief", /* name */ SetRelief, /* setProc */ GetStruct, /* getProc */ NULL, /* restoreProc */ FreeStruct, /* freeProc */ 0 }; static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, offsetof(TkTextTag, borderWidthPtr), offsetof(TkTextTag, borderWidth), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-elide", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elideString), TK_OPTION_NULL_OK, &booleanOption, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-justify", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, justifyString), TK_OPTION_NULL_OK, &justifyOption,0}, {TK_OPTION_CUSTOM, "-lmargin1", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,&pixelsOption,0}, {TK_OPTION_CUSTOM, "-lmargin2", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,&pixelsOption,0}, {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-offset", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, offsetString), TK_OPTION_NULL_OK, &pixelsOption, 0}, {TK_OPTION_CUSTOM, "-overstrike", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeString), TK_OPTION_NULL_OK, &booleanOption, 0}, {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-relief", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, &reliefOption, 0}, {TK_OPTION_CUSTOM, "-rmargin", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginString), TK_OPTION_NULL_OK, &pixelsOption,0}, {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-spacing1", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing1String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption,0}, {TK_OPTION_CUSTOM, "-spacing2", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing2String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption,0}, {TK_OPTION_CUSTOM, "-spacing3", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing3String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption,0}, {TK_OPTION_STRING, "-tabs", NULL, NULL, NULL, offsetof(TkTextTag, tabStringPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle), TK_OPTION_NULL_OK|TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, 0}, {TK_OPTION_CUSTOM, "-underline", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineString), TK_OPTION_NULL_OK, &booleanOption, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, wrapMode), TK_OPTION_NULL_OK|TK_OPTION_ENUM_VAR, tkTextWrapStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} |
︙ | ︙ | |||
166 167 168 169 170 171 172 | /* * Indices are potentially obsolete after adding or removing * elided character ranges, especially indices having "display" * or "any" submodifier, therefore increase the epoch. */ textPtr->sharedTextPtr->stateEpoch++; } | | | | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | /* * Indices are potentially obsolete after adding or removing * elided character ranges, especially indices having "display" * or "any" submodifier, therefore increase the epoch. */ textPtr->sharedTextPtr->stateEpoch++; } for (i = 4; i < objc; i += 2) { if (TkTextGetObjIndex(interp, textPtr, objv[i], &index1) != TCL_OK) { return TCL_ERROR; } if (objc > (i+1)) { if (TkTextGetObjIndex(interp, textPtr, objv[i+1], &index2) != TCL_OK) { return TCL_ERROR; } if (TkTextIndexCmp(&index1, &index2) >= 0) { return TCL_OK; } |
︙ | ︙ | |||
277 278 279 280 281 282 283 | |EnterWindowMask|LeaveWindowMask|KeyPressMask |KeyReleaseMask|PointerMotionMask|VirtualEventMask)) { Tk_DeleteBinding(interp, textPtr->sharedTextPtr->bindingTable, (void *) tagPtr->name, Tcl_GetString(objv[4])); Tcl_SetObjResult(interp, Tcl_NewStringObj( "requested illegal events; only key, button, motion," " enter, leave, and virtual events may be used", TCL_INDEX_NONE)); | | | 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |EnterWindowMask|LeaveWindowMask|KeyPressMask |KeyReleaseMask|PointerMotionMask|VirtualEventMask)) { Tk_DeleteBinding(interp, textPtr->sharedTextPtr->bindingTable, (void *) tagPtr->name, Tcl_GetString(objv[4])); Tcl_SetObjResult(interp, Tcl_NewStringObj( "requested illegal events; only key, button, motion," " enter, leave, and virtual events may be used", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT", (char *)NULL); return TCL_ERROR; } } else if (objc == 5) { const char *command; command = Tk_GetBinding(interp, textPtr->sharedTextPtr->bindingTable, |
︙ | ︙ | |||
361 362 363 364 365 366 367 | * -justify, require additional translation (this is needed * because we need to distinguish a particular value of an option * from "unspecified"). */ if (tagPtr->borderWidth < 0) { tagPtr->borderWidth = 0; | < < < < < < < < < < < < < < < | | 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | * -justify, require additional translation (this is needed * because we need to distinguish a particular value of an option * from "unspecified"). */ if (tagPtr->borderWidth < 0) { tagPtr->borderWidth = 0; } if (tagPtr->tabArrayPtr != NULL) { ckfree(tagPtr->tabArrayPtr); tagPtr->tabArrayPtr = NULL; } if (tagPtr->tabStringPtr != NULL) { tagPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr, tagPtr->tabStringPtr); if (tagPtr->tabArrayPtr == NULL) { return TCL_ERROR; } } if (tagPtr->elide >= 0) { /* * Indices are potentially obsolete after changing -elide, |
︙ | ︙ | |||
436 437 438 439 440 441 442 | || (tagPtr->rMargin != INT_MIN) || (tagPtr->spacing1 != INT_MIN) || (tagPtr->spacing2 != INT_MIN) || (tagPtr->spacing3 != INT_MIN) || (tagPtr->tabStringPtr != NULL) || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR) || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR) | | > > | 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | || (tagPtr->rMargin != INT_MIN) || (tagPtr->spacing1 != INT_MIN) || (tagPtr->spacing2 != INT_MIN) || (tagPtr->spacing3 != INT_MIN) || (tagPtr->tabStringPtr != NULL) || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR) || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR) || (tagPtr->wrapMode == TEXT_WRAPMODE_CHAR) || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE) || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) { tagPtr->affectsDisplay = 1; tagPtr->affectsDisplayGeometry = 1; } if ((tagPtr->border != NULL) || (tagPtr->selBorder != NULL) || (tagPtr->relief != TK_RELIEF_NULL) || (tagPtr->bgStipple != None) |
︙ | ︙ | |||
481 482 483 484 485 486 487 | case TAG_DELETE: { Tcl_HashEntry *hPtr; if (objc < 4) { Tcl_WrongNumArgs(interp, 3, objv, "tagName ?tagName ...?"); return TCL_ERROR; } | | | 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | case TAG_DELETE: { Tcl_HashEntry *hPtr; if (objc < 4) { Tcl_WrongNumArgs(interp, 3, objv, "tagName ?tagName ...?"); return TCL_ERROR; } for (i = 3; i < objc; i++) { hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable, Tcl_GetString(objv[i])); if (hPtr == NULL) { /* * Either this tag doesn't exist or it's the 'sel' tag (which * is not in the hash table). Either way we don't want to * delete it. |
︙ | ︙ | |||
585 586 587 588 589 590 591 | SortTags(arraySize, arrayPtr); listObj = Tcl_NewListObj(0, NULL); for (i = 0; i < arraySize; i++) { tagPtr = arrayPtr[i]; Tcl_ListObjAppendElement(interp, listObj, | | | 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 | SortTags(arraySize, arrayPtr); listObj = Tcl_NewListObj(0, NULL); for (i = 0; i < arraySize; i++) { tagPtr = arrayPtr[i]; Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(tagPtr->name, TCL_INDEX_NONE)); } Tcl_SetObjResult(interp, listObj); ckfree(arrayPtr); break; } case TAG_NEXTRANGE: { TkTextIndex last; |
︙ | ︙ | |||
937 938 939 940 941 942 943 944 945 946 947 948 949 | tagPtr->textPtr = NULL; tagPtr->toggleCount = 0; tagPtr->tagRootPtr = NULL; tagPtr->priority = textPtr->sharedTextPtr->numTags; tagPtr->border = NULL; tagPtr->borderWidth = 0; tagPtr->borderWidthPtr = NULL; tagPtr->relief = TK_RELIEF_NULL; tagPtr->bgStipple = None; tagPtr->fgColor = NULL; tagPtr->tkfont = NULL; tagPtr->fgStipple = None; tagPtr->justify = TK_JUSTIFY_NULL; | > > | | | > | | | | > > | 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | tagPtr->textPtr = NULL; tagPtr->toggleCount = 0; tagPtr->tagRootPtr = NULL; tagPtr->priority = textPtr->sharedTextPtr->numTags; tagPtr->border = NULL; tagPtr->borderWidth = 0; tagPtr->borderWidthPtr = NULL; tagPtr->reliefString = NULL; tagPtr->relief = TK_RELIEF_NULL; tagPtr->bgStipple = None; tagPtr->fgColor = NULL; tagPtr->tkfont = NULL; tagPtr->fgStipple = None; tagPtr->justifyString = NULL; tagPtr->justify = TK_JUSTIFY_NULL; tagPtr->lMargin1String = NULL; tagPtr->lMargin1 = INT_MIN; tagPtr->lMargin2String = NULL; tagPtr->lMargin2 = INT_MIN; tagPtr->lMarginColor = NULL; tagPtr->offsetString = NULL; tagPtr->offset = INT_MIN; tagPtr->overstrikeString = NULL; tagPtr->overstrike = -1; tagPtr->overstrikeColor = NULL; tagPtr->rMarginString = NULL; tagPtr->rMargin = INT_MIN; tagPtr->rMarginColor = NULL; tagPtr->selBorder = NULL; tagPtr->selFgColor = NULL; tagPtr->spacing1String = NULL; tagPtr->spacing1 = INT_MIN; tagPtr->spacing2String = NULL; tagPtr->spacing2 = INT_MIN; tagPtr->spacing3String = NULL; tagPtr->spacing3 = INT_MIN; tagPtr->tabStringPtr = NULL; tagPtr->tabArrayPtr = NULL; tagPtr->tabStyle = TK_TEXT_TABSTYLE_NULL; tagPtr->underlineString = NULL; tagPtr->underline = -1; tagPtr->underlineColor = NULL; tagPtr->elideString = NULL; tagPtr->elide = -1; tagPtr->wrapMode = TEXT_WRAPMODE_NULL; tagPtr->affectsDisplay = 0; tagPtr->affectsDisplayGeometry = 0; textPtr->sharedTextPtr->numTags++; if (!strcmp(tagName, "sel")) { tagPtr->textPtr = textPtr; |
︙ | ︙ | |||
1029 1030 1031 1032 1033 1034 1035 | return (TkTextTag *)Tcl_GetHashValue(hPtr); } if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tag \"%s\" isn't defined in text widget", Tcl_GetString(tagName))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG", | | | 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 | return (TkTextTag *)Tcl_GetHashValue(hPtr); } if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tag \"%s\" isn't defined in text widget", Tcl_GetString(tagName))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG", Tcl_GetString(tagName), (char *)NULL); } return NULL; } /* *---------------------------------------------------------------------- * |
︙ | ︙ |
Changes to generic/tkTextWind.c.
︙ | ︙ | |||
167 168 169 170 171 172 173 | return TCL_ERROR; } ewPtr = TkTextIndexToSeg(&index, NULL); if (ewPtr->typePtr != &tkTextEmbWindowType) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded window at index \"%s\"", Tcl_GetString(objv[3]))); | | | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | return TCL_ERROR; } ewPtr = TkTextIndexToSeg(&index, NULL); if (ewPtr->typePtr != &tkTextEmbWindowType) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded window at index \"%s\"", Tcl_GetString(objv[3]))); Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_WINDOW", (char *)NULL); return TCL_ERROR; } /* * Copy over client specific value before querying. */ |
︙ | ︙ | |||
205 206 207 208 209 210 211 | return TCL_ERROR; } ewPtr = TkTextIndexToSeg(&index, NULL); if (ewPtr->typePtr != &tkTextEmbWindowType) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded window at index \"%s\"", Tcl_GetString(objv[3]))); | | | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | return TCL_ERROR; } ewPtr = TkTextIndexToSeg(&index, NULL); if (ewPtr->typePtr != &tkTextEmbWindowType) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded window at index \"%s\"", Tcl_GetString(objv[3]))); Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_WINDOW", (char *)NULL); return TCL_ERROR; } if (objc <= 5) { TkTextEmbWindowClient *client; Tcl_Obj *objPtr; /* |
︙ | ︙ | |||
439 440 441 442 443 444 445 | if (Tk_TopWinHierarchy(ancestor)) { badContainer: Tcl_SetObjResult(textPtr->interp, Tcl_ObjPrintf( "can't embed %s in %s", Tk_PathName(ewPtr->body.ew.tkwin), Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", | | | 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | if (Tk_TopWinHierarchy(ancestor)) { badContainer: Tcl_SetObjResult(textPtr->interp, Tcl_ObjPrintf( "can't embed %s in %s", Tk_PathName(ewPtr->body.ew.tkwin), Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); ewPtr->body.ew.tkwin = NULL; if (client != NULL) { client->tkwin = NULL; } return TCL_ERROR; } } |
︙ | ︙ | |||
936 937 938 939 940 941 942 | || (textPtr->tkwin == ewPtr->body.ew.tkwin)) { badContainer: Tcl_SetObjResult(textPtr->interp, Tcl_ObjPrintf( "can't embed %s relative to %s", Tk_PathName(ewPtr->body.ew.tkwin), Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", "HIERARCHY", | | | 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 | || (textPtr->tkwin == ewPtr->body.ew.tkwin)) { badContainer: Tcl_SetObjResult(textPtr->interp, Tcl_ObjPrintf( "can't embed %s relative to %s", Tk_PathName(ewPtr->body.ew.tkwin), Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); Tcl_BackgroundException(textPtr->interp, TCL_ERROR); ewPtr->body.ew.tkwin = NULL; goto gotWindow; } if (client == NULL) { /* |
︙ | ︙ |
Changes to generic/tkUtil.c.
︙ | ︙ | |||
1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 | event.virt.name = Tk_GetUid(eventName); event.virt.user_data = detail; if (detail) Tcl_IncrRefCount(detail); // Event code will DecrRefCount Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 | event.virt.name = Tk_GetUid(eventName); event.virt.user_data = detail; if (detail) Tcl_IncrRefCount(detail); // Event code will DecrRefCount Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL); } #if TCL_MAJOR_VERSION < 9 /* *--------------------------------------------------------------------------- * * TkUtfToUniChar -- * * Almost the same as Tcl_UtfToUniChar but using int instead of Tcl_UniChar. * This function is capable of collapsing a upper/lower surrogate pair to a * single unicode character. So, up to 6 bytes might be consumed. * * Results: * *chPtr is filled with the Tcl_UniChar, and the return value is the * number of bytes from the UTF-8 string that were consumed. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Size TkUtfToUniChar( const char *src, /* The UTF-8 string. */ int *chPtr) /* Filled with the Unicode value represented by * the UTF-8 string. */ { Tcl_UniChar uniChar = 0; Tcl_Size len = Tcl_UtfToUniChar(src, &uniChar); if ((uniChar & 0xFC00) == 0xD800) { Tcl_UniChar low = uniChar; /* This can only happen if src points to a character > U+FFFF */ Tcl_Size len2 = Tcl_UtfToUniChar(src+len, &low); if ((low & 0xFC00) == 0xDC00) { *chPtr = (((uniChar & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000; return len + len2; } } *chPtr = uniChar; return len; } /* *--------------------------------------------------------------------------- * * TkUniCharToUtf -- * * Almost the same as Tcl_UniCharToUtf but producing 2 x 3-byte UTF-8 * sequences for out-of-bmp characters when TCL_UTF_MAX==3. * So, up to 6 bytes might be produced. * * Results: * *buf is filled with the UTF-8 string, and the return value is the * number of bytes produced. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Size TkUniCharToUtf(int ch, char *buf) { if ((unsigned)(ch - 0x10000) <= 0xFFFFF) { /* Spit out a 4-byte UTF-8 character (Tcl 8.7+) or * 2 x 3-byte UTF-8 characters (Tcl 8.6) */ Tcl_Size len = Tcl_UniCharToUtf(0xD800 | ((ch - 0x10000) >> 10), buf); return len + Tcl_UniCharToUtf(0xDC00 | (ch & 0x7FF), buf + len); } return Tcl_UniCharToUtf(ch, buf); } #endif /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to generic/tkWindow.c.
︙ | ︙ | |||
884 885 886 887 888 889 890 | Tcl_InitHashTable(&mainPtr->imageTable, TCL_STRING_KEYS); mainPtr->strictMotif = 0; mainPtr->alwaysShowSelection = 0; mainPtr->tclUpdateObjProc = NULL; #if TCL_MAJOR_VERSION > 8 mainPtr->tclUpdateObjProc2 = NULL; #endif | | | | 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 | Tcl_InitHashTable(&mainPtr->imageTable, TCL_STRING_KEYS); mainPtr->strictMotif = 0; mainPtr->alwaysShowSelection = 0; mainPtr->tclUpdateObjProc = NULL; #if TCL_MAJOR_VERSION > 8 mainPtr->tclUpdateObjProc2 = NULL; #endif if (Tcl_LinkVar(interp, "tk_strictMotif", (char *)&mainPtr->strictMotif, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } if (Tcl_CreateNamespace(interp, "::tk", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::AlwaysShowSelection", (char *)&mainPtr->alwaysShowSelection, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } mainPtr->nextPtr = tsdPtr->mainWindowList; tsdPtr->mainWindowList = mainPtr; winPtr->mainPtr = mainPtr; hPtr = Tcl_CreateHashEntry(&mainPtr->nameTable, ".", &dummy); |
︙ | ︙ | |||
2944 2945 2946 2947 2948 2949 2950 | } #if defined(_WIN32) && !defined(STATIC_BUILD) static HMODULE tkcygwindll = NULL; /* | | | | | | | 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 | } #if defined(_WIN32) && !defined(STATIC_BUILD) static HMODULE tkcygwindll = NULL; /* * Run Tk_MainEx from libtk8.?.dll * * This function is only ever called from wish8.?.exe, the cygwin port of Tcl. * This means that the system encoding is utf-8, so we don't have to do any * encoding conversions. */ MODULE_SCOPE void TkCygwinMainEx( Tcl_Size argc, /* Number of arguments. */ char **argv, /* Array of argument strings. */ Tcl_AppInitProc *appInitProc, /* Application-specific initialization * procedure to call after most initialization * but before starting to execute commands. */ Tcl_Interp *interp) { WCHAR name[MAX_PATH]; size_t len; void (*tkmainex)(Tcl_Size, char **, Tcl_AppInitProc *, Tcl_Interp *); /* construct "<path>/libtk8.?.dll", from "<path>/tk8?.dll" */ len = GetModuleFileNameW((HINSTANCE)Tk_GetHINSTANCE(), name, MAX_PATH); name[len-2] = '.'; name[len-1] = name[len-5]; wcscpy(name+len, L".dll"); #if TCL_MAJOR_VERSION > 8 memcpy(name+len-12, L"libtcl9tk8", 10 * sizeof(WCHAR)); #else memcpy(name+len-8, L"libtk8", 6 * sizeof(WCHAR)); #endif tkcygwindll = LoadLibraryW(name); if (tkcygwindll) { tkmainex = (void (*)(Tcl_Size, char **, Tcl_AppInitProc *, Tcl_Interp *)) (void *)GetProcAddress(tkcygwindll, "Tk_MainEx"); if (tkmainex) { |
︙ | ︙ | |||
3173 3174 3175 3176 3177 3178 3179 | TCL_ARGV_AUTO_REST, TCL_ARGV_AUTO_HELP, TCL_ARGV_TABLE_END }; /* * Ensure that we are getting a compatible version of Tcl. */ | | | 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 | TCL_ARGV_AUTO_REST, TCL_ARGV_AUTO_HELP, TCL_ARGV_TABLE_END }; /* * Ensure that we are getting a compatible version of Tcl. */ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return TCL_ERROR; } /* * TIP #59: Make embedded configuration information available. */ |
︙ | ︙ | |||
3373 3374 3375 3376 3377 3378 3379 | } if (visualObj) { Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj("-visual", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(NULL, cmd, visualObj); visualObj = NULL; } | < < < < < < | < | 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 | } if (visualObj) { Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj("-visual", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(NULL, cmd, visualObj); visualObj = NULL; } code = TkListCreateFrame(NULL, interp, cmd, 1, nameObj); Tcl_DecrRefCount(cmd); if (code != TCL_OK) { goto done; } Tcl_ResetResult(interp); |
︙ | ︙ |
Changes to generic/ttk/ttk.decls.
︙ | ︙ | |||
139 140 141 142 143 144 145 | declare 35 { Tcl_Obj *Ttk_NewBoxObj(Ttk_Box box) } # # Utilities. # | | | | 139 140 141 142 143 144 145 146 147 148 149 150 | declare 35 { Tcl_Obj *Ttk_NewBoxObj(Ttk_Box box) } # # Utilities. # declare 40 {deprecated {}} { int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient) } |
Changes to generic/ttk/ttkButton.c.
︙ | ︙ | |||
225 226 227 228 229 230 231 | { Tcl_Obj *backgroundObj; Tcl_Obj *foregroundObj; Tcl_Obj *fontObj; Tcl_Obj *borderWidthObj; Tcl_Obj *reliefObj; Tcl_Obj *anchorObj; | < | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | { Tcl_Obj *backgroundObj; Tcl_Obj *foregroundObj; Tcl_Obj *fontObj; Tcl_Obj *borderWidthObj; Tcl_Obj *reliefObj; Tcl_Obj *anchorObj; Tcl_Obj *wrapLengthObj; } LabelPart; typedef struct { WidgetCore core; BasePart base; |
︙ | ︙ | |||
256 257 258 259 260 261 262 | TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL, offsetof(Label,label.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "w", offsetof(Label,label.anchorObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, | < < < | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL, offsetof(Label,label.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "w", offsetof(Label,label.anchorObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", NULL, offsetof(Label, label.wrapLengthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED /*SB: SIZE_CHANGED*/ }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; |
︙ | ︙ |
Changes to generic/ttk/ttkClamTheme.c.
︙ | ︙ | |||
545 546 547 548 549 550 551 | * * TODO: factor this with ThumbElementDraw */ typedef struct { Tcl_Obj *lightColorObj; Tcl_Obj *borderColorObj; | | | | | > | > | 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | * * TODO: factor this with ThumbElementDraw */ typedef struct { Tcl_Obj *lightColorObj; Tcl_Obj *borderColorObj; Tcl_Obj *gripCountObj; } GripElement; static const Ttk_ElementOptionSpec GripElementOptions[] = { { "-lightcolor", TK_OPTION_COLOR, offsetof(GripElement,lightColorObj), LIGHT_COLOR }, { "-bordercolor", TK_OPTION_COLOR, offsetof(GripElement,borderColorObj), DARKEST_COLOR }, { "-gripcount", TK_OPTION_PIXELS, offsetof(GripElement,gripCountObj), "5" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void GripElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { Ttk_Orient orient = (Ttk_Orient)PTR2INT(clientData); GripElement *grip = (GripElement *)elementRecord; int gripSize = 0; Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize); gripSize *= 2; if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = gripSize; } else { *heightPtr = gripSize; } } static void GripElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, TCL_UNUSED(Ttk_State)) { const int w = WIN32_XDRAWLINE_HACK; Ttk_Orient orient = (Ttk_Orient)PTR2INT(clientData); GripElement *grip = (GripElement *)elementRecord; GC lightGC = Ttk_GCForColor(tkwin,grip->lightColorObj,d); GC darkGC = Ttk_GCForColor(tkwin,grip->borderColorObj,d); int gripPad = 1, gripSize = 0; int i; Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize); gripSize *= 2; if (orient == TTK_ORIENT_HORIZONTAL) { int x = b.x + (b.width - gripSize) / 2; int y1 = b.y + gripPad, y2 = b.y + b.height - gripPad - 1 + w; for (i=0; i<gripSize; ++i) { XDrawLine(Tk_Display(tkwin), d, (i&1)?lightGC:darkGC, x,y1, x,y2); ++x; |
︙ | ︙ | |||
631 632 633 634 635 636 637 | Tcl_Obj *backgroundObj; Tcl_Obj *borderColorObj; Tcl_Obj *troughColorObj; Tcl_Obj *lightColorObj; Tcl_Obj *darkColorObj; Tcl_Obj *arrowColorObj; Tcl_Obj *arrowSizeObj; | | | | | 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | Tcl_Obj *backgroundObj; Tcl_Obj *borderColorObj; Tcl_Obj *troughColorObj; Tcl_Obj *lightColorObj; Tcl_Obj *darkColorObj; Tcl_Obj *arrowColorObj; Tcl_Obj *arrowSizeObj; Tcl_Obj *gripCountObj; Tcl_Obj *sliderlengthObj; } ScrollbarElement; static const Ttk_ElementOptionSpec ScrollbarElementOptions[] = { { "-orient", TK_OPTION_ANY, offsetof(ScrollbarElement, orientObj), "horizontal" }, { "-background", TK_OPTION_BORDER, offsetof(ScrollbarElement,backgroundObj), FRAME_COLOR }, { "-bordercolor", TK_OPTION_COLOR, offsetof(ScrollbarElement,borderColorObj), DARKEST_COLOR }, { "-troughcolor", TK_OPTION_COLOR, offsetof(ScrollbarElement,troughColorObj), DARKER_COLOR }, { "-lightcolor", TK_OPTION_COLOR, offsetof(ScrollbarElement,lightColorObj), LIGHT_COLOR }, { "-darkcolor", TK_OPTION_COLOR, offsetof(ScrollbarElement,darkColorObj), DARK_COLOR }, { "-arrowcolor", TK_OPTION_COLOR, offsetof(ScrollbarElement,arrowColorObj), "#000000" }, { "-arrowsize", TK_OPTION_PIXELS, offsetof(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) }, { "-gripcount", TK_OPTION_PIXELS, offsetof(ScrollbarElement,gripCountObj), "5" }, { "-sliderlength", TK_OPTION_PIXELS, offsetof(ScrollbarElement,sliderlengthObj), "30" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void TroughElementDraw( TCL_UNUSED(void *), /* clientData */ |
︙ | ︙ | |||
722 723 724 725 726 727 728 | XFillRectangle( Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), b.x+2, b.y+2, b.width-4, b.height-4); /* * Draw grip: */ | | | > | 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | XFillRectangle( Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), b.x+2, b.y+2, b.width-4, b.height-4); /* * Draw grip: */ TtkGetOrientFromObj(NULL, sb->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, sb->gripCountObj, &gripSize); gripSize *= 2; lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d); darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d); if (orient == TTK_ORIENT_HORIZONTAL) { dx = 1; dy = 0; x1 = x2 = b.x + (b.width - gripSize) / 2; y1 = b.y + 2; |
︙ | ︙ | |||
770 771 772 773 774 775 776 | TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; int length, thickness; Ttk_Orient orient; length = thickness = SCROLLBAR_THICKNESS; | | | 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; int length, thickness; Ttk_Orient orient; length = thickness = SCROLLBAR_THICKNESS; TtkGetOrientFromObj(NULL, sb->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, sb->sliderlengthObj, &length); if (orient == TTK_ORIENT_VERTICAL) { *heightPtr = length; *widthPtr = thickness; } else { *heightPtr = thickness; |
︙ | ︙ |
Changes to generic/ttk/ttkClassicTheme.c.
︙ | ︙ | |||
168 169 170 171 172 173 174 | { case TTK_BUTTON_DEFAULT_DISABLED : break; case TTK_BUTTON_DEFAULT_NORMAL : inset += round(5 * TkScalingLevel(tkwin)); break; case TTK_BUTTON_DEFAULT_ACTIVE : | | | | | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | { case TTK_BUTTON_DEFAULT_DISABLED : break; case TTK_BUTTON_DEFAULT_NORMAL : inset += round(5 * TkScalingLevel(tkwin)); break; case TTK_BUTTON_DEFAULT_ACTIVE : Tk_Draw3DRectangle(tkwin, d, border, b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset, 2, TK_RELIEF_FLAT); inset += 2; Tk_Draw3DRectangle(tkwin, d, border, b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset, 1, TK_RELIEF_SUNKEN); ++inset; Tk_Draw3DRectangle(tkwin, d, border, b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset, 2, TK_RELIEF_FLAT); inset += 2; break; } /* |
︙ | ︙ | |||
230 231 232 233 234 235 236 | static const Ttk_ElementOptionSpec IndicatorElementOptions[] = { { "-background", TK_OPTION_BORDER, offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, { "-indicatorcolor", TK_OPTION_BORDER, offsetof(IndicatorElement,colorObj), DEFAULT_BACKGROUND }, { "-indicatorrelief", TK_OPTION_RELIEF, offsetof(IndicatorElement,reliefObj), "raised" }, | | | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | static const Ttk_ElementOptionSpec IndicatorElementOptions[] = { { "-background", TK_OPTION_BORDER, offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, { "-indicatorcolor", TK_OPTION_BORDER, offsetof(IndicatorElement,colorObj), DEFAULT_BACKGROUND }, { "-indicatorrelief", TK_OPTION_RELIEF, offsetof(IndicatorElement,reliefObj), "raised" }, { "-indicatordiameter", TK_OPTION_PIXELS, offsetof(IndicatorElement,sizeObj), "9p" }, { "-indicatormargin", TK_OPTION_STRING, offsetof(IndicatorElement,marginObj), "0 2 4 2" }, { "-borderwidth", TK_OPTION_PIXELS, offsetof(IndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; |
︙ | ︙ | |||
590 591 592 593 594 595 596 | int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; int length, thickness; | | | 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; int length, thickness; TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->lengthObj, &length); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); switch (orient) { case TTK_ORIENT_VERTICAL: *widthPtr = thickness; *heightPtr = length; |
︙ | ︙ | |||
623 624 625 626 627 628 629 | Tk_3DBorder border = NULL; int relief = TK_RELIEF_RAISED, borderWidth = 2; Ttk_Orient orient; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); | | | 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 | Tk_3DBorder border = NULL; int relief = TK_RELIEF_RAISED, borderWidth = 2; Ttk_Orient orient; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, relief); if (relief != TK_RELIEF_FLAT) { if (orient == TTK_ORIENT_HORIZONTAL) { |
︙ | ︙ | |||
801 802 803 804 805 806 807 | * +++ Widget layouts. */ TTK_BEGIN_LAYOUT_TABLE(LayoutTable) TTK_LAYOUT("TButton", TTK_GROUP("Button.highlight", TTK_FILL_BOTH, | | | | | | | | | | | | | | | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | * +++ Widget layouts. */ TTK_BEGIN_LAYOUT_TABLE(LayoutTable) TTK_LAYOUT("TButton", TTK_GROUP("Button.highlight", TTK_FILL_BOTH, TTK_GROUP("Button.border", TTK_FILL_BOTH|TTK_BORDER, TTK_GROUP("Button.padding", TTK_FILL_BOTH, TTK_NODE("Button.label", TTK_FILL_BOTH))))) TTK_LAYOUT("TCheckbutton", TTK_GROUP("Checkbutton.highlight", TTK_FILL_BOTH, TTK_GROUP("Checkbutton.border", TTK_FILL_BOTH, TTK_GROUP("Checkbutton.padding", TTK_FILL_BOTH, TTK_NODE("Checkbutton.indicator", TTK_PACK_LEFT) TTK_NODE("Checkbutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH))))) TTK_LAYOUT("TRadiobutton", TTK_GROUP("Radiobutton.highlight", TTK_FILL_BOTH, TTK_GROUP("Radiobutton.border", TTK_FILL_BOTH, TTK_GROUP("Radiobutton.padding", TTK_FILL_BOTH, TTK_NODE("Radiobutton.indicator", TTK_PACK_LEFT) TTK_NODE("Radiobutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH))))) TTK_LAYOUT("TMenubutton", TTK_GROUP("Menubutton.highlight", TTK_FILL_BOTH, TTK_GROUP("Menubutton.border", TTK_FILL_BOTH, TTK_NODE("Menubutton.indicator", TTK_PACK_RIGHT) TTK_GROUP("Menubutton.padding", TTK_FILL_X, TTK_NODE("Menubutton.label", 0))))) /* "classic" entry, includes highlight border */ TTK_LAYOUT("TEntry", TTK_GROUP("Entry.highlight", TTK_FILL_BOTH, TTK_GROUP("Entry.field", TTK_FILL_BOTH|TTK_BORDER, TTK_GROUP("Entry.padding", TTK_FILL_BOTH, TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))) /* "classic" combobox, includes highlight border */ TTK_LAYOUT("TCombobox", TTK_GROUP("Combobox.highlight", TTK_FILL_BOTH, TTK_GROUP("Combobox.field", TTK_FILL_BOTH, TTK_NODE("Combobox.downarrow", TTK_PACK_RIGHT|TTK_FILL_Y) TTK_GROUP("Combobox.padding", TTK_FILL_BOTH, TTK_NODE("Combobox.textarea", TTK_FILL_BOTH))))) /* "classic" spinbox, includes highlight border */ TTK_LAYOUT("TSpinbox", TTK_GROUP("Spinbox.highlight", TTK_FILL_BOTH, TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X, TTK_GROUP("null", TTK_PACK_RIGHT, TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) TTK_GROUP("Spinbox.padding", TTK_FILL_BOTH, TTK_NODE("Spinbox.textarea", TTK_FILL_BOTH))))) /* "classic" scale, includes highlight border */ |
︙ | ︙ |
Changes to generic/ttk/ttkDecls.h.
︙ | ︙ | |||
9 10 11 12 13 14 15 | extern const char *TtkInitializeStubs( Tcl_Interp *, const char *version, int epoch, int revision); #define Ttk_InitStubs(interp) TtkInitializeStubs( \ interp, TTK_VERSION, TTK_STUBS_EPOCH, TTK_STUBS_REVISION) #else | > > > | > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | extern const char *TtkInitializeStubs( Tcl_Interp *, const char *version, int epoch, int revision); #define Ttk_InitStubs(interp) TtkInitializeStubs( \ interp, TTK_VERSION, TTK_STUBS_EPOCH, TTK_STUBS_REVISION) #else #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 # define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "Ttk", TTK_VERSION, 0, NULL) #else # define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL) #endif #endif #if !defined(BUILD_tk) # define TTK_DEPRECATED(msg) TTKAPI TCL_DEPRECATED_API(msg) #elif defined(TK_NO_DEPRECATED) # define TTK_DEPRECATED(msg) MODULE_SCOPE |
︙ | ︙ | |||
135 136 137 138 139 140 141 | /* 35 */ TTKAPI Tcl_Obj * Ttk_NewBoxObj(Ttk_Box box); /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* Slot 38 is reserved */ /* Slot 39 is reserved */ /* 40 */ | > | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | /* 35 */ TTKAPI Tcl_Obj * Ttk_NewBoxObj(Ttk_Box box); /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* Slot 38 is reserved */ /* Slot 39 is reserved */ /* 40 */ TTK_DEPRECATED("") int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient); typedef struct TtkStubs { int magic; int epoch; int revision; void *hooks; |
︙ | ︙ | |||
184 185 186 187 188 189 190 | Ttk_Box (*ttk_ExpandBox) (Ttk_Box b, Ttk_Padding p); /* 33 */ Ttk_Box (*ttk_PlaceBox) (Ttk_Box *cavity, int w, int h, Ttk_Side side, Ttk_Sticky sticky); /* 34 */ Tcl_Obj * (*ttk_NewBoxObj) (Ttk_Box box); /* 35 */ void (*reserved36)(void); void (*reserved37)(void); void (*reserved38)(void); void (*reserved39)(void); | | | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | Ttk_Box (*ttk_ExpandBox) (Ttk_Box b, Ttk_Padding p); /* 33 */ Ttk_Box (*ttk_PlaceBox) (Ttk_Box *cavity, int w, int h, Ttk_Side side, Ttk_Sticky sticky); /* 34 */ Tcl_Obj * (*ttk_NewBoxObj) (Ttk_Box box); /* 35 */ void (*reserved36)(void); void (*reserved37)(void); void (*reserved38)(void); void (*reserved39)(void); TCL_DEPRECATED_API("") int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient); /* 40 */ } TtkStubs; extern const TtkStubs *ttkStubsPtr; #ifdef __cplusplus } #endif |
︙ | ︙ |
Changes to generic/ttk/ttkDefaultTheme.c.
︙ | ︙ | |||
1059 1060 1061 1062 1063 1064 1065 | TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumb = (ThumbElement *)elementRecord; Ttk_Orient orient; int size; Tk_GetPixelsFromObj(NULL, tkwin, thumb->sizeObj, &size); | | | 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 | TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumb = (ThumbElement *)elementRecord; Ttk_Orient orient; int size; Tk_GetPixelsFromObj(NULL, tkwin, thumb->sizeObj, &size); TtkGetOrientFromObj(NULL, thumb->orientObj, &orient); if (orient == TTK_ORIENT_VERTICAL) { *widthPtr = size; *heightPtr = MIN_THUMB_SIZE; } else { *widthPtr = MIN_THUMB_SIZE; *heightPtr = size; |
︙ | ︙ | |||
1154 1155 1156 1157 1158 1159 1160 | int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; int thickness, borderWidth; | | | 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 | int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; int thickness, borderWidth; TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); switch (orient) { case TTK_ORIENT_VERTICAL: *widthPtr = thickness + (borderWidth *2); *heightPtr = *widthPtr/2; |
︙ | ︙ | |||
1213 1214 1215 1216 1217 1218 1219 | Tcl_Obj *marginObj; Tcl_Obj *sizeObj; } TreeitemIndicator; static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, | | | | | | | 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 | Tcl_Obj *marginObj; Tcl_Obj *sizeObj; } TreeitemIndicator; static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, { "-diameter", TK_OPTION_PIXELS, offsetof(TreeitemIndicator,sizeObj), "6.75p" }, { "-indicatormargins", TK_OPTION_STRING, offsetof(TreeitemIndicator,marginObj), "2 2 4 2" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void TreeitemIndicatorSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { TreeitemIndicator *indicator = (TreeitemIndicator *)elementRecord; int diameter = 0; Ttk_Padding margins; Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &diameter); Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); *widthPtr = diameter + Ttk_PaddingWidth(margins); *heightPtr = diameter + Ttk_PaddingHeight(margins); } static void TreeitemIndicatorDraw( TCL_UNUSED(void *), /* clientData */ void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { |
︙ | ︙ |
Changes to generic/ttk/ttkElements.c.
︙ | ︙ | |||
81 82 83 84 85 86 87 | void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, TCL_UNUSED(Ttk_State)) { BackgroundElement *bg = (BackgroundElement *)elementRecord; | | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, TCL_UNUSED(Ttk_State)) { BackgroundElement *bg = (BackgroundElement *)elementRecord; Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin, bg->backgroundObj); XFillRectangle(Tk_Display(tkwin), d, Tk_3DBorderGC(tkwin, backgroundPtr, TK_3D_FLAT_GC), b.x, b.y, b.width, b.height); } static void BackgroundElementDraw( |
︙ | ︙ | |||
336 337 338 339 340 341 342 | PaddingElement *padding = (PaddingElement *)elementRecord; int shiftRelief = 0; int relief = TK_RELIEF_FLAT; Ttk_Padding pad; Tk_GetReliefFromObj(NULL, padding->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, padding->shiftreliefObj, &shiftRelief); | | | 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | PaddingElement *padding = (PaddingElement *)elementRecord; int shiftRelief = 0; int relief = TK_RELIEF_FLAT; Ttk_Padding pad; Tk_GetReliefFromObj(NULL, padding->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, padding->shiftreliefObj, &shiftRelief); Ttk_GetPaddingFromObj(NULL, tkwin, padding->paddingObj, &pad); *paddingPtr = Ttk_RelievePadding(pad, relief, shiftRelief); } static const Ttk_ElementSpec PaddingElementSpec = { TK_STYLE_VERSION_2, sizeof(PaddingElement), PaddingElementOptions, |
︙ | ︙ | |||
389 390 391 392 393 394 395 | gc = Tk_GetGC(tkwin, mask, &gcvalues); XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); Tk_FreeGC(Tk_Display(tkwin), gc); } static const Ttk_ElementOptionSpec FocusElementOptions[] = { | | | | | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | gc = Tk_GetGC(tkwin, mask, &gcvalues); XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); Tk_FreeGC(Tk_Display(tkwin), gc); } static const Ttk_ElementOptionSpec FocusElementOptions[] = { { "-focuscolor", TK_OPTION_COLOR, offsetof(FocusElement,focusColorObj), "black" }, { "-focusthickness", TK_OPTION_PIXELS, offsetof(FocusElement,focusThicknessObj), "1" }, { "-focussolid", TK_OPTION_BOOLEAN, offsetof(FocusElement,focusSolidObj), "0" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void FocusElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, |
︙ | ︙ | |||
513 514 515 516 517 518 519 | static void GeneralSeparatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { SeparatorElement *separator = (SeparatorElement *)elementRecord; Ttk_Orient orient; | | | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | static void GeneralSeparatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { SeparatorElement *separator = (SeparatorElement *)elementRecord; Ttk_Orient orient; TtkGetOrientFromObj(NULL, separator->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: HorizontalSeparatorElementDraw( clientData, elementRecord, tkwin, d, b, state); break; case TTK_ORIENT_VERTICAL: VerticalSeparatorElementDraw( |
︙ | ︙ | |||
564 565 566 567 568 569 570 | } SizegripElement; static const Ttk_ElementOptionSpec SizegripOptions[] = { { "-background", TK_OPTION_BORDER, offsetof(SizegripElement,backgroundObj), DEFAULT_BACKGROUND }, { "-gripsize", TK_OPTION_PIXELS, offsetof(SizegripElement,gripSizeObj), "11.25p" }, | | | 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | } SizegripElement; static const Ttk_ElementOptionSpec SizegripOptions[] = { { "-background", TK_OPTION_BORDER, offsetof(SizegripElement,backgroundObj), DEFAULT_BACKGROUND }, { "-gripsize", TK_OPTION_PIXELS, offsetof(SizegripElement,gripSizeObj), "11.25p" }, {0, TK_OPTION_BOOLEAN, 0, 0} }; static void SizegripSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, Tk_Window tkwin, int *widthPtr, |
︙ | ︙ | |||
604 605 606 607 608 609 610 | Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize); gripThickness = gripSize * 3 / (gripCount * 5); gripSpace = gripSize / 3 - gripThickness; while (gripCount--) { x1 -= gripSpace; y2 -= gripSpace; for (int i = 1; i < gripThickness; i++) { | | | | 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 | Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize); gripThickness = gripSize * 3 / (gripCount * 5); gripSpace = gripSize / 3 - gripThickness; while (gripCount--) { x1 -= gripSpace; y2 -= gripSpace; for (int i = 1; i < gripThickness; i++) { XDrawLine(Tk_Display(tkwin), d, darkGC, x1,y1, x2,y2); --x1; --y2; } XDrawLine(Tk_Display(tkwin), d, lightGC, x1,y1, x2,y2); --x1; --y2; } } static const Ttk_ElementSpec SizegripElementSpec = { TK_STYLE_VERSION_2, sizeof(SizegripElement), SizegripOptions, |
︙ | ︙ | |||
916 917 918 919 920 921 922 | { "-borderwidth", TK_OPTION_PIXELS, offsetof(ArrowElement,borderWidthObj), "1" }, { "-relief", TK_OPTION_RELIEF, offsetof(ArrowElement,reliefObj), "raised"}, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; | | | 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | { "-borderwidth", TK_OPTION_PIXELS, offsetof(ArrowElement,borderWidthObj), "1" }, { "-relief", TK_OPTION_RELIEF, offsetof(ArrowElement,reliefObj), "raised"}, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static const Ttk_Padding ArrowPadding = { 3, 3, 3, 3 }; static void ArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { ArrowElement *arrow = (ArrowElement *)elementRecord; |
︙ | ︙ | |||
1223 1224 1225 1226 1227 1228 1229 | int borderWidth = 1, grooveWidth = -1, relief = TK_RELIEF_SUNKEN; Ttk_Orient orient; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->grooveWidthObj, &grooveWidth); Tk_GetReliefFromObj(NULL, troughPtr->reliefObj, &relief); | | | 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 | int borderWidth = 1, grooveWidth = -1, relief = TK_RELIEF_SUNKEN; Ttk_Orient orient; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->grooveWidthObj, &grooveWidth); Tk_GetReliefFromObj(NULL, troughPtr->reliefObj, &relief); TtkGetOrientFromObj(NULL, troughPtr->orientObj, &orient); if (grooveWidth > 0 && grooveWidth < b.height && grooveWidth < b.width) { if (orient == TTK_ORIENT_HORIZONTAL) { b.y += (b.height - grooveWidth) / 2; b.height = grooveWidth; } else { b.x += (b.width - grooveWidth) / 2; |
︙ | ︙ | |||
1297 1298 1299 1300 1301 1302 1303 | TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumb = (ThumbElement *)elementRecord; Ttk_Orient orient; int thickness; Tk_GetPixelsFromObj(NULL, tkwin, thumb->thicknessObj, &thickness); | | | 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 | TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumb = (ThumbElement *)elementRecord; Ttk_Orient orient; int thickness; Tk_GetPixelsFromObj(NULL, tkwin, thumb->thicknessObj, &thickness); TtkGetOrientFromObj(NULL, thumb->orientObj, &orient); if (orient == TTK_ORIENT_VERTICAL) { *widthPtr = thickness; *heightPtr = MIN_THUMB_SIZE; } else { *widthPtr = MIN_THUMB_SIZE; *heightPtr = thickness; |
︙ | ︙ | |||
1428 1429 1430 1431 1432 1433 1434 | } /* * Fill the thin trough area preceding the * slider's center with the inner color */ if (mainInfoPtr != NULL) { | | | 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | } /* * Fill the thin trough area preceding the * slider's center with the inner color */ if (mainInfoPtr != NULL) { TtkGetOrientFromObj(NULL, slider->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: XFillRectangle(disp, d, gc, mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY, b.x + dim/2 - 1, mainInfoPtr->troughInnerHeight); break; case TTK_ORIENT_VERTICAL: |
︙ | ︙ | |||
1567 1568 1569 1570 1571 1572 1573 | int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { PbarElement *pbar = (PbarElement *)elementRecord; Ttk_Orient orient; int thickness = 15, length = 30, borderWidth = 2; | | | 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 | int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { PbarElement *pbar = (PbarElement *)elementRecord; Ttk_Orient orient; int thickness = 15, length = 30, borderWidth = 2; TtkGetOrientFromObj(NULL, pbar->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, pbar->thicknessObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, pbar->lengthObj, &length); Tk_GetPixelsFromObj(NULL, tkwin, pbar->borderWidthObj, &borderWidth); switch (orient) { case TTK_ORIENT_HORIZONTAL: *widthPtr = length + 2 * borderWidth; |
︙ | ︙ | |||
1630 1631 1632 1633 1634 1635 1636 | offsetof(TabElement,borderWidthObj), "1" }, { "-background", TK_OPTION_BORDER, offsetof(TabElement,backgroundObj), DEFAULT_BACKGROUND }, { "-highlight", TK_OPTION_BOOLEAN, offsetof(TabElement,highlightObj), "0" }, { "-highlightcolor", TK_OPTION_COLOR, offsetof(TabElement,highlightColorObj), "#4a6984" }, | | | 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 | offsetof(TabElement,borderWidthObj), "1" }, { "-background", TK_OPTION_BORDER, offsetof(TabElement,backgroundObj), DEFAULT_BACKGROUND }, { "-highlight", TK_OPTION_BOOLEAN, offsetof(TabElement,highlightObj), "0" }, { "-highlightcolor", TK_OPTION_COLOR, offsetof(TabElement,highlightColorObj), "#4a6984" }, {0, TK_OPTION_BOOLEAN, 0, 0} }; static void TabElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ |
︙ | ︙ | |||
1865 1866 1867 1868 1869 1870 1871 | ClientElement *ce = (ClientElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj); int borderWidth = 1; Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, | | | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 | ClientElement *ce = (ClientElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj); int borderWidth = 1; Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED); } static const Ttk_ElementSpec ClientElementSpec = { TK_STYLE_VERSION_2, sizeof(ClientElement), ClientElementOptions, ClientElementSize, |
︙ | ︙ | |||
1890 1891 1892 1893 1894 1895 1896 | { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); /* * Elements: */ Ttk_RegisterElement(interp, theme, "background", | | | 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 | { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); /* * Elements: */ Ttk_RegisterElement(interp, theme, "background", &BackgroundElementSpec, NULL); Ttk_RegisterElement(interp, theme, "fill", &FillElementSpec, NULL); Ttk_RegisterElement(interp, theme, "border", &BorderElementSpec, NULL); Ttk_RegisterElement(interp, theme, "field", &FieldElementSpec, NULL); Ttk_RegisterElement(interp, theme, "focus", &FocusElementSpec, NULL); Ttk_RegisterElement(interp, theme, "padding", &PaddingElementSpec, NULL); |
︙ | ︙ |
Changes to generic/ttk/ttkEntry.c.
︙ | ︙ | |||
296 297 298 299 300 301 302 | static char *EntryDisplayString(const char *showChar, int numChars) { char *displayString, *p; int size; int ch; char buf[6]; | | | | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | static char *EntryDisplayString(const char *showChar, int numChars) { char *displayString, *p; int size; int ch; char buf[6]; TkUtfToUniChar(showChar, &ch); size = TkUniCharToUtf(ch, buf); p = displayString = (char *)ckalloc(numChars * size + 1); while (numChars--) { memcpy(p, buf, size); p += size; } *p = '\0'; |
︙ | ︙ | |||
365 366 367 368 369 370 371 | if (entryPtr->entry.selectFirst < 0 || (!entryPtr->entry.exportSelection) || Tcl_IsSafe(entryPtr->core.interp)) { return TCL_INDEX_NONE; } string = entryPtr->entry.displayString; | | | | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | if (entryPtr->entry.selectFirst < 0 || (!entryPtr->entry.exportSelection) || Tcl_IsSafe(entryPtr->core.interp)) { return TCL_INDEX_NONE; } string = entryPtr->entry.displayString; selStart = TkUtfAtIndex(string, entryPtr->entry.selectFirst); selEnd = TkUtfAtIndex(selStart, entryPtr->entry.selectLast - entryPtr->entry.selectFirst); if (selEnd <= selStart + offset) { return 0; } byteCount = selEnd - selStart - offset; if (byteCount > maxBytes) { /* @@@POSSIBLE BUG: Can transfer partial UTF-8 sequences. Is this OK? */ |
︙ | ︙ | |||
454 455 456 457 458 459 460 | templ = string; } /* There's a percent sequence here. Process it. */ ++templ; /* skip over % */ if (*templ != '\0') { | | | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | templ = string; } /* There's a percent sequence here. Process it. */ ++templ; /* skip over % */ if (*templ != '\0') { templ += TkUtfToUniChar(templ, &ch); } else { ch = '%'; } stringLength = -1; switch (ch) { case 'd': /* Type of call that caused validation */ |
︙ | ︙ | |||
484 485 486 487 488 489 490 | string = newValue; break; case 's': /* Current string value */ string = entryPtr->entry.string; break; case 'S': /* string to be inserted/deleted, if any */ if (reason == VALIDATE_INSERT) { | | | | | | | 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | string = newValue; break; case 's': /* Current string value */ string = entryPtr->entry.string; break; case 'S': /* string to be inserted/deleted, if any */ if (reason == VALIDATE_INSERT) { string = TkUtfAtIndex(newValue, index); stringLength = TkUtfAtIndex(string, count) - string; } else if (reason == VALIDATE_DELETE) { string = TkUtfAtIndex(entryPtr->entry.string, index); stringLength = TkUtfAtIndex(string, count) - string; } else { string = ""; stringLength = 0; } break; case 'v': /* type of validation currently set */ string = validateStrings[entryPtr->entry.validate]; break; case 'V': /* type of validation in effect */ string = validateReasonStrings[reason]; break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->core.tkwin); break; default: length = TkUniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; } spaceNeeded = Tcl_ScanCountedElement(string, stringLength, &cvtFlags); length = Tcl_DStringLength(dsPtr); |
︙ | ︙ | |||
736 737 738 739 740 741 742 | * * See also: EntrySetValue(). */ static void EntryStoreValue(Entry *entryPtr, const char *value) { size_t numBytes = strlen(value); | | | 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | * * See also: EntrySetValue(). */ static void EntryStoreValue(Entry *entryPtr, const char *value) { size_t numBytes = strlen(value); Tcl_Size numChars = TkNumUtfChars(value, numBytes); if (entryPtr->core.flags & VALIDATING) entryPtr->core.flags |= VALIDATION_SET_VALUE; /* Make sure all indices remain in bounds: */ if (numChars < entryPtr->entry.numChars) |
︙ | ︙ | |||
841 842 843 844 845 846 847 | static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ Tcl_Size index, /* Insert before this index */ const char *value) /* New characters to add */ { char *string = entryPtr->entry.string; | | | | 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 | static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ Tcl_Size index, /* Insert before this index */ const char *value) /* New characters to add */ { char *string = entryPtr->entry.string; size_t byteIndex = TkUtfAtIndex(string, index) - string; size_t byteCount = strlen(value); int charsAdded = TkNumUtfChars(value, byteCount); size_t newByteCount = entryPtr->entry.numBytes + byteCount + 1; char *newBytes; int code; if (byteCount == 0) { return TCL_OK; } |
︙ | ︙ | |||
895 896 897 898 899 900 901 | if (count + index > entryPtr->entry.numChars) { count = entryPtr->entry.numChars - index; } if (count <= 0) { return TCL_OK; } | | | | 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 | if (count + index > entryPtr->entry.numChars) { count = entryPtr->entry.numChars - index; } if (count <= 0) { return TCL_OK; } byteIndex = TkUtfAtIndex(string, index) - string; byteCount = TkUtfAtIndex(string+byteIndex, count) - (string+byteIndex); newByteCount = entryPtr->entry.numBytes + 1 - byteCount; newBytes = (char *)ckalloc(newByteCount); memcpy(newBytes, string, byteIndex); strcpy(newBytes + byteIndex, string + byteIndex + byteCount); code = EntryValidateChange( |
︙ | ︙ | |||
1315 1316 1317 1318 1319 1320 1321 | } /* Draw the text: */ if ((*(entryPtr->entry.displayString) == '\0') && (entryPtr->entry.placeholderObj != NULL)) { /* No text displayed, but -placeholder is given */ | | | 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 | } /* Draw the text: */ if ((*(entryPtr->entry.displayString) == '\0') && (entryPtr->entry.placeholderObj != NULL)) { /* No text displayed, but -placeholder is given */ if (TkGetCharLength(es.placeholderForegroundObj) > 0) { foregroundObj = es.placeholderForegroundObj; } else { foregroundObj = es.foregroundObj; } /* Use placeholder text width */ leftIndex = 0; (void)Tcl_GetStringFromObj(entryPtr->entry.placeholderObj, &rightIndex); |
︙ | ︙ |
Changes to generic/ttk/ttkInit.c.
︙ | ︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | * Legal values for the -orient option. * See also: enum Ttk_Orient. */ const char *const ttkOrientStrings[] = { "horizontal", "vertical", NULL }; int Ttk_GetOrientFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr) { int orient = (int)TTK_ORIENT_HORIZONTAL; int result = Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings, "orientation", 0, &orient); *resultPtr = (Ttk_Orient)orient; | > > > > > > > > > > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | * Legal values for the -orient option. * See also: enum Ttk_Orient. */ const char *const ttkOrientStrings[] = { "horizontal", "vertical", NULL }; #if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9 int Ttk_GetOrientFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr) { *resultPtr = TTK_ORIENT_HORIZONTAL; return Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings, "orientation", 0, resultPtr); } #endif int TtkGetOrientFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr) { int orient = (int)TTK_ORIENT_HORIZONTAL; int result = Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings, "orientation", 0, &orient); *resultPtr = (Ttk_Orient)orient; |
︙ | ︙ |
Changes to generic/ttk/ttkLabel.c.
︙ | ︙ | |||
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | { "-text", TK_OPTION_STRING, offsetof(TextElement,textObj), "" }, { "-font", TK_OPTION_FONT, offsetof(TextElement,fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, offsetof(TextElement,foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, offsetof(TextElement,underlineObj), NULL}, { "-width", TK_OPTION_INT, offsetof(TextElement,widthObj), "-1"}, { "-anchor", TK_OPTION_ANCHOR, offsetof(TextElement,anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, offsetof(TextElement,justifyObj), "left" }, { "-wraplength", TK_OPTION_PIXELS, | > > > > | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | { "-text", TK_OPTION_STRING, offsetof(TextElement,textObj), "" }, { "-font", TK_OPTION_FONT, offsetof(TextElement,fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, offsetof(TextElement,foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) offsetof(TextElement,underlineObj), "-1"}, #else offsetof(TextElement,underlineObj), NULL}, #endif { "-width", TK_OPTION_INT, offsetof(TextElement,widthObj), "-1"}, { "-anchor", TK_OPTION_ANCHOR, offsetof(TextElement,anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, offsetof(TextElement,justifyObj), "left" }, { "-wraplength", TK_OPTION_PIXELS, |
︙ | ︙ | |||
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | { "-text", TK_OPTION_STRING, offsetof(LabelElement,text.textObj), "" }, { "-font", TK_OPTION_FONT, offsetof(LabelElement,text.fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, offsetof(LabelElement,text.foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, offsetof(LabelElement,text.underlineObj), "-1"}, { "-width", TK_OPTION_INT, offsetof(LabelElement,text.widthObj), ""}, { "-anchor", TK_OPTION_ANCHOR, offsetof(LabelElement,text.anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, offsetof(LabelElement,text.justifyObj), "left" }, { "-wraplength", TK_OPTION_PIXELS, | > > > > | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | { "-text", TK_OPTION_STRING, offsetof(LabelElement,text.textObj), "" }, { "-font", TK_OPTION_FONT, offsetof(LabelElement,text.fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, offsetof(LabelElement,text.foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) offsetof(LabelElement,text.underlineObj), "-1"}, #else offsetof(LabelElement,text.underlineObj), NULL}, #endif { "-width", TK_OPTION_INT, offsetof(LabelElement,text.widthObj), ""}, { "-anchor", TK_OPTION_ANCHOR, offsetof(LabelElement,text.anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, offsetof(LabelElement,text.justifyObj), "left" }, { "-wraplength", TK_OPTION_PIXELS, |
︙ | ︙ |
Changes to generic/ttk/ttkManager.c.
︙ | ︙ | |||
430 431 432 433 434 435 436 | Tcl_Size index; for (index = 0; index < mgr->nContent; ++index) if (mgr->content[index]->window == window) return index; return -1; } | | > > > > | | > > > > > | | | 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | Tcl_Size index; for (index = 0; index < mgr->nContent; ++index) if (mgr->content[index]->window == window) return index; return -1; } /* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, lastOK, indexPtr) -- * Return the index of the content window specified by objPtr. * Content windows may be specified as an integer index or * as the name of the managed window. * * The parameter lastOK should be non-0 if the resolved index can be equal to * the current size (i.e. one more than the current highest index) and 0 * otherwise. * * Returns: * Standard Tcl completion code. Leaves an error message in case of error. */ int Ttk_GetContentIndexFromObj( Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr) { const char *string = Tcl_GetString(objPtr); Tcl_Size index = 0; Tk_Window tkwin; /* Try interpreting as an integer first: */ if (TkGetIntForIndex(objPtr, mgr->nContent - 1, lastOK, &index) == TCL_OK) { /* * Note despite passing lastOK above, we still need to check here * as well as TkGetIntForIndex only uses lastOK for end-relative indices, * not integers. */ if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Managed window index \"%s\" out of bounds", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); return TCL_ERROR; } *indexPtr = index; return TCL_OK; } |
︙ | ︙ |
Changes to generic/ttk/ttkManager.h.
︙ | ︙ | |||
77 78 79 80 81 82 83 | */ #define Ttk_SlaveIndex Ttk_ContentIndex MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); /* Returns: index in content array of specified window, TCL_INDEX_NONE if not found */ #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | */ #define Ttk_SlaveIndex Ttk_ContentIndex MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); /* Returns: index in content array of specified window, TCL_INDEX_NONE if not found */ #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, int lastOK, Tcl_Size *indexPtr); /* Accessor functions: */ #define Ttk_NumberSlaves Ttk_NumberContent MODULE_SCOPE Tcl_Size Ttk_NumberContent(Ttk_Manager *); /* Returns: number of managed content windows */ |
︙ | ︙ |
Changes to generic/ttk/ttkNotebook.c.
︙ | ︙ | |||
364 365 366 367 368 369 370 | for (i = 0; i < Ttk_NumberContent(nb->notebook.mgr); ++i) { Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, i); Ttk_State tabState = TabState(nb,i); Ttk_RebindSublayout(tabLayout, tab); Ttk_LayoutSize(tabLayout,tabState,&tab->width,&tab->height); | | | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | for (i = 0; i < Ttk_NumberContent(nb->notebook.mgr); ++i) { Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, i); Ttk_State tabState = TabState(nb,i); Ttk_RebindSublayout(tabLayout, tab); Ttk_LayoutSize(tabLayout,tabState,&tab->width,&tab->height); tab->width = MAX(tab->width, minTabWidth); if (orient == TTK_ORIENT_HORIZONTAL) { tabrowHeight = MAX(tabrowHeight, tab->height); if (tab->state != TAB_STATE_HIDDEN) { tabrowWidth += tab->width; } } else { tabrowWidth = MAX(tabrowWidth, tab->width); if (tab->state != TAB_STATE_HIDDEN) { tabrowHeight += tab->height; } |
︙ | ︙ | |||
859 860 861 862 863 864 865 | *index_rtn = nb->notebook.currentIndex; return TCL_OK; } /* ... or integer index or content window name: */ if (Ttk_GetContentIndexFromObj( | | | 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | *index_rtn = nb->notebook.currentIndex; return TCL_OK; } /* ... or integer index or content window name: */ if (Ttk_GetContentIndexFromObj( interp, nb->notebook.mgr, objPtr, 1, index_rtn) == TCL_OK) { return TCL_OK; } if (*index_rtn == Ttk_NumberContent(nb->notebook.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Invalid tab specification %s", string)); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "SPEC", NULL); |
︙ | ︙ | |||
886 887 888 889 890 891 892 | */ static int GetTabIndex( Tcl_Interp *interp, Notebook *nb, Tcl_Obj *objPtr, Tcl_Size *index_rtn) { int status = FindTabIndex(interp, nb, objPtr, index_rtn); if (status == TCL_OK && *index_rtn >= Ttk_NumberContent(nb->notebook.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( | | | | 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 | */ static int GetTabIndex( Tcl_Interp *interp, Notebook *nb, Tcl_Obj *objPtr, Tcl_Size *index_rtn) { int status = FindTabIndex(interp, nb, objPtr, index_rtn); if (status == TCL_OK && *index_rtn >= Ttk_NumberContent(nb->notebook.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Tab index \"%s\" out of bounds", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "INDEX", NULL); return TCL_ERROR; } if (status == TCL_OK && *index_rtn < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Tab '%s' not found", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "TAB", NULL); status = TCL_ERROR; } return status; } /*------------------------------------------------------------------------ |
︙ | ︙ | |||
958 959 960 961 962 963 964 | Tcl_Size srcIndex, destIndex; if (objc < 4) { Tcl_WrongNumArgs(interp, 2,objv, "index window ?-option value ...?"); return TCL_ERROR; } | < < < < < > > > > | > > > > > | 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | Tcl_Size srcIndex, destIndex; if (objc < 4) { Tcl_WrongNumArgs(interp, 2,objv, "index window ?-option value ...?"); return TCL_ERROR; } if (Tcl_GetString(objv[3])[0] == '.') { /* Window name -- could be new or existing content window. */ Tk_Window window = Tk_NameToWindow(interp,Tcl_GetString(objv[3]),nb->core.tkwin); if (!window) { return TCL_ERROR; } srcIndex = Ttk_ContentIndex(nb->notebook.mgr, window); if (srcIndex < 0) { /* New content window */ if (TCL_OK != Ttk_GetContentIndexFromObj( interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( interp, nb->notebook.mgr, objv[3], 0, &srcIndex) != TCL_OK) { return TCL_ERROR; } else if (srcIndex >= Ttk_NumberContent(nb->notebook.mgr)) { srcIndex = Ttk_NumberContent(nb->notebook.mgr) - 1; } if (TCL_OK != Ttk_GetContentIndexFromObj( interp, nb->notebook.mgr, objv[2], 0, &destIndex)) { return TCL_ERROR; } /* Move existing content window: */ if (ConfigureTab(interp, nb, (Tab *)Ttk_ContentData(nb->notebook.mgr, srcIndex), Ttk_ContentWindow(nb->notebook.mgr, srcIndex), objc-4,objv+4) != TCL_OK) |
︙ | ︙ | |||
1064 1065 1066 1067 1068 1069 1070 | } tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); tab->state = TAB_STATE_HIDDEN; if (index == nb->notebook.currentIndex) { SelectNearestTab(nb); } else { | | | 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 | } tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); tab->state = TAB_STATE_HIDDEN; if (index == nb->notebook.currentIndex) { SelectNearestTab(nb); } else { TtkRedisplayWidget(&nb->core); } return TCL_OK; } /* $nb identify $x $y -- * Returns name of tab element at $x,$y; empty string if none. |
︙ | ︙ | |||
1118 1119 1120 1121 1122 1123 1124 | if (element) { const char *elementName = Ttk_ElementName(element); Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); } break; case IDENTIFY_TAB: | > | > | < | 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 | if (element) { const char *elementName = Ttk_ElementName(element); Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); } break; case IDENTIFY_TAB: #if !defined TK_NO_DEPRECATED && (TCL_MAJOR_VERSION < 9) if (tabIndex >= 0) #endif Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex)); break; } return TCL_OK; } /* $nb index $item -- * Returns the integer index of the tab specified by $item, |
︙ | ︙ | |||
1145 1146 1147 1148 1149 1150 1151 | if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "tab"); return TCL_ERROR; } status = FindTabIndex(interp, nb, objv[2], &index); if (status == TCL_OK) { | > | > | < | 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 | if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "tab"); return TCL_ERROR; } status = FindTabIndex(interp, nb, objv[2], &index); if (status == TCL_OK) { #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) if (index >= 0) #endif Tcl_SetObjResult(interp, TkNewIndexObj(index)); } return status; } /* $nb select ?$item? -- * Select the specified tab, or return the widget path of |
︙ | ︙ |
Changes to generic/ttk/ttkPanedwindow.c.
︙ | ︙ | |||
663 664 665 666 667 668 669 | window = Tk_NameToWindow( interp, Tcl_GetString(objv[3]), pw->core.tkwin); if (!window) { return TCL_ERROR; } if (TCL_OK != Ttk_GetContentIndexFromObj( | | | 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | window = Tk_NameToWindow( interp, Tcl_GetString(objv[3]), pw->core.tkwin); if (!window) { return TCL_ERROR; } if (TCL_OK != Ttk_GetContentIndexFromObj( interp,pw->paned.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } srcIndex = Ttk_ContentIndex(pw->paned.mgr, window); if (srcIndex < 0) { /* New content: */ return AddPane(interp, pw, destIndex, window, objc-4, objv+4); |
︙ | ︙ | |||
698 699 700 701 702 703 704 | if (objc != 3) { Tcl_WrongNumArgs(interp, 2,objv, "pane"); return TCL_ERROR; } if (TCL_OK != Ttk_GetContentIndexFromObj( | | | 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | if (objc != 3) { Tcl_WrongNumArgs(interp, 2,objv, "pane"); return TCL_ERROR; } if (TCL_OK != Ttk_GetContentIndexFromObj( interp, pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { paneIndex = Ttk_NumberContent(pw->paned.mgr) - 1; } Ttk_ForgetContent(pw->paned.mgr, paneIndex); |
︙ | ︙ | |||
779 780 781 782 783 784 785 | if (objc < 3) { Tcl_WrongNumArgs(interp, 2,objv, "pane ?-option value ...?"); return TCL_ERROR; } if (TCL_OK != Ttk_GetContentIndexFromObj( | | | 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 | if (objc < 3) { Tcl_WrongNumArgs(interp, 2,objv, "pane ?-option value ...?"); return TCL_ERROR; } if (TCL_OK != Ttk_GetContentIndexFromObj( interp,pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { paneIndex = Ttk_NumberContent(pw->paned.mgr) - 1; } pane = (Pane *)Ttk_ContentData(pw->paned.mgr, paneIndex); |
︙ | ︙ |
Changes to generic/ttk/ttkProgress.c.
︙ | ︙ | |||
299 300 301 302 303 304 305 | Ttk_Orient orient = TTK_ORIENT_HORIZONTAL; TtkWidgetSize(recordPtr, widthPtr, heightPtr); /* Override requested width (height) based on -length and -orient */ Tk_GetPixelsFromObj(NULL, pb->core.tkwin, pb->progress.lengthObj, &length); | | | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | Ttk_Orient orient = TTK_ORIENT_HORIZONTAL; TtkWidgetSize(recordPtr, widthPtr, heightPtr); /* Override requested width (height) based on -length and -orient */ Tk_GetPixelsFromObj(NULL, pb->core.tkwin, pb->progress.lengthObj, &length); TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = length; } else { *heightPtr = length; } |
︙ | ︙ | |||
372 373 374 375 376 377 378 | Ttk_PlaceLayout(corePtr->layout,corePtr->state,Ttk_WinBox(corePtr->tkwin)); /* Adjust the bar size: */ Tcl_GetDoubleFromObj(NULL, pb->progress.valueObj, &value); Tcl_GetDoubleFromObj(NULL, pb->progress.maximumObj, &maximum); | | | 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | Ttk_PlaceLayout(corePtr->layout,corePtr->state,Ttk_WinBox(corePtr->tkwin)); /* Adjust the bar size: */ Tcl_GetDoubleFromObj(NULL, pb->progress.valueObj, &value); Tcl_GetDoubleFromObj(NULL, pb->progress.maximumObj, &maximum); TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient); if (pbar) { double fraction = value / maximum; Ttk_Box parcel = Ttk_ClientRegion(corePtr->layout, "trough"); if (pb->progress.mode == TTK_PROGRESSBAR_DETERMINATE) { ProgressbarDeterminateLayout( |
︙ | ︙ |
Changes to generic/ttk/ttkStubInit.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /* * This file is (mostly) automatically generated from ttk.decls. * It is compiled and linked in with the ttk package proper. */ #include "tkInt.h" #include "ttkTheme.h" MODULE_SCOPE const TtkStubs ttkStubs; #ifdef __GNUC__ /* * The rest of this file shouldn't warn about deprecated functions; they're * there because we intend them to be so and know that this file is OK to * touch those fields. */ | > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /* * This file is (mostly) automatically generated from ttk.decls. * It is compiled and linked in with the ttk package proper. */ #include "tkInt.h" #include "ttkTheme.h" MODULE_SCOPE const TtkStubs ttkStubs; #if defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8 #define Ttk_GetOrientFromObj 0 #endif #ifdef __GNUC__ /* * The rest of this file shouldn't warn about deprecated functions; they're * there because we intend them to be so and know that this file is OK to * touch those fields. */ |
︙ | ︙ |
Changes to generic/ttk/ttkTheme.h.
︙ | ︙ | |||
362 363 364 365 366 367 368 369 370 371 372 373 374 375 | TTKAPI int Ttk_GetCompoundFromObj(Tcl_Interp *, Tcl_Obj *, Ttk_Compound *); typedef enum { /* -orient option values */ TTK_ORIENT_HORIZONTAL, TTK_ORIENT_VERTICAL } Ttk_Orient; /*------------------------------------------------------------------------ * +++ Utilities. */ typedef struct TtkEnsemble { const char *name; /* subcommand name */ | > > > | 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | TTKAPI int Ttk_GetCompoundFromObj(Tcl_Interp *, Tcl_Obj *, Ttk_Compound *); typedef enum { /* -orient option values */ TTK_ORIENT_HORIZONTAL, TTK_ORIENT_VERTICAL } Ttk_Orient; MODULE_SCOPE int TtkGetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient); /*------------------------------------------------------------------------ * +++ Utilities. */ typedef struct TtkEnsemble { const char *name; /* subcommand name */ |
︙ | ︙ |
Changes to generic/ttk/ttkThemeInt.h.
︙ | ︙ | |||
48 49 50 51 52 53 54 | MODULE_SCOPE const char *Ttk_StyleName(Ttk_Style); MODULE_SCOPE void TtkSetBlinkCursorTimes(Tcl_Interp* interp); MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box); | > > > | > | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | MODULE_SCOPE const char *Ttk_StyleName(Ttk_Style); MODULE_SCOPE void TtkSetBlinkCursorTimes(Tcl_Interp* interp); MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box); #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) # define TTK_OPTION_UNDERLINE_DEF(type, field) "-1", offsetof(type, field), TCL_INDEX_NONE, 0, NULL #else # define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL #endif #endif /* _TTKTHEMEINT */ |
Changes to generic/ttk/ttkTreeview.c.
︙ | ︙ | |||
671 672 673 674 675 676 677 | Tcl_SetErrorCode(interp, "TTK", "TREE", "COLBOUND", NULL); return NULL; } return tv->tree.columns + columnIndex; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( | | | 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 | Tcl_SetErrorCode(interp, "TTK", "TREE", "COLBOUND", NULL); return NULL; } return tv->tree.columns + columnIndex; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Invalid column index \"%s\"", Tcl_GetString(columnIDObj))); Tcl_SetErrorCode(interp, "TTK", "TREE", "COLUMN", NULL); return NULL; } /* + FindColumn -- * Look up column by name, number, or display index. */ |
︙ | ︙ | |||
1378 1379 1380 1381 1382 1383 1384 | if (TreeviewInitDisplayColumns(interp, tv) != TCL_OK) return TCL_ERROR; } if (mask & COLUMNS_CHANGED) { CellSelectionClear(tv); } if (tv->tree.nTitleColumns < 0) { | | | | | | | | 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 | if (TreeviewInitDisplayColumns(interp, tv) != TCL_OK) return TCL_ERROR; } if (mask & COLUMNS_CHANGED) { CellSelectionClear(tv); } if (tv->tree.nTitleColumns < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"#%" TCL_SIZE_MODIFIER "d\" is out of range", tv->tree.nTitleColumns)); Tcl_SetErrorCode(interp, "TTK", "TREE", "TITLECOLUMNS", NULL); return TCL_ERROR; } if (tv->tree.nTitleItems < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%" TCL_SIZE_MODIFIER "d\" is out of range", tv->tree.nTitleItems)); Tcl_SetErrorCode(interp, "TTK", "TREE", "TITLEITEMS", NULL); return TCL_ERROR; } if (mask & SCROLLCMD_CHANGED) { TtkScrollbarUpdateRequired(tv->tree.xscrollHandle); TtkScrollbarUpdateRequired(tv->tree.yscrollHandle); } |
︙ | ︙ | |||
1537 1538 1539 1540 1541 1542 1543 | /* Propagate column width changes to overall widget request width, * but only if the widget is currently unmapped, in order to prevent * geometry jumping during interactive column resize. */ if (mask & GEOMETRY_CHANGED) { if (!Tk_IsMapped(tv->core.tkwin)) { TtkResizeWidget(&tv->core); | | | | 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 | /* Propagate column width changes to overall widget request width, * but only if the widget is currently unmapped, in order to prevent * geometry jumping during interactive column resize. */ if (mask & GEOMETRY_CHANGED) { if (!Tk_IsMapped(tv->core.tkwin)) { TtkResizeWidget(&tv->core); } else { RecomputeSlack(tv); ResizeColumns(tv, TreeWidth(tv)); } } TtkRedisplayWidget(&tv->core); Tk_FreeSavedOptions(&savedOptions); return TCL_OK; error: |
︙ | ︙ | |||
1970 1971 1972 1973 1974 1975 1976 | visibleRows = tv->tree.treeArea.height / tv->tree.rowHeight; tv->tree.root->state |= TTK_STATE_OPEN; UpdatePositionTree(tv); first = tv->tree.yscroll.first; last = tv->tree.yscroll.first + visibleRows - tv->tree.titleRows; total = tv->tree.totalRows - tv->tree.titleRows; if (tv->tree.treeArea.height % tv->tree.rowHeight) { | | | | | | | | | 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 | visibleRows = tv->tree.treeArea.height / tv->tree.rowHeight; tv->tree.root->state |= TTK_STATE_OPEN; UpdatePositionTree(tv); first = tv->tree.yscroll.first; last = tv->tree.yscroll.first + visibleRows - tv->tree.titleRows; total = tv->tree.totalRows - tv->tree.titleRows; if (tv->tree.treeArea.height % tv->tree.rowHeight) { /* When the treeview height doesn't correspond to an exact number * of rows, the last row count must be incremented to draw a * partial row at the bottom. The total row count must also be * incremented to be able to scroll all the way to the bottom. */ last++; total++; } TtkScrolled(tv->tree.yscrollHandle, first, last, total); } /* + TreeviewSize -- * SizeProc() widget hook. Size is determined by * -height option and column widths. |
︙ | ︙ | |||
2328 2329 2330 2331 2332 2333 2334 | Ttk_TagSetValues(tv->tree.tagTable, column->tagset, displayItemUsed); OverrideStriped(tv, item, displayItemUsed); Ttk_TagSetApplyStyle(tv->tree.tagTable, style, stateCell, displayItemUsed); } | | | 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 | Ttk_TagSetValues(tv->tree.tagTable, column->tagset, displayItemUsed); OverrideStriped(tv, item, displayItemUsed); Ttk_TagSetApplyStyle(tv->tree.tagTable, style, stateCell, displayItemUsed); } displayItem.anchorObj = tv->tree.column0.anchorObj; Tk_GetAnchorFromObj(NULL, column->anchorObj, &textAnchor); displayItemUsed->textObj = item->textObj; /* Item's image can be null, and may come from the tag */ if (item->imageObj) { displayItemUsed->imageObj = item->imageObj; } if (item->imageAnchorObj) { |
︙ | ︙ | |||
2388 2389 2390 2391 2392 2393 2394 | /* + DrawForest -- * Draw a sequence of items and their visible descendants. */ static void DrawForest( Treeview *tv, TreeItem *item, Drawable d, int depth) { while (item) { | | | 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 | /* + DrawForest -- * Draw a sequence of items and their visible descendants. */ static void DrawForest( Treeview *tv, TreeItem *item, Drawable d, int depth) { while (item) { DrawSubtree(tv, item, d, depth); item = item->next; } } /* + TreeviewDisplay -- * Display() widget hook. Draw the widget contents. */ |
︙ | ︙ | |||
2800 2801 2802 2803 2804 2805 2806 | Ttk_Box itemBox; DisplayItem displayItem; Ttk_Element element; Ttk_State state = ItemState(tv, item); BoundingBox(tv, item, NULL, &itemBox); PrepareItem(tv, item, &displayItem, state); | | | | 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 | Ttk_Box itemBox; DisplayItem displayItem; Ttk_Element element; Ttk_State state = ItemState(tv, item); BoundingBox(tv, item, NULL, &itemBox); PrepareItem(tv, item, &displayItem, state); if (item->textObj) { displayItem.textObj = item->textObj; } if (item->imageObj) { displayItem.imageObj = item->imageObj; } Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, state, itemBox); element = Ttk_IdentifyElement(layout, x, y); if (element) { what = "item"; detail = Ttk_ElementName(element); |
︙ | ︙ | |||
2858 2859 2860 2861 2862 2863 2864 | } else if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "command x y"); return TCL_ERROR; } if (Tcl_GetIndexFromObjStruct(interp, objv[2], submethodStrings, sizeof(char *), "command", TCL_EXACT, &submethod) != TCL_OK | | | 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 | } else if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "command x y"); return TCL_ERROR; } if (Tcl_GetIndexFromObjStruct(interp, objv[2], submethodStrings, sizeof(char *), "command", TCL_EXACT, &submethod) != TCL_OK || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &x) != TCL_OK || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[4], &y) != TCL_OK ) { return TCL_ERROR; } region = IdentifyRegion(tv, x, y); item = IdentifyItem(tv, y); |
︙ | ︙ | |||
2928 2929 2930 2931 2932 2933 2934 | return TCL_OK; } if (!BoundingBox(tv, item, column, &bbox)) { return TCL_OK; } state = ItemState(tv, item); PrepareItem(tv, item, &displayItem, state); | | | | 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 | return TCL_OK; } if (!BoundingBox(tv, item, column, &bbox)) { return TCL_OK; } state = ItemState(tv, item); PrepareItem(tv, item, &displayItem, state); if (item->textObj) { displayItem.textObj = item->textObj; } if (item->imageObj) { displayItem.imageObj = item->imageObj; } Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, state, bbox); element = Ttk_IdentifyElement(layout, x, y); if (element) { const char *elementName = Ttk_ElementName(element); Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); |
︙ | ︙ | |||
3249 3250 3251 3252 3253 3254 3255 | tv->tree.rowPosNeedsUpdate = 1; TtkRedisplayWidget(&tv->core); ckfree(items); return TCL_OK; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 | tv->tree.rowPosNeedsUpdate = 1; TtkRedisplayWidget(&tv->core); ckfree(items); return TCL_OK; } /* + $tv delete $items -- * Delete each item in $items. * * Do this in two passes: * First detach the item and all its descendants and remove them * from the hash table. Free the items themselves in a second pass. * |
︙ | ︙ | |||
3338 3339 3340 3341 3342 3343 3344 | } } /* Remove items from hash table. */ delq = 0; for (i = 0; items[i]; ++i) { | | | | | 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 | } } /* Remove items from hash table. */ delq = 0; for (i = 0; items[i]; ++i) { if (items[i]->state & TTK_STATE_SELECTED) { selChange = 1; } else if (items[i]->selObj != NULL) { Tcl_Size length; Tcl_ListObjLength(interp, items[i]->selObj, &length); if (length > 0) { selChange = 1; } } delq = DeleteItems(items[i], delq); |
︙ | ︙ | |||
3364 3365 3366 3367 3368 3369 3370 | tv->tree.endPtr = 0; FreeItem(delq); delq = next; } ckfree(items); if (selChange) { | | | 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 | tv->tree.endPtr = 0; FreeItem(delq); delq = next; } ckfree(items); if (selChange) { Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); } tv->tree.rowPosNeedsUpdate = 1; TtkRedisplayWidget(&tv->core); return TCL_OK; } /* + $tv move $item $parent $index |
︙ | ︙ | |||
4033 4034 4035 4036 4037 4038 4039 | Tcl_WrongNumArgs(interp, 3, objv, "tagName"); return TCL_ERROR; } tag = Ttk_GetTagFromObj(tagTable, objv[3]); /* remove the tag from all cells and items */ while (item) { | | | 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 | Tcl_WrongNumArgs(interp, 3, objv, "tagName"); return TCL_ERROR; } tag = Ttk_GetTagFromObj(tagTable, objv[3]); /* remove the tag from all cells and items */ while (item) { RemoveTagFromCellsAtItem(item, tag); RemoveTag(item, tag); item = NextPreorder(item); } /* then remove the tag from the tag table */ Tk_DeleteAllBindings(tv->tree.bindingTable, tag); Ttk_DeleteTagFromTable(tagTable, tag); TtkRedisplayWidget(&tv->core); |
︙ | ︙ | |||
4281 4282 4283 4284 4285 4286 4287 | /* Remove tag from all cells at row 'item' */ static void RemoveTagFromCellsAtItem(TreeItem *item, Ttk_Tag tag) { Tcl_Size i; for (i = 0; i < item->nTagSets; i++) { | | | | | 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 | /* Remove tag from all cells at row 'item' */ static void RemoveTagFromCellsAtItem(TreeItem *item, Ttk_Tag tag) { Tcl_Size i; for (i = 0; i < item->nTagSets; i++) { if (item->cellTagSets[i] != NULL) { Ttk_TagSetRemove(item->cellTagSets[i], tag); } } } static int TreeviewTagRemoveCommand( void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) { Treeview *tv = (Treeview *)recordPtr; |
︙ | ︙ | |||
4362 4363 4364 4365 4366 4367 4368 | AllocCellTagSets(tv, item, columnNumber); Ttk_TagSetRemove(item->cellTagSets[columnNumber], tag); } ckfree(cells); } else { item = tv->tree.root; while (item) { | | | 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 | AllocCellTagSets(tv, item, columnNumber); Ttk_TagSetRemove(item->cellTagSets[columnNumber], tag); } ckfree(cells); } else { item = tv->tree.root; while (item) { RemoveTagFromCellsAtItem(item, tag); item = NextPreorder(item); } } TtkRedisplayWidget(&tv->core); return TCL_OK; |
︙ | ︙ | |||
4396 4397 4398 4399 4400 4401 4402 | }; /*------------------------------------------------------------------------ * +++ Widget commands record. */ static const Ttk_Ensemble TreeviewCommands[] = { { "bbox", TreeviewBBoxCommand,0 }, | | < | | 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 | }; /*------------------------------------------------------------------------ * +++ Widget commands record. */ static const Ttk_Ensemble TreeviewCommands[] = { { "bbox", TreeviewBBoxCommand,0 }, { "cellselection", TreeviewCellSelectionCommand,0 }, { "children", TreeviewChildrenCommand,0 }, { "cget", TtkWidgetCgetCommand,0 }, { "column", TreeviewColumnCommand,0 }, { "configure", TtkWidgetConfigureCommand,0 }, { "delete", TreeviewDeleteCommand,0 }, { "detach", TreeviewDetachCommand,0 }, { "drag", TreeviewDragCommand,0 }, { "drop", TreeviewDropCommand,0 }, { "exists", TreeviewExistsCommand,0 }, { "focus", TreeviewFocusCommand,0 }, { "heading", TreeviewHeadingCommand,0 }, { "identify", TreeviewIdentifyCommand,0 }, { "index", TreeviewIndexCommand,0 }, { "insert", TreeviewInsertCommand,0 }, { "instate", TtkWidgetInstateCommand,0 }, { "item", TreeviewItemCommand,0 }, { "move", TreeviewMoveCommand,0 }, { "next", TreeviewNextCommand,0 }, { "parent", TreeviewParentCommand,0 }, { "prev", TreeviewPrevCommand,0 }, { "see", TreeviewSeeCommand,0 }, { "selection", TreeviewSelectionCommand,0 }, { "set", TreeviewSetCommand,0 }, { "state", TtkWidgetStateCommand,0 }, { "style", TtkWidgetStyleCommand,0 }, { "tag", 0,TreeviewTagCommands }, { "xview", TreeviewXViewCommand,0 }, { "yview", TreeviewYViewCommand,0 }, { 0,0,0 } |
︙ | ︙ |
Changes to generic/ttk/ttkWidget.c.
︙ | ︙ | |||
478 479 480 481 482 483 484 | Ttk_Orient orient = TTK_ORIENT_HORIZONTAL; Ttk_Layout layout; Tcl_DStringInit(&styleName); /* Prefix: */ | | | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | Ttk_Orient orient = TTK_ORIENT_HORIZONTAL; Ttk_Layout layout; Tcl_DStringInit(&styleName); /* Prefix: */ TtkGetOrientFromObj(NULL, orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) Tcl_DStringAppend(&styleName, "Horizontal.", TCL_INDEX_NONE); else Tcl_DStringAppend(&styleName, "Vertical.", TCL_INDEX_NONE); /* Add base style name: */ |
︙ | ︙ |
Changes to library/button.tcl.
︙ | ︙ | |||
748 749 750 751 752 753 754 | $w configure -state normal } # Restore the original button "selected" color; but only if the user # has not changed it in the meantime. if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} { | | | | | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | $w configure -state normal } # Restore the original button "selected" color; but only if the user # has not changed it in the meantime. if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} { if {[$w cget -selectcolor] eq $Priv($w,selectcolor) || ([info exist Priv($w,aselectcolor)] && [$w cget -selectcolor] eq $Priv($w,aselectcolor))} { $w configure -selectcolor $Priv($w,selectcolor) } } unset -nocomplain Priv($w,selectcolor) Priv($w,aselectcolor) # Restore the original button relief if it was changed by Tk. That is # signaled by the existence of Priv($w,prelief). |
︙ | ︙ |
Changes to library/demos/anilabel.tcl.
1 2 3 4 5 6 7 8 9 | # anilabel.tcl -- # # This demonstration script creates a toplevel window containing # several animated label widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # anilabel.tcl -- # # This demonstration script creates a toplevel window containing # several animated label widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .anilabel catch {destroy $w} toplevel $w wm title $w "Animated Label Demonstration" wm iconname $w "anilabel" positionWindow $w |
︙ | ︙ |
Changes to library/demos/aniwave.tcl.
1 2 3 4 5 6 7 8 9 10 | # aniwave.tcl -- # # This demonstration script illustrates how to adjust canvas item # coordinates in a way that does something fairly similar to waveform # display. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # aniwave.tcl -- # # This demonstration script illustrates how to adjust canvas item # coordinates in a way that does something fairly similar to waveform # display. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .aniwave catch {destroy $w} toplevel $w wm title $w "Animated Wave Demonstration" wm iconname $w "aniwave" positionWindow $w |
︙ | ︙ |
Changes to library/demos/arrow.tcl.
1 2 3 4 5 6 7 8 9 | # arrow.tcl -- # # This demonstration script creates a canvas widget that displays a # large line with an arrowhead whose shape can be edited interactively. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # arrow.tcl -- # # This demonstration script creates a canvas widget that displays a # large line with an arrowhead whose shape can be edited interactively. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # scl -- # Scales an integer according to the display's current scaling percentage. # # Arguments: # num - An integer. |
︙ | ︙ |
Changes to library/demos/bind.tcl.
1 2 3 4 5 6 7 8 9 | # bind.tcl -- # # This demonstration script creates a text widget with bindings set # up for hypertext-like effects. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # bind.tcl -- # # This demonstration script creates a text widget with bindings set # up for hypertext-like effects. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .bind catch {destroy $w} toplevel $w wm title $w "Text Demonstration - Tag Bindings" wm iconname $w "bind" positionWindow $w |
︙ | ︙ |
Changes to library/demos/bitmap.tcl.
1 2 3 4 5 6 7 8 9 | # bitmap.tcl -- # # This demonstration script creates a toplevel window that displays # all of Tk's built-in bitmaps. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # bitmap.tcl -- # # This demonstration script creates a toplevel window that displays # all of Tk's built-in bitmaps. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # bitmapRow -- # Create a row of bitmap items in a window. # # Arguments: # w - The window that is to contain the row. # args - The names of one or more bitmaps, which will be displayed |
︙ | ︙ |
Changes to library/demos/browse.
1 2 3 4 5 6 7 8 9 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # browse -- # This script generates a directory browser, which lists the working # directory and allows you to open files or subdirectories by # double-clicking. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # browse -- # This script generates a directory browser, which lists the working # directory and allows you to open files or subdirectories by # double-clicking. package require Tk # Create a scrollbar on the right side of the main window and a listbox # on the left side. scrollbar .scroll -command ".list yview" pack .scroll -side right -fill y listbox .list -yscroll ".scroll set" -relief sunken -width 20 -height 20 \ |
︙ | ︙ |
Changes to library/demos/button.tcl.
1 2 3 4 5 6 7 8 9 | # button.tcl -- # # This demonstration script creates a toplevel window containing # several button widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # button.tcl -- # # This demonstration script creates a toplevel window containing # several button widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .button catch {destroy $w} toplevel $w wm title $w "Button Demonstration" wm iconname $w "button" positionWindow $w |
︙ | ︙ |
Changes to library/demos/check.tcl.
1 2 3 4 5 6 7 8 9 | # check.tcl -- # # This demonstration script creates a toplevel window containing # several checkbuttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # check.tcl -- # # This demonstration script creates a toplevel window containing # several checkbuttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .check catch {destroy $w} toplevel $w wm title $w "Checkbutton Demonstration" wm iconname $w "check" positionWindow $w |
︙ | ︙ |
Changes to library/demos/clrpick.tcl.
1 2 3 4 5 6 7 8 | # clrpick.tcl -- # # This demonstration script prompts the user to select a color. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # clrpick.tcl -- # # This demonstration script prompts the user to select a color. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .clrpick catch {destroy $w} toplevel $w wm title $w "Color Selection Dialog" wm iconname $w "colors" positionWindow $w |
︙ | ︙ |
Changes to library/demos/colors.tcl.
1 2 3 4 5 6 7 8 9 10 | # colors.tcl -- # # This demonstration script creates a listbox widget that displays # many of the colors from the X color database. You can click on # a color to change the application's palette. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # colors.tcl -- # # This demonstration script creates a listbox widget that displays # many of the colors from the X color database. You can click on # a color to change the application's palette. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .colors catch {destroy $w} toplevel $w wm title $w "Listbox Demonstration (colors)" wm iconname $w "Listbox" positionWindow $w |
︙ | ︙ |
Changes to library/demos/combo.tcl.
1 2 3 4 5 6 7 8 | # combo.tcl -- # # This demonstration script creates several combobox widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # combo.tcl -- # # This demonstration script creates several combobox widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .combo catch {destroy $w} toplevel $w wm title $w "Combobox Demonstration" wm iconname $w "combo" positionWindow $w |
︙ | ︙ |
Changes to library/demos/cscroll.tcl.
1 2 3 4 5 6 7 8 9 | # cscroll.tcl -- # # This demonstration script creates a simple canvas that can be # scrolled in two dimensions. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # cscroll.tcl -- # # This demonstration script creates a simple canvas that can be # scrolled in two dimensions. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .cscroll catch {destroy $w} toplevel $w wm title $w "Scrollable Canvas Demonstration" wm iconname $w "cscroll" positionWindow $w |
︙ | ︙ | |||
52 53 54 55 56 57 58 | -anchor center -tags text } } $c bind all <Enter> "scrollEnter $c" $c bind all <Leave> "scrollLeave $c" $c bind all <Button-1> "scrollButton $c" | < | | < < | < < < < < < < < < < < < | | | | | | | > > > > > > > | | | | | | < < < < < < < | | | | | | | | | | | | | | | | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | -anchor center -tags text } } $c bind all <Enter> "scrollEnter $c" $c bind all <Leave> "scrollLeave $c" $c bind all <Button-1> "scrollButton $c" bind $c <Button-2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" # We must make sure that positive and negative movements are rounded # equally to integers, avoiding the problem that # (int)1/-40 = -1, # but # (int)-1/-40 = 0 # The following code ensures equal +/- behaviour. bind $c <MouseWheel> { if {%D >= 0} { %W yview scroll [expr {%D/-40}] units } else { %W yview scroll [expr {(%D-39)/-40}] units } } bind $c <Option-MouseWheel> { if {%D >= 0} { %W yview scroll [expr {%D/-12}] units } else { %W yview scroll [expr {(%D-11)/-12}] units } } bind $c <Shift-MouseWheel> { if {%D >= 0} { %W xview scroll [expr {%D/-40}] units } else { %W xview scroll [expr {(%D-39)/-40}] units } } bind $c <Shift-Option-MouseWheel> { if {%D >= 0} { %W xview scroll [expr {%D/-12}] units } else { %W xview scroll [expr {(%D-11)/-12}] units } } bind $c <TouchpadScroll> { lassign [tk::PreciseScrollDeltas %D] deltaX deltaY if {$deltaX != 0 || $deltaY != 0} { tk::ScrollByPixels %W $deltaX $deltaY } } proc scrollEnter canvas { global oldFill set id [$canvas find withtag current] if {[lsearch [$canvas gettags current] text] >= 0} { set id [expr {$id-1}] } |
︙ | ︙ |
Changes to library/demos/ctext.tcl.
1 2 3 4 5 6 7 8 9 | # ctext.tcl -- # # This demonstration script creates a canvas widget with a text # item that can be edited and reconfigured in various ways. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # ctext.tcl -- # # This demonstration script creates a canvas widget with a text # item that can be edited and reconfigured in various ways. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ctext catch {destroy $w} toplevel $w wm title $w "Canvas Text Demonstration" wm iconname $w "Text" positionWindow $w |
︙ | ︙ | |||
46 47 48 49 50 51 52 | $c bind text <Shift-Button-1> "$c select adjust current @%x,%y" $c bind text <Shift-B1-Motion> "textB1Move $c %x %y" $c bind text <Key> "textInsert $c %A" $c bind text <Return> "textInsert $c \\n" $c bind text <Control-h> "textBs $c" $c bind text <BackSpace> "textBs $c" $c bind text <Delete> "textDel $c" | < < < | < | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | $c bind text <Shift-Button-1> "$c select adjust current @%x,%y" $c bind text <Shift-B1-Motion> "textB1Move $c %x %y" $c bind text <Key> "textInsert $c %A" $c bind text <Return> "textInsert $c \\n" $c bind text <Control-h> "textBs $c" $c bind text <BackSpace> "textBs $c" $c bind text <Delete> "textDel $c" $c bind text <Button-2> "textPaste $c @%x,%y" # Next, create some items that allow the text's anchor position # to be edited. proc mkTextConfigBox {w x y option value color} { ;# x, y are in points set item [$w create rect ${x}p ${y}p [expr {$x+22.5}]p [expr {$y+22.5}]p \ -outline black -fill $color -width 0.75p] |
︙ | ︙ |
Changes to library/demos/entry1.tcl.
1 2 3 4 5 6 7 8 9 | # entry1.tcl -- # # This demonstration script creates several entry widgets without # scrollbars. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # entry1.tcl -- # # This demonstration script creates several entry widgets without # scrollbars. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .entry1 catch {destroy $w} toplevel $w wm title $w "Entry Demonstration (no scrollbars)" wm iconname $w "entry1" positionWindow $w |
︙ | ︙ |
Changes to library/demos/entry2.tcl.
1 2 3 4 5 6 7 8 9 | # entry2.tcl -- # # This demonstration script is the same as the entry1.tcl script # except that it creates scrollbars for the entries. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # entry2.tcl -- # # This demonstration script is the same as the entry1.tcl script # except that it creates scrollbars for the entries. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .entry2 catch {destroy $w} toplevel $w wm title $w "Entry Demonstration (with scrollbars)" wm iconname $w "entry2" positionWindow $w |
︙ | ︙ |
Changes to library/demos/entry3.tcl.
1 2 3 4 5 6 7 8 9 10 | # entry3.tcl -- # # This demonstration script creates several entry widgets whose # permitted input is constrained in some way. It also shows off a # password entry. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # entry3.tcl -- # # This demonstration script creates several entry widgets whose # permitted input is constrained in some way. It also shows off a # password entry. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .entry3 catch {destroy $w} toplevel $w wm title $w "Constrained Entry Demonstration" wm iconname $w "entry3" positionWindow $w |
︙ | ︙ |
Changes to library/demos/filebox.tcl.
1 2 3 4 5 6 7 8 | # filebox.tcl -- # # This demonstration script prompts the user to select a file. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # filebox.tcl -- # # This demonstration script prompts the user to select a file. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .filebox catch {destroy $w} toplevel $w wm title $w "File Selection Dialogs" wm iconname $w "filebox" positionWindow $w |
︙ | ︙ |
Changes to library/demos/floor.tcl.
1 2 3 4 5 6 7 8 9 | # floor.tcl -- # # This demonstration script creates a canvas widet that displays the # floorplan for DEC's Western Research Laboratory. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # floor.tcl -- # # This demonstration script creates a canvas widet that displays the # floorplan for DEC's Western Research Laboratory. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # floorDisplay -- # Recreate the floorplan display in the canvas given by "w". The # floor given by "active" is displayed on top with its office structure # visible. # # Arguments: |
︙ | ︙ | |||
1368 1369 1370 1371 1372 1373 1374 | # Set up event bindings for canvas: $c bind floor1 <Button-1> "floorDisplay $c 1" $c bind floor2 <Button-1> "floorDisplay $c 2" $c bind floor3 <Button-1> "floorDisplay $c 3" $c bind room <Enter> "newRoom $c" $c bind room <Leave> {set currentRoom ""} | < < < < | | < | 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 | # Set up event bindings for canvas: $c bind floor1 <Button-1> "floorDisplay $c 1" $c bind floor2 <Button-1> "floorDisplay $c 2" $c bind floor3 <Button-1> "floorDisplay $c 3" $c bind room <Enter> "newRoom $c" $c bind room <Leave> {set currentRoom ""} bind $c <Button-2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" bind $c <Destroy> "unset currentRoom" set currentRoom "" trace add variable currentRoom write "roomChanged $c" |
Changes to library/demos/fontchoose.tcl.
1 2 3 4 5 6 7 8 | # fontchoose.tcl -- # # Show off the stock font selector dialog if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # fontchoose.tcl -- # # Show off the stock font selector dialog if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .fontchoose catch {destroy $w} toplevel $w wm title $w "Font Selection Dialog" wm iconname $w "fontchooser" positionWindow $w |
︙ | ︙ |
Changes to library/demos/form.tcl.
1 2 3 4 5 6 7 8 9 | # form.tcl -- # # This demonstration script creates a simple form with a bunch # of entry widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # form.tcl -- # # This demonstration script creates a simple form with a bunch # of entry widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .form catch {destroy $w} toplevel $w wm title $w "Form Demonstration" wm iconname $w "form" positionWindow $w |
︙ | ︙ |
Changes to library/demos/goldberg.tcl.
︙ | ︙ | |||
36 37 38 39 40 41 42 | # I could comment on the code, but it's just 26 state machines with # lots of canvas create and move calls. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | # I could comment on the code, but it's just 26 state machines with # lots of canvas create and move calls. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .goldberg catch {destroy $w} toplevel $w wm title $w "Tk Goldberg (demonstration)" wm iconname $w "goldberg" wm resizable $w 0 0 |
︙ | ︙ |
Changes to library/demos/hello.
1 2 3 4 5 6 7 8 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # hello -- # Simple Tk script to create a button that prints "Hello, world". # Click on the button to terminate the program. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # hello -- # Simple Tk script to create a button that prints "Hello, world". # Click on the button to terminate the program. package require Tk # The first line below creates the button, and the second line # asks the packer to shrink-wrap the application's main window # around the button. button .hello -text "Hello, world" -command { puts stdout "Hello, world"; destroy . |
︙ | ︙ |
Changes to library/demos/hscale.tcl.
1 2 3 4 5 6 7 8 | # hscale.tcl -- # # This demonstration script shows an example with a horizontal scale. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # hscale.tcl -- # # This demonstration script shows an example with a horizontal scale. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .hscale catch {destroy $w} toplevel $w wm title $w "Horizontal Scale Demonstration" wm iconname $w "hscale" positionWindow $w |
︙ | ︙ |
Changes to library/demos/icon.tcl.
1 2 3 4 5 6 7 8 9 | # icon.tcl -- # # This demonstration script creates a toplevel window containing # buttons that display bitmaps instead of text. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # icon.tcl -- # # This demonstration script creates a toplevel window containing # buttons that display bitmaps instead of text. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .icon catch {destroy $w} toplevel $w wm title $w "Iconic Button Demonstration" wm iconname $w "icon" positionWindow $w |
︙ | ︙ |
Changes to library/demos/image1.tcl.
1 2 3 4 5 6 7 8 | # image1.tcl -- # # This demonstration script displays two image widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # image1.tcl -- # # This demonstration script displays two image widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .image1 catch {destroy $w} toplevel $w wm title $w "Image Demonstration #1" wm iconname $w "Image1" positionWindow $w |
︙ | ︙ |
Changes to library/demos/image2.tcl.
1 2 3 4 5 6 7 8 9 | # image2.tcl -- # # This demonstration script creates a simple collection of widgets # that allow you to select and view images in a Tk label. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # image2.tcl -- # # This demonstration script creates a simple collection of widgets # that allow you to select and view images in a Tk label. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # loadDir -- # This procedure reloads the directory listbox from the directory # named in the demo's entry. # # Arguments: # w - Name of the toplevel window of the demo. |
︙ | ︙ |
Changes to library/demos/items.tcl.
1 2 3 4 5 6 7 8 9 | # items.tcl -- # # This demonstration script creates a canvas that displays the # canvas item types. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # items.tcl -- # # This demonstration script creates a canvas that displays the # canvas item types. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .items catch {destroy $w} toplevel $w wm title $w "Canvas Item Demonstration" wm iconname $w "Items" positionWindow $w |
︙ | ︙ | |||
181 182 183 184 185 186 187 | $c create text 21c 20.9c -text Entry: -anchor sw $c create text 28.5c 17.4c -text Scale: -anchor s # Set up event bindings for canvas: $c bind item <Enter> "itemEnter $c" $c bind item <Leave> "itemLeave $c" | < < < < < < | | | | < | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | $c create text 21c 20.9c -text Entry: -anchor sw $c create text 28.5c 17.4c -text Scale: -anchor s # Set up event bindings for canvas: $c bind item <Enter> "itemEnter $c" $c bind item <Leave> "itemLeave $c" bind $c <Button-2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" bind $c <Button-3> "itemMark $c %x %y" bind $c <B3-Motion> "itemStroke $c %x %y" bind $c <<NextChar>> "itemsUnderArea $c" bind $c <Button-1> "itemStartDrag $c %x %y" bind $c <B1-Motion> "itemDrag $c %x %y" # Utility procedures for highlighting the item under the pointer: proc itemEnter {c} { |
︙ | ︙ |
Changes to library/demos/ixset.
1 2 3 4 5 6 7 8 9 10 11 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # ixset -- # A nice interface to "xset" to change X server settings # # History : # 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design # 92/08/01 : pda@masi.ibp.fr : cleaning | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # ixset -- # A nice interface to "xset" to change X server settings # # History : # 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design # 92/08/01 : pda@masi.ibp.fr : cleaning package require Tk # # Button actions # proc quit {} { destroy . |
︙ | ︙ |
Changes to library/demos/knightstour.tcl.
︙ | ︙ | |||
17 18 19 20 21 22 23 | # If the call to the Edgemost function is commented out you can see # this occur. # # You can drag the knight to a specific square to start if you wish. # If you let it repeat then it will choose random start positions # for each new tour. | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # If the call to the Edgemost function is commented out you can see # this occur. # # You can drag the knight to a specific square to start if you wish. # If you let it repeat then it will choose random start positions # for each new tour. package require Tk # Return a list of accessible squares from a given square proc ValidMoves {square} { set moves {} foreach pair {{-1 -2} {-2 -1} {-2 1} {-1 2} {1 2} {2 1} {2 -1} {1 -2}} { set col [expr {($square % 8) + [lindex $pair 0]}] set row [expr {($square / 8) + [lindex $pair 1]}] |
︙ | ︙ |
Changes to library/demos/label.tcl.
1 2 3 4 5 6 7 8 9 | # label.tcl -- # # This demonstration script creates a toplevel window containing # several label widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # label.tcl -- # # This demonstration script creates a toplevel window containing # several label widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .label catch {destroy $w} toplevel $w wm title $w "Label Demonstration" wm iconname $w "label" positionWindow $w |
︙ | ︙ |
Changes to library/demos/labelframe.tcl.
1 2 3 4 5 6 7 8 9 | # labelframe.tcl -- # # This demonstration script creates a toplevel window containing # several labelframe widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # labelframe.tcl -- # # This demonstration script creates a toplevel window containing # several labelframe widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .labelframe catch {destroy $w} toplevel $w wm title $w "Labelframe Demonstration" wm iconname $w "labelframe" positionWindow $w |
︙ | ︙ |
Changes to library/demos/mac_styles.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # mac_styles.tcl -- # # This demonstration script creates a toplevel window containing a notebook # whose pages provide examples of the various mac-specific widgets that are # provided via special values for the -style option. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } set w .mac_styles catch {destroy $w} toplevel $w | > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # mac_styles.tcl -- # # This demonstration script creates a toplevel window containing a notebook # whose pages provide examples of the various mac-specific widgets that are # provided via special values for the -style option. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .mac_styles catch {destroy $w} toplevel $w package require Tk wm title $w "Tk Aqua Widgets" wm iconname $w "mac_styles" positionWindow $w ## # System images we use in our buttons set featherImg [file join $tk_demoDirectory images Tk_feather.png] |
︙ | ︙ |
Changes to library/demos/mac_tabs.tcl.
1 2 3 4 5 6 7 8 9 10 | # mac_tabs.tcl -- # # This demonstration script creates three tabbable windows and allows the # wm attributes tabbingid and tabbingmode to be manipulated for the third # window, to demonstrate the effects of those attributes. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # mac_tabs.tcl -- # # This demonstration script creates three tabbable windows and allows the # wm attributes tabbingid and tabbingmode to be manipulated for the third # window, to demonstrate the effects of those attributes. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk catch {font create giant -family {Times New Roman} -size 64} set w .mac_tabs catch {destroy $w} toplevel $w package require Tk wm title $w "Tabbed Windows in Aqua" wm iconname $w "mac_tabs" positionWindow $w set suffix 0 set winlist {} ## |
︙ | ︙ |
Changes to library/demos/mac_wm.tcl.
1 2 3 4 5 6 7 8 9 10 | # mac_window_styles.tcl -- # # This demonstration script creates a toplevel window containing a notebook # whose pages provide examples of the various mac-specific widgets that are # provided via special values for the -style option. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # mac_window_styles.tcl -- # # This demonstration script creates a toplevel window containing a notebook # whose pages provide examples of the various mac-specific widgets that are # provided via special values for the -style option. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .mac_wm catch {destroy $w} toplevel $w package require Tk wm title $w "Tk Aqua Window Styles" wm iconname $w "mac_wm" positionWindow $w set suffix 0 set winlist {} ## |
︙ | ︙ |
Changes to library/demos/mclist.tcl.
1 2 3 4 5 6 7 8 9 | # mclist.tcl -- # # This demonstration script creates a toplevel window containing a Ttk # tree widget configured as a multi-column listbox. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # mclist.tcl -- # # This demonstration script creates a toplevel window containing a Ttk # tree widget configured as a multi-column listbox. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .mclist catch {destroy $w} toplevel $w -class MCList wm title $w "Multi-Column List" wm iconname $w "mclist" positionWindow $w |
︙ | ︙ |
Changes to library/demos/menu.tcl.
1 2 3 4 5 6 7 8 9 | # menu.tcl -- # # This demonstration script creates a window with a bunch of menus # and cascaded menus using menubars. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # menu.tcl -- # # This demonstration script creates a window with a bunch of menus # and cascaded menus using menubars. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .menu catch {destroy $w} toplevel $w wm title $w "Menu Demonstration" wm iconname $w "menu" positionWindow $w |
︙ | ︙ |
Changes to library/demos/menubu.tcl.
1 2 3 4 5 6 7 8 9 | # menubu.tcl -- # # This demonstration script creates a window with a bunch of menus # and cascaded menus using menubuttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # menubu.tcl -- # # This demonstration script creates a window with a bunch of menus # and cascaded menus using menubuttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .menubu catch {destroy $w} toplevel $w wm title $w "Menu Button Demonstration" wm iconname $w "menubutton" positionWindow $w |
︙ | ︙ |
Changes to library/demos/msgbox.tcl.
1 2 3 4 5 6 7 8 | # msgbox.tcl -- # # This demonstration script creates message boxes of various type if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # msgbox.tcl -- # # This demonstration script creates message boxes of various type if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .msgbox catch {destroy $w} toplevel $w wm title $w "Message Box Demonstration" wm iconname $w "messagebox" positionWindow $w |
︙ | ︙ |
Changes to library/demos/paned1.tcl.
1 2 3 4 5 6 7 8 9 | # paned1.tcl -- # # This demonstration script creates a toplevel window containing # a paned window that separates two windows horizontally. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # paned1.tcl -- # # This demonstration script creates a toplevel window containing # a paned window that separates two windows horizontally. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .paned1 catch {destroy $w} toplevel $w wm title $w "Horizontal Paned Window Demonstration" wm iconname $w "paned1" positionWindow $w |
︙ | ︙ |
Changes to library/demos/paned2.tcl.
1 2 3 4 5 6 7 8 9 | # paned2.tcl -- # # This demonstration script creates a toplevel window containing # a paned window that separates two windows vertically. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # paned2.tcl -- # # This demonstration script creates a toplevel window containing # a paned window that separates two windows vertically. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .paned2 catch {destroy $w} toplevel $w wm title $w "Vertical Paned Window Demonstration" wm iconname $w "paned2" positionWindow $w |
︙ | ︙ |
Changes to library/demos/pendulum.tcl.
1 2 3 4 5 6 7 8 9 | # pendulum.tcl -- # # This demonstration illustrates how Tcl/Tk can be used to construct # simulations of physical systems. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # pendulum.tcl -- # # This demonstration illustrates how Tcl/Tk can be used to construct # simulations of physical systems. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .pendulum catch {destroy $w} toplevel $w wm title $w "Pendulum Animation Demonstration" wm iconname $w "pendulum" positionWindow $w |
︙ | ︙ |
Changes to library/demos/plot.tcl.
1 2 3 4 5 6 7 8 9 | # plot.tcl -- # # This demonstration script creates a canvas widget showing a 2-D # plot with data points that can be dragged with the mouse. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # plot.tcl -- # # This demonstration script creates a canvas widget showing a 2-D # plot with data points that can be dragged with the mouse. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .plot catch {destroy $w} toplevel $w wm title $w "Plot Demonstration" wm iconname $w "Plot" positionWindow $w |
︙ | ︙ |
Changes to library/demos/puzzle.tcl.
1 2 3 4 5 6 7 8 9 | # puzzle.tcl -- # # This demonstration script creates a 15-puzzle game using a collection # of buttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # puzzle.tcl -- # # This demonstration script creates a 15-puzzle game using a collection # of buttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # puzzleSwitch -- # This procedure is invoked when the user clicks on a particular button; # if the button is next to the empty space, it moves the button into the # empty space. proc puzzleSwitch {w num} { |
︙ | ︙ |
Changes to library/demos/radio.tcl.
1 2 3 4 5 6 7 8 9 | # radio.tcl -- # # This demonstration script creates a toplevel window containing # several radiobutton widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # radio.tcl -- # # This demonstration script creates a toplevel window containing # several radiobutton widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .radio catch {destroy $w} toplevel $w wm title $w "Radiobutton Demonstration" wm iconname $w "radio" positionWindow $w |
︙ | ︙ |
Changes to library/demos/rmt.
1 2 3 4 5 6 7 8 9 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # rmt -- # This script implements a simple remote-control mechanism for # Tk applications. It allows you to select an application and # then type commands to that application. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # rmt -- # This script implements a simple remote-control mechanism for # Tk applications. It allows you to select an application and # then type commands to that application. package require Tk wm title . "Tk Remote Controller" wm iconname . "Tk Remote" wm minsize . 1 1 # The global variable below keeps track of the remote application # that we're sending to. If it's an empty string then we execute |
︙ | ︙ |
Changes to library/demos/rolodex.
1 2 3 4 5 6 7 8 9 10 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # rolodex -- # This script was written as an entry in Tom LaStrange's rolodex # benchmark. It creates something that has some of the look and # feel of a rolodex program, although it's lifeless and doesn't # actually do the rolodex application. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # rolodex -- # This script was written as an entry in Tom LaStrange's rolodex # benchmark. It creates something that has some of the look and # feel of a rolodex program, although it's lifeless and doesn't # actually do the rolodex application. package require Tk foreach i [winfo children .] { catch {destroy $i} } set version 1.2 |
︙ | ︙ |
Changes to library/demos/ruler.tcl.
1 2 3 4 5 6 7 8 9 | # ruler.tcl -- # # This demonstration script creates a canvas widget that displays a ruler # with tab stops that can be set, moved, and deleted. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # ruler.tcl -- # # This demonstration script creates a canvas widget that displays a ruler # with tab stops that can be set, moved, and deleted. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # rulerMkTab -- # This procedure creates a new triangular polygon in a canvas to # represent a tab stop. # # Arguments: # c - The canvas window. |
︙ | ︙ |
Changes to library/demos/sayings.tcl.
1 2 3 4 5 6 7 8 9 10 | # sayings.tcl -- # # This demonstration script creates a listbox that can be scrolled # both horizontally and vertically. It displays a collection of # well-known sayings. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # sayings.tcl -- # # This demonstration script creates a listbox that can be scrolled # both horizontally and vertically. It displays a collection of # well-known sayings. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .sayings catch {destroy $w} toplevel $w wm title $w "Listbox Demonstration (well-known sayings)" wm iconname $w "sayings" positionWindow $w |
︙ | ︙ |
Changes to library/demos/search.tcl.
1 2 3 4 5 6 7 8 9 10 | # search.tcl -- # # This demonstration script creates a collection of widgets that # allow you to load a file into a text widget, then perform searches # on that file. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # search.tcl -- # # This demonstration script creates a collection of widgets that # allow you to load a file into a text widget, then perform searches # on that file. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # textLoadFile -- # This procedure below loads a file into a text widget, discarding # the previous contents of the widget. Tags for the old widget are # not affected, however. # # Arguments: |
︙ | ︙ |
Changes to library/demos/spin.tcl.
1 2 3 4 5 6 7 8 | # spin.tcl -- # # This demonstration script creates several spinbox widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # spin.tcl -- # # This demonstration script creates several spinbox widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .spin catch {destroy $w} toplevel $w wm title $w "Spinbox Demonstration" wm iconname $w "spin" positionWindow $w |
︙ | ︙ |
Changes to library/demos/states.tcl.
1 2 3 4 5 6 7 8 9 | # states.tcl -- # # This demonstration script creates a listbox widget that displays # the names of the 50 states in the United States of America. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # states.tcl -- # # This demonstration script creates a listbox widget that displays # the names of the 50 states in the United States of America. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .states catch {destroy $w} toplevel $w wm title $w "Listbox Demonstration (50 states)" wm iconname $w "states" positionWindow $w |
︙ | ︙ |
Changes to library/demos/style.tcl.
1 2 3 4 5 6 7 8 9 | # style.tcl -- # # This demonstration script creates a text widget that illustrates the # various display styles that may be set for tags. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # style.tcl -- # # This demonstration script creates a text widget that illustrates the # various display styles that may be set for tags. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .style catch {destroy $w} toplevel $w wm title $w "Text Demonstration - Display Styles" wm iconname $w "style" positionWindow $w |
︙ | ︙ |
Changes to library/demos/tcolor.
1 2 3 4 5 6 7 8 9 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # tcolor -- # This script implements a simple color editor, where you can # create colors using either the RGB, HSB, or CYM color spaces # and apply the color to existing applications. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # tcolor -- # This script implements a simple color editor, where you can # create colors using either the RGB, HSB, or CYM color spaces # and apply the color to existing applications. package require Tk wm title . "Color Editor" # Global variables that control the program: # # colorSpace - Color space currently being used for # editing. Must be "rgb", "cmy", or "hsb". # label1, label2, label3 - Labels for the scales. |
︙ | ︙ |
Changes to library/demos/text.tcl.
1 2 3 4 5 6 7 8 9 | # text.tcl -- # # This demonstration script creates a text widget that describes # the basic editing functions. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # text.tcl -- # # This demonstration script creates a text widget that describes # the basic editing functions. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .text catch {destroy $w} toplevel $w wm title $w "Text Demonstration - Basic Facilities" wm iconname $w "text" positionWindow $w |
︙ | ︙ |
Changes to library/demos/textpeer.tcl.
1 2 3 4 5 6 7 8 9 10 | # textpeer.tcl -- # # This demonstration script creates a pair of text widgets that can edit a # single logical buffer. This is particularly useful when editing related text # in two (or more) parts of the same file. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # textpeer.tcl -- # # This demonstration script creates a pair of text widgets that can edit a # single logical buffer. This is particularly useful when editing related text # in two (or more) parts of the same file. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .textpeer catch {destroy $w} toplevel $w wm title $w "Text Widget Peering Demonstration" wm iconname $w "textpeer" positionWindow $w |
︙ | ︙ |
Changes to library/demos/timer.
1 2 3 4 5 6 7 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # timer -- # This script generates a counter with start and stop buttons. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # timer -- # This script generates a counter with start and stop buttons. package require Tk label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m button .start -text Start -command { if {$stopped} { set stopped 0 set startMoment [clock clicks -milliseconds] tick |
︙ | ︙ |
Changes to library/demos/toolbar.tcl.
1 2 3 4 5 6 7 8 | # toolbar.tcl -- # # This demonstration script creates a toolbar that can be torn off. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # toolbar.tcl -- # # This demonstration script creates a toolbar that can be torn off. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .toolbar destroy $w toplevel $w wm title $w "Toolbar Demonstration" wm iconname $w "toolbar" positionWindow $w |
︙ | ︙ |
Changes to library/demos/tree.tcl.
1 2 3 4 5 6 7 8 9 | # tree.tcl -- # # This demonstration script creates a toplevel window containing a Ttk # tree widget. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # tree.tcl -- # # This demonstration script creates a toplevel window containing a Ttk # tree widget. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .tree catch {destroy $w} toplevel $w wm title $w "Directory Browser" wm iconname $w "tree" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttkbut.tcl.
1 2 3 4 5 6 7 8 9 10 | # ttkbut.tcl -- # # This demonstration script creates a toplevel window containing several # simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and # radiobuttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # ttkbut.tcl -- # # This demonstration script creates a toplevel window containing several # simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and # radiobuttons. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttkbut catch {destroy $w} toplevel $w wm title $w "Simple Ttk Widgets" wm iconname $w "ttkbut" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttkmenu.tcl.
1 2 3 4 5 6 7 8 9 | # ttkmenu.tcl -- # # This demonstration script creates a toplevel window containing several Ttk # menubutton widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # ttkmenu.tcl -- # # This demonstration script creates a toplevel window containing several Ttk # menubutton widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttkmenu catch {destroy $w} toplevel $w wm title $w "Ttk Menu Buttons" wm iconname $w "ttkmenu" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttknote.tcl.
1 2 3 4 5 6 7 8 9 | # ttknote.tcl -- # # This demonstration script creates a toplevel window containing a Ttk # notebook widget. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # ttknote.tcl -- # # This demonstration script creates a toplevel window containing a Ttk # notebook widget. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttknote catch {destroy $w} toplevel $w wm title $w "Ttk Notebook Widget" wm iconname $w "ttknote" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttkpane.tcl.
1 2 3 4 5 6 7 8 | # ttkpane.tcl -- # # This demonstration script creates a Ttk pane with some content. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # ttkpane.tcl -- # # This demonstration script creates a Ttk pane with some content. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttkpane catch {destroy $w} toplevel $w wm title $w "Themed Nested Panes" wm iconname $w "ttkpane" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttkprogress.tcl.
1 2 3 4 5 6 7 8 | # ttkprogress.tcl -- # # This demonstration script creates several progress bar widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # ttkprogress.tcl -- # # This demonstration script creates several progress bar widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttkprogress catch {destroy $w} toplevel $w wm title $w "Progress Bar Demonstration" wm iconname $w "ttkprogress" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttkscale.tcl.
1 2 3 4 5 6 7 8 | # ttkscale.tcl -- # # This demonstration script shows an example with a horizontal scale. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # ttkscale.tcl -- # # This demonstration script shows an example with a horizontal scale. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttkscale catch {destroy $w} toplevel $w -bg [ttk::style lookup TLabel -background] wm title $w "Themed Scale Demonstration" wm iconname $w "ttkscale" positionWindow $w |
︙ | ︙ |
Changes to library/demos/ttkspin.tcl.
1 2 3 4 5 6 7 8 | # ttkspin.tcl -- # # This demonstration script creates several Ttk spinbox widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # ttkspin.tcl -- # # This demonstration script creates several Ttk spinbox widgets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .ttkspin catch {destroy $w} toplevel $w wm title $w "Themed Spinbox Demonstration" wm iconname $w "ttkspin" positionWindow $w |
︙ | ︙ |
Changes to library/demos/twind.tcl.
1 2 3 4 5 6 7 8 9 | # twind.tcl -- # # This demonstration script creates a text widget with a bunch of # embedded windows. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # twind.tcl -- # # This demonstration script creates a text widget with a bunch of # embedded windows. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk # Make an Aqua button's fill color match its parent's background proc blend {bt} { if {[tk windowingsystem] eq "aqua"} { $bt configure -highlightbackground [[winfo parent $bt] cget -background] } return $bt |
︙ | ︙ |
Changes to library/demos/unicodeout.tcl.
1 2 3 4 5 6 7 8 9 | # unicodeout.tcl -- # # This demonstration script shows how you can produce output (in label # widgets) using many different alphabets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # unicodeout.tcl -- # # This demonstration script shows how you can produce output (in label # widgets) using many different alphabets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .unicodeout catch {destroy $w} toplevel $w wm title $w "Unicode Label Demonstration" wm iconname $w "unicodeout" positionWindow $w |
︙ | ︙ |
Changes to library/demos/vscale.tcl.
1 2 3 4 5 6 7 8 | # vscale.tcl -- # # This demonstration script shows an example with a vertical scale. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # vscale.tcl -- # # This demonstration script shows an example with a vertical scale. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .vscale catch {destroy $w} toplevel $w wm title $w "Vertical Scale Demonstration" wm iconname $w "vscale" positionWindow $w |
︙ | ︙ |
Changes to library/demos/widget.
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # widget -- # This script demonstrates the various widgets provided by Tk, along with many # of the features of the Tk toolkit. This file only contains code to generate # the main window for the application, which invokes individual # demonstrations. The code for the actual demonstrations is contained in # separate ".tcl" files is this directory, which are sourced by this script as # needed. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #!/bin/sh # the next line restarts using wish \ exec wish "$0" ${1+"$@"} # widget -- # This script demonstrates the various widgets provided by Tk, along with many # of the features of the Tk toolkit. This file only contains code to generate # the main window for the application, which invokes individual # demonstrations. The code for the actual demonstrations is contained in # separate ".tcl" files is this directory, which are sourced by this script as # needed. package require Tk 8.7- package require msgcat destroy {*}[winfo children .] set tk_demoDirectory [file join [pwd] [file dirname [info script]]] ::msgcat::mcload $tk_demoDirectory namespace import ::msgcat::mc wm title . [mc "Widget Demonstration"] |
︙ | ︙ |
Changes to library/listbox.tcl.
︙ | ︙ | |||
10 11 12 13 14 15 16 | # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #-------------------------------------------------------------------------- # tk::Priv elements used in this file: # # afterId - Token returned by "after" for autoscanning. | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #-------------------------------------------------------------------------- # tk::Priv elements used in this file: # # afterId - Token returned by "after" for autoscanning. # listboxPrev - The last element to be selected or deselected # during a selection operation. # listboxSelection - All of the items that were selected before the # current selection operation (such as a mouse # drag) started; used to cancel an operation. #-------------------------------------------------------------------------- #------------------------------------------------------------------------- |
︙ | ︙ | |||
187 188 189 190 191 192 193 | bind Listbox <Shift-Option-MouseWheel> { tk::MouseWheel %W x %D -12.0 units } bind Listbox <TouchpadScroll> { if {%# %% 5 != 0} { return } | | | | | | | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | bind Listbox <Shift-Option-MouseWheel> { tk::MouseWheel %W x %D -12.0 units } bind Listbox <TouchpadScroll> { if {%# %% 5 != 0} { return } lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) if {$tk::Priv(deltaX) != 0} { %W xview scroll [expr {-$tk::Priv(deltaX)}] units } if {$tk::Priv(deltaY) != 0} { %W yview scroll [expr {-$tk::Priv(deltaY)}] units } } # ::tk::ListboxBeginSelect -- # # This procedure is typically invoked on button-1 presses. It begins # the process of making a selection in the listbox. Its exact behavior |
︙ | ︙ |
Changes to library/menu.tcl.
︙ | ︙ | |||
483 484 485 486 487 488 489 490 491 492 493 494 495 496 | } } else { $menu activate @$x,$y GenerateMenuSelect $menu } set index [$menu index @$x,$y] if {[info exists Priv(menuActivated)] \ && $index >= 0 \ && $index ne $activeindex} { set mode [option get $menu clickToFocus ClickToFocus] if {[string is false $mode]} { set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}] if {[$menu type $index] eq "cascade"} { # Catch these postcascade commands since the menu could be | > | 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | } } else { $menu activate @$x,$y GenerateMenuSelect $menu } set index [$menu index @$x,$y] if {[info exists Priv(menuActivated)] \ && $index ne "none" \ && $index >= 0 \ && $index ne $activeindex} { set mode [option get $menu clickToFocus ClickToFocus] if {[string is false $mode]} { set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}] if {[$menu type $index] eq "cascade"} { # Catch these postcascade commands since the menu could be |
︙ | ︙ | |||
525 526 527 528 529 530 531 | proc ::tk::MenuButtonDown menu { variable ::tk::Priv if {![winfo viewable $menu]} { return } | | > | 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | proc ::tk::MenuButtonDown menu { variable ::tk::Priv if {![winfo viewable $menu]} { return } set activeindex [$menu index active] if {($activeindex eq "none") || ($activeindex < 0)} { if {[$menu cget -type] ne "menubar" } { set Priv(window) {} } return } $menu postcascade active if {$Priv(postedMb) ne "" && [winfo viewable $Priv(postedMb)]} { |
︙ | ︙ | |||
583 584 585 586 587 588 589 | # menu - The menu window. # rootx, rooty - Root coordinates of mouse. # state - Modifier state. proc ::tk::MenuLeave {menu rootx rooty state} { variable ::tk::Priv set Priv(window) {} | | > | 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | # menu - The menu window. # rootx, rooty - Root coordinates of mouse. # state - Modifier state. proc ::tk::MenuLeave {menu rootx rooty state} { variable ::tk::Priv set Priv(window) {} set activeindex [$menu index active] if {($activeindex eq "none") || ($activeindex < 0)} { return } if {[$menu type active] eq "cascade" \ && [winfo containing $rootx $rooty] eq \ [$menu entrycget active -menu]} { return } |
︙ | ︙ | |||
650 651 652 653 654 655 656 | # the use of checkbuttons/commands/etc. on menubars (which is legal, # but not recommended) if { !$isCascade } { uplevel #0 [list $w invoke $activeindex] } } else { | | > | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | # the use of checkbuttons/commands/etc. on menubars (which is legal, # but not recommended) if { !$isCascade } { uplevel #0 [list $w invoke $activeindex] } } else { set activeindex [$w index active] if {($Priv(popup) eq "") || (($activeindex ne "none") && ($activeindex >= 0))} { MenuUnpost $w } uplevel #0 [list $w invoke active] } } # ::tk::MenuEscape -- |
︙ | ︙ | |||
794 795 796 797 798 799 800 801 802 803 804 805 806 807 | while {$i >= $length} { incr i -$length } set mb [lindex $buttons $i] if {[winfo class $mb] eq "Menubutton" \ && [$mb cget -state] ne "disabled" \ && [$mb cget -menu] ne "" \ && [[$mb cget -menu] index last] >= 0} { break } if {$mb eq $w} { return } incr i $count | > | 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | while {$i >= $length} { incr i -$length } set mb [lindex $buttons $i] if {[winfo class $mb] eq "Menubutton" \ && [$mb cget -state] ne "disabled" \ && [$mb cget -menu] ne "" \ && [[$mb cget -menu] index last] ne "none" \ && [[$mb cget -menu] index last] >= 0} { break } if {$mb eq $w} { return } incr i $count |
︙ | ︙ | |||
817 818 819 820 821 822 823 | # Arguments: # menu - Menu window that received the keystroke. # count - 1 means go to the next lower entry, # -1 means go to the next higher entry. proc ::tk::MenuNextEntry {menu count} { set last [$menu index last] | | | | 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 | # Arguments: # menu - Menu window that received the keystroke. # count - 1 means go to the next lower entry, # -1 means go to the next higher entry. proc ::tk::MenuNextEntry {menu count} { set last [$menu index last] if {($last eq "none") || ($last < 0)} { return } set length [expr {$last+1}] set quitAfter $length set activeindex [$menu index active] if {($activeindex eq "none") || ($activeindex < 0)} { set i 0 } else { set i [expr {$activeindex + $count}] } while {1} { if {$quitAfter <= 0} { # We've tried every entry in the menu. Either there are |
︙ | ︙ | |||
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 | proc ::tk::TraverseWithinMenu {w char} { if {$char eq ""} { return } set char [string tolower $char] set last [$w index last] for {set i 0} {$i <= $last} {incr i} { if {[catch {set char2 [string index \ [$w entrycget $i -label] [$w entrycget $i -underline]]}]} { continue } if {$char eq [string tolower $char2]} { if {[$w type $i] eq "cascade"} { | > > > | 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 | proc ::tk::TraverseWithinMenu {w char} { if {$char eq ""} { return } set char [string tolower $char] set last [$w index last] if {$last eq "none"} { return } for {set i 0} {$i <= $last} {incr i} { if {[catch {set char2 [string index \ [$w entrycget $i -label] [$w entrycget $i -underline]]}]} { continue } if {$char eq [string tolower $char2]} { if {[$w type $i] eq "cascade"} { |
︙ | ︙ | |||
1062 1063 1064 1065 1066 1067 1068 | # menu - Name of the menu window (possibly empty). proc ::tk::MenuFirstEntry menu { if {$menu eq ""} { return } tk_menuSetFocus $menu | | > > > > | 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 | # menu - Name of the menu window (possibly empty). proc ::tk::MenuFirstEntry menu { if {$menu eq ""} { return } tk_menuSetFocus $menu set activeindex [$menu index active] if {($activeindex ne "none") && ($activeindex >= 0)} { return } set last [$menu index last] if {$last eq "none"} { return } for {set i 0} {$i <= $last} {incr i} { if {([catch {set state [$menu entrycget $i -state]}] == 0) \ && $state ne "disabled" && [$menu type $i] ne "tearoff"} { $menu activate $i GenerateMenuSelect $menu # Only post the cascade if the current menu is a menubar; # otherwise, if the first entry of the cascade is a cascade, |
︙ | ︙ | |||
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 | proc ::tk::MenuFindName {menu s} { set i "" if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} { catch {set i [$menu index $s]} return $i } set last [$menu index last] for {set i 0} {$i <= $last} {incr i} { if {![catch {$menu entrycget $i -label} label]} { if {$label eq $s} { return $i } } } | > > > | 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | proc ::tk::MenuFindName {menu s} { set i "" if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} { catch {set i [$menu index $s]} return $i } set last [$menu index last] if {$last eq "none"} { return "" } for {set i 0} {$i <= $last} {incr i} { if {![catch {$menu entrycget $i -label} label]} { if {$label eq $s} { return $i } } } |
︙ | ︙ |
Added library/obsolete.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | # obsolete.tcl -- # # This file contains obsolete procedures that people really shouldn't # be using anymore, but which are kept around for backward compatibility. # # Copyright © 1994 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # The procedures below are here strictly for backward compatibility with # Tk version 3.6 and earlier. The procedures are no longer needed, so # they are no-ops. You should not use these procedures anymore, since # they may be removed in some future release. proc tk_menuBar args {} proc tk_bindForTraversal args {} # ::tk::classic::restore -- # # Restore the pre-8.5 (Tk classic) look as the widget defaults for classic # Tk widgets. # # The value following an 'option add' call is the new 8.5 value. # namespace eval ::tk::classic { # This may need to be adjusted for some window managers that are # more aggressive with their own Xdefaults (like KDE and CDE) variable prio "widgetDefault" } proc ::tk::classic::restore {args} { # Restore classic (8.4) look to classic Tk widgets variable prio if {[llength $args]} { foreach what $args { ::tk::classic::restore_$what } } else { foreach cmd [info procs restore_*] { $cmd } } } proc ::tk::classic::restore_font {args} { # Many widgets were adjusted from hard-coded defaults to using the # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...) # For restoring compatibility, we only correct size and weighting changes, # as the fonts themselves remained mostly the same. if {[tk windowingsystem] eq "x11"} { font configure TkDefaultFont -weight bold ; # normal font configure TkFixedFont -size -12 ; # -10 } # Add these with prio 21 to override value in dialog/msgbox.tcl if {[tk windowingsystem] eq "aqua"} { option add *Dialog.msg.font system 21; # TkCaptionFont option add *Dialog.dtl.font system 21; # TkCaptionFont option add *ErrorDialog*Label.font system 21; # TkCaptionFont } else { option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont } } proc ::tk::classic::restore_button {args} { variable prio if {[tk windowingsystem] eq "x11"} { foreach cls {Button Radiobutton Checkbutton} { option add *$cls.borderWidth 2 $prio; # 1 } } } proc ::tk::classic::restore_entry {args} { variable prio # Entry and Spinbox share core defaults foreach cls {Entry Spinbox} { if {[tk windowingsystem] ne "aqua"} { option add *$cls.borderWidth 2 $prio; # 1 } if {[tk windowingsystem] eq "x11"} { option add *$cls.background "#d9d9d9" $prio; # "white" option add *$cls.selectBorderWidth 1 $prio; # 0 } } } proc ::tk::classic::restore_listbox {args} { variable prio if {[tk windowingsystem] ne "win32"} { option add *Listbox.background "#d9d9d9" $prio; # "white" option add *Listbox.activeStyle "underline" $prio; # "dotbox" } if {[tk windowingsystem] ne "aqua"} { option add *Listbox.borderWidth 2 $prio; # 1 } if {[tk windowingsystem] eq "x11"} { option add *Listbox.selectBorderWidth 1 $prio; # 0 } # Remove focus into Listbox added for 8.5 bind Listbox <Button-1> { if {[winfo exists %W]} { tk::ListboxBeginSelect %W [%W index @%x,%y] } } } proc ::tk::classic::restore_menu {args} { variable prio if {[tk windowingsystem] eq "x11"} { option add *Menu.activeBorderWidth 2 $prio; # 1 option add *Menu.borderWidth 2 $prio; # 1 option add *Menu.clickToFocus true $prio option add *Menu.useMotifHelp true $prio } if {[tk windowingsystem] ne "aqua"} { option add *Menu.font "TkDefaultFont" $prio; # "TkMenuFont" } } proc ::tk::classic::restore_menubutton {args} { variable prio option add *Menubutton.borderWidth 2 $prio; # 1 } proc ::tk::classic::restore_message {args} { variable prio option add *Message.borderWidth 2 $prio; # 1 } proc ::tk::classic::restore_panedwindow {args} { variable prio option add *Panedwindow.borderWidth 2 $prio; # 1 option add *Panedwindow.sashWidth 2 $prio; # 3 option add *Panedwindow.sashPad 2 $prio; # 0 option add *Panedwindow.sashRelief raised $prio; # flat option add *Panedwindow.opaqueResize 0 $prio; # 1 if {[tk windowingsystem] ne "win32"} { option add *Panedwindow.showHandle 1 $prio; # 0 } } proc ::tk::classic::restore_scale {args} { variable prio option add *Scale.borderWidth 2 $prio; # 1 if {[tk windowingsystem] eq "x11"} { option add *Scale.troughColor "#c3c3c3" $prio; # "#b3b3b3" } } proc ::tk::classic::restore_scrollbar {args} { variable prio if {[tk windowingsystem] eq "x11"} { option add *Scrollbar.borderWidth 2 $prio; # 1 option add *Scrollbar.highlightThickness 1 $prio; # 0 option add *Scrollbar.width 15 $prio; # 11 option add *Scrollbar.troughColor "#c3c3c3" $prio; # "#b3b3b3" } } proc ::tk::classic::restore_text {args} { variable prio if {[tk windowingsystem] ne "aqua"} { option add *Text.borderWidth 2 $prio; # 1 } if {[tk windowingsystem] eq "win32"} { option add *Text.font "TkDefaultFont" $prio; # "TkFixedFont" } if {[tk windowingsystem] eq "x11"} { option add *Text.background "#d9d9d9" $prio; # white option add *Text.selectBorderWidth 1 $prio; # 0 } } |
Changes to library/print.tcl.
︙ | ︙ | |||
648 649 650 651 652 653 654 | return $color } # Initialize all the variables once. _init_print_canvas } #end win32 procedures | | > | > > > > > > > > > > | | | > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > | > > > > > > > > > > | | | | | | | > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > | > > > > > > > > > > > > > | > > > > > > > > > | > > > > > | > > > > > | > > > > > > | > > > > > > > > > > > > > > | > < < < | | | < < < | < < < < < < < < < < < | < < < | | < < < | | < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | > | | | | | | > | | | | > | > > > > > > > | > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > | | | | | | | | > | | | | > | < | | | > | > | | | | | | | | > > > > > > > > > > > > > > > > > > > | | | | | | | | | | > > > > | | | > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > | < | | | | | > > | | | | | | | > > > > > > > > | | | | > > | < > > | | | > > | > > | | < < < > | > > > > | > | | > | < < > | > > > > | | < < < > | | > | > > > > > > | < < > > > > > > | > > > > > | | < | < < < < > | > | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 | return $color } # Initialize all the variables once. _init_print_canvas } #end win32 procedures } # Begin X11 procedures. They depends on Cups being installed. # X11 procedures abstracts print management with a "cups" ensemble command # cups defaultprinter returns the default printer # cups getprinters returns a dictionary of printers along # with printer info # cups print $printer $data ?$options? # print the data (binary) on a given printer # with the provided (supported) options: # -colormode -copies -format -margins # -media -nup -orientation # -prettyprint -title -tzoom # Some output configuration that on other platforms is managed through # the printer driver/dialog is configured through the canvas postscript command. if {[tk windowingsystem] eq "x11"} { if {[info commands ::tk::print::cups] eq ""} { namespace eval ::tk::print::cups { # Pure Tcl cups ensemble command implementation variable pcache } proc ::tk::print::cups::defaultprinter {} { set default {} regexp {: ([^[:space:]]+)$} [exec lpstat -d] _ default return $default } proc ::tk::print::cups::getprinters {} { variable pcache # Test for existence of lpstat command to obtain the list of # printers. # Return an error if not found. set res {} try { set printers [lsort -unique [split [exec lpstat -e] \n]] foreach printer $printers { set options [Parseoptions [exec lpoptions -p $printer]] dict set res $printer $options } } trap {POSIX ENOENT} {e o} { # no such command in PATH set cmd [lindex [dict get $o -errorstack ] 1 2] return -code error "Unable to obtain the list of printers.\ Command \"$cmd\" not found.\ Please install the CUPS package for your system." } trap {CHILDSTATUS} {} { # command returns a non-0 exit status. Wrong print system? set cmd [lindex [dict get $o -errorstack ] 1 2] return -code error "Command \"$cmd\" return with errors" } return [set pcache $res] } # Parseoptions # Parse lpoptions -d output. It has three forms # option-key # option-key=option-value # option-key='option value with spaces' # Arguments: # data - data to process. # proc ::tk::print::cups::Parseoptions {data} { set res {} set re {[^ =]+|[^ ]+='[^']+'|[^ ]+=[^ ']+} foreach tok [regexp -inline -all $re $data] { lassign [split $tok "="] k v dict set res $k [string trim $v "'"] } return $res } proc ::tk::print::cups::print {printer data args} { variable pcache if {$printer ni [dict keys $pcache]} { return -code error "unknown printer or class \"$printer\"" } set title "Tk print job" set options { -colormode -copies -format -margins -media -nup -orientation -prettyprint -title -tzoom } while {[llength $args]} { set opt [tcl::prefix match $options [lpop args 0]] switch $opt { -colormode { set opts {auto monochrome color} set val [tcl::prefix match $opts [lpop args 0]] lappend printargs -o print-color-mode=$val } -copies { set val [lpop args 0] if {![string is integer -strict $val] || $val < 0 || $val > 100 } { # save paper !! return -code error "copies must be an integer\ between 0 and 100" } lappend printargs -o copies=$val } -format { set opts {auto pdf postscript text} set val [tcl::prefix match $opts [lpop args 0]] # lpr uses auto always } -margins { set val [lpop args 0] if {[llength $val] != 4 || ![string is integer -strict [lindex $val 0]] || ![string is integer -strict [lindex $val 1]] || ![string is integer -strict [lindex $val 2]] || ![string is integer -strict [lindex $val 3]] } { return -code error "margins must be a list of 4\ integers: top left bottom right" } lappend printargs -o page-top=[lindex $val 0] lappend printargs -o page-left=[lindex $val 1] lappend printargs -o page-bottom=[lindex $val 2] lappend printargs -o page-right=[lindex $val 3] } -media { set opts {a4 legal letter} set val [tcl::prefix match $opts [lpop args 0]] lappend printargs -o media=$val } -nup { set val [lpop args 0] if {$val ni {1 2 4 6 9 16}} { return -code error "number-up must be 1, 2, 4, 6, 9 or\ 16" } lappend printargs -o number-up=$val } -orientation { set opts {portrait landscape} set val [tcl::prefix match $opts [lpop args 0]] if {$val eq "landscape"} lappend printargs -o landscape=true } -prettyprint { lappend printargs -o prettyprint=true # prettyprint mess with these default values if set # so we force them. # these will be overriden if set after this point if {[lsearch $printargs {cpi=*}] == -1} { lappend printargs -o cpi=10.0 lappend printargs -o lpi=6.0 } } -title { set title [lpop args 0] } -tzoom { set val [lpop args 0] if {![string is double -strict $val] || $val < 0.5 || $val > 2.0 } { return -code error "text zoom must be a number between\ 0.5 and 2.0" } # CUPS text filter defaults to lpi=6 and cpi=10 lappend printargs -o cpi=[expr {10.0 / $val}] lappend printargs -o lpi=[expr {6.0 / $val}] } default { # shouldn't happen } } } # build our options lappend printargs -T $title lappend printargs -P $printer # open temp file set fd [file tempfile fname tk_print] chan configure $fd -encoding binary -translation binary chan puts $fd $data chan close $fd # add -r to automatically delete temp files exec lpr {*}$printargs -r $fname & } namespace eval ::tk::print::cups { namespace export defaultprinter getprinters print namespace ensemble create } };# ::tk::print::cups namespace eval ::tk::print { variable mcmap set mcmap(media) [dict create \ [mc "Letter"] letter \ [mc "Legal"] legal \ [mc "A4"] a4] set mcmap(orient) [dict create \ [mc "Portrait"] portrait \ [mc "Landscape"] landscape] set mcmap(color) [dict create \ [mc "RGB"] color \ [mc "Grayscale"] gray] # available print options variable optlist set optlist(printer) {} set optlist(media) [dict keys $mcmap(media)] set optlist(orient) [dict keys $mcmap(orient)] set optlist(color) [dict keys $mcmap(color)] set optlist(number-up) {1 2 4 6 9 16} # selected options variable option set option(printer) {} # Initialize with sane defaults. set option(copies) 1 set option(media) [mc "A4"] # Canvas options set option(orient) [mc "Portrait"] set option(color) [mc "RGB"] set option(czoom) 100 # Text options. # See libcupsfilter's cfFilterTextToPDF() and cups-filters's texttopdf # known options: # prettyprint, wrap, columns, lpi, cpi set option(number-up) 1 set option(tzoom) 100; # we derive lpi and cpi from this value set option(pprint) 0 ; # pretty print set option(margin-top) 20 ; # ~ 7mm (~ 1/4") set option(margin-left) 20 ; # ~ 7mm (~ 1/4") set option(margin-right) 20 ; # ~ 7mm (~ 1/4") set option(margin-bottom) 20 ; # ~ 7mm (~ 1/4") # array to collect printer information variable pinfo array set pinfo {} # a map for printer state -> human readable message variable statemap dict set statemap 3 [mc "Idle"] dict set statemap 4 [mc "Printing"] dict set statemap 5 [mc "Printer stopped"] } # ttk version of [tk_optionMenu] # var should be a full qualified varname proc ::tk::print::ttk_optionMenu {w var args} { ttk::menubutton $w -textvariable $var -menu $w.menu menu $w.menu foreach option $args { $w.menu add command \ -label $option \ -command [list set $var $option] } # return the same value as tk_optionMenu return $w.menu } # _setprintenv # Set the print environtment - list of printers, state and options. # Arguments: # none. # proc ::tk::print::_setprintenv {} { variable option variable optlist variable pinfo set optlist(printer) {} dict for {printer options} [cups getprinters] { lappend optlist(printer) $printer set pinfo($printer) $options } # It's an error to not have any printer configured if {[llength $optlist(printer)] == 0} { return -code error "No installed printers found.\ Please check or update your CUPS installation." } # If no printer is selected, check for the default one # If none found, use the first one from the list if {$option(printer) eq ""} { set option(printer) [cups defaultprinter] if {$option(printer) eq ""} { set option(printer) [lindex $optlist(printer) 0] } } } # _print # Main printer dialog. # Select printer, set options, and fire print command. # Arguments: # w - widget with contents to print. # proc ::tk::print::_print {w} { variable optlist variable option variable pinfo variable statemap # default values for dialog widgets option add *Printdialog*TLabel.anchor e option add *Printdialog*TMenubutton.Menu.tearOff 0 option add *Printdialog*TMenubutton.width 12 option add *Printdialog*TSpinbox.width 12 # this is tempting to add, but it's better to leave it to # user's taste. # option add *Printdialog*Menu.background snow set class [winfo class $w] if {$class ni {Text Canvas}} { return -code error "printing windows of class \"$class\"\ is not supported" } # Should this be called with every invocaton? # Yes. It allows dynamic discovery of newly added printers # whithout having to restart the app _setprintenv set p ._print destroy $p # Copy the current values to a dialog's temporary variable. # This allow us to cancel the dialog discarding any changes # made to the options namespace eval dlg {variable option} array set dlg::option [array get option] set var [namespace which -variable dlg::option] # The toplevel of our dialog toplevel $p -class Printdialog place [ttk::frame $p.background] -x 0 -y 0 -relwidth 1.0 -relheight 1.0 wm title $p [mc "Print"] wm resizable $p 0 0 wm attributes $p -type dialog wm transient $p [winfo toplevel $w] # The printer to use set pf [ttk::frame $p.printerf] pack $pf -side top -fill x -expand no -padx 9p -pady 9p ttk::label $pf.printerl -text "[mc "Printer"]" set tv [ttk::treeview $pf.prlist -height 5 \ -columns {printer location state} \ -show headings \ -selectmode browse] $tv configure \ -yscrollcommand [namespace code [list _scroll $pf.sy]] \ -xscrollcommand [namespace code [list _scroll $pf.sx]] ttk::scrollbar $pf.sy -command [list $tv yview] ttk::scrollbar $pf.sx -command [list $tv xview] -orient horizontal $tv heading printer -text [mc "Printer"] $tv heading location -text [mc "Location"] $tv heading state -text [mc "State"] $tv column printer -width 200 -stretch 0 $tv column location -width 100 -stretch 0 $tv column state -width 250 -stretch 0 foreach printer $optlist(printer) { set location [dict getdef $pinfo($printer) printer-location ""] set nstate [dict getdef $pinfo($printer) printer-state 0] set state [dict getdef $statemap $nstate ""] switch -- $nstate { 3 - 4 { set accepting [dict getdef $pinfo($printer) \ printer-is-accepting-jobs ""] if {$accepting ne ""} { append state ". " [mc "Printer is accepting jobs"] } } 5 { set reason [dict getdef $pinfo($printer) \ printer-state-reasons ""] if {$reason ne ""} { append state ". (" $reason ")" } } } set id [$tv insert {} end \ -values [list $printer $location $state]] if {$option(printer) eq $printer} { $tv selection set $id } } grid $pf.printerl -sticky w grid $pf.prlist $pf.sy -sticky news grid $pf.sx -sticky ew grid remove $pf.sy $pf.sx bind $tv <<TreeviewSelect>> [namespace code {_onselect %W}] # Start of printing options set of [ttk::labelframe $p.optionsframe -text [mc "Options"]] pack $of -fill x -padx 9p -pady {0 9p} -ipadx 2p -ipady 2p # COPIES ttk::label $of.copiesl -text "[mc "Copies"] :" ttk::spinbox $of.copies -textvariable ${var}(copies) \ -from 1 -to 1000 grid $of.copiesl $of.copies -sticky ew -padx 2p -pady 2p $of.copies state readonly # PAPER SIZE ttk::label $of.medial -text "[mc "Paper"] :" ttk_optionMenu $of.media ${var}(media) {*}$optlist(media) grid $of.medial $of.media -sticky ew -padx 2p -pady 2p if {$class eq "Canvas"} { # additional options for Canvas output # SCALE ttk::label $of.percentl -text "[mc "Scale"] :" ttk::spinbox $of.percent -textvariable ${var}(czoom) \ -from 5 -to 500 -increment 5 grid $of.percentl $of.percent -sticky ew -padx 2p -pady 2p $of.percent state readonly # ORIENT ttk::label $of.orientl -text "[mc "Orientation"] :" ttk_optionMenu $of.orient ${var}(orient) {*}$optlist(orient) grid $of.orientl $of.orient -sticky ew -padx 2p -pady 2p # COLOR ttk::label $of.colorl -text "[mc "Output"] :" ttk_optionMenu $of.color ${var}(color) {*}$optlist(color) grid $of.colorl $of.color -sticky ew -padx 2p -pady 2p } elseif {$class eq "Text"} { # additional options for Text output # NUMBER-UP ttk::label $of.nupl -text "[mc "Pages per sheet"] :" ttk_optionMenu $of.nup ${var}(number-up) {*}$optlist(number-up) grid $of.nupl $of.nup -sticky ew -padx 2p -pady 2p # TEXT SCALE ttk::label $of.tzooml -text "[mc "Text scale"] :" ttk::spinbox $of.tzoom -textvariable ${var}(tzoom) \ -from 50 -to 200 -increment 5 grid $of.tzooml $of.tzoom -sticky ew -padx 2p -pady 2p $of.tzoom state readonly # PRETTY PRINT (banner on top) ttk::checkbutton $of.pprint -onvalue 1 -offvalue 0 \ -text [mc "Pretty print"] \ -variable ${var}(pprint) grid $of.pprint - -sticky ew -padx 2p -pady 2p } # The buttons frame. set bf [ttk::frame $p.buttonf] pack $bf -fill x -expand no -side bottom -padx 9p -pady {0 9p} ttk::button $bf.print -text [mc "Print"] \ -command [namespace code [list _runprint $w $class $p]] ttk::button $bf.cancel -text [mc "Cancel"] \ -command [list destroy $p] pack $bf.print -side right pack $bf.cancel -side right -padx {0 4.5p} # cleanup binding bind $bf <Destroy> [namespace code [list _cleanup $p]] # Center the window as a dialog. ::tk::PlaceWindow $p } # _onselect # Updates the selected printer when treeview selection changes. # Arguments: # tv - treeview pathname. # proc ::tk::print::_onselect {tv} { variable dlg::option set id [$tv selection] if {$id eq ""} { # is this even possible? set option(printer) "" } else { set option(printer) [$tv set $id printer] } } # _scroll # Implements autoscroll for the printers view # proc ::tk::print::_scroll {sbar from to} { if {$from == 0.0 && $to == 1.0} { grid remove $sbar } else { grid $sbar $sbar set $from $to } } # _cleanup # Perform cleanup when the dialog is destroyed. # Arguments: # p - print dialog pathname (not used). # proc ::tk::print::_cleanup {p} { namespace delete dlg } # _runprint - # Execute the print command--print the file. # Arguments: # w - widget with contents to print. # class - class of the widget to print (Canvas or Text). # p - print dialog pathname. # proc ::tk::print::_runprint {w class p} { variable option variable mcmap # copy the values back from the dialog array set option [array get dlg::option] # get (back) name of media from the translated one set media [dict get $mcmap(media) $option(media)] set printargs {} lappend printargs -title "[tk appname]: Tk window $w" lappend printargs -copies $option(copies) lappend printargs -media $media if {$class eq "Canvas"} { set colormode [dict get $mcmap(color) $option(color)] set rotate 0 if {[dict get $mcmap(orient) $option(orient)] eq "landscape"} { set rotate 1 } # Scale based on size of widget, not size of paper. # TODO: is this correct?? set printwidth [expr { $option(czoom) / 100.0 * [winfo width $w] }] set data [encoding convertto iso8859-1 [$w postscript \ -colormode $colormode -rotate $rotate -pagewidth $printwidth]] } elseif {$class eq "Text"} { set tzoom [expr {$option(tzoom) / 100.0}] if {$option(tzoom) != 100} { lappend printargs -tzoom $tzoom } if {$option(pprint)} { lappend printargs -prettyprint } if {$option(number-up) != 1} { lappend printargs -nup $option(number-up) } # these are hardcoded. Should we allow the user to control # margins? lappend printargs -margins [list \ $option(margin-top) $option(margin-left) \ $option(margin-bottom) $option(margin-right) ] # get the data in shape. Cupsfilter's text filter wraps lines # at character level, not words, so we do it by ourselves. # compute usable page width in inches set pw [dict get {a4 8.27 legal 8.5 letter 8.5} $media] set pw [expr { $pw - ($option(margin-left) + $option(margin-right)) / 72.0 }] # set the wrap length at 98% of computed page width in chars # the 9.8 constant is the product 10.0 (default cpi) * 0.95 set wl [expr {int( 9.8 * $pw / $tzoom )}] set data [encoding convertto utf-8 [_wrapLines [$w get 1.0 end] $wl]] } # launch the job in the background after idle [namespace code \ [list cups print $option(printer) $data {*}$printargs]] destroy $p } # _wrapLines - # wrap long lines into lines of at most length wl at word boundaries # Arguments: # str - string to be wrapped # wl - wrap length # proc ::tk::print::_wrapLines {str wl} { # This is a really simple algorithm: it breaks a line on space or tab # character, collapsing them only at the breaking point. # Leading space is left as-is. # For a full fledged line breaking algorithm see # Unicode® Standard Annex #14 "Unicode Line Breaking Algorithm" set res {} incr wl -1 set re [format {((?:^|[^[:blank:]]).{0,%d})(?:[[:blank:]]|$)} $wl] foreach line [split $str \n] { lappend res {*}[lmap {_ l} [regexp -all -inline -- $re $line] { set l }] } return [join $res \n] } } #end X11 procedures namespace eval ::tk::print { #begin macOS Aqua procedures if {[tk windowingsystem] eq "aqua"} { # makePDF - # Convert a file to PDF # Arguments: # inFilename - file containing the data to convert; format is # autodetected. |
︙ | ︙ |
Changes to library/scrlbar.tcl.
︙ | ︙ | |||
141 142 143 144 145 146 147 | bind Scrollbar <Shift-MouseWheel> { tk::ScrollByUnits %W hv %D -40.0 } bind Scrollbar <Shift-Option-MouseWheel> { tk::ScrollByUnits %W hv %D -12.0 } bind Scrollbar <TouchpadScroll> { | | | | | | | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | bind Scrollbar <Shift-MouseWheel> { tk::ScrollByUnits %W hv %D -40.0 } bind Scrollbar <Shift-Option-MouseWheel> { tk::ScrollByUnits %W hv %D -12.0 } bind Scrollbar <TouchpadScroll> { lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) if {$tk::Priv(deltaX) != 0 && [%W cget -orient] eq "horizontal"} { tk::ScrollbarScrollByPixels %W h $tk::Priv(deltaX) } if {$tk::Priv(deltaY) != 0 && [%W cget -orient] eq "vertical"} { tk::ScrollbarScrollByPixels %W v $tk::Priv(deltaY) } } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. # It changes the way the scrollbar is displayed and takes actions # depending on where the mouse is. |
︙ | ︙ |
Changes to library/tclIndex.
1 2 3 4 5 6 7 8 | # Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | # Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(::tk::dialog::error::Return) [list source -encoding utf-8 [file join $dir bgerror.tcl]] set auto_index(::tk::dialog::error::Details) [list source -encoding utf-8 [file join $dir bgerror.tcl]] set auto_index(::tk::dialog::error::SaveToLog) [list source -encoding utf-8 [file join $dir bgerror.tcl]] set auto_index(::tk::dialog::error::Destroy) [list source -encoding utf-8 [file join $dir bgerror.tcl]] set auto_index(::tk::dialog::error::bgerror) [list source -encoding utf-8 [file join $dir bgerror.tcl]] set auto_index(bgerror) [list source -encoding utf-8 [file join $dir bgerror.tcl]] set auto_index(::tk::ButtonInvoke) [list source -encoding utf-8 [file join $dir button.tcl]] set auto_index(::tk::ButtonAutoInvoke) [list source -encoding utf-8 [file join $dir button.tcl]] set auto_index(::tk::CheckRadioInvoke) [list source -encoding utf-8 [file join $dir button.tcl]] set auto_index(::tk::dialog::file::chooseDir::) [list source -encoding utf-8 [file join $dir choosedir.tcl]] set auto_index(::tk::dialog::file::chooseDir::Config) [list source -encoding utf-8 [file join $dir choosedir.tcl]] set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source -encoding utf-8 [file join $dir choosedir.tcl]] set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source -encoding utf-8 [file join $dir choosedir.tcl]] set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source -encoding utf-8 [file join $dir choosedir.tcl]] set auto_index(::tk::dialog::file::chooseDir::Done) [list source -encoding utf-8 [file join $dir choosedir.tcl]] set auto_index(::tk::dialog::color::) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::InitValues) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::Config) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::BuildDialog) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::SetRGBValue) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::XToRgb) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::RgbToX) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::DrawColorScale) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::CreateSelector) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::RedrawFinalColor) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::RedrawColorBars) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::StartMove) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::MoveSelector) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::ReleaseMouse) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::ResizeColorBars) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::HandleSelEntry) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::HandleRGBEntry) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::EnterColorBar) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::LeaveColorBar) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::OkCmd) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(::tk::dialog::color::CancelCmd) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(tclParseConfigSpec) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(tclListValidFlags) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FocusGroup_Create) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FocusGroup_BindIn) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FocusGroup_BindOut) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FocusGroup_Destroy) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FocusGroup_In) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FocusGroup_Out) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::FDGetFileTypes) [list source -encoding utf-8 [file join $dir comdlg.tcl]] set auto_index(::tk::ConsoleInit) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleSource) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleInvoke) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleHistory) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsolePrompt) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleBind) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleInsert) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleOutput) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleExit) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(::tk::ConsoleAbout) [list source -encoding utf-8 [file join $dir console.tcl]] set auto_index(tk_dialog) [list source -encoding utf-8 [file join $dir dialog.tcl]] set auto_index(::tk::EntryClosestGap) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryButton1) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryMouseSelect) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryPaste) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryAutoScan) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryKeySelect) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryInsert) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryBackspace) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntrySeeInsert) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntrySetCursor) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryTranspose) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryPreviousWord) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(::tk::EntryGetSelection) [list source -encoding utf-8 [file join $dir entry.tcl]] set auto_index(tk_focusNext) [list source -encoding utf-8 [file join $dir focus.tcl]] set auto_index(tk_focusPrev) [list source -encoding utf-8 [file join $dir focus.tcl]] set auto_index(::tk::FocusOK) [list source -encoding utf-8 [file join $dir focus.tcl]] set auto_index(tk_focusFollowsMouse) [list source -encoding utf-8 [file join $dir focus.tcl]] set auto_index(::tk::IconList) [list source -encoding utf-8 [file join $dir iconlist.tcl]] set auto_index(::tk::ListboxBeginSelect) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxMotion) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxBeginExtend) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxBeginToggle) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxAutoScan) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxUpDown) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxExtendUpDown) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxDataExtend) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxCancel) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::ListboxSelectAll) [list source -encoding utf-8 [file join $dir listbox.tcl]] set auto_index(::tk::Megawidget) [list source -encoding utf-8 [file join $dir megawidget.tcl]] set auto_index(::tk::MbEnter) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MbLeave) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MbPost) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuUnpost) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MbMotion) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MbButtonUp) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuMotion) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuButtonDown) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuLeave) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuInvoke) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuEscape) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuUpArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuDownArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuLeftArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuRightArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuNextMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuNextEntry) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuFind) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::TraverseToMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::FirstMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::TraverseWithinMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuFirstEntry) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::MenuFindName) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::PostOverPoint) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::SaveGrabInfo) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::RestoreOldGrab) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(tk_menuSetFocus) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::GenerateMenuSelect) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(tk_popup) [list source -encoding utf-8 [file join $dir menu.tcl]] set auto_index(::tk::ensure_psenc_is_loaded) [list source -encoding utf-8 [file join $dir mkpsenc.tcl]] set auto_index(::tk::MessageBox) [list source -encoding utf-8 [file join $dir msgbox.tcl]] set auto_index(tk_menuBar) [list source -encoding utf-8 [file join $dir obsolete.tcl]] set auto_index(tk_bindForTraversal) [list source -encoding utf-8 [file join $dir obsolete.tcl]] set auto_index(::tk::classic::restore) [list source -encoding utf-8 [file join $dir obsolete.tcl]] set auto_index(tk_optionMenu) [list source -encoding utf-8 [file join $dir optMenu.tcl]] set auto_index(tk_setPalette) [list source -encoding utf-8 [file join $dir palette.tcl]] set auto_index(::tk::RecolorTree) [list source -encoding utf-8 [file join $dir palette.tcl]] set auto_index(::tk::Darken) [list source -encoding utf-8 [file join $dir palette.tcl]] set auto_index(tk_bisque) [list source -encoding utf-8 [file join $dir palette.tcl]] set auto_index(::safe::tkInterpInit) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::safe::loadTk) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::safe::TkInit) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::safe::allowTk) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::safe::disallowTk) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::safe::tkDelete) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::safe::tkTopLevel) [list source -encoding utf-8 [file join $dir safetk.tcl]] set auto_index(::tk::ScaleActivate) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScaleButtonDown) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScaleDrag) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScaleEndDrag) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScaleIncrement) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScaleControlPress) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScaleButton2Down) [list source -encoding utf-8 [file join $dir scale.tcl]] set auto_index(::tk::ScalingPct) [list source -encoding utf-8 [file join $dir scaling.tcl]] set auto_index(::tk::ScaleNum) [list source -encoding utf-8 [file join $dir scaling.tcl]] set auto_index(::tk::FontScalingFactor) [list source -encoding utf-8 [file join $dir scaling.tcl]] set auto_index(::tk::ScanMonitorsFile) [list source -encoding utf-8 [file join $dir scaling.tcl]] set auto_index(::tk::ScrollButtonDown) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollButtonUp) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollSelect) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollStartDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollEndDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollByUnits) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollByPages) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollToPos) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollTopBottom) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::ScrollButton2Down) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] set auto_index(::tk::spinbox::Invoke) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::ClosestGap) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::ButtonDown) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::ButtonUp) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::MouseSelect) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::Paste) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::Motion) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::AutoScan) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::KeySelect) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::Insert) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::Backspace) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::SeeInsert) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::SetCursor) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::Transpose) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::PreviousWord) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::spinbox::GetSelection) [list source -encoding utf-8 [file join $dir spinbox.tcl]] set auto_index(::tk::TearOffMenu) [list source -encoding utf-8 [file join $dir tearoff.tcl]] set auto_index(::tk::MenuDup) [list source -encoding utf-8 [file join $dir tearoff.tcl]] set auto_index(::tk::TextClosestGap) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextButton1) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextSelectTo) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextKeyExtend) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextPaste) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextAutoScan) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextSetCursor) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextKeySelect) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextResetAnchor) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextInsert) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextUpDownLine) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextPrevPara) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextNextPara) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextScrollPages) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextTranspose) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(tk_textCopy) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(tk_textCut) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(tk_textPaste) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextNextPos) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::TextPrevPos) [list source -encoding utf-8 [file join $dir text.tcl]] set auto_index(::tk::PlaceWindow) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::SetFocusGrab) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::RestoreFocusGrab) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::ScreenChanged) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::EventMotifBindings) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::CancelRepeat) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::MouseWheel) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::TabToWindow) [list source -encoding utf-8 [file join $dir tk.tcl]] set auto_index(::tk::dialog::file::) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Config) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Create) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetSelectMode) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Update) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetPathSilently) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetPath) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetFilter) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ResolveFile) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::EntFocusIn) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::EntFocusOut) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ActivateEnt) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::VerifyFileName) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::InvokeBtn) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpDirCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::JoinFile) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::OkCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::CancelCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ListBrowse) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ListInvoke) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Done) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] set auto_index(::tk::MotifFDialog) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_Create) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_FileTypes) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_SetFilter) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_Config) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_BuildUI) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_SetListMode) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_MakeSList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_InterpFilter) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_Update) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_LoadFiles) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_BrowseDList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_ActivateDList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_BrowseFList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_ActivateFList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_OkCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_FilterCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::MotifFDialog_CancelCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Set) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Unset) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Key) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Goto) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::ListBoxKeyAccel_Reset) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] set auto_index(::tk::unsupported::ExposePrivateCommand) [list source -encoding utf-8 [file join $dir unsupported.tcl]] set auto_index(::tk::unsupported::ExposePrivateVariable) [list source -encoding utf-8 [file join $dir unsupported.tcl]] set auto_index(::tk::fontchooser) [list source -encoding utf-8 [file join $dir fontchooser.tcl]] |
Changes to library/tearoff.tcl.
︙ | ︙ | |||
134 135 136 137 138 139 140 | lappend cmd [lindex $option 0] [lindex $option 4] } eval $cmd # Copy the meny entries, if any set last [$src index last] | > | | | | | | > | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | lappend cmd [lindex $option 0] [lindex $option 4] } eval $cmd # Copy the meny entries, if any set last [$src index last] if {$last ne "none"} { for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { set cmd [list $dst add [$src type $i] [$src id $i]] foreach option [$src entryconfigure $i] { lappend cmd [lindex $option 0] [lindex $option 4] } eval $cmd } } # Duplicate the binding tags from the source menu, replacing src with dst set tags [bindtags $src] set x [lsearch -exact $tags $src] if {$x >= 0} {lset tags $x $dst} |
︙ | ︙ |
Changes to library/text.tcl.
︙ | ︙ | |||
465 466 467 468 469 470 471 | bind Text <Shift-MouseWheel> { tk::MouseWheel %W x [tk::ScaleNum %D] -4.0 pixels } bind Text <Shift-Option-MouseWheel> { tk::MouseWheel %W x [tk::ScaleNum %D] -1.2 pixels } bind Text <TouchpadScroll> { | | | | | | | 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | bind Text <Shift-MouseWheel> { tk::MouseWheel %W x [tk::ScaleNum %D] -4.0 pixels } bind Text <Shift-Option-MouseWheel> { tk::MouseWheel %W x [tk::ScaleNum %D] -1.2 pixels } bind Text <TouchpadScroll> { lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) if {$tk::Priv(deltaX) != 0} { %W xview scroll [tk::ScaleNum [expr {-$tk::Priv(deltaX)}]] pixels } if {$tk::Priv(deltaY) != 0} { %W yview scroll [tk::ScaleNum [expr {-$tk::Priv(deltaY)}]] pixels } } # ::tk::TextClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. |
︙ | ︙ |
Changes to library/tk.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # tk.tcl -- # # Initialization script normally executed in the interpreter for each Tk-based # application. Arranges class bindings for widgets. # # Copyright © 1992-1994 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release | | | | | | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # tk.tcl -- # # Initialization script normally executed in the interpreter for each Tk-based # application. Arranges class bindings for widgets. # # Copyright © 1992-1994 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release package require -exact tk 8.7b1 # Create a ::tk namespace namespace eval ::tk { # Set up the msgcat commands namespace eval msgcat { namespace export mc mcmax if {[interp issafe] || [catch {package require msgcat}]} { # The msgcat package is not available. Supply our own # minimal replacement. proc mc {src args} { return [format $src {*}$args] } proc mcmax {args} { set max 0 foreach string $args { set len [string length $string] if {$len>$max} { set max $len } } return $max } } else { # Get the commands from the msgcat package that Tk uses. namespace import ::msgcat::mc namespace import ::msgcat::mcmax ::msgcat::mcload [file join $::tk_library msgs] } } namespace import ::tk::msgcat::* } # and a ::ttk namespace namespace eval ::ttk { if {$::tk_library ne ""} { # avoid file join to work in safe interps, but this is also x-plat ok |
︙ | ︙ | |||
494 495 496 497 498 499 500 | # ---------------------------------------------------------------------- # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { | | | 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | # ---------------------------------------------------------------------- # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] } namespace eval ::tk { SourceLibFile icons SourceLibFile iconbadges SourceLibFile button SourceLibFile entry SourceLibFile listbox |
︙ | ︙ | |||
554 555 556 557 558 559 560 | proc ::tk::PreciseScrollDeltas {dxdy} { set deltaX [expr {$dxdy >> 16}] set low [expr {$dxdy & 0xffff}] set deltaY [expr {$low < 0x8000 ? $low : $low - 0x10000}] return [list $deltaX $deltaY] } | | | < < | | | | | | | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | proc ::tk::PreciseScrollDeltas {dxdy} { set deltaX [expr {$dxdy >> 16}] set low [expr {$dxdy & 0xffff}] set deltaY [expr {$low < 0x8000 ? $low : $low - 0x10000}] return [list $deltaX $deltaY] } ## Helper for smooth scrolling of widgets that support xview moveto and ## yview moveto. proc ::tk::ScrollByPixels {w deltaX deltaY} { set fracX [lindex [$w xview] 0] set fracY [lindex [$w yview] 0] set width [expr {1.0 * [winfo width $w]}] set height [expr {1.0 * [winfo height $w]}] $w xview moveto [expr {$fracX - $deltaX / $width}] $w yview moveto [expr {$fracY - $deltaY / $height}] } # ::tk::TabToWindow -- # This procedure moves the focus to the given widget. # It sends a <<TraverseOut>> virtual event to the previous focus window, # if any, before changing the focus, and a <<TraverseIn>> event # to the new focus window afterwards. |
︙ | ︙ | |||
711 712 713 714 715 716 717 | return $maxlen } if {[tk windowingsystem] eq "aqua"} { #stub procedures to respond to "do script" Apple Events proc ::tk::mac::DoScriptFile {file} { uplevel #0 $file | | | | | 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | return $maxlen } if {[tk windowingsystem] eq "aqua"} { #stub procedures to respond to "do script" Apple Events proc ::tk::mac::DoScriptFile {file} { uplevel #0 $file source -encoding utf-8 $file } proc ::tk::mac::DoScriptText {script} { uplevel #0 $script eval $script } #This procedure is required to silence warnings generated #by inline AppleScript execution. proc ::tk::mac::GetDynamicSdef {} { puts "" } } if {[info commands ::tk::endOfWord] eq ""} { proc ::tk::endOfWord {str start {locale {}}} { if {$start < 0} { set start -1 } |
︙ | ︙ | |||
839 840 841 842 843 844 845 | # Scale the default scrollbar width on X11 if {[tk windowingsystem] eq "x11"} { option add *Scrollbar.width 8.25p widgetDefault } # Run the Ttk themed widget set initialization if {$::ttk::library ne ""} { | | | 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 | # Scale the default scrollbar width on X11 if {[tk windowingsystem] eq "x11"} { option add *Scrollbar.width 8.25p widgetDefault } # Run the Ttk themed widget set initialization if {$::ttk::library ne ""} { uplevel \#0 [list source -encoding utf-8 $::ttk::library/ttk.tcl] } # Local Variables: # mode: tcl # fill-column: 78 # End: |
Changes to library/ttk/clamTheme.tcl.
︙ | ︙ | |||
140 141 142 143 144 145 146 | -foreground [list disabled $colors(-disabledfg) \ selected $colors(-selectfg)] ttk::style configure TLabelframe \ -labeloutside true -labelmargins {0 0 0 3p} \ -borderwidth 2 -relief raised | | | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | -foreground [list disabled $colors(-disabledfg) \ selected $colors(-selectfg)] ttk::style configure TLabelframe \ -labeloutside true -labelmargins {0 0 0 3p} \ -borderwidth 2 -relief raised ttk::style configure TScrollbar -gripcount 3.75p \ -arrowsize 10.5p -width 10.5p ttk::style configure TScale -gripcount 3.75p \ -arrowsize 10.5p -sliderlength 22.5p ttk::style configure TProgressbar -background $colors(-frame) \ -arrowsize 10.5p -sliderlength 22.5p ttk::style configure Sash -sashthickness 4.5p -gripcount 7.5p } } |
Changes to library/ttk/combobox.tcl.
︙ | ︙ | |||
53 54 55 56 57 58 59 | bind TCombobox <Motion> { ttk::combobox::Motion %W %x %y } ttk::bindMouseWheel TCombobox { ttk::combobox::Scroll %W } bind TCombobox <Shift-MouseWheel> { # Ignore the event } bind TCombobox <TouchpadScroll> { | | | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | bind TCombobox <Motion> { ttk::combobox::Motion %W %x %y } ttk::bindMouseWheel TCombobox { ttk::combobox::Scroll %W } bind TCombobox <Shift-MouseWheel> { # Ignore the event } bind TCombobox <TouchpadScroll> { lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) # TouchpadScroll events fire about 60 times per second. if {$tk::Priv(deltaY) != 0 && %# %% 15 == 0} { ttk::combobox::Scroll %W [expr {$tk::Priv(deltaY) > 0 ? -1 : 1}] } } bind TCombobox <<TraverseIn>> { ttk::combobox::TraverseIn %W } ### Combobox listbox bindings. # bind ComboboxListbox <ButtonRelease-1> { ttk::combobox::LBSelected %W } |
︙ | ︙ |
Changes to library/ttk/spinbox.tcl.
︙ | ︙ | |||
24 25 26 27 28 29 30 | bind TSpinbox <<Decrement>> { ttk::spinbox::Spin %W -1 } ttk::bindMouseWheel TSpinbox { ttk::spinbox::Spin %W } bind TSpinbox <Shift-MouseWheel> { # Ignore the event } bind TSpinbox <TouchpadScroll> { | | | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | bind TSpinbox <<Decrement>> { ttk::spinbox::Spin %W -1 } ttk::bindMouseWheel TSpinbox { ttk::spinbox::Spin %W } bind TSpinbox <Shift-MouseWheel> { # Ignore the event } bind TSpinbox <TouchpadScroll> { lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) # TouchpadScroll events fire about 60 times per second. if {$tk::Priv(deltaY) != 0 && %# %% 12 == 0} { ttk::spinbox::Spin %W [expr {$tk::Priv(deltaY) > 0 ? -1 : 1}] } } ## Motion -- # Sets cursor. # proc ttk::spinbox::Motion {w x y} { |
︙ | ︙ |
Changes to library/ttk/utils.tcl.
︙ | ︙ | |||
303 304 305 306 307 308 309 | ## Touchpad scrolling # bind TtkScrollable <TouchpadScroll> { if {%# %% 5 != 0} { return } | | | | | | | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | ## Touchpad scrolling # bind TtkScrollable <TouchpadScroll> { if {%# %% 5 != 0} { return } lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) if {$tk::Priv(deltaX) != 0} { %W xview scroll [expr {-$tk::Priv(deltaX)}] units } if {$tk::Priv(deltaY) != 0} { %W yview scroll [expr {-$tk::Priv(deltaY)}] units } } #*EOF* |
Added library/unsupported.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | # unsupported.tcl -- # # Commands provided by Tk without official support. Use them at your # own risk. They may change or go away without notice. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ---------------------------------------------------------------------- # Unsupported compatibility interface for folks accessing Tk's private # commands and variable against recommended usage. # ---------------------------------------------------------------------- namespace eval ::tk::unsupported { # Map from the old global names of Tk private commands to their # new namespace-encapsulated names. variable PrivateCommands array set PrivateCommands { tkButtonAutoInvoke ::tk::ButtonAutoInvoke tkButtonDown ::tk::ButtonDown tkButtonEnter ::tk::ButtonEnter tkButtonInvoke ::tk::ButtonInvoke tkButtonLeave ::tk::ButtonLeave tkButtonUp ::tk::ButtonUp tkCancelRepeat ::tk::CancelRepeat tkCheckRadioDown ::tk::CheckRadioDown tkCheckRadioEnter ::tk::CheckRadioEnter tkCheckRadioInvoke ::tk::CheckRadioInvoke tkColorDialog ::tk::dialog::color:: tkColorDialog_BuildDialog ::tk::dialog::color::BuildDialog tkColorDialog_CancelCmd ::tk::dialog::color::CancelCmd tkColorDialog_Config ::tk::dialog::color::Config tkColorDialog_CreateSelector ::tk::dialog::color::CreateSelector tkColorDialog_DrawColorScale ::tk::dialog::color::DrawColorScale tkColorDialog_EnterColorBar ::tk::dialog::color::EnterColorBar tkColorDialog_InitValues ::tk::dialog::color::InitValues tkColorDialog_HandleRGBEntry ::tk::dialog::color::HandleRGBEntry tkColorDialog_HandleSelEntry ::tk::dialog::color::HandleSelEntry tkColorDialog_LeaveColorBar ::tk::dialog::color::LeaveColorBar tkColorDialog_MoveSelector ::tk::dialog::color::MoveSelector tkColorDialog_OkCmd ::tk::dialog::color::OkCmd tkColorDialog_RedrawColorBars ::tk::dialog::color::RedrawColorBars tkColorDialog_RedrawFinalColor ::tk::dialog::color::RedrawFinalColor tkColorDialog_ReleaseMouse ::tk::dialog::color::ReleaseMouse tkColorDialog_ResizeColorBars ::tk::dialog::color::ResizeColorBars tkColorDialog_RgbToX ::tk::dialog::color::RgbToX tkColorDialog_SetRGBValue ::tk::dialog::color::SetRGBValue tkColorDialog_StartMove ::tk::dialog::color::StartMove tkColorDialog_XToRgb ::tk::dialog::color::XToRGB tkConsoleAbout ::tk::ConsoleAbout tkConsoleBind ::tk::ConsoleBind tkConsoleExit ::tk::ConsoleExit tkConsoleHistory ::tk::ConsoleHistory tkConsoleInit ::tk::ConsoleInit tkConsoleInsert ::tk::ConsoleInsert tkConsoleInvoke ::tk::ConsoleInvoke tkConsoleOutput ::tk::ConsoleOutput tkConsolePrompt ::tk::ConsolePrompt tkConsoleSource ::tk::ConsoleSource tkDarken ::tk::Darken tkEntryAutoScan ::tk::EntryAutoScan tkEntryBackspace ::tk::EntryBackspace tkEntryButton1 ::tk::EntryButton1 tkEntryClosestGap ::tk::EntryClosestGap tkEntryGetSelection ::tk::EntryGetSelection tkEntryInsert ::tk::EntryInsert tkEntryKeySelect ::tk::EntryKeySelect tkEntryMouseSelect ::tk::EntryMouseSelect tkEntryNextWord ::tk::EntryNextWord tkEntryPaste ::tk::EntryPaste tkEntryPreviousWord ::tk::EntryPreviousWord tkEntrySeeInsert ::tk::EntrySeeInsert tkEntrySetCursor ::tk::EntrySetCursor tkEntryTranspose ::tk::EntryTranspose tkEventMotifBindings ::tk::EventMotifBindings tkFDGetFileTypes ::tk::FDGetFileTypes tkFirstMenu ::tk::FirstMenu tkFocusGroup_BindIn ::tk::FocusGroup_BindIn tkFocusGroup_BindOut ::tk::FocusGroup_BindOut tkFocusGroup_Create ::tk::FocusGroup_Create tkFocusGroup_Destroy ::tk::FocusGroup_Destroy tkFocusGroup_In ::tk::FocusGroup_In tkFocusGroup_Out ::tk::FocusGroup_Out tkFocusOK ::tk::FocusOK tkGenerateMenuSelect ::tk::GenerateMenuSelect tkIconList ::tk::IconList tkListbox ::tk::Listbox tkListboxAutoScan ::tk::ListboxAutoScan tkListboxBeginExtend ::tk::ListboxBeginExtend tkListboxBeginSelect ::tk::ListboxBeginSelect tkListboxBeginToggle ::tk::ListboxBeginToggle tkListboxCancel ::tk::ListboxCancel tkListboxDataExtend ::tk::ListboxDataExtend tkListboxExtendUpDown ::tk::ListboxExtendUpDown tkListboxKeyAccel_Goto ::tk::ListboxKeyAccel_Goto tkListboxKeyAccel_Key ::tk::ListboxKeyAccel_Key tkListboxKeyAccel_Reset ::tk::ListboxKeyAccel_Reset tkListboxKeyAccel_Set ::tk::ListboxKeyAccel_Set tkListboxKeyAccel_Unset ::tk::ListboxKeyAccel_Unxet tkListboxMotion ::tk::ListboxMotion tkListboxSelectAll ::tk::ListboxSelectAll tkListboxUpDown ::tk::ListboxUpDown tkListboxBeginToggle ::tk::ListboxBeginToggle tkMbButtonUp ::tk::MbButtonUp tkMbEnter ::tk::MbEnter tkMbLeave ::tk::MbLeave tkMbMotion ::tk::MbMotion tkMbPost ::tk::MbPost tkMenuButtonDown ::tk::MenuButtonDown tkMenuDownArrow ::tk::MenuDownArrow tkMenuDup ::tk::MenuDup tkMenuEscape ::tk::MenuEscape tkMenuFind ::tk::MenuFind tkMenuFindName ::tk::MenuFindName tkMenuFirstEntry ::tk::MenuFirstEntry tkMenuInvoke ::tk::MenuInvoke tkMenuLeave ::tk::MenuLeave tkMenuLeftArrow ::tk::MenuLeftArrow tkMenuMotion ::tk::MenuMotion tkMenuNextEntry ::tk::MenuNextEntry tkMenuNextMenu ::tk::MenuNextMenu tkMenuRightArrow ::tk::MenuRightArrow tkMenuUnpost ::tk::MenuUnpost tkMenuUpArrow ::tk::MenuUpArrow tkMessageBox ::tk::MessageBox tkMotifFDialog ::tk::MotifFDialog tkMotifFDialog_ActivateDList ::tk::MotifFDialog_ActivateDList tkMotifFDialog_ActivateFList ::tk::MotifFDialog_ActivateFList tkMotifFDialog_ActivateFEnt ::tk::MotifFDialog_ActivateFEnt tkMotifFDialog_ActivateSEnt ::tk::MotifFDialog_ActivateSEnt tkMotifFDialog ::tk::MotifFDialog tkMotifFDialog_BrowseDList ::tk::MotifFDialog_BrowseDList tkMotifFDialog_BrowseFList ::tk::MotifFDialog_BrowseFList tkMotifFDialog_BuildUI ::tk::MotifFDialog_BuildUI tkMotifFDialog_CancelCmd ::tk::MotifFDialog_CancelCmd tkMotifFDialog_Config ::tk::MotifFDialog_Config tkMotifFDialog_Create ::tk::MotifFDialog_Create tkMotifFDialog_FileTypes ::tk::MotifFDialog_FileTypes tkMotifFDialog_FilterCmd ::tk::MotifFDialog_FilterCmd tkMotifFDialog_InterpFilter ::tk::MotifFDialog_InterpFilter tkMotifFDialog_LoadFiles ::tk::MotifFDialog_LoadFiles tkMotifFDialog_MakeSList ::tk::MotifFDialog_MakeSList tkMotifFDialog_OkCmd ::tk::MotifFDialog_OkCmd tkMotifFDialog_SetFilter ::tk::MotifFDialog_SetFilter tkMotifFDialog_SetListMode ::tk::MotifFDialog_SetListMode tkMotifFDialog_Update ::tk::MotifFDialog_Update tkPostOverPoint ::tk::PostOverPoint tkRecolorTree ::tk::RecolorTree tkRestoreOldGrab ::tk::RestoreOldGrab tkSaveGrabInfo ::tk::SaveGrabInfo tkScaleActivate ::tk::ScaleActivate tkScaleButtonDown ::tk::ScaleButtonDown tkScaleButton2Down ::tk::ScaleButton2Down tkScaleControlPress ::tk::ScaleControlPress tkScaleDrag ::tk::ScaleDrag tkScaleEndDrag ::tk::ScaleEndDrag tkScaleIncrement ::tk::ScaleIncrement tkScreenChanged ::tk::ScreenChanged tkScrollButtonDown ::tk::ScrollButtonDown tkScrollButton2Down ::tk::ScrollButton2Down tkScrollButtonDrag ::tk::ScrollButtonDrag tkScrollButtonUp ::tk::ScrollButtonUp tkScrollByPages ::tk::ScrollByPages tkScrollByUnits ::tk::ScrollByUnits tkScrollEndDrag ::tk::ScrollEndDrag tkScrollSelect ::tk::ScrollSelect tkScrollStartDrag ::tk::ScrollStartDrag tkScrollTopBottom ::tk::ScrollTopBottom tkScrollToPos ::tk::ScrollToPos tkTabToWindow ::tk::TabToWindow tkTearOffMenu ::tk::TearOffMenu tkTextAutoScan ::tk::TextAutoScan tkTextButton1 ::tk::TextButton1 tkTextClosestGap ::tk::TextClosestGap tkTextInsert ::tk::TextInsert tkTextKeyExtend ::tk::TextKeyExtend tkTextKeySelect ::tk::TextKeySelect tkTextNextPara ::tk::TextNextPara tkTextNextPos ::tk::TextNextPos tkTextNextWord ::tk::TextNextWord tkTextPaste ::tk::TextPaste tkTextPrevPara ::tk::TextPrevPara tkTextPrevPos ::tk::TextPrevPos tkTextPrevWord ::tk::TextPrevWord tkTextResetAnchor ::tk::TextResetAnchor tkTextScrollPages ::tk::TextScrollPages tkTextSelectTo ::tk::TextSelectTo tkTextSetCursor ::tk::TextSetCursor tkTextTranspose ::tk::TextTranspose tkTextUpDownLine ::tk::TextUpDownLine tkTraverseToMenu ::tk::TraverseToMenu tkTraverseWithinMenu ::tk::TraverseWithinMenu unsupported1 ::tk::unsupported::MacWindowStyle } # Map from the old global names of Tk private variable to their # new namespace-encapsulated names. variable PrivateVariables array set PrivateVariables { droped_to_start ::tk::mac::Droped_to_start histNum ::tk::HistNum stub_location ::tk::mac::Stub_location tkFocusIn ::tk::FocusIn tkFocusOut ::tk::FocusOut tkPalette ::tk::Palette tkPriv ::tk::Priv tkPrivMsgBox ::tk::PrivMsgBox } } # ::tk::unsupported::ExposePrivateCommand -- # # Expose one of Tk's private commands to be visible under its # old global name # # Arguments: # cmd Global name by which the command was once known, # or a glob-style pattern. # # Results: # None. # # Side effects: # The old command name in the global namespace is aliased to the # new private name. proc ::tk::unsupported::ExposePrivateCommand {cmd} { variable PrivateCommands set cmds [array get PrivateCommands $cmd] if {[llength $cmds] == 0} { return -code error -errorcode {TK EXPOSE_PRIVATE_COMMAND} \ "No compatibility support for \[$cmd]" } foreach {old new} $cmds { namespace eval :: [list interp alias {} $old {}] $new } } # ::tk::unsupported::ExposePrivateVariable -- # # Expose one of Tk's private variables to be visible under its # old global name # # Arguments: # var Global name by which the variable was once known, # or a glob-style pattern. # # Results: # None. # # Side effects: # The old variable name in the global namespace is aliased to the # new private name. proc ::tk::unsupported::ExposePrivateVariable {var} { variable PrivateVariables set vars [array get PrivateVariables $var] if {[llength $vars] == 0} { return -code error -errorcode {TK EXPOSE_PRIVATE_VARIABLE} \ "No compatibility support for \$$var" } namespace eval ::tk::mac {} foreach {old new} $vars { namespace eval :: [list upvar "#0" $new $old] } } |
Changes to macosx/Tk.xcodeproj/project.pbxproj.
︙ | ︙ | |||
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | F966BB6208F27A3A005CB29B /* dialog.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog.tcl; sourceTree = "<group>"; }; F966BB6308F27A3A005CB29B /* entry.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.tcl; sourceTree = "<group>"; }; F966BB6408F27A3A005CB29B /* focus.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focus.tcl; sourceTree = "<group>"; }; F966BB7308F27A3A005CB29B /* listbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listbox.tcl; sourceTree = "<group>"; }; F966BB7408F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; }; F966BB7508F27A3A005CB29B /* mkpsenc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mkpsenc.tcl; sourceTree = "<group>"; }; F966BB7608F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; }; F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; }; F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; }; F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; }; F966BB8B08F27A3B005CB29B /* safetk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safetk.tcl; sourceTree = "<group>"; }; F966BB8C08F27A3B005CB29B /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; }; F966BB8D08F27A3B005CB29B /* scrlbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrlbar.tcl; sourceTree = "<group>"; }; F966BB8E08F27A3B005CB29B /* spinbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spinbox.tcl; sourceTree = "<group>"; }; F966BB8F08F27A3B005CB29B /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; }; F966BB9008F27A3B005CB29B /* tearoff.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tearoff.tcl; sourceTree = "<group>"; }; F966BB9108F27A3B005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; }; F966BB9208F27A3B005CB29B /* tk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.tcl; sourceTree = "<group>"; }; F966BB9308F27A3B005CB29B /* tkfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkfbox.tcl; sourceTree = "<group>"; }; F966BB9508F27A3B005CB29B /* xmfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.tcl; sourceTree = "<group>"; }; F966BB9608F27A3B005CB29B /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; }; F966BBBA08F27A3B005CB29B /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; }; F966BBBB08F27A3B005CB29B /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = GNUmakefile; sourceTree = "<group>"; }; F966BBBE08F27A3B005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; F966BBC008F27A3B005CB29B /* Tk-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Tk-Info.plist.in"; sourceTree = "<group>"; }; F966BBC208F27A3B005CB29B /* tkMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSX.h; sourceTree = "<group>"; }; | > > | 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 | F966BB6208F27A3A005CB29B /* dialog.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog.tcl; sourceTree = "<group>"; }; F966BB6308F27A3A005CB29B /* entry.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.tcl; sourceTree = "<group>"; }; F966BB6408F27A3A005CB29B /* focus.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focus.tcl; sourceTree = "<group>"; }; F966BB7308F27A3A005CB29B /* listbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listbox.tcl; sourceTree = "<group>"; }; F966BB7408F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; }; F966BB7508F27A3A005CB29B /* mkpsenc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mkpsenc.tcl; sourceTree = "<group>"; }; F966BB7608F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; }; F966BB8608F27A3A005CB29B /* obsolete.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obsolete.tcl; sourceTree = "<group>"; }; F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; }; F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; }; F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; }; F966BB8B08F27A3B005CB29B /* safetk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safetk.tcl; sourceTree = "<group>"; }; F966BB8C08F27A3B005CB29B /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; }; F966BB8D08F27A3B005CB29B /* scrlbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrlbar.tcl; sourceTree = "<group>"; }; F966BB8E08F27A3B005CB29B /* spinbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spinbox.tcl; sourceTree = "<group>"; }; F966BB8F08F27A3B005CB29B /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; }; F966BB9008F27A3B005CB29B /* tearoff.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tearoff.tcl; sourceTree = "<group>"; }; F966BB9108F27A3B005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; }; F966BB9208F27A3B005CB29B /* tk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.tcl; sourceTree = "<group>"; }; F966BB9308F27A3B005CB29B /* tkfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkfbox.tcl; sourceTree = "<group>"; }; F966BB9408F27A3B005CB29B /* unsupported.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unsupported.tcl; sourceTree = "<group>"; }; F966BB9508F27A3B005CB29B /* xmfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.tcl; sourceTree = "<group>"; }; F966BB9608F27A3B005CB29B /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; }; F966BBBA08F27A3B005CB29B /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; }; F966BBBB08F27A3B005CB29B /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = GNUmakefile; sourceTree = "<group>"; }; F966BBBE08F27A3B005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; F966BBC008F27A3B005CB29B /* Tk-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Tk-Info.plist.in"; sourceTree = "<group>"; }; F966BBC208F27A3B005CB29B /* tkMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSX.h; sourceTree = "<group>"; }; |
︙ | ︙ | |||
2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 | F99388380EE0114B0065FE6B /* fontchooser.tcl */, F974D57C0FBE7EFF00BF728B /* iconlist.tcl */, F974D57D0FBE7EFF00BF728B /* icons.tcl */, F966BB7308F27A3A005CB29B /* listbox.tcl */, F966BB7408F27A3A005CB29B /* menu.tcl */, F966BB7508F27A3A005CB29B /* mkpsenc.tcl */, F966BB7608F27A3A005CB29B /* msgbox.tcl */, F966BB8708F27A3A005CB29B /* optMenu.tcl */, F966BB8808F27A3A005CB29B /* palette.tcl */, F966BB8908F27A3B005CB29B /* panedwindow.tcl */, F966BB8B08F27A3B005CB29B /* safetk.tcl */, F966BB8C08F27A3B005CB29B /* scale.tcl */, F966BB8D08F27A3B005CB29B /* scrlbar.tcl */, F966BB8E08F27A3B005CB29B /* spinbox.tcl */, F966BB8F08F27A3B005CB29B /* tclIndex */, F966BB9008F27A3B005CB29B /* tearoff.tcl */, F966BB9108F27A3B005CB29B /* text.tcl */, F966BB9208F27A3B005CB29B /* tk.tcl */, F966BB9308F27A3B005CB29B /* tkfbox.tcl */, F96888360AF787B3000797B5 /* ttk */, F966BB9508F27A3B005CB29B /* xmfbox.tcl */, ); path = library; sourceTree = "<group>"; }; F966BB1A08F27A39005CB29B /* demos */ = { isa = PBXGroup; | > > | 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 | F99388380EE0114B0065FE6B /* fontchooser.tcl */, F974D57C0FBE7EFF00BF728B /* iconlist.tcl */, F974D57D0FBE7EFF00BF728B /* icons.tcl */, F966BB7308F27A3A005CB29B /* listbox.tcl */, F966BB7408F27A3A005CB29B /* menu.tcl */, F966BB7508F27A3A005CB29B /* mkpsenc.tcl */, F966BB7608F27A3A005CB29B /* msgbox.tcl */, F966BB8608F27A3A005CB29B /* obsolete.tcl */, F966BB8708F27A3A005CB29B /* optMenu.tcl */, F966BB8808F27A3A005CB29B /* palette.tcl */, F966BB8908F27A3B005CB29B /* panedwindow.tcl */, F966BB8B08F27A3B005CB29B /* safetk.tcl */, F966BB8C08F27A3B005CB29B /* scale.tcl */, F966BB8D08F27A3B005CB29B /* scrlbar.tcl */, F966BB8E08F27A3B005CB29B /* spinbox.tcl */, F966BB8F08F27A3B005CB29B /* tclIndex */, F966BB9008F27A3B005CB29B /* tearoff.tcl */, F966BB9108F27A3B005CB29B /* text.tcl */, F966BB9208F27A3B005CB29B /* tk.tcl */, F966BB9308F27A3B005CB29B /* tkfbox.tcl */, F96888360AF787B3000797B5 /* ttk */, F966BB9408F27A3B005CB29B /* unsupported.tcl */, F966BB9508F27A3B005CB29B /* xmfbox.tcl */, ); path = library; sourceTree = "<group>"; }; F966BB1A08F27A39005CB29B /* demos */ = { isa = PBXGroup; |
︙ | ︙ |
Changes to macosx/tkMacOSXButton.c.
︙ | ︙ | |||
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (TkMacOSXComputeButtonDrawParams(butPtr, dpPtr)) { macButtonPtr->useTkText = 0; } else { macButtonPtr->useTkText = 1; } if (macButtonPtr->useTkText) { if (butPtr->type == TYPE_BUTTON) { Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } else { Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } | > > | | | | | | | | | | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } pixmap = (Pixmap) Tk_WindowId(tkwin); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (TkMacOSXComputeButtonDrawParams(butPtr, dpPtr)) { macButtonPtr->useTkText = 0; } else { macButtonPtr->useTkText = 1; } if (macButtonPtr->useTkText) { if (butPtr->type == TYPE_BUTTON) { Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } else { Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } /* * Display image or bitmap or text for labels or custom controls. */ DrawButtonImageAndText(butPtr); needhighlight = 1; } else { /* * Draw the native portion of the buttons. */ TkMacOSXDrawButton(macButtonPtr, dpPtr->gc, pixmap); /* * Ask for the highlight border, if needed. */ if (butPtr->highlightWidth < 3) { needhighlight = 1; } } /* * Draw highlight border, if needed. */ if (needhighlight) { GC gc = NULL; if ((butPtr->flags & GOT_FOCUS) && butPtr->highlightColorPtr) { gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); } else if (butPtr->type == TYPE_LABEL) { gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder), pixmap); } if (gc) { TkMacOSXDrawSolidBorder(tkwin, gc, 0, butPtr->highlightWidth); } |
︙ | ︙ | |||
309 310 311 312 313 314 315 316 317 318 319 320 321 | Tk_SizeOfImage(butPtr->image, &width, &height); haveImage = 1; } else if (butPtr->bitmap != None) { Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) { Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, text, TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); | > > > | | | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | Tk_SizeOfImage(butPtr->image, &width, &height); haveImage = 1; } else if (butPtr->bitmap != None) { Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) { Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, text, TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); txtWidth = butPtr->textWidth + 2 * butPtr->padX; txtHeight = butPtr->textHeight + 2 * butPtr->padY; haveText = 1; } if (haveImage) { if (haveText) { /* Image and Text */ switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: |
︙ | ︙ | |||
338 339 340 341 342 343 344 | break; case COMPOUND_LEFT: case COMPOUND_RIGHT: /* * Image is left or right of text. */ | | | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | break; case COMPOUND_LEFT: case COMPOUND_RIGHT: /* * Image is left or right of text. */ width += txtWidth + 2 * butPtr->padX; height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_CENTER: /* * Image and text are superimposed. */ |
︙ | ︙ | |||
364 365 366 367 368 369 370 | /* * Allow room to shift the image. */ width += 2; height += 2; } } else { /* Text only */ | | | | | | < | | | | | | | | | | | | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | /* * Allow room to shift the image. */ width += 2; height += 2; } } else { /* Text only */ width = txtWidth + butPtr->indicatorSpace; height = txtHeight; if (butPtr->width > 0) { charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); width = butPtr->width * charWidth + 2 * butPtr->padX; } if (butPtr->height > 0) { Tk_GetFontMetrics(butPtr->tkfont, &fm); height = butPtr->height * fm.linespace + 2 * butPtr->padY; } } /* * Now figure out the size of the border decorations for the button. */ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); butPtr->inset = butPtr->borderWidth + butPtr->highlightWidth; width += butPtr->inset * 2; height += butPtr->inset * 2; if ([NSApp macOSVersion] == 100600) { width += 12; } if (mbPtr->btnkind == kThemePushButton) { HIRect tmpRect; HIRect contBounds; /* * A PushButton has a minimum size. We make sure that we are not * underestimating the size by requesting the content size of a * Pushbutton whose overall size is our content size expanded by the * standard padding. */ tmpRect = CGRectMake(0, 0, width + 2 * HI_PADX, height + 2 * HI_PADY); HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); if (height < contBounds.size.height) { height = (int)contBounds.size.height; } if (width < contBounds.size.width) { width = (int)contBounds.size.width; } height += 2 * HI_PADY; width += 2 * HI_PADX; } Tk_GeometryRequest(butPtr->tkwin, width, height); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
449 450 451 452 453 454 455 | int imageXOffset = 0, imageYOffset = 0; int textXOffset = 0, textYOffset = 0; int width = 0, height = 0; int fullWidth = 0, fullHeight = 0; DrawParams *dpPtr = &mbPtr->drawParams; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { | | | | | | | > > > > > | | | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | int imageXOffset = 0, imageYOffset = 0; int textXOffset = 0, textYOffset = 0; int width = 0, height = 0; int fullWidth = 0, fullHeight = 0; DrawParams *dpPtr = &mbPtr->drawParams; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (butPtr->image != NULL) { Tk_SizeOfImage(butPtr->image, &width, &height); haveImage = 1; } else if (butPtr->bitmap != None) { Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } imageWidth = width; imageHeight = height; if (mbPtr->drawinfo.state == kThemeStatePressed) { pressed = 1; } Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { /* Image and Text */ int x, y; switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* Image is above or below text */ if (butPtr->compound == COMPOUND_TOP) { textYOffset = height + butPtr->padY; } else { imageYOffset = butPtr->textHeight + butPtr->padY; |
︙ | ︙ | |||
522 523 524 525 526 527 528 | textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; default: break; } | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; default: break; } TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX + butPtr->borderWidth, butPtr->padY + butPtr->borderWidth, fullWidth + butPtr->indicatorSpace, fullHeight, &x, &y); x += butPtr->indicatorSpace; if (dpPtr->relief == TK_RELIEF_SUNKEN) { x += dpPtr->offset; y += dpPtr->offset; } else if (dpPtr->relief == TK_RELIEF_RAISED) { x -= dpPtr->offset; y -= dpPtr->offset; } if (pressed) { x += dpPtr->offset; y += dpPtr->offset; } imageXOffset += x; imageYOffset += y; if (butPtr->image != NULL) { if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) { Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height, pixmap, imageXOffset, imageYOffset); } else if ((butPtr->tristateImage != NULL) && (butPtr->flags & TRISTATED)) { Tk_RedrawImage(butPtr->tristateImage, 0, 0, width, height, pixmap, imageXOffset, imageYOffset); } else { Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, imageXOffset, imageYOffset); } } else { XSetClipOrigin(butPtr->display, dpPtr->gc, imageXOffset, imageYOffset); XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc, 0, 0, (unsigned int) width, (unsigned int) height, imageXOffset, imageYOffset, 1); XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } y += 1; /* Tweak to match native buttons. */ Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, x + textXOffset, y + textYOffset, 0, -1); Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, x + textXOffset, y + textYOffset, butPtr->underline); } else if (haveImage) { /* Image only */ int x = 0, y; TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX + butPtr->borderWidth, butPtr->padY + butPtr->borderWidth, width + butPtr->indicatorSpace, height, &x, &y); x += butPtr->indicatorSpace; if (pressed) { x += dpPtr->offset; y += dpPtr->offset; } imageXOffset += x; imageYOffset += y; |
︙ | ︙ | |||
606 607 608 609 610 611 612 | XSetClipOrigin(butPtr->display, dpPtr->gc, x, y); XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc, 0, 0, (unsigned int) width, (unsigned int) height, imageXOffset, imageYOffset, 1); XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } } else { /* Text only */ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | XSetClipOrigin(butPtr->display, dpPtr->gc, x, y); XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc, 0, 0, (unsigned int) width, (unsigned int) height, imageXOffset, imageYOffset, 1); XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } } else { /* Text only */ int x, y; TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->textWidth + butPtr->indicatorSpace, butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; y += 1; /* Tweak to match native buttons */ Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, x, y, 0, -1); } /* * If the button is disabled with a stipple rather than a special * foreground color, generate the stippled effect. If the widget is * selected and we use a different background color when selected, must * temporarily modify the GC so the stippling is the right color. */ if (mbPtr->useTkText) { if ((butPtr->state == STATE_DISABLED) && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) { if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn && (butPtr->selectBorder != NULL)) { XSetForeground(butPtr->display, butPtr->stippleGC, Tk_3DBorderColor(butPtr->selectBorder)->pixel); } /* * Stipple the whole button if no disabledFg was specified, * otherwise restrict stippling only to displayed image */ if (butPtr->disabledFg == NULL) { XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin)); } else { XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, imageXOffset, imageYOffset, (unsigned) imageWidth, (unsigned) imageHeight); } if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn && (butPtr->selectBorder != NULL) ) { XSetForeground(butPtr->display, butPtr->stippleGC, Tk_3DBorderColor(butPtr->normalBorder)->pixel); } } /* * Draw the border and traversal highlight last. This way, if the * button's contents overflow they'll be covered up by the border. */ if (dpPtr->relief != TK_RELIEF_FLAT) { int inset = butPtr->highlightWidth; Tk_Draw3DRectangle(tkwin, pixmap, dpPtr->border, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, butPtr->borderWidth, dpPtr->relief); } } } /* *---------------------------------------------------------------------- * * TkpDestroyButton -- |
︙ | ︙ | |||
691 692 693 694 695 696 697 | void TkpDestroyButton( TkButton *butPtr) { MacButton *mbPtr = (MacButton *) butPtr; /* Mac button. */ if (mbPtr->defaultPulseHandler) { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | void TkpDestroyButton( TkButton *butPtr) { MacButton *mbPtr = (MacButton *) butPtr; /* Mac button. */ if (mbPtr->defaultPulseHandler) { Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } } /* *-------------------------------------------------------------- * * TkMacOSXDrawButton -- * * This function draws the tk button using Mac controls. In addition, * this code may apply custom colors passed in the TkButton. * * Results: * None. * * Side effects: * The control is created, or reinitialised as needed * *-------------------------------------------------------------- */ static void TkMacOSXDrawButton( MacButton *mbPtr, /* Mac button. */ TCL_UNUSED(GC), /* The GC we are drawing into - needed for * the bevel button */ Pixmap pixmap) /* The pixmap we are drawing into - needed * for the bevel button */ { TkButton *butPtr = (TkButton *) mbPtr; TkWindow *winPtr = (TkWindow *) butPtr->tkwin; HIRect cntrRect; TkMacOSXDrawingContext dc; DrawParams *dpPtr = &mbPtr->drawParams; int useNewerHITools = 1; TkMacOSXComputeButtonParams(butPtr, &mbPtr->btnkind, &mbPtr->drawinfo); cntrRect = CGRectMake(winPtr->privatePtr->xOff, winPtr->privatePtr->yOff, Tk_Width(butPtr->tkwin), Tk_Height(butPtr->tkwin)); cntrRect = CGRectInset(cntrRect, butPtr->inset, butPtr->inset); if (useNewerHITools == 1) { HIRect contHIRec; static HIThemeButtonDrawInfo hiinfo; ButtonBackgroundDrawCB(&cntrRect, mbPtr, 32, true); if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) { return; } hiinfo.version = 0; hiinfo.state = mbPtr->drawinfo.state; hiinfo.kind = mbPtr->btnkind; hiinfo.value = mbPtr->drawinfo.value; hiinfo.adornment = mbPtr->drawinfo.adornment; hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent(); if (hiinfo.animation.time.start == 0) { hiinfo.animation.time.start = hiinfo.animation.time.current; } /* * To avoid buttons with white text on a white background, we set the * state to inactive in Dark Mode unless the button is pressed or is a * -default active button. This isn't perfect but it is mostly usable. * Using a ttk::button would be a much better choice, however. */ if ([NSApp macOSVersion] < 101500) { if (TkMacOSXInDarkMode(butPtr->tkwin) && mbPtr->drawinfo.state != kThemeStatePressed && !(mbPtr->drawinfo.adornment & kThemeAdornmentDefault)) { hiinfo.state = kThemeStateInactive; } } HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); TkMacOSXRestoreDrawingContext(&dc); ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *) mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) { return; } TkMacOSXRestoreDrawingContext(&dc); } mbPtr->lastdrawinfo = mbPtr->drawinfo; } /* *-------------------------------------------------------------- * * ButtonBackgroundDrawCB -- * * This function draws the background that lies under checkboxes and * radiobuttons. * * Results: * None. * * Side effects: * The background gets updated to the current color. * *-------------------------------------------------------------- */ static void ButtonBackgroundDrawCB( TCL_UNUSED(const HIRect *), MacButton *ptr, TCL_UNUSED(SInt16), TCL_UNUSED(Boolean)) { MacButton *mbPtr = (MacButton *) ptr; TkButton *butPtr = (TkButton *) mbPtr; Tk_Window tkwin = butPtr->tkwin; Pixmap pixmap; int usehlborder = 0; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (butPtr->type != TYPE_LABEL) { switch (mbPtr->btnkind) { case kThemeSmallBevelButton: case kThemeBevelButton: case kThemeRoundedBevelButton: case kThemePushButton: usehlborder = 1; break; } } if (usehlborder) { Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } else { Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } } /* *-------------------------------------------------------------- * * ButtonContentDrawCB -- * * This function draws the label and image for the button. * * Results: * None. * * Side effects: * The content of the button gets updated. * *-------------------------------------------------------------- */ static void ButtonContentDrawCB ( TCL_UNUSED(const HIRect *), TCL_UNUSED(ThemeButtonKind), TCL_UNUSED(const HIThemeButtonDrawInfo *), MacButton *ptr, TCL_UNUSED(SInt16), TCL_UNUSED(Boolean)) { TkButton *butPtr = (TkButton *) ptr; Tk_Window tkwin = butPtr->tkwin; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } /* * Overlay Tk elements over button native region: drawing elements within * button boundaries/native region causes unpredictable metrics. */ |
︙ | ︙ | |||
932 933 934 935 936 937 938 | * Carbon Appearance control. These are determined by the various tk * button parameters * * Results: * None. * * Side effects: | | > > > | | | | | | 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | * Carbon Appearance control. These are determined by the various tk * button parameters * * Results: * None. * * Side effects: * Sets the btnkind and drawinfo parameters * *---------------------------------------------------------------------- */ static void TkMacOSXComputeButtonParams( TkButton *butPtr, ThemeButtonKind *btnkind, HIThemeButtonDrawInfo *drawinfo) { MacButton *mbPtr = (MacButton *) butPtr; Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (butPtr->borderWidth <= 2) { *btnkind = kThemeSmallBevelButton; } else if (butPtr->borderWidth == 3) { *btnkind = kThemeBevelButton; } else if (butPtr->borderWidth == 4) { *btnkind = kThemeRoundedBevelButton; } else { *btnkind = kThemePushButton; } if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { switch (butPtr->type) { case TYPE_BUTTON: *btnkind = kThemePushButton; break; case TYPE_RADIO_BUTTON: if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallRadioButton; } else { |
︙ | ︙ | |||
978 979 980 981 982 983 984 | *btnkind = kThemeCheckBox; } break; } } if (butPtr->indicatorOn) { | | | | | | | | | | | | | | | | | | | | | | | | | 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 | *btnkind = kThemeCheckBox; } break; } } if (butPtr->indicatorOn) { switch (butPtr->type) { case TYPE_RADIO_BUTTON: if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallRadioButton; } else { *btnkind = kThemeRadioButton; } break; case TYPE_CHECK_BUTTON: if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallCheckBox; } else { *btnkind = kThemeCheckBox; } break; } } else { if (butPtr->type == TYPE_RADIO_BUTTON || butPtr->type == TYPE_CHECK_BUTTON) { if (*btnkind == kThemePushButton) { *btnkind = kThemeBevelButton; } } } if (butPtr->flags & SELECTED) { drawinfo->value = kThemeButtonOn; } else if (butPtr->flags & TRISTATED) { drawinfo->value = kThemeButtonMixed; } else { drawinfo->value = kThemeButtonOff; } if ((mbPtr->flags & FIRST_DRAW) != 0) { mbPtr->flags &= ~FIRST_DRAW; if (Tk_MacOSXIsAppInFront()) { mbPtr->flags |= ACTIVE; } } drawinfo->state = kThemeStateInactive; if ((mbPtr->flags & ACTIVE) == 0) { if (butPtr->state == STATE_DISABLED) { drawinfo->state = kThemeStateUnavailableInactive; } else { drawinfo->state = kThemeStateInactive; } } else if (butPtr->state == STATE_DISABLED) { drawinfo->state = kThemeStateUnavailable; } else if (butPtr->state == STATE_ACTIVE) { drawinfo->state = kThemeStatePressed; } else { drawinfo->state = kThemeStateActive; } drawinfo->adornment = kThemeAdornmentNone; if (butPtr->defaultState == DEFAULT_ACTIVE) { if (drawinfo->state != kThemeStatePressed) { drawinfo->adornment |= kThemeAdornmentDefault; } /* * Older macOS systems (10.9 and earlier) use an animation to * indicate the active button. This is simulated by redrawing * the button periodically. */ if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] <= 100900)) { mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( PULSE_TIMER_MSECS, PulseDefaultButtonProc, butPtr); } } else if (mbPtr->defaultPulseHandler) { Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } if (butPtr->highlightWidth >= 3) { if ((butPtr->flags & GOT_FOCUS)) { drawinfo->adornment |= kThemeAdornmentFocus; } } } /* *---------------------------------------------------------------------- * * TkMacOSXComputeButtonDrawParams -- |
︙ | ︙ | |||
1087 1088 1089 1090 1091 1092 1093 | { MacButton *mbPtr = (MacButton *) butPtr; dpPtr->hasImageOrBitmap = ((butPtr->image != NULL) || (butPtr->bitmap != None)); if (butPtr->type != TYPE_LABEL) { | | | | | | | 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 | { MacButton *mbPtr = (MacButton *) butPtr; dpPtr->hasImageOrBitmap = ((butPtr->image != NULL) || (butPtr->bitmap != None)); if (butPtr->type != TYPE_LABEL) { dpPtr->offset = 0; if (dpPtr->hasImageOrBitmap) { switch (mbPtr->btnkind) { case kThemeSmallBevelButton: case kThemeBevelButton: case kThemeRoundedBevelButton: case kThemePushButton: dpPtr->offset = 1; break; } } } dpPtr->border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { dpPtr->gc = butPtr->disabledGC; } else if (butPtr->type == TYPE_BUTTON && butPtr->state == STATE_ACTIVE) { dpPtr->gc = butPtr->activeTextGC; |
︙ | ︙ | |||
1183 1184 1185 1186 1187 1188 1189 | * Fix 40ada90762: any idle calls to TkpDisplayButton need to be canceled * in case the button is destroyed and has its data freed before the idle * event is handled (DestroyButton only cancels calls when REDRAW_PENDING * is set, which is not the case after calling TkpDisplayButton directly). */ Tcl_CancelIdleCall(TkpDisplayButton, clientData); mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( | | | 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 | * Fix 40ada90762: any idle calls to TkpDisplayButton need to be canceled * in case the button is destroyed and has its data freed before the idle * event is handled (DestroyButton only cancels calls when REDRAW_PENDING * is set, which is not the case after calling TkpDisplayButton directly). */ Tcl_CancelIdleCall(TkpDisplayButton, clientData); mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData); } /* * Local Variables: * mode: objc * c-basic-offset: 4 * fill-column: 79 * coding: utf-8 * End: */ |
Changes to macosx/tkMacOSXColor.h.
︙ | ︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | * or as an index into a table of color descriptions. */ enum colorType { rgbColor, /* The 24 bit value is an rgb color. */ clearColor, /* The unique rgba color with all channels 0. */ HIBrush, /* A HITheme brush color.*/ ttkBackground, /* A background color which indicates nesting level.*/ semantic, /* A semantic NSColor.*/ }; typedef struct xpixel_t { unsigned value: 24; /* Either RGB or an index into systemColorData. */ unsigned colortype: 8; | > > > > | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | * or as an index into a table of color descriptions. */ enum colorType { rgbColor, /* The 24 bit value is an rgb color. */ clearColor, /* The unique rgba color with all channels 0. */ HIBrush, /* A HITheme brush color.*/ #if TCL_MAJOR_VERSION < 9 HIText, /* A HITheme text color (32-bit only). */ HIBackground, /* A HITheme background color (32-bit only). */ #endif ttkBackground, /* A background color which indicates nesting level.*/ semantic, /* A semantic NSColor.*/ }; typedef struct xpixel_t { unsigned value: 24; /* Either RGB or an index into systemColorData. */ unsigned colortype: 8; |
︙ | ︙ |
Changes to macosx/tkMacOSXDefault.h.
︙ | ︙ | |||
375 376 377 378 379 380 381 | #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG NORMAL_FG #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT NORMAL_FG #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" | | | | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG NORMAL_FG #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT NORMAL_FG #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" #define DEF_MESSAGE_PADX "-1" #define DEF_MESSAGE_PADY "-1" #define DEF_MESSAGE_RELIEF "flat" #define DEF_MESSAGE_TAKE_FOCUS "0" #define DEF_MESSAGE_TEXT "" #define DEF_MESSAGE_TEXT_VARIABLE "" #define DEF_MESSAGE_WIDTH "0" /* * Defaults for panedwindows |
︙ | ︙ |
Changes to macosx/tkMacOSXDraw.c.
︙ | ︙ | |||
82 83 84 85 86 87 88 | initialized = TRUE; if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit", | | | | | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | initialized = TRUE; if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit", (char *)&cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) { Tcl_ResetResult(interp); } cgAntiAliasLimit = limit; /* * Piggy-back the themed drawing var init here. */ if (Tcl_LinkVar(interp, "::tk::mac::useThemedToplevel", (char *)&useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::useThemedFrame", (char *)&useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } transparentColor = TkMacOSXClearPixel(); } return TCL_OK; } |
︙ | ︙ |
Changes to macosx/tkMacOSXFont.c.
︙ | ︙ | |||
22 23 24 25 26 27 28 | /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_FONTS #endif */ | < < < < < < < < < < < < < < < < < < < < | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_FONTS #endif */ /* * The following structure represents our Macintosh-specific implementation * of a font object. */ typedef struct { TkFont font; /* Stuff used by generic font package. Must be |
︙ | ︙ | |||
474 475 476 477 478 479 480 | Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?"); return TCL_ERROR; } stringArg = Tcl_GetStringFromObj(objv[1], &len); if (stringArg == NULL) { return TCL_ERROR; } | | | | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?"); return TCL_ERROR; } stringArg = Tcl_GetStringFromObj(objv[1], &len); if (stringArg == NULL) { return TCL_ERROR; } Tcl_Size ulen = TkGetCharLength(objv[1]); S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len]; len = [S length]; if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL); return TCL_ERROR; } if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ Tcl_Size newIdx = 0; for (Tcl_Size i = 0; i < idx; i++) { newIdx += 1 + (((newIdx < (Tcl_Size)len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00)); } idx = newIdx; } if (idx >= 0) { if (idx >= len) { idx = len; } else { |
︙ | ︙ | |||
531 532 533 534 535 536 537 | Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?"); return TCL_ERROR; } stringArg = Tcl_GetStringFromObj(objv[1], &len); if (stringArg == NULL) { return TCL_ERROR; } | | | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | Tcl_WrongNumArgs(interp, 1 , objv, "str start ?locale?"); return TCL_ERROR; } stringArg = Tcl_GetStringFromObj(objv[1], &len); if (stringArg == NULL) { return TCL_ERROR; } Tcl_Size ulen = TkGetCharLength(objv[1]); S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len]; len = [S length]; if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL); |
︙ | ︙ | |||
1080 1081 1082 1083 1084 1085 1086 | fit = rangeLength; goto done; } attributedString = [[NSAttributedString alloc] initWithString:string attributes:fontPtr->nsAttributes]; typesetter = CTTypesetterCreateWithAttributedString( (CFAttributedStringRef)attributedString); | | | | 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 | fit = rangeLength; goto done; } attributedString = [[NSAttributedString alloc] initWithString:string attributes:fontPtr->nsAttributes]; typesetter = CTTypesetterCreateWithAttributedString( (CFAttributedStringRef)attributedString); start = Tcl_NumUtfChars(source, rangeStart); len = Tcl_NumUtfChars(source + rangeStart, rangeLength); if (start > 0) { range.length = start; line = CTTypesetterCreateLine(typesetter, range); offset = CTLineGetTypographicBounds(line, NULL, NULL, NULL); CFRelease(line); } if (maxLength < 0) { |
︙ | ︙ | |||
1182 1183 1184 1185 1186 1187 1188 | } } CFRelease(typesetter); [attributedString release]; [string release]; length = ceil(width - offset); | | | 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 | } } CFRelease(typesetter); [attributedString release]; [string release]; length = ceil(width - offset); fit = (Tcl_UtfAtIndex(source, index) - source) - rangeStart; done: #ifdef TK_MAC_DEBUG_FONTS TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d " "flags='%s%s%s%s' -> width=%d bytesFit=%d\n", source, rangeLength, source+rangeStart, maxLength, flags & TK_PARTIAL_OK ? "partialOk " : "", flags & TK_WHOLE_WORDS ? "wholeWords " : "", |
︙ | ︙ | |||
1381 1382 1383 1384 1385 1386 1387 | if (angle != 0.0) { t = CGAffineTransformTranslate( CGAffineTransformRotate( CGAffineTransformTranslate(t, textX, textY), angle*PI/180.0), -textX, -textY); } CGContextConcatCTM(context, t); | | | | 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 | if (angle != 0.0) { t = CGAffineTransformTranslate( CGAffineTransformRotate( CGAffineTransformTranslate(t, textX, textY), angle*PI/180.0), -textX, -textY); } CGContextConcatCTM(context, t); start = Tcl_NumUtfChars(source, rangeStart); length = Tcl_NumUtfChars(source, rangeStart + rangeLength) - start; line = CTTypesetterCreateLine(typesetter, CFRangeMake(start, length)); if (start > 0) { /* * We are only drawing part of the string. To compute the x coordinate * of the part we are drawing we subtract its typographical length from * the typographical length of the full string. This accounts for the |
︙ | ︙ | |||
1550 1551 1552 1553 1554 1555 1556 | if (!initialized) { initialized = TRUE; if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::antialiasedtext", | | | 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 | if (!initialized) { initialized = TRUE; if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::antialiasedtext", (char *) &antialiasedTextEnabled, TCL_LINK_INT) != TCL_OK) { Tcl_ResetResult(interp); } } antialiasedTextEnabled = enable; return TCL_OK; } |
︙ | ︙ |
Changes to macosx/tkMacOSXKeyboard.c.
︙ | ︙ | |||
497 498 499 500 501 502 503 | { MacKeycode macKC; char utfChars[8]; int length = 0; macKC.uint = eventPtr->xkey.keycode; if (IS_PRINTABLE(macKC.v.keychar)) { | | | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | { MacKeycode macKC; char utfChars[8]; int length = 0; macKC.uint = eventPtr->xkey.keycode; if (IS_PRINTABLE(macKC.v.keychar)) { length = TkUniCharToUtf(macKC.v.keychar, utfChars); } utfChars[length] = 0; Tcl_DStringInit(dsPtr); return Tcl_DStringAppend(dsPtr, utfChars, length); } |
︙ | ︙ |
Changes to macosx/tkMacOSXNotify.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" #include "tkMacOSXInt.h" #include "tkMacOSXConstants.h" #import <objc/objc-auto.h> /* This is not used for anything at the moment. */ typedef struct ThreadSpecificData { int initialized; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" #include "tkMacOSXInt.h" #include "tkMacOSXConstants.h" #if TCL_MAJOR_VERSION < 9 #undef Tcl_MacOSXNotifierAddRunLoopMode #ifdef USE_TCL_STUBS #ifdef __cplusplus extern "C" { #endif /* Little hack to eliminate the need for "tclInt.h" here: Just copy a small portion of TclIntPlatStubs, just enough to make it work. See [600b72bfbc] */ typedef struct TclIntPlatStubs { int magic; void *hooks; void (*dummy[19]) (void); /* dummy entries 0-18, not used */ void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */ } TclIntPlatStubs; extern const TclIntPlatStubs *tclIntPlatStubsPtr; #ifdef __cplusplus } #endif #define Tcl_MacOSXNotifierAddRunLoopMode \ (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */ #elif TCL_MINOR_VERSION < 7 extern void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode); # define Tcl_MacOSXNotifierAddRunLoopMode TclMacOSXNotifierAddRunLoopMode #else extern void Tcl_MacOSXNotifierAddRunLoopMode(const void *runLoopMode); #endif #endif #import <objc/objc-auto.h> /* This is not used for anything at the moment. */ typedef struct ThreadSpecificData { int initialized; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; |
︙ | ︙ |
Changes to macosx/tkMacOSXPrivate.h.
︙ | ︙ | |||
518 519 520 521 522 523 524 | /* *--------------------------------------------------------------------------- * * TKNSString -- * | > > > > > > | | | > | 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | /* *--------------------------------------------------------------------------- * * TKNSString -- * * When Tcl is compiled with TCL_UTF_MAX = 3 (the default for 8.6) it cannot * deal directly with UTF-8 encoded non-BMP characters, since their UTF-8 * encoding requires 4 bytes. Instead, when using these versions of Tcl, Tk * uses the CESU-8 encoding internally. This encoding is similar to UTF-8 * except that it allows encoding surrogate characters as 3-byte sequences * using the same algorithm which UTF-8 uses for non-surrogates. This means * that a non-BMP character is encoded as a string of length 6. Apple's * NSString class does not provide a constructor which accepts a CESU-8 encoded * byte sequence as initial data. So we add a new class which does provide * such a constructor. It also has a DString property which is a DString whose * string pointer is a byte sequence encoding the NSString with the current Tcl * internal encoding, namely UTF-8 for Tcl8.7+ or CESU-8 otherwise. * *--------------------------------------------------------------------------- */ @interface TKNSString:NSString { @private Tcl_DString _ds; |
︙ | ︙ |
Changes to macosx/tkMacOSXScale.c.
︙ | ︙ | |||
193 194 195 196 197 198 199 | Tcl_Release(scalePtr); /* * Now handle the part of redisplay that is the same for horizontal and * vertical scales: border and traversal highlight. */ | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | Tcl_Release(scalePtr); /* * Now handle the part of redisplay that is the same for horizontal and * vertical scales: border and traversal highlight. */ if (scalePtr->highlightWidth > 0) { GC gc = Tk_GCForColor(scalePtr->highlightColorPtr, Tk_WindowId(tkwin)); Tk_DrawFocusHighlight(tkwin, gc, scalePtr->highlightWidth, Tk_WindowId(tkwin)); } Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), scalePtr->bgBorder, scalePtr->highlightWidth, scalePtr->highlightWidth, |
︙ | ︙ |
Changes to macosx/tkMacOSXScrlbr.c.
︙ | ︙ | |||
280 281 282 283 284 285 286 | CGContextConcatCTM(dc.context, t); /* * Draw a 3D rectangle to provide a base for the native scrollbar. */ | | | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | CGContextConcatCTM(dc.context, t); /* * Draw a 3D rectangle to provide a base for the native scrollbar. */ if (scrollPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(scrollPtr->highlightBgColorPtr, (Pixmap) macWin); if (scrollPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(scrollPtr->highlightColorPtr, (Pixmap) macWin); } else { fgGC = bgGC; |
︙ | ︙ | |||
645 646 647 648 649 650 651 | msPtr->info.value = factor * scrollPtr->firstFraction; } if ((scrollPtr->firstFraction <= 0.0 && scrollPtr->lastFraction >= 1.0) || height <= metrics.minHeight) { msPtr->info.enableState = kThemeTrackHideTrack; } else { | | | | 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 | msPtr->info.value = factor * scrollPtr->firstFraction; } if ((scrollPtr->firstFraction <= 0.0 && scrollPtr->lastFraction >= 1.0) || height <= metrics.minHeight) { msPtr->info.enableState = kThemeTrackHideTrack; } else { msPtr->info.enableState = kThemeTrackActive; msPtr->info.attributes = kThemeTrackShowThumb | kThemeTrackThumbRgnIsNotGhost; } } /* *-------------------------------------------------------------- * |
︙ | ︙ |
Changes to macosx/tkMacOSXWm.c.
︙ | ︙ | |||
6976 6977 6978 6979 6980 6981 6982 | * * Side effects: * May maximize, minimize, restore, or withdraw a window. * *---------------------------------------------------------------------- */ | | | | 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 | * * Side effects: * May maximize, minimize, restore, or withdraw a window. * *---------------------------------------------------------------------- */ void TkpWmSetState( TkWindow *winPtr, /* Toplevel window to operate on. */ int state) /* One of IconicState, ZoomState, NormalState, * or WithdrawnState. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; NSWindow *macWin; wmPtr->hints.initial_state = state; if (wmPtr->flags & WM_NEVER_MAPPED) { return; } macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); /* * Make sure windows are updated before the state change. As an exception, * do not process idle tasks before withdrawing a window. The purpose of |
︙ | ︙ | |||
7031 7032 7033 7034 7035 7036 7037 | } /* * Make sure windows are updated after the state change too. */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} | < < | 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 | } /* * Make sure windows are updated after the state change too. */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} } /* *---------------------------------------------------------------------- * * TkpIsWindowFloating -- * |
︙ | ︙ |
Changes to macosx/tkMacOSXXStubs.c.
︙ | ︙ | |||
861 862 863 864 865 866 867 | /* * This is a no-op, no icon name for Macs. */ LastKnownRequestProcessed(display)++; return Success; } | < < < < < < < < | 861 862 863 864 865 866 867 868 869 870 871 872 873 874 | /* * This is a no-op, no icon name for Macs. */ LastKnownRequestProcessed(display)++; return Success; } int XForceScreenSaver( Display* display, TCL_UNUSED(int)) { /* * This function is just a no-op. It is defined to reset the screen saver. |
︙ | ︙ |
Changes to macosx/ttkMacOSXTheme.c.
︙ | ︙ | |||
2476 2477 2478 2479 2480 2481 2482 | { TrackElementData *data = (TrackElementData *)clientData; TrackElement *elem = (TrackElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; double from = 0, to = 100, value = 0, fraction, max; CGRect bounds = BoxToRect(d, b); | | | 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 | { TrackElementData *data = (TrackElementData *)clientData; TrackElement *elem = (TrackElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; double from = 0, to = 100, value = 0, fraction, max; CGRect bounds = BoxToRect(d, b); TtkGetOrientFromObj(NULL, elem->orientObj, &orientation); Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from); Tcl_GetDoubleFromObj(NULL, elem->toObj, &to); Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value); fraction = (value - from) / (to - from); max = RangeToFactor(fabs(to - from)); HIThemeTrackDrawInfo info = { |
︙ | ︙ | |||
2618 2619 2620 2621 2622 2623 2624 | Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; int phase; double value = 0, maximum = 100, factor; CGRect bounds = BoxToRect(d, b); int isIndeterminate = !strcmp("indeterminate", Tcl_GetString(pbar->modeObj)); | | | 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 | Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; int phase; double value = 0, maximum = 100, factor; CGRect bounds = BoxToRect(d, b); int isIndeterminate = !strcmp("indeterminate", Tcl_GetString(pbar->modeObj)); TtkGetOrientFromObj(NULL, pbar->orientObj, &orientation); Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value); Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum); Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase); if (isIndeterminate) { /* |
︙ | ︙ | |||
2693 2694 2695 2696 2697 2698 2699 | int *minHeight, Ttk_Padding *paddingPtr) { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; SInt32 thickness = 15; | | | 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 | int *minHeight, Ttk_Padding *paddingPtr) { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; SInt32 thickness = 15; TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); ChkErr(GetThemeMetric, kThemeMetricScrollBarWidth, &thickness); if (orientation == TTK_ORIENT_HORIZONTAL) { *minHeight = thickness; if ([NSApp macOSVersion] > 100700) { *paddingPtr = Ttk_MakePadding(4, 4, 4, 3); } } else { |
︙ | ︙ | |||
2721 2722 2723 2724 2725 2726 2727 | TCL_UNUSED(Ttk_State)) /* state */ { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; CGRect bounds = BoxToRect(d, b); GrayColor bgGray; | | | 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 | TCL_UNUSED(Ttk_State)) /* state */ { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; CGRect bounds = BoxToRect(d, b); GrayColor bgGray; TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_HORIZONTAL) { bounds = CGRectInset(bounds, 0, 1); } else { bounds = CGRectInset(bounds, 1, 0); } BEGIN_DRAWING(d) if ([NSApp macOSVersion] > 100800) { |
︙ | ︙ | |||
2757 2758 2759 2760 2761 2762 2763 | int *minWidth, int *minHeight, TCL_UNUSED(Ttk_Padding *)) /* paddingPtr */ { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; | | | | 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 | int *minWidth, int *minHeight, TCL_UNUSED(Ttk_Padding *)) /* paddingPtr */ { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_VERTICAL) { *minHeight = 18; *minWidth = 8; } else { *minHeight = 8; *minWidth = 18; } } static void ThumbElementDraw( TCL_UNUSED(void *), /* clientData */ void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); /* * In order to make ttk scrollbars work correctly it is necessary to be * able to display the thumb element at the size and location which the ttk * scrollbar widget requests. The algorithm that HIToolbox uses to * determine the thumb geometry from the input values of min, max, value * and viewSize is undocumented. A seemingly natural algorithm is |
︙ | ︙ |
Changes to tests/bind.test.
︙ | ︙ | |||
2221 2222 2223 2224 2225 2226 2227 | list $x $y $z } -cleanup { destroy .t.e bind Entry <Key> $savedBind(Entry) bind all <Key> $savedBind(All) unset savedBind } -result {0 1 2} | | | 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 | list $x $y $z } -cleanup { destroy .t.e bind Entry <Key> $savedBind(Entry) bind all <Key> $savedBind(All) unset savedBind } -result {0 1 2} test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f focus -force .t.f update } -body { bind .t.f <Key> {set x "%K"} set x none |
︙ | ︙ | |||
6034 6035 6036 6037 6038 6039 6040 | test bind-28.11 {keysym names, gcedilla} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <gcedilla> foo bind .t.f } -cleanup { destroy .t.f } -result <Key-gcedilla> | | | | 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 | test bind-28.11 {keysym names, gcedilla} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <gcedilla> foo bind .t.f } -cleanup { destroy .t.f } -result <Key-gcedilla> test bind-28.12 {keysym names, Greek_IOTAdiaeresis -> Greek_IOTAdieresis} -constraints {deprecated needsTcl87} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <Greek_IOTAdiaeresis> foo bind .t.f } -cleanup { destroy .t.f } -result <Key-Greek_IOTAdieresis> test bind-28.13 {keysym names, Unicode} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <€> foo bind .t.f } -cleanup { destroy .t.f } -result "<Key-€>" test bind-28.14 {keysym names, Emoji} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <\U1F44D> foo bind .t.f } -cleanup { destroy .t.f } -result "<Key-\U1F44D>" test bind-28.15 {keysym names, Emoji} -constraints needsTcl87 -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <👍> foo bind .t.f } -cleanup { destroy .t.f } -result "<Key-👍>" |
︙ | ︙ |
Changes to tests/button.test.
︙ | ︙ | |||
1740 1741 1742 1743 1744 1745 1746 | update } -body { .b configure -overrelief "" .b cget -overrelief } -cleanup { destroy .b } -result {} | | | | | 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 | update } -body { .b configure -overrelief "" .b cget -overrelief } -cleanup { destroy .b } -result {} test button-1.178 {configuration option: "overrelief" for button} -constraints needsTcl87 -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b update } -body { .b configure -overrelief 1.5 } -cleanup { destroy .b } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test button-1.179 {configuration option: "overrelief" for checkbutton} -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c update } -body { .c configure -overrelief "" .c cget -overrelief } -cleanup { destroy .c } -result {} test button-1.180 {configuration option: "overrelief" for checkbutton} -constraints needsTcl87 -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c update } -body { .c configure -overrelief 1.5 } -cleanup { destroy .c } -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test button-1.181 {configuration option: "overrelief" for radiobutton} -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r update } -body { .r configure -overrelief "" .r cget -overrelief } -cleanup { destroy .r } -result {} test button-1.182 {configuration option: "overrelief" for radiobutton} -constraints needsTcl87 -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r update } -body { .r configure -overrelief 1.5 } -cleanup { destroy .r |
︙ | ︙ | |||
2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 | # checkbox widgets checkbutton .c .c configure -selectcolor {} } -cleanup { destroy .c } -result {} # ex-tests 3.* test button-2.1 {ButtonCreate - not enough arguments} -body { button } -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"} test button-2.2 {ButtonCreate procedure - setting label class} -body { label .x | > > > > > > > > > > > | 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 | # checkbox widgets checkbutton .c .c configure -selectcolor {} } -cleanup { destroy .c } -result {} test button-1.271 {configuration options: fallback to default} -setup { checkbutton .c -borderwidth -2 -highlightthickness -2 -font {Helvetica -12 bold} pack .c update } -body { .c configure -padx -2 -pady -2 -wraplength -2 list [.c cget -padx] [.c cget -pady] [.c cget -borderwidth] [.c cget -highlightthickness] [.c cget -wraplength] } -cleanup { destroy .c } -result {0 0 0 0 0} # ex-tests 3.* test button-2.1 {ButtonCreate - not enough arguments} -body { button } -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"} test button-2.2 {ButtonCreate procedure - setting label class} -body { label .x |
︙ | ︙ | |||
3364 3365 3366 3367 3368 3369 3370 | test button-5.17 {ConfigureButton - -width option} -body { button .b -text "Button 1" catch {.b configure -width 1i} return $errorInfo } -cleanup { destroy .b } -result {expected integer but got "1i" | | | | | 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 | test button-5.17 {ConfigureButton - -width option} -body { button .b -text "Button 1" catch {.b configure -width 1i} return $errorInfo } -cleanup { destroy .b } -result {expected integer but got "1i" (processing "-width" option) invoked from within ".b configure -width 1i"} test button-5.18 {ConfigureButton - -height option} -body { button .b -text "Button 1" .b configure -height 0.5c } -cleanup { destroy .b } -returnCodes {error} -result {expected integer but got "0.5c"} test button-5.19 {ConfigureButton - -height option} -body { button .b -text "Button 1" catch {.b configure -height 0.5c} return $errorInfo } -cleanup { destroy .b } -result {expected integer but got "0.5c" (processing "-height" option) invoked from within ".b configure -height 0.5c"} #ex 6.16 test button-5.20 {ConfigureButton - -width option} -body { button .b -bitmap questhead .b configure -width abc } -cleanup { destroy .b } -returnCodes {error} -result {expected screen distance but got "abc"} test button-5.21 {ConfigureButton - -width option} -body { button .b -bitmap questhead catch {.b configure -width abc} return $errorInfo } -cleanup { destroy .b } -result {expected screen distance but got "abc" (processing "-width" option) invoked from within ".b configure -width abc"} test button-5.22 {ConfigureButton - -height option} -constraints { testImageType } -setup { image create test image1 } -body { |
︙ | ︙ | |||
3424 3425 3426 3427 3428 3429 3430 | button .b -image image1 catch {.b configure -height 0.5x} return $errorInfo } -cleanup { destroy .b image delete image1 } -result {expected screen distance but got "0.5x" | | | 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 | button .b -image image1 catch {.b configure -height 0.5x} return $errorInfo } -cleanup { destroy .b image delete image1 } -result {expected screen distance but got "0.5x" (processing "-height" option) invoked from within ".b configure -height 0.5x"} #ex 6.18 test button-5.24 {ConfigureButton - computing geometry} -constraints { fonts } -body { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ |
︙ | ︙ |
Changes to tests/canvas.test.
︙ | ︙ | |||
553 554 555 556 557 558 559 560 561 562 563 564 565 566 | test canvas-11.3 {canvas poly dchars, bug 3291543} { # This would crash destroy .c pack [canvas .c] .c create polygon 0 0 0 10 10 0 .c dchars 1 2 end .c coords 1 } {} test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup { destroy .c pack [canvas .c] } -body { set qx [expr {1.+1.}] | > > > > > > > | 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 | test canvas-11.3 {canvas poly dchars, bug 3291543} { # This would crash destroy .c pack [canvas .c] .c create polygon 0 0 0 10 10 0 .c dchars 1 2 end .c coords 1 } {} test canvas-11.4 {canvas line dchars crash with -arrows, bug 51ece3786f} { # This would crash destroy .c canvas .c .c create line 10 10 100 100 -arrow last .c dchars 1 0 1 } {} test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup { destroy .c pack [canvas .c] } -body { set qx [expr {1.+1.}] |
︙ | ︙ |
Changes to tests/cluster.test.
︙ | ︙ | |||
118 119 120 121 122 123 124 | } -result 3 test cluster-4.7 {::tk::startOfPreviousWord} -body { ::tk::startOfPreviousWord "ab cd" end } -result 3 test cluster-4.8 {::tk::startOfPreviousWord} -body { ::tk::startOfPreviousWord "ab cd" {} } -result {} | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | } -result 3 test cluster-4.7 {::tk::startOfPreviousWord} -body { ::tk::startOfPreviousWord "ab cd" end } -result 3 test cluster-4.8 {::tk::startOfPreviousWord} -body { ::tk::startOfPreviousWord "ab cd" {} } -result {} test cluster-4.9 {::tk::startOfPreviousWord} -constraints needsTcl87 -body { ::tk::startOfPreviousWord "ab cd" end-1 } -result 0 test cluster-5.0 {::tk::startOfNextWord} -body { ::tk::startOfNextWord "ab cd" -1 } -result 3 test cluster-5.1 {::tk::startOfNextWord} -body { |
︙ | ︙ |
Changes to tests/config.test.
︙ | ︙ | |||
454 455 456 457 458 459 460 | testobjconfig alltypes .foo -stringtable two .foo cget -stringtable rename .foo {} } -cleanup { killTables } -returnCodes ok test config-4.29 {DoObjConfig - invalid string table} -constraints { | | | | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | testobjconfig alltypes .foo -stringtable two .foo cget -stringtable rename .foo {} } -cleanup { killTables } -returnCodes ok test config-4.29 {DoObjConfig - invalid string table} -constraints { testobjconfig needsTcl87 } -body { testobjconfig alltypes .foo -stringtable foo } -cleanup { killTables } -returnCodes error -result {bad stringtable "foo": must be one, two, three, four, or ""} test config-4.29a {DoObjConfig - invalid string table} -constraints { testobjconfig needsTcl87 } -body { testobjconfig alltypes .foo -stringtable2 foo } -cleanup { killTables } -returnCodes error -result {bad stringtable2 "foo": must be one, two, or ""} test config-4.30 {DoObjConfig - new string table} -constraints { testobjconfig |
︙ | ︙ | |||
776 777 778 779 780 781 782 | test config-4.70 {DoObjConfig - relief} -constraints testobjconfig -body { testobjconfig alltypes .foo -relief flat .foo cget -relief } -cleanup { killTables } -returnCodes ok -result flat test config-4.71 {DoObjConfig - invalid relief} -constraints { | | | 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | test config-4.70 {DoObjConfig - relief} -constraints testobjconfig -body { testobjconfig alltypes .foo -relief flat .foo cget -relief } -cleanup { killTables } -returnCodes ok -result flat test config-4.71 {DoObjConfig - invalid relief} -constraints { testobjconfig needsTcl87 } -body { testobjconfig alltypes .foo -relief foo } -cleanup { killTables } -returnCodes error -result {bad relief "foo": must be flat, groove, raised, ridge, solid, sunken, or ""} test config-4.72 {DoObjConfig - relief internal value} -constraints testobjconfig -setup { catch {rename .foo {}} |
︙ | ︙ | |||
870 871 872 873 874 875 876 | } -returnCodes ok -result .foo test config-4.84 {DoObjConfig - justify} -constraints testobjconfig -body { testobjconfig alltypes .foo -justify center .foo cget -justify } -cleanup { killTables } -returnCodes ok -result center | | | 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | } -returnCodes ok -result .foo test config-4.84 {DoObjConfig - justify} -constraints testobjconfig -body { testobjconfig alltypes .foo -justify center .foo cget -justify } -cleanup { killTables } -returnCodes ok -result center test config-4.85 {DoObjConfig - invalid justify} -constraints {testobjconfig needsTcl87} -body { testobjconfig alltypes .foo -justify foo } -cleanup { killTables } -returnCodes error -result {bad justification "foo": must be left, right, center, or ""} test config-4.86 {DoObjConfig - new justify} -constraints testobjconfig -body { testobjconfig alltypes .foo -justify left .foo configure -justify right |
︙ | ︙ | |||
912 913 914 915 916 917 918 | testobjconfig alltypes .foo -anchor center .foo cget -anchor } -cleanup { killTables } -returnCodes ok -result center test config-4.91 {DoObjConfig - invalid anchor} -constraints testobjconfig -body { testobjconfig alltypes .foo -anchor foo | | | 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | testobjconfig alltypes .foo -anchor center .foo cget -anchor } -cleanup { killTables } -returnCodes ok -result center test config-4.91 {DoObjConfig - invalid anchor} -constraints testobjconfig -body { testobjconfig alltypes .foo -anchor foo } -constraints needsTcl87 -cleanup { killTables } -returnCodes error -result {bad anchor "foo": must be n, ne, e, se, s, sw, w, nw, center, or ""} test config-4.92 {DoObjConfig - new anchor} -constraints testobjconfig -body { testobjconfig alltypes .foo -anchor e .foo configure -anchor n } -cleanup { killTables |
︙ | ︙ |
Changes to tests/constraints.tcl.
︙ | ︙ | |||
185 186 187 188 189 190 191 | # pointer has actually been moved to its new position after a Tk test issued: # # [event generate $w $event -warp 1 ...] # # It takes care of the following timing details of pointer warping: # # a. Allow pointer warping to happen if it was scheduled for execution at | > > > | | > > | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | # pointer has actually been moved to its new position after a Tk test issued: # # [event generate $w $event -warp 1 ...] # # It takes care of the following timing details of pointer warping: # # a. Allow pointer warping to happen if it was scheduled for execution at # idle time. # - In Tk releases 8.6 and older, pointer warping is scheduled for # execution at idle time # - In release 8.7 and newer this happens synchronously if $w refers to the # whole screen or if the -when option to [event generate] is "now". # The namespace variable idle_pointer_warping records which of these is # the case. # # b. Work around a race condition associated with OS notification of # mouse motion on Windows. # # When calling [event generate $w $event -warp 1 ...], the following # sequence occurs: # - At some point in the processing of this command, either via a |
︙ | ︙ | |||
229 230 231 232 233 234 235 236 | # # Beware: there are cases, not (yet) exercised by the Tk test suite, where # [controlPointerWarpTiming] doesn't ensure the new position of the pointer. # For example, when issued under Tk8.7+, if the value for the -when option # to [event generate $w] is not "now", and $w refers to a Tk window, i.e. not # the whole screen. # proc controlPointerWarpTiming {{duration 50}} { | > > > | > | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | # # Beware: there are cases, not (yet) exercised by the Tk test suite, where # [controlPointerWarpTiming] doesn't ensure the new position of the pointer. # For example, when issued under Tk8.7+, if the value for the -when option # to [event generate $w] is not "now", and $w refers to a Tk window, i.e. not # the whole screen. # variable idle_pointer_warping [expr {[package provide tk] != ""}] proc controlPointerWarpTiming {{duration 50}} { variable idle_pointer_warping if {$idle_pointer_warping} { update idletasks ;# see a. above } if {[tk windowingsystem] eq "win32"} { after $duration ;# see b. above } } namespace export controlPointerWarpTiming } |
︙ | ︙ | |||
260 261 262 263 264 265 266 | ([testConstraint unix] && [testConstraint notAqua]) }] testConstraint haveDISPLAY [expr {[info exists env(DISPLAY)] && [testConstraint x11]}] testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)] testConstraint noExceed [expr { ![testConstraint unix] || [catch {font actual "\{xyz"}] }] | | > | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | ([testConstraint unix] && [testConstraint notAqua]) }] testConstraint haveDISPLAY [expr {[info exists env(DISPLAY)] && [testConstraint x11]}] testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)] testConstraint noExceed [expr { ![testConstraint unix] || [catch {font actual "\{xyz"}] }] testConstraint deprecated [expr {![package vsatisfies [package provide Tcl] 8.7-] || ![::tk::build-info no-deprecate]}] testConstraint needsTcl87 [package vsatisfies [package provide Tcl] 8.7-] # constraint for running a test on all windowing system except aqua # where the test fails due to a known bug testConstraint aquaKnownBug [expr {[testConstraint notAqua] || [testConstraint knownBug]}] # constraints for testing facilities defined in the tktest executable... testConstraint testImageType [expr {"test" in [image types]}] |
︙ | ︙ |
Added tests/corruptTruncatedColormap.gif.
cannot compute difference between binary files
Changes to tests/entry.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # This file is a Tcl script to test entry widgets in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright © 1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands # For xscrollcommand set scrollInfo {} proc scroll args { global scrollInfo set scrollInfo $args } # For trace add variable | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # This file is a Tcl script to test entry widgets in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright © 1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] # For xscrollcommand set scrollInfo {} proc scroll args { global scrollInfo set scrollInfo $args } # For trace add variable |
︙ | ︙ | |||
887 888 889 890 891 892 893 | } -body { .e insert end "01234567890" .e delete 6 .e get } -cleanup { destroy .e } -result 0123457890 | | | 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 | } -body { .e insert end "01234567890" .e delete 6 .e get } -cleanup { destroy .e } -result 0123457890 test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -constraints failsOnXQuarz -setup { entry .e pack .e ; update idletasks update set x {} } -body { # UTF .e insert end "01234乎67890" |
︙ | ︙ |
Changes to tests/imgListFormat.test.
︙ | ︙ | |||
10 11 12 13 14 15 16 | package require tcltest 2.2 namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands imageInit | < < < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | package require tcltest 2.2 namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands imageInit set teapotPhotoFile [file join [file dirname [info script]] teapot.ppm] set transpTeapotPhotoFile [file join [file dirname [info script]] teapotTransparent.png] # --------------------------------------------------------------------- test imgListFormat-1.1 {ParseFormatOptions: default values} -setup { image create photo photo1 } -body { |
︙ | ︙ | |||
171 172 173 174 175 176 177 | } -returnCodes error -result \ {bad format option "-bogus": no options allowed} test imgListFormat-4.3 {StringReadDef: erroneous non-option argument} -setup { image create photo photo1 } -body { photo1 put orange -format {default bogus} } -returnCodes error -result {bad format option "bogus": no options allowed} | | < < | < < | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | } -returnCodes error -result \ {bad format option "-bogus": no options allowed} test imgListFormat-4.3 {StringReadDef: erroneous non-option argument} -setup { image create photo photo1 } -body { photo1 put orange -format {default bogus} } -returnCodes error -result {bad format option "bogus": no options allowed} test imgListFormat-4.4 {StringReadDef: normal use case} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { set imgData [photo1 data] photo2 put $imgData string equal [photo1 data] [photo2 data] } -cleanup { imageCleanup unset imgData } -result 1 test imgListFormat-4.5 {StringReadDef: correct compositing rule} -setup { image create photo photo1 -file $transpTeapotPhotoFile image create photo photo2 } -body { photo2 put #FF0000 -to 0 0 50 50 photo2 put [photo1 data -format {default -colorformat rgba}] -to 10 10 40 40 list [photo2 get 0 0 -withalpha] [photo2 get 20 25 -withalpha] \ [photo2 get 49 49 -withalpha] |
︙ | ︙ | |||
237 238 239 240 241 242 243 | photo1 put blue -to 0 0 35 64 set imgData [photo1 data] list [llength [lindex $imgData 0]] [llength $imgData] } -cleanup { unset imgData imageCleanup } -result {35 64} | | < < | < < | < < | < < | < < | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | photo1 put blue -to 0 0 35 64 set imgData [photo1 data] list [llength [lindex $imgData 0]] [llength $imgData] } -cleanup { unset imgData imageCleanup } -result {35 64} test imgListFormat-5.6 {StringWriteDef: test some pixels #1} -setup { set result {} image create photo photo1 -file $teapotPhotoFile } -body { set imgData [photo1 data] # note: with [lindex], the coords are inverted (y x) lappend result [lindex $imgData 0 0] lappend result [lindex $imgData 3 2] lappend result [lindex $imgData 107 53] lappend result [lindex $imgData 203 157] lappend result [lindex $imgData 255 255] set result } -cleanup { unset result unset imgData imageCleanup } -result {{#135cc0} #135cc0 #a06d52 #e1c8ba #135cc0} test imgListFormat-5.7 {StringWriteDef: test some pixels #2} -setup { set result {} image create photo photo1 -file $teapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat rgba}] # note: with [lindex], the coords are inverted (y x) lappend result [lindex $imgData 0 0] lappend result [lindex $imgData 3 2] lappend result [lindex $imgData 107 53] lappend result [lindex $imgData 203 157] lappend result [lindex $imgData 255 255] set result } -cleanup { unset result unset imgData imageCleanup } -result {{#135cc0ff} #135cc0ff #a06d52ff #e1c8baff #135cc0ff} test imgListFormat-5.8 {StringWriteDef: test some pixels #3} -setup { image create photo photo1 -file $transpTeapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat rgb}] set result {} lappend result [lindex $imgData 3 2] lappend result [lindex $imgData 107 53] lappend result [lindex $imgData 203 157] set result } -cleanup { unset result unset imgData imageCleanup } -result {{#004eb9} #a14100 #ffca9f} test imgListFormat-5.9 {StringWriteDef: test some pixels #4} -setup { image create photo photo1 -file $transpTeapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat rgba}] set result [lindex $imgData 3 2] lappend result [lindex $imgData 107 53] lappend result [lindex $imgData 203 157] set result } -cleanup { unset result unset imgData imageCleanup } -result {{#004eb9e1} #a14100aa #ffca9faf} test imgListFormat-5.10 {StringWriteDef: test some pixels #5} -setup { image create photo photo1 -file $transpTeapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat list}] set result {} lappend result [lindex $imgData 3 2] lappend result [lindex $imgData 107 53] lappend result [lindex $imgData 203 157] |
︙ | ︙ |
Changes to tests/imgPhoto.test.
︙ | ︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | # Tk_PhotoExpand: no tests # Tk_PhotoGetSize: no tests # Tk_PhotoSetSize: no tests # TkGetPhotoValidRegion: no tests # ImgGetPhoto: no tests # Tk_PhotoGetImage no tests # ImgPostscriptPhoto no tests # Tk_PhotoGetMetadata: imgPhoto-21.* # Tk_PhotoSetMetadata: imgPhoto-22.* #-------------------------------------------------------------------------- # # # Some tests are not specific to a function in tkImgPhoto.c. They are: | > > > > > > | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # Tk_PhotoExpand: no tests # Tk_PhotoGetSize: no tests # Tk_PhotoSetSize: no tests # TkGetPhotoValidRegion: no tests # ImgGetPhoto: no tests # Tk_PhotoGetImage no tests # ImgPostscriptPhoto no tests # Tk_PhotoPutBlock_NoComposite no tests, probably none needed # Tk_PhotoPutZoomedBlock_NoComposite no tests, probably none needed # Tk_PhotoExpand_Panic no tests, probably none needed # Tk_PhotoPutBlock_Panic no tests, probably none needed # Tk_PhotoPutZoomedBlock_Panic no tests, probably none needed # Tk_PhotoSetSize_Panic no tests, probably none needed # Tk_PhotoGetMetadata: imgPhoto-21.* # Tk_PhotoSetMetadata: imgPhoto-22.* #-------------------------------------------------------------------------- # # # Some tests are not specific to a function in tkImgPhoto.c. They are: |
︙ | ︙ | |||
115 116 117 118 119 120 121 | } imageInit set README [makeFile { README -- Tk test suite design document. } README-imgPhoto] | < < < | | | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | } imageInit set README [makeFile { README -- Tk test suite design document. } README-imgPhoto] set teapotPhotoFile [file join [file dirname [info script]] teapot.ppm] set transpTeapotPhotoFile [file join [file dirname [info script]] teapotTransparent.png] testConstraint needsTcl867 [package vsatisfies [package provide Tcl] 8.6.7-] test imgPhoto-1.1 {options for photo images} -body { image create photo photo1 -width 79 -height 83 list [photo1 cget -width] [photo1 cget -height] \ [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {79 83 79 83} test imgPhoto-1.2 {options for photo images} -body { list [catch {image create photo photo1 -file no.such.file} err] \ [string tolower $err] } -result {1 {couldn't open "no.such.file": no such file or directory}} test imgPhoto-1.3 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile -format no.such.format } -returnCodes error -result {image file format "no.such.format" is not supported} test imgPhoto-1.4 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile list [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {256 256} test imgPhoto-1.5 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile \ -format ppm -width 79 -height 83 list [image width photo1] [image height photo1] [photo1 cget -file] [photo1 cget -format] } -cleanup { image delete photo1 } -result [list 79 83 $teapotPhotoFile ppm] test imgPhoto-1.6 {options for photo images} -body { |
︙ | ︙ | |||
215 216 217 218 219 220 221 | # image create photo photo1 # image create photo photo2 -width 10 -height 10 # catch {image create photo photo2 -file bogus.img} msg # photo1 copy photo2 # set msg # } {couldn't open "bogus.img": no such file or directory} | | < < | < < | < < | < < | | < < | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | # image create photo photo1 # image create photo photo2 -width 10 -height 10 # catch {image create photo photo2 -file bogus.img} msg # photo1 copy photo2 # set msg # } {couldn't open "bogus.img": no such file or directory} test imgPhoto-3.1 {ImgPhotoConfigureModel procedure} -body { image create photo photo1 -file $teapotPhotoFile photo1 configure -file $teapotPhotoFile } -cleanup { image delete photo1 } -result {} test imgPhoto-3.2 {ImgPhotoConfigureModel procedure} -body { image create photo photo1 -file $teapotPhotoFile list [catch {photo1 configure -file bogus} err] [string tolower $err] \ [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory} 256 256} test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -setup { destroy .c pack [canvas .c] update } -body { image create photo photo1 .c create image 10 10 -image photo1 -tags photo1.1 -anchor nw .c create image 300 10 -image photo1 -tags photo1.2 -anchor nw update photo1 configure -file $teapotPhotoFile update list [image width photo1] [image height photo1] [.c bbox photo1.1] [.c bbox photo1.2] } -cleanup { destroy .c image delete photo1 } -result {256 256 {10 10 266 266} {300 10 556 266}} test imgPhoto-3.4 {ImgPhotoConfigureModel: -data <ppm>} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { photo2 configure -data [photo1 data -format ppm -from 100 100 120 120] list [image width photo2] [image height photo2] } -cleanup { imageCleanup } -result {20 20} # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-3.5 {ImgPhotoConfigureModel: -data <png>} -constraints { needsTcl867 } -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { photo2 configure -data [photo1 data -format png -from 120 120 140 140] list [image width photo2] [image height photo2] } -cleanup { imageCleanup } -result {20 20} test imgPhoto-3.6 {ImgPhotoConfigureModel: -data <default>} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { photo2 configure -data [photo1 data -from 80 90 100 110] list [image width photo2] [image height photo2] } -cleanup { imageCleanup |
︙ | ︙ | |||
350 351 352 353 354 355 356 | test imgPhoto-4.9 {ImgPhotoCmd procedure: configure option} -setup { image create photo photo1 } -body { photo1 configure -palette {} -gamma } -cleanup { image delete photo1 } -returnCodes error -result {value for "-gamma" missing} | | < < | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | test imgPhoto-4.9 {ImgPhotoCmd procedure: configure option} -setup { image create photo photo1 } -body { photo1 configure -palette {} -gamma } -cleanup { image delete photo1 } -returnCodes error -result {value for "-gamma" missing} test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -width 25 -height 30 } -body { image create photo photo2 -file $teapotPhotoFile photo1 configure -width 0 -height 0 -palette {} -gamma 1 photo1 copy photo2 list [image width photo1] [image height photo1] [photo1 get 100 100] |
︙ | ︙ | |||
393 394 395 396 397 398 399 | image create photo photo1 image create photo photo2 } -body { photo1 copy photo2 -from -to } -returnCodes error -cleanup { image delete photo1 photo2 } -result {the "-from" option requires one to four integer values} | | < < | < < | < < | < < | < < | < < | < < | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | image create photo photo1 image create photo photo2 } -body { photo1 copy photo2 -from -to } -returnCodes error -cleanup { image delete photo1 photo2 } -result {the "-from" option requires one to four integer values} test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 photo1 copy photo2 -from 0 70 60 120 -shrink list [image width photo1] [image height photo1] [photo1 get 20 10] } -cleanup { image delete photo1 photo2 } -result {60 50 {215 154 120}} test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 -from 60 120 0 70 -to 20 50 list [image width photo1] [image height photo1] [photo1 get 40 80] } -cleanup { image delete photo1 photo2 } -result {80 100 {19 92 192}} test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 -from 0 120 60 70 -to 0 0 100 100 list [image width photo1] [image height photo1] [photo1 get 80 60] } -cleanup { image delete photo1 photo2 } -result {100 100 {215 154 120}} test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 -from 60 70 0 120 -zoom 2 list [image width photo1] [image height photo1] [photo1 get 100 50] } -cleanup { image delete photo1 photo2 } -result {120 100 {169 99 47}} test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 -from 0 70 60 120 -zoom 2 list [image width photo1] [image height photo1] [photo1 get 100 50] } -cleanup { image delete photo1 photo2 } -result {120 100 {169 99 47}} test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 -from 20 20 200 180 -subsample 2 -shrink list [image width photo1] [image height photo1] [photo1 get 50 30] } -cleanup { image delete photo1 photo2 } -result {90 80 {207 146 112}} test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { photo1 copy photo2 set result [list [image width photo1] [image height photo1]] photo1 conf -width 49 -height 51 lappend result [image width photo1] [image height photo1] |
︙ | ︙ | |||
484 485 486 487 488 489 490 | photo1 conf -height 0 photo1 copy photo2 -from 0 0 10 10 -shrink lappend result [image width photo1] [image height photo1] } -cleanup { image delete photo1 photo2 } -result {256 256 49 51 49 51 49 51 10 51 10 10} # tests for <imageName> data: imgPhoto-4. | | < < | 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | photo1 conf -height 0 photo1 copy photo2 -from 0 0 10 10 -shrink lappend result [image width photo1] [image height photo1] } -cleanup { image delete photo1 photo2 } -result {256 256 49 51 49 51 49 51 10 51 10 10} # tests for <imageName> data: imgPhoto-4. test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} -setup { image create photo photo1 } -body { photo1 read $transpTeapotPhotoFile list [photo1 get 100 100 -withalpha] \ [photo1 get 150 100 -withalpha] \ [photo1 get 100 150] [photo1 get 150 150] } -cleanup { |
︙ | ︙ | |||
561 562 563 564 565 566 567 | test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read } -returnCodes error -cleanup { image delete photo1 } -result {wrong # args: should be "photo1 read fileName ?-option value ...?"} | | < < | < < | < < | < < | 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 | test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read } -returnCodes error -cleanup { image delete photo1 } -result {wrong # args: should be "photo1 read fileName ?-option value ...?"} test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -zoom 2 } -returnCodes error -cleanup { image delete photo1 } -result {unrecognized option "-zoom": must be -format, -from, -metadata, -shrink, or -to} test imgPhoto-4.32 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { list [catch {photo1 read bogus} err] [string tolower $err] } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory}} test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -format bogus } -cleanup { image delete photo1 } -returnCodes error -result {image file format "bogus" is not supported} test imgPhoto-4.34 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $README } -returnCodes error -cleanup { image delete photo1 } -result [subst {couldn't recognize data in image file "$README"}] test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile list [image width photo1] [image height photo1] [photo1 get 120 120] } -cleanup { image delete photo1 } -result {256 256 {161 109 82}} test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -from 0 70 60 120 -to 10 10 -shrink list [image width photo1] [image height photo1] [photo1 get 29 19] } -cleanup { image delete photo1 } -result {70 60 {244 180 144}} |
︙ | ︙ | |||
939 940 941 942 943 944 945 | test imgPhoto-4.74 {ImgPhotoCmd procedure: put option error handling} -setup { image create photo photo1 } -body { photo1 put {{white}} -to 10 10 20 20 {{white}} } -cleanup { image delete photo1 } -returnCodes 1 -result {wrong # args: should be "photo1 put data ?-option value ...?"} | | < < | < < | 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 | test imgPhoto-4.74 {ImgPhotoCmd procedure: put option error handling} -setup { image create photo photo1 } -body { photo1 put {{white}} -to 10 10 20 20 {{white}} } -cleanup { image delete photo1 } -returnCodes 1 -result {wrong # args: should be "photo1 put data ?-option value ...?"} test imgPhoto-4.75 {<photo> read command: filename starting with '-'} -body { file copy -force $teapotPhotoFile -teapotPhotoFile image create photo photo1 photo1 read -teapotPhotoFile } -cleanup { image delete photo1 file delete ./-teapotPhotoFile } -result {} test imgPhoto-4.75.1 {ImgPhotoCmd procedure: copy to same image} -setup { imageCleanup image create photo photo1 -file $teapotPhotoFile } -body { # non-regression test for bug [5239fd749b] - shall just not crash photo1 copy photo1 -to 0 0 2000 1000 photo1 copy photo1 -subsample 2 2 -shrink } -cleanup { |
︙ | ︙ | |||
988 989 990 991 992 993 994 | } -body { photo1 put white -to 0 0 1 1 set result [photo1 transparency get 0 0] lappend result [photo1 transparency get 0 0 -alpha] } -cleanup { imageCleanup } -result {0 255} | | < < | < < | 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 | } -body { photo1 put white -to 0 0 1 1 set result [photo1 transparency get 0 0] lappend result [photo1 transparency get 0 0 -alpha] } -cleanup { imageCleanup } -result {0 255} test imgPhoto-4.79 {ImgPhotoCmd, transparency get: no option} -setup { image create photo photo1 -file $transpTeapotPhotoFile set result {} } -body { set pixelCoords {{156 239} {76 207} {153 213} {139 43} {75 112}} foreach coord $pixelCoords { lappend result [photo1 transparency get {*}$coord] } set result } -cleanup { imageCleanup } -result {0 1 0 0 0} # test imgPhoto-4.80: deleted (was transparency get: -boolean) test imgPhoto-4.81 {ImgPhotoCmd, transparency get: -alpha} -setup { image create photo photo1 -file $transpTeapotPhotoFile set result {} } -body { set pixelCoords {{156 239} {76 207} {153 213} {139 43} {75 112}} foreach coord $pixelCoords { lappend result [photo1 transparency get {*}$coord -alpha] } |
︙ | ︙ | |||
1099 1100 1101 1102 1103 1104 1105 | {unrecognized option "-bogus": must be -format, -metadata, or -to} test imgPhoto-4.92 {ImgPhotocmd put: missing data} -setup { image create photo photo1 } -body { photo1 put -to 0 0 } -returnCodes error -result \ {wrong # args: should be "photo1 put data ?-option value ...?"} | | < < | 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 | {unrecognized option "-bogus": must be -format, -metadata, or -to} test imgPhoto-4.92 {ImgPhotocmd put: missing data} -setup { image create photo photo1 } -body { photo1 put -to 0 0 } -returnCodes error -result \ {wrong # args: should be "photo1 put data ?-option value ...?"} test imgPhoto-4.93 {ImgPhotoCmd put: data in ppm format} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { set imgdata [photo1 data -format ppm] photo2 put $imgdata -format ppm set result {} if {[image width photo1] != [image width photo2] \ |
︙ | ︙ | |||
1333 1334 1335 1336 1337 1338 1339 | image create photo photo1 -data {{red#a green} {blue#c white#d}} } -body { photo1 data -format {default -colorformat list} } -result {{{255 0 0 170} {0 128 0 255}} {{0 0 255 204} {255 255 255 221}}} # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { | | | 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 | image create photo photo1 -data {{red#a green} {blue#c white#d}} } -body { photo1 data -format {default -colorformat list} } -result {{{255 0 0 170} {0 128 0 255}} {{0 0 255 204} {255 255 255 221}}} # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { needsTcl867 } -setup { image create photo teapot -file $teapotPhotoFile teapot copy teapot -from 50 60 70 80 -shrink image create photo teapotTransp -file $transpTeapotPhotoFile teapotTransp copy teapotTransp -from 100 110 120 130 -shrink image create photo photo1 } -body { |
︙ | ︙ | |||
1366 1367 1368 1369 1370 1371 1372 | set result } -cleanup { unset imgData unset result imageCleanup } -result {} | | < < | 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 | set result } -cleanup { unset imgData unset result imageCleanup } -result {} test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} -setup { destroy .c pack [canvas .c] imageCleanup } -body { image create photo photo1 -file $teapotPhotoFile .c create image 0 0 -image photo1 -tags photo1.1 .c create image 256 0 -image photo1 -tags photo1.2 |
︙ | ︙ | |||
1403 1404 1405 1406 1407 1408 1409 | .c create image 10 10 -image photo1 update } -cleanup { destroy .c image delete photo1 } -result {} | | < < | < < | 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 | .c create image 10 10 -image photo1 update } -cleanup { destroy .c image delete photo1 } -result {} test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -setup { destroy .c pack [canvas .c] imageCleanup } -body { image create photo photo1 -file $teapotPhotoFile .c create image 0 0 -image photo1 -anchor nw update .c delete all image delete photo1 } -cleanup { destroy .c } -result {} test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -setup { deleteWindows imageCleanup } -body { image create photo photo1 -file $teapotPhotoFile pack [canvas .c] .c create image 10 10 -image photo1 -anchor nw button .b1 -image photo1 |
︙ | ︙ | |||
1443 1444 1445 1446 1447 1448 1449 | destroy .b1 update .c delete all } -cleanup { destroy .c image delete photo1 } -result {} | | < < | | < < | < < | < < | < < | 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 | destroy .b1 update .c delete all } -cleanup { destroy .c image delete photo1 } -result {} test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -setup { deleteWindows imageCleanup } -body { image create photo photo1 -file $teapotPhotoFile button .b1 -image photo1 frame .f -visual best button .f.b2 -image photo1 pack .f.b2 pack .b1 .f update destroy .b1 update .f.b2 configure -image {} update destroy .f image delete photo1 } -result {} test imgPhoto-8.1 {ImgPhotoDelete procedure} -body { image create photo photo2 -file $teapotPhotoFile image delete photo2 } -result {} test imgPhoto-8.2 {ImgPhotoDelete procedure} -setup { set x {} } -body { image create photo photo2 -file $teapotPhotoFile rename photo2 newphoto2 lappend x [info command photo2] [info command new*] [newphoto2 cget -file] image delete photo2 lappend x [info command new*] } -result [list {} newphoto2 $teapotPhotoFile {}] test imgPhoto-8.3 {ImgPhotoDelete procedure, name cleanup} -body { image create photo photo1 image create photo photo2 -width 10 -height 10 image delete photo2 photo1 copy photo2 } -returnCodes error -cleanup { imageCleanup } -result {image "photo2" doesn't exist or is not a photo image} test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -body { image create photo photo2 -file $teapotPhotoFile rename photo2 {} list [expr {"photo2" in [imageNames]}] [catch {photo2 foo} msg] $msg } -result {0 1 {invalid command name "photo2"}} test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} -setup { imageCleanup } -body { image create photo photo1 photo1 put "{#ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000}" -to 0 0 photo1 put "{#00ff00 #00ff00}" -to 2 0 list [photo1 get 2 0] [photo1 get 3 0] [photo1 get 4 0] } -result {{0 255 0} {0 255 0} {255 0 0}} test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d image create photo photo1 -file $teapotPhotoFile image create photo photo2 -file $teapotPhotoFile photo2 copy photo1 -to 1 2 photo1 copy photo1 -to 1 2 string equal [photo1 data] [photo2 data] } -cleanup { imageCleanup } -result 1 test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d image create photo photo1 -file $teapotPhotoFile image create photo photo2 -file $teapotPhotoFile photo2 copy photo1 -from 2 1 -to 4 5 300 300 photo1 copy photo1 -from 2 1 -to 4 5 300 300 |
︙ | ︙ | |||
1551 1552 1553 1554 1555 1556 1557 | image create bitmap i1 image create photo photo1 photo1 copy i1 } -cleanup { imageCleanup } -returnCodes error -result {image "i1" doesn't exist or is not a photo image} | | | < < | 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 | image create bitmap i1 image create photo photo1 photo1 copy i1 } -cleanup { imageCleanup } -returnCodes error -result {image "i1" doesn't exist or is not a photo image} test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -body { image create photo p3 -file $teapotPhotoFile set result [list [p3 get 50 50] [p3 get 100 100]] p3 copy p3 -zoom 2 lappend result [image width p3] [image height p3] [p3 get 100 100] } -cleanup { image delete p3 } -result {{19 92 192} {169 117 90} 512 512 {19 92 192}} test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d image create photo photo1 -file $teapotPhotoFile image create photo photo2 -file $teapotPhotoFile photo2 copy photo1 -to 0 1 200 200 -zoom 2 3 photo1 copy photo1 -to 0 1 200 200 -zoom 2 3 |
︙ | ︙ | |||
1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 | } -body { image create photo photo1 photo1 copy photo1 -to 0 5 10 20 list [image width photo1] [image height photo1] } -cleanup { imageCleanup } -result {0 0} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup set data { R0lGODlhQgBkAPUAANbWxs7Wxs7OxsbOxsbGxsbGvb3Gvca9vcDAwL21vbW1vbW1tbWtta2t ta2ltaWltaWlraWctaWcrZycrZyUrZSUrZSMrZSMpYyMrYyMpYyEpYSEpYR7pYR7nHp7pYRz pYRynHtzpXtznHtrnHNrnHNjnGtjnGtjlGtalGNalGNSlGNSjFpSlFpKlFpKjFJKjFJCjFI5 | > > > > > > > > > > > | 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 | } -body { image create photo photo1 photo1 copy photo1 -to 0 5 10 20 list [image width photo1] [image height photo1] } -cleanup { imageCleanup } -result {0 0} test imgPhoto-12.5 {Tk_ImgPhotoPutZoomedBlock, copy from area outside the image, bug [a0241c0e25]} -setup { imageCleanup } -body { image create photo photo1 -width 20 -height 20 image create photo photo2 -width 9 -height 10 # next line used to loop for a very long time; if the bug is present # the CI runner will time out, leading to test suite failure photo2 copy photo1 -to 0 5 3 8 -from 21 0 } -cleanup { imageCleanup } -returnCodes error -result {coordinates for -from option extend outside source image} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup set data { R0lGODlhQgBkAPUAANbWxs7Wxs7OxsbOxsbGxsbGvb3Gvca9vcDAwL21vbW1vbW1tbWtta2t ta2ltaWltaWlraWctaWcrZycrZyUrZSUrZSMrZSMpYyMrYyMpYyEpYSEpYR7pYR7nHp7pYRz pYRynHtzpXtznHtrnHNrnHNjnGtjnGtjlGtalGNalGNSlGNSjFpSlFpKlFpKjFJKjFJCjFI5 |
︙ | ︙ | |||
1895 1896 1897 1898 1899 1900 1901 | } -body { photo1 put $imgData -format ppm list [image width photo1] [image height photo1] } -cleanup { unset imgData imageCleanup } -result {1 2} | | < < | 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 | } -body { photo1 put $imgData -format ppm list [image width photo1] [image height photo1] } -cleanup { unset imgData imageCleanup } -result {1 2} test imgPhoto-19.4 {MatchStringFormat: ppm fmt, without opt} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { set imgData [photo1 data -format ppm] photo2 put $imgData list [image width photo2] [image height photo2] } -cleanup { |
︙ | ︙ | |||
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 | test imgPhoto-20.6 {Reject truncated GIF (file)} -setup { set fileName [file join [file dirname [info script]] corruptTruncated.gif] } -body { image create photo gif1 -file $fileName } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map} test imgPhoto-20.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints { nonPortable } -setup { # About the non portability constraint of this test: see ticket [cc42cc18a5] # If there is insufficient memory, the error message # {not enough free memory for image buffer} should be returned. # Instead, some systems (e.g. FreeBSD 11.1) terminate the test interpreter. | > > > > > > > > > > > > > > > > > | 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 | test imgPhoto-20.6 {Reject truncated GIF (file)} -setup { set fileName [file join [file dirname [info script]] corruptTruncated.gif] } -body { image create photo gif1 -file $fileName } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map} test imgPhoto-20.6.1 {Reject truncated GIF in Colormap - ticket 865af0148c - file} -setup { set fileName [file join [file dirname [info script]] corruptTruncatedColormap.gif] } -body { image create photo gif1 -file $fileName } -cleanup { catch {image delete gif1} } -returnCodes error -result {GIF file truncated} test imgPhoto-20.6.2 {Reject truncated GIF in Colormap - ticket 865af0148c - data} -setup { set fileName [file join [file dirname [info script]] corruptTruncatedColormap.gif] set h [open $fileName rb] set d [read $h] close $h } -body { image create photo gif1 -data $d } -cleanup { catch {image delete gif1} } -returnCodes error -result {GIF file truncated} test imgPhoto-20.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints { nonPortable } -setup { # About the non portability constraint of this test: see ticket [cc42cc18a5] # If there is insufficient memory, the error message # {not enough free memory for image buffer} should be returned. # Instead, some systems (e.g. FreeBSD 11.1) terminate the test interpreter. |
︙ | ︙ | |||
2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 | gif1 cget -metadata } -cleanup { catch {image delete gif1} } -result {{update region} {0 0 16 16} {delay time} 4096 {disposal method} {do not dispose} {user interaction} 1} unset -nocomplain gifstart gifdata gifend catch {rename foreachPixel {}} catch {rename checkImgTrans {}} catch {rename checkImgTransLoop {}} imageFinish # cleanup | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 | gif1 cget -metadata } -cleanup { catch {image delete gif1} } -result {{update region} {0 0 16 16} {delay time} 4096 {disposal method} {do not dispose} {user interaction} 1} unset -nocomplain gifstart gifdata gifend set earthPhotoFile [file join [file dirname [info script]] earth.gif] test imgPhoto-24.1 {Read GIF file with -from option - Bug [1576528]} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 gif1 read $earthPhotoFile -from 152 62 185 97 list [lindex [lindex [gif1 data] 0] 0] [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} } -result {{#d8c8b8} 33 35} test imgPhoto-24.2 {Read GIF file, copy with -from option} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 -file $earthPhotoFile image create photo gif2 gif2 copy gif1 -from 152 62 185 97 list [lindex [lindex [gif2 data] 0] 0] [image width gif2] [image height gif2] } -cleanup { catch {image delete gif1 ; image delete gif2} } -result {{#d8c8b8} 33 35} test imgPhoto-24.3 {Read GIF file with -to option} -body { image create photo gif1 gif1 read $earthPhotoFile -to 100 200 list [lindex [lindex [gif1 data] 262] 252] [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} } -result {{#d8c8b8} 420 400} test imgPhoto-24.4 {Read GIF file with -from and -to options} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 gif1 read $earthPhotoFile -from 152 62 185 97 -to 100 200 list [lindex [lindex [gif1 data] 200] 100] [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} } -result {{#d8c8b8} 133 235} test imgPhoto-24.5 {Read GIF file with -from, -to and -shrink options} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 -file $teapotPhotoFile gif1 read $earthPhotoFile -from 152 62 185 97 -to 80 120 -shrink list [lindex [lindex [gif1 data] 120] 80] [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} } -result {{#d8c8b8} 113 155} test imgPhoto-24.6 {Read GIF file with -from option, read large region from small file} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 catch {gif1 read $earthPhotoFile -from 152 62 2000 1000} msg list $msg [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} } -result {{coordinates for -from option extend outside source image} 0 0} unset earthPhotoFile set ousterPhotoFile [file join [file dirname [info script]] ouster.png] test imgPhoto-25.1 {Read PNG file with -from option - Bug [1576528]} -body { image create photo png1 png1 read $ousterPhotoFile -from 102 62 135 97 list [lindex [lindex [png1 data] 0] 0] [image width png1] [image height png1] } -cleanup { catch {image delete png1} } -result {{#c97962} 33 35} test imgPhoto-25.2 {Read PNG file, copy with -from option} -body { image create photo png1 -file $ousterPhotoFile image create photo png2 png2 copy png1 -from 102 62 135 97 list [lindex [lindex [png2 data] 0] 0] [image width png2] [image height png2] } -cleanup { catch {image delete png1 ; image delete png2} } -result {{#c97962} 33 35} test imgPhoto-25.3 {Read PNG file with -to option} -body { image create photo png1 png1 read $ousterPhotoFile -to 100 200 list [lindex [lindex [png1 data] 262] 202] [image width png1] [image height png1] } -cleanup { catch {image delete png1} } -result {{#c97962} 242 381} test imgPhoto-25.4 {Read PNG file with -from and -to options} -body { image create photo png1 png1 read $ousterPhotoFile -from 102 62 135 97 -to 100 200 list [lindex [lindex [png1 data] 200] 100] [image width png1] [image height png1] } -cleanup { catch {image delete png1} } -result {{#c97962} 133 235} test imgPhoto-25.5 {Read PNG file with -from, -to and -shrink options} -body { image create photo png1 -file $teapotPhotoFile png1 read $ousterPhotoFile -from 102 62 135 97 -to 80 120 -shrink list [lindex [lindex [png1 data] 120] 80] [image width png1] [image height png1] } -cleanup { catch {image delete png1} } -result {{#c97962} 113 155} test imgPhoto-25.6 {Read PNG file with -from option, read large region from small file} -body { image create photo png1 catch {png1 read $ousterPhotoFile -from 102 62 2000 1000} msg list $msg [image width png1] [image height png1] } -cleanup { catch {image delete png1} } -result {{coordinates for -from option extend outside source image} 0 0} unset ousterPhotoFile catch {rename foreachPixel {}} catch {rename checkImgTrans {}} catch {rename checkImgTransLoop {}} imageFinish # cleanup |
︙ | ︙ |
Changes to tests/menu.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # This file is a Tcl script to test menus in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright © 1995-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands imageInit | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # This file is a Tcl script to test menus in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright © 1995-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands imageInit testConstraint pressbutton [llength [info commands pressbutton]] testConstraint movemouse [llength [info commands movemouse]] test menu-1.1 {Tk_MenuCmd procedure} -body { menu } -returnCodes error -result {wrong # args: should be "menu pathName ?-option value ...?"} test menu-1.2 {Tk_MenuCmd procedure} -body { |
︙ | ︙ | |||
294 295 296 297 298 299 300 | menu .m2 -tearoff 1 .m2 add command -label "test" .m1 add cascade -label "cascade" -menu .m2 .m1 add separator .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off .m1 add radiobutton -label "radiobutton" -variable radio | | | < | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | menu .m2 -tearoff 1 .m2 add command -label "test" .m1 add cascade -label "cascade" -menu .m2 .m1 add separator .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off .m1 add radiobutton -label "radiobutton" -variable radio set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo image1 -file $earthPhotoFile test menu-2.31 {entry configuration options 0 -activebackground #012345 tearoff} -body { .m1 entryconfigure 0 -activebackground #012345 } -returnCodes error -result {unknown option "-activebackground"} test menu-2.32 {entry configuration options 1 -activebackground #012345 command} -body { .m1 entryconfigure 1 -activebackground #012345 |
︙ | ︙ | |||
696 697 698 699 700 701 702 | .m1 entryconfigure 4 -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} test menu-2.120 {entry configuration options 5 -foreground non-existent radiobutton} -body { .m1 entryconfigure 5 -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} | | < < | < < | < < | < < | < < | < < | 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 | .m1 entryconfigure 4 -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} test menu-2.120 {entry configuration options 5 -foreground non-existent radiobutton} -body { .m1 entryconfigure 5 -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} test menu-2.121 {entry configuration options 0 -image image1 tearoff} -body { .m1 entryconfigure 0 -image image1 } -returnCodes error -result {unknown option "-image"} test menu-2.122 {entry configuration options 1 -image image1 command} -setup { .m1 entryconfigure 1 -image {} } -body { .m1 entryconfigure 1 -image image1 lindex [.m1 entryconfigure 1 -image] 4 } -cleanup { .m1 entryconfigure 1 -image {} } -result {image1} test menu-2.123 {entry configuration options 2 -image image1 cascade} -setup { .m1 entryconfigure 2 -image {} } -body { .m1 entryconfigure 2 -image image1 lindex [.m1 entryconfigure 2 -image] 4 } -cleanup { .m1 entryconfigure 2 -image {} } -result {image1} test menu-2.124 {entry configuration options 3 -image image1 separator} -body { .m1 entryconfigure 3 -image image1 } -returnCodes error -result {unknown option "-image"} test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -setup { .m1 entryconfigure 4 -image {} } -body { .m1 entryconfigure 4 -image image1 lindex [.m1 entryconfigure 4 -image] 4 } -cleanup { .m1 entryconfigure 4 -image {} } -result {image1} test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -setup { .m1 entryconfigure 5 -image {} } -body { .m1 entryconfigure 5 -image image1 lindex [.m1 entryconfigure 5 -image] 4 } -cleanup { .m1 entryconfigure 5 -image {} } -result {image1} |
︙ | ︙ | |||
987 988 989 990 991 992 993 | .m1 entryconfigure 4 -selectcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test menu-2.180 {entry configuration options 5 -selectcolor non-existent radiobutton} -body { .m1 entryconfigure 5 -selectcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} | | < < | < < | < < | < < | < < | < < | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 | .m1 entryconfigure 4 -selectcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test menu-2.180 {entry configuration options 5 -selectcolor non-existent radiobutton} -body { .m1 entryconfigure 5 -selectcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -body { .m1 entryconfigure 0 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} test menu-2.182 {entry configuration options 1 -selectimage image1 command} -body { .m1 entryconfigure 1 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -body { .m1 entryconfigure 2 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -body { .m1 entryconfigure 3 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -setup { .m1 entryconfigure 4 -selectimage {} } -body { .m1 entryconfigure 4 -selectimage image1 lindex [.m1 entryconfigure 4 -selectimage] 4 } -cleanup { .m1 entryconfigure 4 -selectimage {} } -result {image1} test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -setup { .m1 entryconfigure 5 -selectimage {} } -body { .m1 entryconfigure 5 -selectimage image1 lindex [.m1 entryconfigure 5 -selectimage] 4 } -cleanup { .m1 entryconfigure 5 -selectimage {} } -result {image1} |
︙ | ︙ | |||
1216 1217 1218 1219 1220 1221 1222 | } -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body { .m1 entryconfigure 5 -underline 3p } -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} deleteWindows | < | < < | 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 | } -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body { .m1 entryconfigure 5 -underline 3p } -returnCodes error -result {bad index "3p": must be integer?[+-]integer?, end?[+-]integer?, or ""} deleteWindows image delete image1 test menu-3.1 {MenuWidgetCmd procedure} -setup { destroy .m1 } -body { menu .m1 .m1 |
︙ | ︙ | |||
1860 1861 1862 1863 1864 1865 1866 | } -cleanup { destroy .m1 } -result {} test menu-3.71 {MenuWidgetCmd procedure, "index end" option, bug [f3cd942e9e]} -setup { destroy .m1 } -body { menu .m1 | | | | 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 | } -cleanup { destroy .m1 } -result {} test menu-3.71 {MenuWidgetCmd procedure, "index end" option, bug [f3cd942e9e]} -setup { destroy .m1 } -body { menu .m1 expr {[.m1 index "end"] in [list {} none]} } -cleanup { destroy .m1 } -result 1 test menu-4.1 {TkInvokeMenu: disabled} -setup { destroy .m1 } -body { catch {unset foo} menu .m1 |
︙ | ︙ | |||
2343 2344 2345 2346 2347 2348 2349 | deleteWindows } -body { menu .m1 menu .m2 .m1 add cascade -menu .m2 list [.m1 delete 1] [destroy .m1 .m2] } -result {{} {}} | | | 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 | deleteWindows } -body { menu .m1 menu .m2 .m1 add cascade -menu .m2 list [.m1 delete 1] [destroy .m1 .m2] } -result {{} {}} test menu-8.2 {DestroyMenuEntry} -setup { deleteWindows catch {image delete image1a} } -body { image create photo image1a -file $earthPhotoFile menu .m1 .m1 add command -image image1a list [.m1 delete 1] [destroy .m1] [image delete image1a] |
︙ | ︙ | |||
2684 2685 2686 2687 2688 2689 2690 | image create test image1 .m1 entryconfigure 1 -image image1 } -cleanup { deleteWindows imageCleanup } -result {} test menu-11.19 {ConfigureMenuEntry} -constraints { | | | | > > | 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 | image create test image1 .m1 entryconfigure 1 -image image1 } -cleanup { deleteWindows imageCleanup } -result {} test menu-11.19 {ConfigureMenuEntry} -constraints { testImageType } -setup { deleteWindows imageCleanup } -body { image create test image1 image create photo image2 -file $earthPhotoFile menu .m1 .m1 add command -image image1 .m1 entryconfigure 1 -image image2 } -cleanup { deleteWindows imageCleanup } -result {} test menu-11.20 {ConfigureMenuEntry} -constraints { testImageType } -setup { deleteWindows imageCleanup } -body { image create photo image1 -file $earthPhotoFile image create test image2 menu .m1 .m1 add checkbutton -image image1 .m1 entryconfigure 1 -selectimage image2 } -cleanup { deleteWindows imageCleanup } -result {} test menu-11.21 {ConfigureMenuEntry} -constraints { testImageType } -setup { deleteWindows imageCleanup } -body { image create photo image1 -file $earthPhotoFile image create test image2 image create test image3 menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 entryconfigure 1 -selectimage image3 } -cleanup { deleteWindows imageCleanup } -result {} unset earthPhotoFile test menu-12.1 {ConfigureMenuCloneEntries} -setup { deleteWindows } -body { menu .m1 .m1 clone .m2 |
︙ | ︙ | |||
4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 | } -body { # The following two lines caused Tk to read from and write to freed memory destroy .t.menubar.select.chain .t.menubar.select delete 1 } -cleanup { destroy .t } -result {} test menu-40.1 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup { } -constraints {pressbutton} -body { set done false event generate {} <Motion> -x 100 -y 100 toplevel .t menu .t.m | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 | } -body { # The following two lines caused Tk to read from and write to freed memory destroy .t.menubar.select.chain .t.menubar.select delete 1 } -cleanup { destroy .t } -result {} test menu-40.1 {identifiers - auto generated} -setup { destroy .m } -body { menu .m list [.m add command -label 1] [.m add command -label 2] [.m add command -label 3] } -cleanup { destroy .m } -result {e001 e002 e003} test menu-40.2 {identifiers - out of sequence} -setup { destroy .m } -body { menu .m -tearoff 0 .m add command -label 1 .m insert 0 command -label 2 .m add command -label 3 list [.m index e001] [.m index e002] [.m index e003] } -cleanup { destroy .m } -result {1 0 2} test menu-40.3 {identifiers - out of sequence with tearoff} -setup { destroy .m } -body { menu .m -tearoff 1 .m add command -label 1 .m insert 0 command -label 2 .m add command -label 3 list [.m index e001] [.m index e002] [.m index e003] } -cleanup { destroy .m } -result {2 1 3} test menu-40.4 {identifiers - entry id} -setup { destroy .m } -body { menu .m -tearoff 1 .m add command -label 1 .m insert 0 command -label 2 .m add command -label 3 list [.m id 0] [.m id 1] [.m id 2] [.m id 3] } -cleanup { destroy .m } -result {{} e002 e001 e003} test menu-40.5 {identifiers - assigned} -setup { destroy .m } -body { menu .m list [.m add command cmd1 -label 1] [.m insert 0 command cmd2 -label 2] [.m add command cmd3 -label 3] } -cleanup { destroy .m } -result {cmd1 cmd2 cmd3} test menu-40.6 {identifiers - mixed} -setup { destroy .m } -body { menu .m list [.m add command -label 1] [.m insert 0 command cmd2 -label 2] [.m add command -label 3] } -cleanup { destroy .m } -result {e001 cmd2 e002} test menu-40.7 {identifiers - conflict} -setup { destroy .m } -body { menu .m list [.m add command e002 -label 1] [.m add command -label 2] [.m add command -label 3] } -cleanup { destroy .m } -result {e002 e001 e003} test menu-40.8 {identifiers - clone of complete menu} -setup { destroy .m1 .m2 } -body { menu .m1 -tearoff 0 .m1 add command -label 1 .m1 insert 0 command -label 2 .m1 add command cmd3 -label 3 .m1 clone .m2 list [.m2 index e001] [.m2 index e002] [.m2 index cmd3] } -cleanup { destroy .m1 .m2 } -result {1 0 2} test menu-40.9 {identifiers - modify after cloning} -setup { destroy .m1 .m2 } -body { menu .m1 -tearoff 0 .m1 clone .m2 .m1 add command -label 1 .m1 insert 0 command -label 2 .m1 add command cmd3 -label 3 list [.m2 index e001] [.m2 index e002] [.m2 index cmd3] } -cleanup { destroy .m1 .m2 } -result {1 0 2} test menu-40.10 {identifiers - modify clone} -setup { destroy .m1 .m2 } -body { menu .m1 -tearoff 0 .m1 clone .m2 .m2 add command -label 1 .m2 insert 0 command -label 2 .m2 add command cmd3 -label 3 list [.m1 index e001] [.m1 index e002] [.m1 index cmd3] } -cleanup { destroy .m1 .m2 } -result {1 0 2} test menu-40.11 {identifiers - entrycget by id} -setup { destroy .m } -body { menu .m .m add command -label 1 .m add command -label 2 .m add command cmd3 -label 3 list [.m entrycget e001 -label] [.m entrycget e002 -label] [.m entrycget cmd3 -label] } -cleanup { destroy .m } -result {1 2 3} test menu-40.12 {identifiers - delete by id} -setup { destroy .m } -body { menu .m .m add command -label 1 .m add command -label 2 .m add command -label 3 .m add command -label 4 .m add command -label 5 .m add command -label 6 .m add command -label 7 .m add command cmd8 -label 8 .m add command cmd9 -label 9 .m delete e003 cmd8 list [.m id 0] [.m id 1] [.m id 2] } -cleanup { destroy .m } -result {e001 e002 cmd9} test menu-40.13 {identifiers - duplicate} -setup { destroy .m } -body { menu .m .m add command foo -label 1 .m add command bar -label 2 .m add command foo -label 3 } -cleanup { destroy .m } -returnCodes error -result {entry "foo" already exists} test menu-40.14 {identifiers - reserved word} -setup { destroy .m } -body { menu .m -tearoff 0 .m add command last -label 1 .m add command -label 2 .m add command -label 3 .m index last } -cleanup { destroy .m } -result {2} test menu-40.1 {Use-after-free if menu destroyed while posted - bug 09a11fb1228f} -setup { } -constraints {pressbutton} -body { set done false event generate {} <Motion> -x 100 -y 100 toplevel .t menu .t.m |
︙ | ︙ | |||
4157 4158 4159 4160 4161 4162 4163 | after 3500 {movemouse 530 530} after 4000 pressbutton 530 530 after 4500 {set done true} tkwait variable done pressbutton 530 510 } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 | after 3500 {movemouse 530 530} after 4000 pressbutton 530 530 after 4500 {set done true} tkwait variable done pressbutton 530 510 } # cleanup imageFinish deleteWindows cleanupTests return # Local variables: # mode: tcl # End: |
Changes to tests/menuDraw.test.
︙ | ︙ | |||
554 555 556 557 558 559 560 | } -returnCodes ok -match glob -result * test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} -setup { deleteWindows } -body { menu .m1 .m1 add command -label "foo" -state active set tearoff [tk::TearOffMenu .m1 40 40] | | | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | } -returnCodes ok -match glob -result * test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} -setup { deleteWindows } -body { menu .m1 .m1 add command -label "foo" -state active set tearoff [tk::TearOffMenu .m1 40 40] expr {[$tearoff index active] in [list {} none]} } -cleanup { deleteWindows } -result 1 test menuDraw-15.3 {TkPostTearoffMenu - post command} -setup { deleteWindows } -body { catch {unset foo} |
︙ | ︙ |
Changes to tests/menubut.test.
︙ | ︙ | |||
400 401 402 403 404 405 406 | } -body { button .mb1 -text "Menubutton 1" catch {.mb1 configure -width 1i} return $errorInfo } -cleanup { deleteWindows } -result {expected integer but got "1i" | | | | | 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | } -body { button .mb1 -text "Menubutton 1" catch {.mb1 configure -width 1i} return $errorInfo } -cleanup { deleteWindows } -result {expected integer but got "1i" (processing "-width" option) invoked from within ".mb1 configure -width 1i"} test menubutton-4.3 {ConfigureMenuButton procedure} -setup { deleteWindows } -body { button .mb1 -text "Menubutton 1" .mb1 configure -height 0.5c } -cleanup { deleteWindows } -returnCodes error -result {expected integer but got "0.5c"} test menubutton-4.4 {ConfigureMenuButton procedure} -setup { deleteWindows } -body { button .mb1 -text "Menubutton 1" catch {.mb1 configure -height 0.5c} return $errorInfo } -cleanup { deleteWindows } -result {expected integer but got "0.5c" (processing "-height" option) invoked from within ".mb1 configure -height 0.5c"} test menubutton-4.5 {ConfigureMenuButton procedure} -setup { deleteWindows } -body { button .mb1 -bitmap questhead .mb1 configure -width abc } -cleanup { deleteWindows } -returnCodes error -result {expected screen distance but got "abc"} test menubutton-4.6 {ConfigureMenuButton procedure} -setup { deleteWindows } -body { button .mb1 -bitmap questhead catch {.mb1 configure -width abc} return $errorInfo } -cleanup { deleteWindows } -result {expected screen distance but got "abc" (processing "-width" option) invoked from within ".mb1 configure -width abc"} test menubutton-4.7 {ConfigureMenuButton procedure} -constraints { testImageType } -setup { deleteWindows |
︙ | ︙ | |||
473 474 475 476 477 478 479 | button .mb1 -image image1 catch {.mb1 configure -height 0.5x} return $errorInfo } -cleanup { deleteWindows imageCleanup } -result {expected screen distance but got "0.5x" | | | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | button .mb1 -image image1 catch {.mb1 configure -height 0.5x} return $errorInfo } -cleanup { deleteWindows imageCleanup } -result {expected screen distance but got "0.5x" (processing "-height" option) invoked from within ".mb1 configure -height 0.5x"} test menubutton-4.9 {ConfigureMenuButton procedure} -constraints { nonPortable fonts } -setup { deleteWindows |
︙ | ︙ |
Changes to tests/message.test.
︙ | ︙ | |||
389 390 391 392 393 394 395 396 397 398 399 400 401 402 | pack .m update } -body { .m configure -width badValue } -cleanup { destroy .m } -returnCodes {error} -result {expected screen distance but got "badValue"} test message-2.1 {Tk_MessageObjCmd procedure} -body { message } -returnCodes {error} -result {wrong # args: should be "message pathName ?-option value ...?"} test message-2.2 {Tk_MessageObjCmd procedure} -body { | > > > > > > > > > > | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | pack .m update } -body { .m configure -width badValue } -cleanup { destroy .m } -returnCodes {error} -result {expected screen distance but got "badValue"} test message-1.39 {configuration options, fallback to default} -setup { message .m -borderwidth -2 -highlightthickness -2 -font {Helvetica -12 bold} pack .m update } -body { .m configure -padx -2 -pady -2 -width -2 list [.m cget -padx] [.m cget -pady] [.m cget -borderwidth] [.m cget -highlightthickness] [.m cget -width] } -cleanup { destroy .m } -result {-1 -1 0 0 0} test message-2.1 {Tk_MessageObjCmd procedure} -body { message } -returnCodes {error} -result {wrong # args: should be "message pathName ?-option value ...?"} test message-2.2 {Tk_MessageObjCmd procedure} -body { |
︙ | ︙ |
Added tests/ouster.png.
cannot compute difference between binary files
Changes to tests/panedwindow.test.
︙ | ︙ | |||
118 119 120 121 122 123 124 | } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.23 {configuration options: -proxyrelief (good)} -body { .p configure -proxyrelief groove list [lindex [.p configure -proxyrelief] 4] [.p cget -proxyrelief] } -cleanup { .p configure -proxyrelief [lindex [.p configure -proxyrelief] 3] } -result {groove groove} | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.23 {configuration options: -proxyrelief (good)} -body { .p configure -proxyrelief groove list [lindex [.p configure -proxyrelief] 4] [.p cget -proxyrelief] } -cleanup { .p configure -proxyrelief [lindex [.p configure -proxyrelief] 3] } -result {groove groove} test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -constraints needsTcl87 -body { .p configure -proxyrelief 1.5 } -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test panedwindow-1.25 {configuration options: -relief (good)} -body { .p configure -relief groove list [lindex [.p configure -relief] 4] [.p cget -relief] } -cleanup { .p configure -relief [lindex [.p configure -relief] 3] |
︙ | ︙ |
Changes to tests/safe.test.
︙ | ︙ | |||
36 37 38 39 40 41 42 | set hidden_cmds [list bell cd clipboard encoding exec exit \ fconfigure glob grab load menu open pwd selection \ socket source toplevel unload wm] if {[package vsatisfies [package provide Tcl] 8.6.7-]} { lappend hidden_cmds tcl:encoding:dirs } if {[package vsatisfies [package provide Tcl] 8.7-]} { | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | set hidden_cmds [list bell cd clipboard encoding exec exit \ fconfigure glob grab load menu open pwd selection \ socket source toplevel unload wm] if {[package vsatisfies [package provide Tcl] 8.6.7-]} { lappend hidden_cmds tcl:encoding:dirs } if {[package vsatisfies [package provide Tcl] 8.7-]} { lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir tcl:file:home tcl:file:tildeexpand foreach cmd { cmdtype nameofexecutable } {lappend hidden_cmds tcl:info:$cmd} foreach cmd { autopurge list purge status } {lappend hidden_cmds tcl:process:$cmd} foreach cmd { |
︙ | ︙ |
Changes to tests/scrollbar.test.
︙ | ︙ | |||
312 313 314 315 316 317 318 319 320 321 322 323 324 325 | test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.t.s fraction 100 0] } 0 destroy .t test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} { list [catch {.s get a} msg] $msg } {1 {wrong # args: should be ".s get"}} test scrollbar-3.45 {ScrollbarWidgetCmd procedure, "get" option} { .s set 0.6 0.8 set result {} foreach element [.s get] { lappend result [format %.1f $element] } set result | > > > > | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} { format {%.6g} [.t.s fraction 100 0] } 0 destroy .t test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} { list [catch {.s get a} msg] $msg } {1 {wrong # args: should be ".s get"}} test scrollbar-3.44 {ScrollbarWidgetCmd procedure, "get" option} {deprecated needsTcl87} { .s set 100 10 13 14 .s get } {100 10 13 14} test scrollbar-3.45 {ScrollbarWidgetCmd procedure, "get" option} { .s set 0.6 0.8 set result {} foreach element [.s get] { lappend result [format %.1f $element] } set result |
︙ | ︙ | |||
393 394 395 396 397 398 399 400 401 402 403 404 405 406 | .s set .4 .3 set result {} foreach element [.s get] { lappend result [format %.1f $element] } set result } {0.4 0.4} test scrollbar-3.71 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3} msg] $msg } {1 {wrong # args: should be ".s set firstFraction lastFraction"}} test scrollbar-3.72 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3 4 5} msg] $msg } {1 {wrong # args: should be ".s set firstFraction lastFraction"}} test scrollbar-3.73 {ScrollbarWidgetCmd procedure} { | > > > > > > > > > > > > > > > > > > > > > > > > | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | .s set .4 .3 set result {} foreach element [.s get] { lappend result [format %.1f $element] } set result } {0.4 0.4} test scrollbar-3.64 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { list [catch {.s set abc def ghi jkl} msg] $msg } {1 {expected integer but got "abc"}} test scrollbar-3.65 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { list [catch {.s set 1 def ghi jkl} msg] $msg } {1 {expected integer but got "def"}} test scrollbar-3.66 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { list [catch {.s set 1 2 ghi jkl} msg] $msg } {1 {expected integer but got "ghi"}} test scrollbar-3.67 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { list [catch {.s set 1 2 3 jkl} msg] $msg } {1 {expected integer but got "jkl"}} test scrollbar-3.68 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { .s set -10 50 20 30 .s get } {0 50 0 0} test scrollbar-3.69 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { .s set 100 -10 20 30 .s get } {100 0 20 30} test scrollbar-3.70 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { .s set 100 50 30 20 .s get } {100 50 30 30} test scrollbar-3.71 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3} msg] $msg } {1 {wrong # args: should be ".s set firstFraction lastFraction"}} test scrollbar-3.72 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3 4 5} msg] $msg } {1 {wrong # args: should be ".s set firstFraction lastFraction"}} test scrollbar-3.73 {ScrollbarWidgetCmd procedure} { |
︙ | ︙ |
Changes to tests/textTag.test.
︙ | ︙ | |||
109 110 111 112 113 114 115 | } -returnCodes error -result {unknown color name "silly color"} test textTag-1.12 {tag configuration options} -body { .t tag configure x -justify left .t tag cget x -justify } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] } -result {left} | | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | } -returnCodes error -result {unknown color name "silly color"} test textTag-1.12 {tag configuration options} -body { .t tag configure x -justify left .t tag cget x -justify } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] } -result {left} test textTag-1.13 {configuration options, bug [026e2bb685]} -constraints needsTcl87 -body { .t tag configure x -justify right catch {.t tag configure x -justify middle} msg list $msg [.t tag configure x -justify] } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] } -result {{bad justification "middle": must be left, right, center, or ""} {-justify {} {} {} right}} test textTag-1.14 {tag configuration options} -body { |
︙ | ︙ | |||
165 166 167 168 169 170 171 | .t tag configure x -offset [lindex [.t tag configure x -offset] 3] } -returnCodes error -result {expected screen distance or "" but got "100xyz"} test textTag-1.20 {tag configuration options} -body { .t tag configure x -overstrike on .t tag cget x -overstrike } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | .t tag configure x -offset [lindex [.t tag configure x -offset] 3] } -returnCodes error -result {expected screen distance or "" but got "100xyz"} test textTag-1.20 {tag configuration options} -body { .t tag configure x -overstrike on .t tag cget x -overstrike } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] } -result {on} test textTag-1.21 {configuration options} -body { .t tag configure x -overstrike stupid } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] } -returnCodes error -result {expected boolean value or "" but got "stupid"} test textTag-1.21a {tag configuration options} -body { .t tag configure x -overstrikefg red |
︙ | ︙ | |||
188 189 190 191 192 193 194 | } -returnCodes error -result {unknown color name "stupid"} test textTag-1.22 {tag configuration options} -body { .t tag configure x -relief raised .t tag cget x -relief } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -result {raised} | | | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | } -returnCodes error -result {unknown color name "stupid"} test textTag-1.22 {tag configuration options} -body { .t tag configure x -relief raised .t tag cget x -relief } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -result {raised} test textTag-1.23 {configuration options} -constraints needsTcl87 -body { .t tag configure x -relief stupid } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -returnCodes error -result {bad relief "stupid": must be flat, groove, raised, ridge, solid, sunken, or ""} test textTag-1.24 {tag configuration options} -body { .t tag configure x -rmargin 10 .t tag cget x -rmargin |
︙ | ︙ | |||
287 288 289 290 291 292 293 | .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3] } -returnCodes error -result {bad tab alignment "fork": must be left, right, center, or numeric} test textTag-1.34 {tag configuration options} -body { .t tag configure x -underline no .t tag cget x -underline } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] | | | 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3] } -returnCodes error -result {bad tab alignment "fork": must be left, right, center, or numeric} test textTag-1.34 {tag configuration options} -body { .t tag configure x -underline no .t tag cget x -underline } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -result {no} test textTag-1.35 {configuration options} -body { .t tag configure x -underline stupid } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -returnCodes error -result {expected boolean value or "" but got "stupid"} test textTag-1.36 {tag configuration options} -body { .t tag configure x -underlinefg red |
︙ | ︙ | |||
497 498 499 500 501 502 503 | } -returnCodes error -result {value for "-underline" missing} test textTag-5.4 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underline yes .t tag configure x -underline } -cleanup { .t tag delete x | | | | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | } -returnCodes error -result {value for "-underline" missing} test textTag-5.4 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underline yes .t tag configure x -underline } -cleanup { .t tag delete x } -result {-underline {} {} {} yes} test textTag-5.4a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underlinefg lightgreen .t tag configure x -underlinefg } -cleanup { .t tag delete x } -result {-underlinefg {} {} {} lightgreen} test textTag-5.5 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -overstrike on .t tag cget x -overstrike } -cleanup { .t tag delete x } -result {on} test textTag-5.5a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -overstrikefg lightgreen .t tag configure x -overstrikefg } -cleanup { .t tag delete x } -result {-overstrikefg {} {} {} lightgreen} |
︙ | ︙ | |||
537 538 539 540 541 542 543 | test textTag-5.8 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -justify left .t tag configure x -justify } -cleanup { .t tag delete x } -result {-justify {} {} {} left} | | | | | 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | test textTag-5.8 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -justify left .t tag configure x -justify } -cleanup { .t tag delete x } -result {-justify {} {} {} left} test textTag-5.9 {TkTextTagCmd - "configure" option, bug [026e2bb685]} -constraints needsTcl87 -body { .t tag delete x catch {.t tag configure x -justify bogus} msg list $msg [.t tag configure x -justify] } -cleanup { .t tag delete x } -result {{bad justification "bogus": must be left, right, center, or ""} {-justify {} {} {} {}}} test textTag-5.10 {TkTextTagCmd - "configure" option} -constraints needsTcl87 -body { .t tag delete x .t tag configure x -justify fill } -cleanup { .t tag delete x } -returnCodes error -result {bad justification "fill": must be left, right, center, or ""} test textTag-5.11 {TkTextTagCmd - "configure" option} -body { .t tag delete x |
︙ | ︙ |
Changes to tests/ttk/entry.test.
︙ | ︙ | |||
60 61 62 63 64 65 66 | test entry-1.7 "Deletion - insert cursor in the middle " -body { .e insert end abcde .e icursor 3 .e delete 0 end .e index insert } -result 0 | | | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | test entry-1.7 "Deletion - insert cursor in the middle " -body { .e insert end abcde .e icursor 3 .e delete 0 end .e index insert } -result 0 test entry-1.8 "Index is between 0 and end" -constraints deprecated -body { .e delete 0 end .e insert end abcde set res [list [.e index -1] [.e index -4] [.e index 999]] } -result {0 0 5} test entry-1.done "Cleanup" -body { destroy .e } |
︙ | ︙ |
Changes to tests/ttk/notebook.test.
︙ | ︙ | |||
549 550 551 552 553 554 555 556 | ttk::style configure customStyle.TNotebook ttk::notebook .w -style customStyle.TNotebook list [.w cget -style] [.w style] [winfo class .w] } -cleanup { destroy .w } -result {customStyle.TNotebook customStyle.TNotebook TNotebook} tcltest::cleanupTests | > > > > > > > > > > > > > > > > > > > > > > > | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | ttk::style configure customStyle.TNotebook ttk::notebook .w -style customStyle.TNotebook list [.w cget -style] [.w style] [winfo class .w] } -cleanup { destroy .w } -result {customStyle.TNotebook customStyle.TNotebook TNotebook} test notebook-9.1 "move last tab by numerical index" -body { ::ttk::notebook .n foreach tabs {TabA TabB TabC} { ::ttk::entry .n.[string tolower $tabs] .n add .n.[string tolower $tabs] -text $tabs } .n insert 0 2 ; # allowed: TabC moves to first tab position .n insert 0 3 ; # not allowed: position 3 is after last tab } -cleanup { destroy .n } -result {Managed window index "3" out of bounds} -returnCodes error test notebook-9.2 "move first tab to last position by numerical index" -body { ::ttk::notebook .n foreach tabs {TabA TabB TabC} { ::ttk::entry .n.[string tolower $tabs] .n add .n.[string tolower $tabs] -text $tabs } .n insert 2 0 ; # allowed: TabA moves to last tab position .n insert 3 0 ; # not allowed: position 3 is after last tab } -cleanup { destroy .n } -result {Managed window index "3" out of bounds} -returnCodes error tcltest::cleanupTests |
Changes to tests/ttk/panedwindow.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | package require tk package require tcltest 2.2 namespace import -force tcltest::* loadTestedCommands proc propagate-geometry {} { update idletasks } # Basic sanity checks: # test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update } test panedwindow-1.2 "Add a pane" -body { | > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | package require tk package require tcltest 2.2 namespace import -force tcltest::* loadTestedCommands proc propagate-geometry {} { update idletasks } # Basic sanity checks: # test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { .pw pane 0 } -result {Managed window index "0" out of bounds} -returnCodes error test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { .pw pane end } -result {Managed window index "end" out of bounds} -returnCodes error test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { .pw forget 0 } -result {Managed window index "0" out of bounds} -returnCodes error test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { .pw forget end } -result {Managed window index "end" out of bounds} -returnCodes error test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update } test panedwindow-1.2 "Add a pane" -body { |
︙ | ︙ |
Changes to tests/ttk/treeview.test.
︙ | ︙ | |||
71 72 73 74 75 76 77 | test treeview-1.2 "Bad columns" -body { #.tv configure -columns {illegal "list"value} ttk::treeview .badtv -columns {illegal "list"value} } -returnCodes error -result "list element in quotes followed by*" -match glob test treeview-1.3 "bad displaycolumns" -body { .tv configure -displaycolumns {a b d} | | | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | test treeview-1.2 "Bad columns" -body { #.tv configure -columns {illegal "list"value} ttk::treeview .badtv -columns {illegal "list"value} } -returnCodes error -result "list element in quotes followed by*" -match glob test treeview-1.3 "bad displaycolumns" -body { .tv configure -displaycolumns {a b d} } -returnCodes error -result {Invalid column index "d"} test treeview-1.4 "more bad displaycolumns" -body { .tv configure -displaycolumns {1 2 3} } -returnCodes error -result {Column index "3" out of bounds} test treeview-1.5 "Don't forget to check negative numbers" -body { .tv configure -displaycolumns {1 {} 3} |
︙ | ︙ | |||
187 188 189 190 191 192 193 | foreach item [.tv children {}] { lappend result [.tv index $item] } set result } -result [list 0 1 2 3 4 5 6] test treeview-3.6 "detach" -body { | < | | | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | foreach item [.tv children {}] { lappend result [.tv index $item] } set result } -result [list 0 1 2 3 4 5 6] test treeview-3.6 "detach" -body { .tv detach newnode consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode anotherone onemore lastnode newlastone] # XREF: treeview-2.13 test treeview-3.7 "detach didn't screw up internal links" -body { consistencyCheck .tv set result [list] foreach item [.tv children {}] { lappend result [.tv index $item] |
︙ | ︙ | |||
226 227 228 229 230 231 232 | .tv detach [list {}] } -cleanup { update consistencyCheck .tv } -returnCodes error -result "Cannot detach root item" test treeview-3.12 "Reattach" -body { | < | | < | | | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | .tv detach [list {}] } -cleanup { update consistencyCheck .tv } -returnCodes error -result "Cannot detach root item" test treeview-3.12 "Reattach" -body { .tv move newnode {} end consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode] # Bug # ????? test treeview-3.13 "Re-reattach" -body { .tv move newnode {} end consistencyCheck .tv .tv children {} } -result [list newfirstone firstnode anotherone onemore lastnode newlastone newnode] catch { .tv insert newfirstone end -id x1 .tv insert newfirstone end -id x2 .tv insert newfirstone end -id x3 } |
︙ | ︙ | |||
856 857 858 859 860 861 862 | test treeview-11.13 "Cellselection - error" -body { .tv cellselection set [list "apa a"] } -returnCodes 1 -match glob -result {Item apa not found} test treeview-11.14 "Cellselection - error" -body { .tv cellselection set [list "nn xx "] | | | 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 | test treeview-11.13 "Cellselection - error" -body { .tv cellselection set [list "apa a"] } -returnCodes 1 -match glob -result {Item apa not found} test treeview-11.14 "Cellselection - error" -body { .tv cellselection set [list "nn xx "] } -returnCodes 1 -match glob -result {Invalid column index "xx"} test treeview-11.15 "Cellselection - error" -body { .tv cellselection set "nn c" "nn d" } -returnCodes 1 -match glob -result {Cell id must be in a visible column} test treeview-11.16 "Cellselection - non visible" -body { .tv cellselection set [list "nn d"] |
︙ | ︙ | |||
925 926 927 928 929 930 931 | } return $result } test treeview-identify-setup "identify series - setup" -body { destroy .tv ttk::setTheme default | | < | | | | < < < < < | | | | | | | | > < | | | < < | 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | } return $result } test treeview-identify-setup "identify series - setup" -body { destroy .tv ttk::setTheme default ttk::style configure Treeview -rowheight 20 ttk::treeview .tv -columns [list A B C] .tv insert {} end -id branch -text branch -open true .tv insert branch end -id item1 -text item1 -height 2 .tv insert branch end -id item2 -text item2 .tv insert branch end -id item3 -text item3 .tv insert {} end -id item4 -text item4 .tv column #0 -width 50 ;# 0-50 .tv column A -width 50 ;# 50-100 .tv column B -width 50 ;# 100-150 .tv column C -width 50 ;# 150-200 (plus slop for margins) wm geometry . {} ; pack .tv ; update } test treeview-identify-1 "identify heading" -body { .tv configure -show {headings tree} update idletasks identify* .tv {region column} 10 10 } -result [list heading #0] test treeview-identify-2 "identify columns" -body { .tv configure -displaycolumns #all update idletasks columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10] } -result [list \#0 A B C] test treeview-identify-3 "reordered columns" -body { .tv configure -displaycolumns {B A C} update idletasks columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10] } -result [list \#0 B A C] test treeview-identify-4 "no tree column" -body { .tv configure -displaycolumns #all -show {headings} update idletasks identify* .tv {region column} 25 10 75 10 125 10 175 10 } -result [list heading #1 heading #2 heading #3 nothing {}] # Item height in default theme is 20px test treeview-identify-5 "vertical scan - no headings" -body { .tv configure -displaycolumns #all -show {tree} update idletasks identify* .tv {region item} 25 10 25 30 25 70 25 90 25 110 25 130 } -result [list tree branch tree item1 tree item2 tree item3 tree item4 nothing {}] test treeview-identify-6 "vertical scan - with headings" -body { .tv configure -displaycolumns #all -show {tree headings} update idletasks identify* .tv {region item} 25 10 25 30 25 50 25 90 25 110 } -result [list heading {} tree branch tree item1 tree item2 tree item3] test treeview-identify-7 "vertical scan - headings, no tree" -body { .tv configure -displaycolumns #all -show {headings} update idletasks identify* .tv {region item cell} 25 10 25 30 25 50 75 90 25 110 } -result [list heading {} {} cell branch {branch #1} cell item1 {item1 #1} cell item2 {item2 #2} cell item3 {item3 #1}] # In default theme, -indent and -itemheight both 20px # Disclosure element name is "Treeitem.indicator" set disclosure "*.indicator" test treeview-identify-8 "identify element" -body { .tv configure -show {tree} .tv insert branch 0 -id branch2 -open true .tv insert branch2 0 -id branch3 -open true .tv insert branch3 0 -id leaf3 update idletasks; identify* .tv {item element} 10 10 30 30 50 50 } -match glob -result [list \ branch $disclosure branch2 $disclosure branch3 $disclosure] test treeview-identify-8.1 "identify element" -body { .tv configure -show {tree headings} update identify* .tv element 1 1 10 10 25 25 # Heading elements are currently not reported } -result [list {} {} text] # See #2381555 test treeview-identify-9 "identify works when horizontally scrolled" -setup { .tv configure -show {tree headings} foreach column {#0 A B C} { .tv column $column -stretch 0 -width 50 } # Scrollable area is 200, visible is 100 |
︙ | ︙ |
Changes to tests/visual_bb.test.
︙ | ︙ | |||
19 20 21 22 23 24 25 | # Each menu entry invokes a visual test file proc runTest {file} { global testNum test "2.$testNum" "testing $file" {userInteraction} { | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # Each menu entry invokes a visual test file proc runTest {file} { global testNum test "2.$testNum" "testing $file" {userInteraction} { uplevel #0 [list source -encoding utf-8 [file join [testsDirectory] $file]] concat "" } {} incr testNum } # The following procedure is invoked to print the contents of a canvas: |
︙ | ︙ |
Changes to unix/Makefile.in.
︙ | ︙ | |||
108 109 110 111 112 113 114 | # appropriate for this version of Tk: TCL_PLATFORM_DIR = $(TCLDIR)/unix # The directory containing the Tcl library archive file appropriate # for this version of Tk: TCL_BIN_DIR = @TCL_BIN_DIR@ | | | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | # appropriate for this version of Tk: TCL_PLATFORM_DIR = $(TCLDIR)/unix # The directory containing the Tcl library archive file appropriate # for this version of Tk: TCL_BIN_DIR = @TCL_BIN_DIR@ # The linker flags needed to link in the Tcl library (ex: -ltcl8.7) TCL_LIB_FLAG = @TCL_LIB_FLAG@ # Flag, 1: we're building a shared lib, 0 we're not TK_SHARED_BUILD = @TK_SHARED_BUILD@ # Subdirectory of $(libdir) containing the pkgIndex.tcl file for loadable Tk TK_PKG_DIR = @TK_PKG_DIR@ |
︙ | ︙ | |||
262 263 264 265 266 267 268 | TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_FLAGS = @TCL_STUB_FLAGS@ # Libraries to use when linking. This definition is determined by the # configure script. | | | | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_FLAGS = @TCL_STUB_FLAGS@ # Libraries to use when linking. This definition is determined by the # configure script. LIBS = @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ @CUPS_LIBS@ WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ @CUPS_LIBS@ @EXTRA_WISH_LIBS@ # The symbols below provide support for dynamic loading and shared # libraries. See configure.ac for a description of what the # symbols mean. The values of the symbols are normally set by the # configure script. You shouldn't normally need to modify any of # these definitions by hand. |
︙ | ︙ | |||
295 296 297 298 299 300 301 302 303 304 305 306 307 308 | REZ = @REZ@ REZ_SWITCHES = @REZ_FLAGS@ -i $(GENERIC_DIR) -i $(TCL_GENERIC_DIR) # support for Xft: XFT_CFLAGS = @XFT_CFLAGS@ XFT_LIBS = @XFT_LIBS@ #---------------------------------------------------------------- # The information below is modified by the configure script when # Makefile is generated from Makefile.in. You shouldn't normally # modify any of this stuff by hand. #---------------------------------------------------------------- AC_FLAGS = @DEFS@ | > > > > | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | REZ = @REZ@ REZ_SWITCHES = @REZ_FLAGS@ -i $(GENERIC_DIR) -i $(TCL_GENERIC_DIR) # support for Xft: XFT_CFLAGS = @XFT_CFLAGS@ XFT_LIBS = @XFT_LIBS@ # support for libcups CUPS_CFLAGS = @CUPS_CFLAGS@ CUPS_LIBS = @CUPS_LIBS@ #---------------------------------------------------------------- # The information below is modified by the configure script when # Makefile is generated from Makefile.in. You shouldn't normally # modify any of this stuff by hand. #---------------------------------------------------------------- AC_FLAGS = @DEFS@ |
︙ | ︙ | |||
331 332 333 334 335 336 337 | CC = @CC@ CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \ ${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \ ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \ | | | | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | CC = @CC@ CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \ ${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \ ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \ ${NO_DEPRECATED_FLAGS} -DTCL_UTF_MAX=3 @EXTRA_CC_SWITCHES@ CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@ APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@ DEPEND_SWITCHES = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \ ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} -I${TCL_GENERIC_DIR} \ -I${TCL_PLATFORM_DIR} ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} \ ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ WISH_OBJS = tkAppInit.o TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o tkOldTest.o \ $(@TK_WINDOWINGSYSTEM@_TKTEST_OBJS) WIDG_OBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o \ tkPanedWindow.o tkScale.o tkScrollbar.o CANV_OBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \ |
︙ | ︙ | |||
390 391 392 393 394 395 396 | STUB_LIB_OBJS = tkStubLib.o ttkStubLib.o X11_OBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkIcu.o \ tkUnixFocus.o $(FONT_OBJS) tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ | | > | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | STUB_LIB_OBJS = tkStubLib.o ttkStubLib.o X11_OBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkIcu.o \ tkUnixFocus.o $(FONT_OBJS) tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ tkUnixSend.o tkUnixSysNotify.o tkUnixSysTray.o tkUnixWm.o tkUnixXId.o \ tkUnixPrint.o AQUA_OBJS = tkMacOSXBitmap.o tkMacOSXButton.o tkMacOSXClipboard.o \ tkMacOSXColor.o tkMacOSXConfig.o tkMacOSXCursor.o tkMacOSXDebug.o \ tkMacOSXDialog.o tkMacOSXDraw.o tkMacOSXEmbed.o tkMacOSXEntry.o \ tkMacOSXEvent.o tkMacOSXFileTypes.o tkMacOSXFont.o tkMacOSXHLEvents.o \ tkMacOSXImage.o tkMacOSXInit.o tkMacOSXKeyboard.o tkMacOSXKeyEvent.o \ tkMacOSXMenu.o tkMacOSXMenubutton.o tkMacOSXMenus.o \ |
︙ | ︙ | |||
458 459 460 461 462 463 464 | $(GENERIC_DIR)/tkImgSVGnano.c $(GENERIC_DIR)/tkImgSVGnano.c \ $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhInstance.c \ $(GENERIC_DIR)/tkImgListFormat.c $(GENERIC_DIR)/tkText.c \ $(GENERIC_DIR)/tkTextBTree.c $(GENERIC_DIR)/tkTextDisp.c \ $(GENERIC_DIR)/tkTextImage.c \ $(GENERIC_DIR)/tkTextIndex.c $(GENERIC_DIR)/tkTextMark.c \ $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ | | | 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | $(GENERIC_DIR)/tkImgSVGnano.c $(GENERIC_DIR)/tkImgSVGnano.c \ $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhInstance.c \ $(GENERIC_DIR)/tkImgListFormat.c $(GENERIC_DIR)/tkText.c \ $(GENERIC_DIR)/tkTextBTree.c $(GENERIC_DIR)/tkTextDisp.c \ $(GENERIC_DIR)/tkTextImage.c \ $(GENERIC_DIR)/tkTextIndex.c $(GENERIC_DIR)/tkTextMark.c \ $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ $(GENERIC_DIR)/tkOldConfig.c $(GENERIC_DIR)/tkOldTest.c \ $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ $(GENERIC_DIR)/tkStubInit.c TTK_SRCS = \ $(TTK_DIR)/ttkBlink.c \ $(TTK_DIR)/ttkButton.c \ $(TTK_DIR)/ttkCache.c \ |
︙ | ︙ | |||
512 513 514 515 516 517 518 | $(UNIX_DIR)/tkUnixRFont.c \ $(UNIX_DIR)/tkUnixFont.c $(UNIX_DIR)/tkUnixInit.c \ $(UNIX_DIR)/tkUnixKey.c \ $(UNIX_DIR)/tkUnixMenu.c $(UNIX_DIR)/tkUnixMenubu.c \ $(UNIX_DIR)/tkUnixScale.c $(UNIX_DIR)/tkUnixScrlbr.c \ $(UNIX_DIR)/tkUnixSelect.c $(UNIX_DIR)/tkUnixSend.c \ $(UNIX_DIR)/tkUnixSysNotify $(UNIX_DIR)/tkUnixSysTray.c \ | | > | 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | $(UNIX_DIR)/tkUnixRFont.c \ $(UNIX_DIR)/tkUnixFont.c $(UNIX_DIR)/tkUnixInit.c \ $(UNIX_DIR)/tkUnixKey.c \ $(UNIX_DIR)/tkUnixMenu.c $(UNIX_DIR)/tkUnixMenubu.c \ $(UNIX_DIR)/tkUnixScale.c $(UNIX_DIR)/tkUnixScrlbr.c \ $(UNIX_DIR)/tkUnixSelect.c $(UNIX_DIR)/tkUnixSend.c \ $(UNIX_DIR)/tkUnixSysNotify $(UNIX_DIR)/tkUnixSysTray.c \ $(UNIX_DIR)/tkUnixWm.c $(UNIX_DIR)/tkUnixXId.c \ $(UNIX_DIR)/tkUnixPrint.c AQUA_SRCS = \ $(MAC_OSX_DIR)/tkMacOSXBitmap.c $(MAC_OSX_DIR)/tkMacOSXButton.c \ $(MAC_OSX_DIR)/tkMacOSXClipboard.c $(MAC_OSX_DIR)/tkMacOSXColor.c \ $(MAC_OSX_DIR)/tkMacOSXConfig.c $(MAC_OSX_DIR)/tkMacOSXCursor.c \ $(MAC_OSX_DIR)/tkMacOSXDebug.c $(MAC_OSX_DIR)/tkMacOSXDialog.c \ $(MAC_OSX_DIR)/tkMacOSXDraw.c $(MAC_OSX_DIR)/tkMacOSXEmbed.c \ |
︙ | ︙ | |||
645 646 647 648 649 650 651 | mv /tmp/macher_output ${LIB_FILE}; chmod u+x ${LIB_FILE}; \ fi; \ ${NATIVE_ZIP} -A ${LIB_FILE} \ || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ fi ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} | | | | | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | mv /tmp/macher_output ${LIB_FILE}; chmod u+x ${LIB_FILE}; \ fi; \ ${NATIVE_ZIP} -A ${LIB_FILE} \ || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ fi ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} @if test "x${LIB_FILE}" = "xlibtk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ (cd ${TOP_DIR}/win; ${MAKE} tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \ cp "${TOP_DIR}/win/tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \ fi rm -f $@ @MAKE_STUB_LIB@ # Build Aqua resource files ${TK_RSRC_FILE}: $(AQUA_RESOURCES) rm -f $@ |
︙ | ︙ | |||
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhoto.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c tkImgPhInstance.o: $(GENERIC_DIR)/tkImgPhInstance.c $(GENERIC_DIR)/tkImgPhoto.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhInstance.c tkTest.o: $(GENERIC_DIR)/tkTest.c tkUuid.h $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkTest.c tkText.o: $(GENERIC_DIR)/tkText.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkText.c tkTextBTree.o: $(GENERIC_DIR)/tkTextBTree.c | > > > | 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 | tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhoto.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c tkImgPhInstance.o: $(GENERIC_DIR)/tkImgPhInstance.c $(GENERIC_DIR)/tkImgPhoto.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhInstance.c tkOldTest.o: $(GENERIC_DIR)/tkOldTest.c $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkOldTest.c tkTest.o: $(GENERIC_DIR)/tkTest.c tkUuid.h $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkTest.c tkText.o: $(GENERIC_DIR)/tkText.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkText.c tkTextBTree.o: $(GENERIC_DIR)/tkTextBTree.c |
︙ | ︙ | |||
1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 | tkUnixMenu.o: $(UNIX_DIR)/tkUnixMenu.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixMenu.c tkUnixMenubu.o: $(UNIX_DIR)/tkUnixMenubu.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixMenubu.c tkUnixScale.o: $(UNIX_DIR)/tkUnixScale.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixScale.c tkUnixScrlbr.o: $(UNIX_DIR)/tkUnixScrlbr.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixScrlbr.c tkUnixSelect.o: $(UNIX_DIR)/tkUnixSelect.c | > > > | 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 | tkUnixMenu.o: $(UNIX_DIR)/tkUnixMenu.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixMenu.c tkUnixMenubu.o: $(UNIX_DIR)/tkUnixMenubu.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixMenubu.c tkUnixPrint.o: $(UNIX_DIR)/tkUnixPrint.c $(CC) -c $(CC_SWITCHES) $(CUPS_CFLAGS) $(UNIX_DIR)/tkUnixPrint.c tkUnixScale.o: $(UNIX_DIR)/tkUnixScale.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixScale.c tkUnixScrlbr.o: $(UNIX_DIR)/tkUnixScrlbr.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixScrlbr.c tkUnixSelect.o: $(UNIX_DIR)/tkUnixSelect.c |
︙ | ︙ |
Changes to unix/configure.
1 2 | #! /bin/sh # Guess values for system-dependent variables and create Makefiles. | | | 1 2 3 4 5 6 7 8 9 10 | #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for tk 8.7. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation |
︙ | ︙ | |||
597 598 599 600 601 602 603 | subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' | | | | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 | subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' PACKAGE_VERSION='8.7' PACKAGE_STRING='tk 8.7' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include <stddef.h> #ifdef HAVE_STDIO_H |
︙ | ︙ | |||
692 693 694 695 696 697 698 699 700 701 702 703 704 705 | ZIP_INSTALL_OBJS ZIP_PROG_VFSSEARCH ZIP_PROG_OPTIONS ZIP_PROG MACHER_PROG EXEEXT_FOR_BUILD CC_FOR_BUILD UNIX_FONT_OBJS XFT_LIBS XFT_CFLAGS XMKMF CPP LDFLAGS_DEFAULT CFLAGS_DEFAULT | > > | 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | ZIP_INSTALL_OBJS ZIP_PROG_VFSSEARCH ZIP_PROG_OPTIONS ZIP_PROG MACHER_PROG EXEEXT_FOR_BUILD CC_FOR_BUILD CUPS_LIBS CUPS_CFLAGS UNIX_FONT_OBJS XFT_LIBS XFT_CFLAGS XMKMF CPP LDFLAGS_DEFAULT CFLAGS_DEFAULT |
︙ | ︙ | |||
807 808 809 810 811 812 813 814 815 816 817 818 819 820 | enable_rpath enable_corefoundation enable_load enable_symbols enable_aqua with_x enable_xft enable_xss enable_framework enable_zipfs ' ac_precious_vars='build_alias host_alias target_alias | > | 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 | enable_rpath enable_corefoundation enable_load enable_symbols enable_aqua with_x enable_xft enable_libcups enable_xss enable_framework enable_zipfs ' ac_precious_vars='build_alias host_alias target_alias |
︙ | ︙ | |||
1369 1370 1371 1372 1373 1374 1375 | # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF | | | 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 | # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures tk 8.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. |
︙ | ︙ | |||
1435 1436 1437 1438 1439 1440 1441 | --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in | | | 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 | --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tk 8.7:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] |
︙ | ︙ | |||
1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 | --disable-rpath disable rpath support (default: on) --enable-corefoundation use CoreFoundation API on MacOSX (default: on) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) --enable-aqua=yes|no use Aqua windowingsystem on Mac OS X (default: no) --enable-xft use freetype/fontconfig/xft (default: on) --enable-xss use XScreenSaver for activity timer (default: on) --enable-framework package shared libraries in MacOSX frameworks (default: off) --enable-zipfs build with Zipfs support (default: on) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] | > | 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 | --disable-rpath disable rpath support (default: on) --enable-corefoundation use CoreFoundation API on MacOSX (default: on) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) --enable-aqua=yes|no use Aqua windowingsystem on Mac OS X (default: no) --enable-xft use freetype/fontconfig/xft (default: on) --enable-libcups use libcups (default: on) --enable-xss use XScreenSaver for activity timer (default: on) --enable-framework package shared libraries in MacOSX frameworks (default: off) --enable-zipfs build with Zipfs support (default: on) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] |
︙ | ︙ | |||
1551 1552 1553 1554 1555 1556 1557 | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF | | | 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tk configure 8.7 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit |
︙ | ︙ | |||
1917 1918 1919 1920 1921 1922 1923 | ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. | | | 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 | ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { |
︙ | ︙ | |||
2596 2597 2598 2599 2600 2601 2602 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | | | | | | 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 | ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.7 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=7 TK_PATCH_LEVEL="b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" #-------------------------------------------------------------------- # Find and load the tclConfig.sh file #-------------------------------------------------------------------- |
︙ | ︙ | |||
2692 2693 2694 2695 2696 2697 2698 | if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ | | | | | 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 | if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib/tcl8.7 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi |
︙ | ︙ | |||
2795 2796 2797 2798 2799 2800 2801 | if test "${TCL_MAJOR_VERSION}" -lt 9 ; then | > > > > | | | 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 | if test "${TCL_MAJOR_VERSION}" -lt 9 ; then if test "${TCL_MAJOR_VERSION}" -ne 8 ; then as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi if test "${TCL_MINOR_VERSION}" -lt 6 ; then as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 printf %s "checking for tclsh... " >&6; } |
︙ | ︙ | |||
5215 5216 5217 5218 5219 5220 5221 | SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) | > > > | | | | > | | 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 | SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) if test "${TCL_THREADS}" = "1" then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
︙ | ︙ | |||
6410 6411 6412 6413 6414 6415 6416 | if test "x$ac_cv_header_stdbool_h" = xyes then : printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 | if test "x$ac_cv_header_stdbool_h" = xyes then : printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. |
︙ | ︙ | |||
6646 6647 6648 6649 6650 6651 6652 | if test "x${tcl_cv_flag__file_offset_bits}" = "xyes" ; then printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h tcl_flags="$tcl_flags _FILE_OFFSET_BITS" fi | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 | if test "x${tcl_cv_flag__file_offset_bits}" = "xyes" ; then printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h tcl_flags="$tcl_flags _FILE_OFFSET_BITS" fi if test "x${tcl_flags}" = "x" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 printf "%s\n" "${tcl_flags}" >&6; } fi |
︙ | ︙ | |||
6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 | fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 printf "%s\n" "$tcl_cv_DIR64" >&6; } if test "x${tcl_cv_DIR64}" = "xyes" ; then printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" if test "x$ac_cv_func_open64" = xyes then : printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 | fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 printf "%s\n" "$tcl_cv_DIR64" >&6; } if test "x${tcl_cv_DIR64}" = "xyes" ; then printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 printf %s "checking for struct stat64... " >&6; } if test ${tcl_cv_struct_stat64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/stat.h> int main (void) { struct stat64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_struct_stat64=yes else case e in #( e) tcl_cv_struct_stat64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 printf "%s\n" "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" if test "x$ac_cv_func_open64" = xyes then : printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h |
︙ | ︙ | |||
8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 | else UNIX_FONT_OBJS=tkUnixFont.o fi fi #-------------------------------------------------------------------- # XXX Do this last. # It might modify XLIBSW which could affect other tests. # # Check whether the header and library for the XScreenSaver # extension are available, and set HAVE_XSS if so. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 | else UNIX_FONT_OBJS=tkUnixFont.o fi fi #-------------------------------------------------------------------- # Check for libcups support #-------------------------------------------------------------------- if test $tk_aqua = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libcups" >&5 printf %s "checking whether to use libcups... " >&6; } # Check whether --enable-libcups was given. if test ${enable_libcups+y} then : enableval=$enable_libcups; enable_libcups=$enableval else case e in #( e) enable_libcups="default" ;; esac fi CUPS_CFLAGS="" CUPS_LIBS="" if test "$enable_libcups" = "no" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_libcups" >&5 printf "%s\n" "$enable_libcups" >&6; } else found_cups=`cups-config 2>/dev/null` if test "$found_cups" = ""; then found_cups=no else found_cups=yes CUPS_CFLAGS="-DHAVE_CUPS" CUPS_LIBS=`cups-config --libs` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $found_cups" >&5 printf "%s\n" "$found_cups" >&6; } if test "$found_cups" = "yes" ; then tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES $CUPS_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $CUPS_LIBS $XLIBSW" ac_fn_c_check_header_compile "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "#include <cups/cups.h> " if test "x$ac_cv_header_cups_cups_h" = xyes then : else case e in #( e) found_cups=no CUPS_CFLAGS="" CUPS_LIBS="" ;; esac fi CFLAGS=$tk_oldCFlags LIBS=$tk_oldLibs fi fi fi #-------------------------------------------------------------------- # XXX Do this last. # It might modify XLIBSW which could affect other tests. # # Check whether the header and library for the XScreenSaver # extension are available, and set HAVE_XSS if so. |
︙ | ︙ | |||
9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 | #-------------------------------------------------------------------- # The statements below define various symbols relating to Tk # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" | > > > > > > > > > | 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 | #-------------------------------------------------------------------- # The statements below define various symbols relating to Tk # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" else eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" else TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" fi fi eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" |
︙ | ︙ | |||
9846 9847 9848 9849 9850 9851 9852 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" | | | 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ |
︙ | ︙ | |||
9905 9906 9907 9908 9909 9910 9911 | _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ | | | 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 | _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ tk config.status 8.7 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." |
︙ | ︙ |
Changes to unix/configure.ac.
1 2 3 4 5 | ! /bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. | | | | | | > > > > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ! /bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. AC_INIT([tk],[8.7]) AC_PREREQ([2.69]) dnl This is only used when included from macosx/configure.ac m4_ifdef([SC_USE_CONFIG_HEADERS], [ AC_CONFIG_HEADERS([tkConfig.h:../unix/tkConfig.h.in]) AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TK_CONFIG_H -imacros tkConfig.h"]) AH_TOP([ #ifndef _TKCONFIG #define _TKCONFIG]) AH_BOTTOM([ /* Undef unused package specific autoheader defines so that we can * include both tclConfig.h and tkConfig.h at the same time: */ /* override */ #undef PACKAGE_NAME /* override */ #undef PACKAGE_TARNAME /* override */ #undef PACKAGE_VERSION /* override */ #undef PACKAGE_STRING #endif /* _TKCONFIG */]) ]) TK_VERSION=8.7 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=7 TK_PATCH_LEVEL="b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" #-------------------------------------------------------------------- # Find and load the tclConfig.sh file #-------------------------------------------------------------------- SC_PATH_TCLCONFIG SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then if test "${TCL_MAJOR_VERSION}" -ne 8 ; then AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ Found config for Tcl ${TCL_VERSION}]) fi if test "${TCL_MINOR_VERSION}" -lt 6 ; then AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ Found config for Tcl ${TCL_VERSION}]) fi fi SC_PROG_TCLSH SC_BUILD_TCLSH |
︙ | ︙ | |||
461 462 463 464 465 466 467 468 469 470 471 472 473 474 | else UNIX_FONT_OBJS=tkUnixFont.o fi AC_SUBST(XFT_CFLAGS) AC_SUBST(XFT_LIBS) AC_SUBST(UNIX_FONT_OBJS) fi #-------------------------------------------------------------------- # XXX Do this last. # It might modify XLIBSW which could affect other tests. # # Check whether the header and library for the XScreenSaver # extension are available, and set HAVE_XSS if so. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 | else UNIX_FONT_OBJS=tkUnixFont.o fi AC_SUBST(XFT_CFLAGS) AC_SUBST(XFT_LIBS) AC_SUBST(UNIX_FONT_OBJS) fi #-------------------------------------------------------------------- # Check for libcups support #-------------------------------------------------------------------- if test $tk_aqua = no; then AC_MSG_CHECKING([whether to use libcups]) AC_ARG_ENABLE(libcups, AS_HELP_STRING([--enable-libcups], [use libcups (default: on)]), [enable_libcups=$enableval], [enable_libcups="default"]) CUPS_CFLAGS="" CUPS_LIBS="" if test "$enable_libcups" = "no" ; then AC_MSG_RESULT([$enable_libcups]) else found_cups=`cups-config 2>/dev/null` dnl make sure package configurator (cups-config) dnl says that libcups is present. if test "$found_cups" = ""; then found_cups=no else found_cups=yes CUPS_CFLAGS="-DHAVE_CUPS" CUPS_LIBS=`cups-config --libs` fi AC_MSG_RESULT([$found_cups]) dnl make sure that compiling against CUPS header file doesn't bomb if test "$found_cups" = "yes" ; then tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES $CUPS_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $CUPS_LIBS $XLIBSW" AC_CHECK_HEADER(cups/cups.h, [], [ found_cups=no CUPS_CFLAGS="" CUPS_LIBS="" ],[#include <cups/cups.h>]) CFLAGS=$tk_oldCFlags LIBS=$tk_oldLibs fi fi AC_SUBST(CUPS_CFLAGS) AC_SUBST(CUPS_LIBS) fi #-------------------------------------------------------------------- # XXX Do this last. # It might modify XLIBSW which could affect other tests. # # Check whether the header and library for the XScreenSaver # extension are available, and set HAVE_XSS if so. |
︙ | ︙ | |||
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | #-------------------------------------------------------------------- # The statements below define various symbols relating to Tk # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" | > > > > > > > > > | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | #-------------------------------------------------------------------- # The statements below define various symbols relating to Tk # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" else eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" else TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" fi fi eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" |
︙ | ︙ |
Changes to unix/tcl.m4.
︙ | ︙ | |||
89 90 91 92 93 94 95 | if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ | | | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib/tcl8.7 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi |
︙ | ︙ | |||
222 223 224 225 226 227 228 | if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ | | | | | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib/tk8.7 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tk8.7 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi |
︙ | ︙ | |||
1272 1273 1274 1275 1276 1277 1278 | SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) | > | | | | | | 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 | SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) AS_IF([test "${TCL_THREADS}" = "1"], [ # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) ;; esac AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) AS_IF([test $do64bit = yes], [ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ |
︙ | ︙ | |||
1869 1870 1871 1872 1873 1874 1875 | CFLAGS=$hold_cflags]) if test $tcl_cv_cc_input_charset = yes; then CFLAGS="$CFLAGS -finput-charset=UTF-8" fi AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],) | < < < | 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 | CFLAGS=$hold_cflags]) if test $tcl_cv_cc_input_charset = yes; then CFLAGS="$CFLAGS -finput-charset=UTF-8" fi AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],) # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. AC_SUBST(DL_LIBS) AC_SUBST(DL_OBJS) AC_SUBST(PLAT_OBJS) |
︙ | ︙ | |||
2290 2291 2292 2293 2294 2295 2296 | # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _FILE_OFFSET_BITS | < | 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 | # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _FILE_OFFSET_BITS # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[ |
︙ | ︙ | |||
2314 2315 2316 2317 2318 2319 2320 | AC_DEFUN([SC_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) SC_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include <sys/stat.h>], [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) | < < > | 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 | AC_DEFUN([SC_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) SC_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include <sys/stat.h>], [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # SC_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # HAVE_STRUCT_DIRENT64, HAVE_DIR64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # _TIME_BITS # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([if 'long' and 'long long' have the same size (64-bit)?]) |
︙ | ︙ | |||
2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> #include <dirent.h>]], [[struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d);]])], [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])]) if test "x${tcl_cv_DIR64}" = "xyes" ; then AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[off64_t offset; ]])], [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])]) | > > > > > > > > | 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> #include <dirent.h>]], [[struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d);]])], [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])]) if test "x${tcl_cv_DIR64}" = "xyes" ; then AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?]) fi AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat64 p; ]])], [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[off64_t offset; ]])], [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])]) |
︙ | ︙ |
Changes to unix/tk.spec.
1 2 3 4 5 6 | # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. Version: 8.7b1 Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: https://www.tcl-lang.org/ Buildroot: /var/tmp/%{name}%{version} Buildrequires: XFree86-devel tcl >= 8.7b1 Requires: tcl >= 8.7b1 %description The Tcl (Tool Command Language) provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and Mac OS X. Tcl |
︙ | ︙ |
Changes to unix/tkAppInit.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ | < < < < < < < < < < < < < < < < < < < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef BUILD_tk #undef STATIC_BUILD #include "tk.h" #include "tkPort.h" #if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 # define Tcl_LibraryInitProc Tcl_PackageInitProc # define Tcl_StaticLibrary Tcl_StaticPackage |
︙ | ︙ |
Changes to unix/tkConfig.h.in.
︙ | ︙ | |||
30 31 32 33 34 35 36 | /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 | < < < < < < < < < | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 /* Does struct password have a pw_gecos field? */ #undef HAVE_PW_GECOS /* Do we have <stdbool.h>? */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the <stdint.h> header file. */ |
︙ | ︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H /* Is 'struct dirent64' in <sys/types.h>? */ #undef HAVE_STRUCT_DIRENT64 /* Should we include <sys/select.h>? */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H | > > > | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H /* Is 'struct dirent64' in <sys/types.h>? */ #undef HAVE_STRUCT_DIRENT64 /* Is 'struct stat64' in <sys/stat.h>? */ #undef HAVE_STRUCT_STAT64 /* Should we include <sys/select.h>? */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H |
︙ | ︙ | |||
84 85 86 87 88 89 90 | /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H | < < < | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Is weak import available? */ #undef HAVE_WEAK_IMPORT /* Have we turned on XFT (antialiased fonts)? */ #undef HAVE_XFT /* Is XScreenSaver available? */ |
︙ | ︙ | |||
194 195 196 197 198 199 200 | /* Add the _FILE_OFFSET_BITS flag when building */ #undef _FILE_OFFSET_BITS /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE | < < < | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | /* Add the _FILE_OFFSET_BITS flag when building */ #undef _FILE_OFFSET_BITS /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE /* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ #undef _OE_SOCKETS /* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS /* Do we want the reentrant OS API? */ |
︙ | ︙ |
Changes to unix/tkUnix.c.
︙ | ︙ | |||
131 132 133 134 135 136 137 | * * Side effects: * None. * *---------------------------------------------------------------------- */ | < < | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | * * Side effects: * None. * *---------------------------------------------------------------------- */ void TkpCopyRegion( TkRegion dst, TkRegion src) { /* XUnionRegion() in Xlib is optimized to detect copying */ XUnionRegion((Region)src, (Region)src, (Region)dst); |
︙ | ︙ |
Changes to unix/tkUnixButton.c.
︙ | ︙ | |||
529 530 531 532 533 534 535 536 537 538 539 540 541 542 | } else if (butPtr->bitmap != None) { Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } imageWidth = width; imageHeight = height; haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { textXOffset = 0; textYOffset = 0; fullWidth = 0; fullHeight = 0; | > > > > > | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | } else if (butPtr->bitmap != None) { Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } imageWidth = width; imageHeight = height; Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { textXOffset = 0; textYOffset = 0; fullWidth = 0; fullHeight = 0; |
︙ | ︙ | |||
721 722 723 724 725 726 727 | /* * Draw the indicator for check buttons and radio buttons. At this point, * x and y refer to the top-left corner of the text or image or bitmap. */ if ((butPtr->type == TYPE_CHECK_BUTTON || butPtr->type == TYPE_RADIO_BUTTON) && butPtr->indicatorOn | | | 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | /* * Draw the indicator for check buttons and radio buttons. At this point, * x and y refer to the top-left corner of the text or image or bitmap. */ if ((butPtr->type == TYPE_CHECK_BUTTON || butPtr->type == TYPE_RADIO_BUTTON) && butPtr->indicatorOn && butPtr->indicatorDiameter > 2 * butPtr->borderWidth) { TkBorder *selBorder = (TkBorder *) butPtr->selectBorder; XColor *selColor = NULL; int btype = (butPtr->type == TYPE_CHECK_BUTTON ? CHECK_BUTTON : RADIO_BUTTON); if (selBorder != NULL) { selColor = selBorder->bgColorPtr; |
︙ | ︙ | |||
795 796 797 798 799 800 801 | * default ring and the button and the default ring and the focus * ring. Note that we need to explicitly draw the space in the * highlightBorder color to ensure that we overwrite any overflow * text and/or a different button background color. */ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, | | | | | | | | | 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 | * default ring and the button and the default ring and the focus * ring. Note that we need to explicitly draw the space in the * highlightBorder color to ensure that we overwrite any overflow * text and/or a different button background color. */ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, 2, TK_RELIEF_FLAT); inset += 2; Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, 1, TK_RELIEF_SUNKEN); inset++; Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, 2, TK_RELIEF_FLAT); inset += 2; } else if (butPtr->defaultState == DEFAULT_NORMAL) { /* * Leave room for the default ring and write over any text or * background color. */ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 5, TK_RELIEF_FLAT); inset += 5; } /* * Draw the button border. */ Tk_Draw3DRectangle(tkwin, pixmap, border, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, butPtr->borderWidth, relief); } if (butPtr->highlightWidth > 0) { if (butPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder), |
︙ | ︙ | |||
883 884 885 886 887 888 889 890 891 892 893 894 895 896 | void TkpComputeButtonGeometry( TkButton *butPtr) /* Button whose geometry may have changed. */ { int width, height, avgWidth, txtWidth, txtHeight; int haveImage = 0, haveText = 0; Tk_FontMetrics fm; butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; /* * Leave room for the default ring if needed. */ | > > > > > | 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 | void TkpComputeButtonGeometry( TkButton *butPtr) /* Button whose geometry may have changed. */ { int width, height, avgWidth, txtWidth, txtHeight; int haveImage = 0, haveText = 0; Tk_FontMetrics fm; Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; /* * Leave room for the default ring if needed. */ |
︙ | ︙ | |||
977 978 979 980 981 982 983 | if (butPtr->type == TYPE_CHECK_BUTTON) { butPtr->indicatorDiameter = (65*height)/100; } else { butPtr->indicatorDiameter = (75*height)/100; } } | | | | 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 | if (butPtr->type == TYPE_CHECK_BUTTON) { butPtr->indicatorDiameter = (65*height)/100; } else { butPtr->indicatorDiameter = (75*height)/100; } } width += 2 * butPtr->padX; height += 2 * butPtr->padY; } else { if (haveImage) { if (butPtr->width > 0) { width = butPtr->width; } if (butPtr->height > 0) { height = butPtr->height; |
︙ | ︙ | |||
1021 1022 1023 1024 1025 1026 1027 | * When issuing the geometry request, add extra space for the indicator, * if any, and for the border and padding, plus two extra pixels so the * display can be offset by 1 pixel in either direction for the raised or * lowered effect. */ if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { | | | | | 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | * When issuing the geometry request, add extra space for the indicator, * if any, and for the border and padding, plus two extra pixels so the * display can be offset by 1 pixel in either direction for the raised or * lowered effect. */ if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { width += 2 * butPtr->padX; height += 2 * butPtr->padY; } if ((butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin)) { width += 2; height += 2; } Tk_GeometryRequest(butPtr->tkwin, (int) (width + butPtr->indicatorSpace + 2 * butPtr->inset), (int) (height + 2 * butPtr->inset)); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to unix/tkUnixDefault.h.
︙ | ︙ | |||
347 348 349 350 351 352 353 | #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG BLACK #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT BLACK #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" | | | | 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG BLACK #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT BLACK #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" #define DEF_MESSAGE_PADX "-1" #define DEF_MESSAGE_PADY "-1" #define DEF_MESSAGE_RELIEF "flat" #define DEF_MESSAGE_TAKE_FOCUS "0" #define DEF_MESSAGE_TEXT "" #define DEF_MESSAGE_TEXT_VARIABLE "" #define DEF_MESSAGE_WIDTH "0" /* |
︙ | ︙ |
Changes to unix/tkUnixEmbed.c.
︙ | ︙ | |||
103 104 105 106 107 108 109 | TkWindow *usePtr; int anyError; Window parent; Tk_ErrorHandler handler; Container *containerPtr; XWindowAttributes parentAtts; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | TkWindow *usePtr; int anyError; Window parent; Tk_ErrorHandler handler; Container *containerPtr; XWindowAttributes parentAtts; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->window != None) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't modify container after widget is created", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL); return TCL_ERROR; } |
︙ | ︙ | |||
135 136 137 138 139 140 141 | * parent window (which is in the container app). */ anyError = 0; handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, EmbedErrorProc, &anyError); if (!XGetWindowAttributes(winPtr->display, parent, &parentAtts)) { | | | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | * parent window (which is in the container app). */ anyError = 0; handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, EmbedErrorProc, &anyError); if (!XGetWindowAttributes(winPtr->display, parent, &parentAtts)) { anyError = 1; } XSync(winPtr->display, False); Tk_DeleteErrorHandler(handler); if (anyError) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't create child of window \"%s\"", string)); |
︙ | ︙ | |||
214 215 216 217 218 219 220 | * to be instantiated. */ Window parent) /* Window system token for the parent in which * the window is to be created. */ { Container *containerPtr; TkWindow *winPtr = (TkWindow *) tkwin; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | * to be instantiated. */ Window parent) /* Window system token for the parent in which * the window is to be created. */ { Container *containerPtr; TkWindow *winPtr = (TkWindow *) tkwin; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->flags & TK_EMBEDDED) { /* * This window is embedded. Don't create the new window in the given * parent; instead, create it as a child of the root window of the * container's screen. The window will get reparented into a wrapper * window later. |
︙ | ︙ | |||
270 271 272 273 274 275 276 | Tk_MakeContainer( Tk_Window tkwin) /* Token for a window that is about to become * a container. */ { TkWindow *winPtr = (TkWindow *) tkwin; Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | Tk_MakeContainer( Tk_Window tkwin) /* Token for a window that is about to become * a container. */ { TkWindow *winPtr = (TkWindow *) tkwin; Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * Register the window as a container so that, for example, we can find * out later if the embedded app. is in the same process. */ Tk_MakeWindowExist(tkwin); |
︙ | ︙ | |||
396 397 398 399 400 401 402 | void *clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { TkWindow *winPtr = (TkWindow *)clientData; Container *containerPtr; Tk_ErrorHandler errHandler; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | void *clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { TkWindow *winPtr = (TkWindow *)clientData; Container *containerPtr; Tk_ErrorHandler errHandler; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * Ignore any X protocol errors that happen in this function (almost any * operation could fail, for example, if the embedded application has * deleted its window). */ |
︙ | ︙ | |||
501 502 503 504 505 506 507 | void *clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { Container *containerPtr = (Container *)clientData; Tk_ErrorHandler errHandler; if (eventPtr->type == ConfigureNotify) { | | | | | | | | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | void *clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { Container *containerPtr = (Container *)clientData; Tk_ErrorHandler errHandler; if (eventPtr->type == ConfigureNotify) { /* * Send a ConfigureNotify to the embedded application. */ if (containerPtr->embeddedPtr != NULL) { TkDoConfigureNotify(containerPtr->embeddedPtr); } if (containerPtr->wrapper != None) { /* * Ignore errors, since the embedded application could have * deleted its window. */ |
︙ | ︙ | |||
711 712 713 714 715 716 717 | Tk_Window Tk_GetOtherWindow( Tk_Window tkwin) /* Tk's structure for a container or embedded * window. */ { Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | Tk_Window Tk_GetOtherWindow( Tk_Window tkwin) /* Tk's structure for a container or embedded * window. */ { Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (containerPtr = tsdPtr->firstContainerPtr; containerPtr != NULL; containerPtr = containerPtr->nextPtr) { if ((Tk_Window)containerPtr->embeddedPtr == tkwin) { return (Tk_Window)containerPtr->parentPtr; } else if ((Tk_Window)containerPtr->parentPtr == tkwin) { return (Tk_Window)containerPtr->embeddedPtr; } } |
︙ | ︙ | |||
757 758 759 760 761 762 763 | * reported. */ XEvent *eventPtr) /* X event to redirect (should be KeyPress or * KeyRelease). */ { Container *containerPtr; Window saved; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | * reported. */ XEvent *eventPtr) /* X event to redirect (should be KeyPress or * KeyRelease). */ { Container *containerPtr; Window saved; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * First, find the top-level window corresponding to winPtr. */ while (1) { if (winPtr == NULL) { |
︙ | ︙ | |||
829 830 831 832 833 834 835 | int force) /* One means that the container should claim * the focus if it doesn't currently have * it. */ { XEvent event; Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | int force) /* One means that the container should claim * the focus if it doesn't currently have * it. */ { XEvent event; Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!(topLevelPtr->flags & TK_EMBEDDED)) { return; } for (containerPtr = tsdPtr->firstContainerPtr; containerPtr->embeddedPtr != topLevelPtr; |
︙ | ︙ | |||
881 882 883 884 885 886 887 | { int all; Container *containerPtr; Tcl_DString dString; char buffer[50]; Tcl_Interp *embeddedInterp = NULL, *parentInterp = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 | { int all; Container *containerPtr; Tcl_DString dString; char buffer[50]; Tcl_Interp *embeddedInterp = NULL, *parentInterp = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); (void)dummy; if ((objc > 1) && (strcmp(Tcl_GetString(objv[1]), "all") == 0)) { all = 1; } else { all = 0; } |
︙ | ︙ | |||
919 920 921 922 923 924 925 | if (containerPtr->parentPtr == NULL || parentInterp != interp) { Tcl_DStringAppendElement(&dString, ""); } else { Tcl_DStringAppendElement(&dString, containerPtr->parentPtr->pathName); } | | | 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 | if (containerPtr->parentPtr == NULL || parentInterp != interp) { Tcl_DStringAppendElement(&dString, ""); } else { Tcl_DStringAppendElement(&dString, containerPtr->parentPtr->pathName); } /* Wrapper */ if (containerPtr->wrapper == None) { Tcl_DStringAppendElement(&dString, ""); } else if (all) { snprintf(buffer, sizeof(buffer), "0x%" TCL_Z_MODIFIER "x", (size_t) containerPtr->wrapper); Tcl_DStringAppendElement(&dString, buffer); } else { Tcl_DStringAppendElement(&dString, "XXX"); |
︙ | ︙ | |||
967 968 969 970 971 972 973 | static void EmbedWindowDeleted( TkWindow *winPtr) /* Tk's information about window that was * deleted. */ { Container *containerPtr, *prevPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 | static void EmbedWindowDeleted( TkWindow *winPtr) /* Tk's information about window that was * deleted. */ { Container *containerPtr, *prevPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * Find the Container structure for this window work. Delete the * information about the embedded application and free the container's * record. */ |
︙ | ︙ | |||
1026 1027 1028 1029 1030 1031 1032 | Window TkUnixContainerId( TkWindow *winPtr) /* Tk's structure for an embedded window. */ { Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | | 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | Window TkUnixContainerId( TkWindow *winPtr) /* Tk's structure for an embedded window. */ { Container *containerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (containerPtr = tsdPtr->firstContainerPtr; containerPtr != NULL; containerPtr = containerPtr->nextPtr) { if (containerPtr->embeddedPtr == winPtr) { return containerPtr->parent; } } Tcl_Panic("TkUnixContainerId couldn't find window"); return None; } |
︙ | ︙ |
Changes to unix/tkUnixFont.c.
︙ | ︙ | |||
234 235 236 237 238 239 240 241 242 243 244 245 246 247 | static char ** ListFontOrAlias(Display *display, const char*faceName, int *numNamesPtr); static unsigned RankAttributes(FontAttributes *wantPtr, FontAttributes *gotPtr); static void ReleaseFont(UnixFont *fontPtr); static void ReleaseSubFont(Display *display, SubFont *subFontPtr); static int SeenName(const char *name, Tcl_DString *dsPtr); /* *------------------------------------------------------------------------- * * FontPkgCleanup -- * * This function is called when an application is created. It initializes | > > > > > > > > > > | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | static char ** ListFontOrAlias(Display *display, const char*faceName, int *numNamesPtr); static unsigned RankAttributes(FontAttributes *wantPtr, FontAttributes *gotPtr); static void ReleaseFont(UnixFont *fontPtr); static void ReleaseSubFont(Display *display, SubFont *subFontPtr); static int SeenName(const char *name, Tcl_DString *dsPtr); #if TCL_MAJOR_VERSION < 9 static int Ucs2beToUtfProc(void *clientData, const char*src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); static int UtfToUcs2beProc(void *clientData, const char*src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); #endif /* *------------------------------------------------------------------------- * * FontPkgCleanup -- * * This function is called when an application is created. It initializes |
︙ | ︙ | |||
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | TkpFontPkgInit( TCL_UNUSED(TkMainInfo *)) /* The application being created. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); SubFont dummy; int i; if (tsdPtr->controlFamily.encoding == NULL) { Tcl_EncodingType type = {"X11ControlChars", ControlUtfProc, ControlUtfProc, NULL, NULL, 0}; tsdPtr->controlFamily.refCount = 2; tsdPtr->controlFamily.encoding = Tcl_CreateEncoding(&type); tsdPtr->controlFamily.isTwoByteFont = 0; dummy.familyPtr = &tsdPtr->controlFamily; dummy.fontMap = tsdPtr->controlFamily.fontMap; for (i = 0x00; i < 0x20; i++) { FontMapInsert(&dummy, i); FontMapInsert(&dummy, i + 0x80); } /* * UCS-2BE is unicode (UCS-2) in big-endian format. Define this if * if it doesn't exist yet. It is used in iso10646 fonts. */ Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL); } } /* *------------------------------------------------------------------------- * | > > > > > > > > > > > > | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | TkpFontPkgInit( TCL_UNUSED(TkMainInfo *)) /* The application being created. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); SubFont dummy; int i; #if TCL_MAJOR_VERSION < 9 Tcl_Encoding ucs2; #endif if (tsdPtr->controlFamily.encoding == NULL) { Tcl_EncodingType type = {"X11ControlChars", ControlUtfProc, ControlUtfProc, NULL, NULL, 0}; tsdPtr->controlFamily.refCount = 2; tsdPtr->controlFamily.encoding = Tcl_CreateEncoding(&type); tsdPtr->controlFamily.isTwoByteFont = 0; dummy.familyPtr = &tsdPtr->controlFamily; dummy.fontMap = tsdPtr->controlFamily.fontMap; for (i = 0x00; i < 0x20; i++) { FontMapInsert(&dummy, i); FontMapInsert(&dummy, i + 0x80); } /* * UCS-2BE is unicode (UCS-2) in big-endian format. Define this if * if it doesn't exist yet. It is used in iso10646 fonts. */ #if TCL_MAJOR_VERSION < 9 ucs2 = Tcl_GetEncoding(NULL, "ucs-2be"); if (ucs2 == NULL) { Tcl_EncodingType ucs2type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2}; Tcl_CreateEncoding(&ucs2type); } else { Tcl_FreeEncoding(ucs2); } #endif Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL); } } /* *------------------------------------------------------------------------- * |
︙ | ︙ | |||
389 390 391 392 393 394 395 | dstEnd = dst + dstLen - 6; for ( ; src < srcEnd; ) { if (dst > dstEnd) { result = TCL_CONVERT_NOSPACE; break; } | | | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | dstEnd = dst + dstLen - 6; for ( ; src < srcEnd; ) { if (dst > dstEnd) { result = TCL_CONVERT_NOSPACE; break; } src += TkUtfToUniChar(src, &ch); dst[0] = '\\'; if (((size_t)ch < sizeof(mapChars)) && (mapChars[ch] != 0)) { dst[1] = mapChars[ch]; dst += 2; } else if ((size_t)ch < 256) { dst[1] = 'x'; dst[2] = hexChars[(ch >> 4) & 0xF]; |
︙ | ︙ | |||
422 423 424 425 426 427 428 429 430 431 432 433 434 435 | } *srcReadPtr = src - srcStart; *dstWrotePtr = dst - dstStart; *dstCharsPtr = dst - dstStart; return result; } /* *--------------------------------------------------------------------------- * * TkpGetNativeFont -- * * Map a platform-specific native font name to a TkFont. * | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | } *srcReadPtr = src - srcStart; *dstWrotePtr = dst - dstStart; *dstCharsPtr = dst - dstStart; return result; } /* *------------------------------------------------------------------------- * * Ucs2beToUtfProc -- * * Convert from UCS-2BE (big-endian 16-bit Unicode) to UTF-8. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ #if TCL_MAJOR_VERSION < 9 static int Ucs2beToUtfProc( TCL_UNUSED(void *), /* Not used. */ const char *src, /* Source string in Unicode. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state * information used during a piecewise * conversion. Contents of statePtr are * initialized and/or reset by conversion * routine under control of flags argument. */ char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in * bytes. */ int *srcReadPtr, /* Filled with the number of bytes from the * source string that were converted. This may * be less than the original source length if * there was a problem converting some source * characters. */ int *dstWrotePtr, /* Filled with the number of bytes that were * stored in the output buffer as a result of * the conversion. */ int *dstCharsPtr) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ { const char *srcStart, *srcEnd; const char *dstEnd, *dstStart; int result, numChars, charLimit = INT_MAX; unsigned short ch; if (flags & TCL_ENCODING_CHAR_LIMIT) { charLimit = *dstCharsPtr; } result = TCL_OK; /* check alignment with ucs-2 (2 == sizeof(UCS-2)) */ if ((srcLen % 2) != 0) { result = TCL_CONVERT_MULTIBYTE; srcLen--; } /* If last code point is a high surrogate, we cannot handle that yet */ if ((srcLen >= 2) && ((src[srcLen - 2] & 0xFC) == 0xD8)) { result = TCL_CONVERT_MULTIBYTE; srcLen -= 2; } srcStart = src; srcEnd = src + srcLen; dstStart = dst; dstEnd = dst + dstLen - 4; for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) { if (dst > dstEnd) { result = TCL_CONVERT_NOSPACE; break; } ch = (src[0] & 0xFF) << 8 | (src[1] & 0xFF); src += 2 /* sizeof(UTF-16) */; /* * Special case for 1-byte utf chars for speed. Make sure we work with * unsigned short-size data. */ if (ch && ch < 0x80) { *dst++ = (ch & 0xFF); } else { dst += Tcl_UniCharToUtf(ch, dst); } } *srcReadPtr = src - srcStart; *dstWrotePtr = dst - dstStart; *dstCharsPtr = numChars; return result; } /* *------------------------------------------------------------------------- * * UtfToUcs2beProc -- * * Convert from UTF-8 to UCS-2BE (fixed 2-byte encoding). * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ #if defined(USE_TCL_STUBS) /* Since the UCS-2BE encoding is only used when Tk is dynamically loaded in Tcl 8.6, * make sure that Tcl_UtfCharComplete is ALWAYS the pre-TIP #575 version, * even though Tk is being compiled with -DTCL_NO_DEPRECATED! */ # undef Tcl_UtfCharComplete # define Tcl_UtfCharComplete ((int (*)(const char *, int))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[326])) #endif static int UtfToUcs2beProc( TCL_UNUSED(void *), /* TableEncodingData that specifies * encoding. */ const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state * information used during a piecewise * conversion. Contents of statePtr are * initialized and/or reset by conversion * routine under control of flags argument. */ char *dst, /* Output buffer in which converted string is * stored. */ int dstLen, /* The maximum length of output buffer in * bytes. */ int *srcReadPtr, /* Filled with the number of bytes from the * source string that were converted. This may * be less than the original source length if * there was a problem converting some source * characters. */ int *dstWrotePtr, /* Filled with the number of bytes that were * stored in the output buffer as a result of * the conversion. */ int *dstCharsPtr) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ { const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; int result, numChars; int ch; srcStart = src; srcEnd = src + srcLen; srcClose = srcEnd; if (!(flags & TCL_ENCODING_END)) { srcClose -= 6; } dstStart = dst; dstEnd = dst + dstLen - 2 /* sizeof(UCS-2) */; result = TCL_OK; for (numChars = 0; src < srcEnd; numChars++) { if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = TCL_CONVERT_MULTIBYTE; break; } if (dst > dstEnd) { result = TCL_CONVERT_NOSPACE; break; } src += TkUtfToUniChar(src, &ch); if (ch > 0xFFFF) { ch = 0xFFFD; } /* * Ensure big-endianness (store big bits first). */ *dst++ = (char)((ch >> 8) & 0xFF); *dst++ = (char)(ch & 0xFF); } *srcReadPtr = src - srcStart; *dstWrotePtr = dst - dstStart; *dstCharsPtr = numChars; return result; } #endif /* *--------------------------------------------------------------------------- * * TkpGetNativeFont -- * * Map a platform-specific native font name to a TkFont. * |
︙ | ︙ | |||
839 840 841 842 843 844 845 | * 2. Convert those chars to the encoding of that font. * 3. Measure converted chars. */ curX = 0; end = source + numBytes; for (p = source; p < end; ) { | | | | | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 | * 2. Convert those chars to the encoding of that font. * 3. Measure converted chars. */ curX = 0; end = source + numBytes; for (p = source; p < end; ) { next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, &runString); if (familyPtr->isTwoByteFont) { curX += XTextWidth16(lastSubFontPtr->fontStructPtr, (XChar2b *) Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) / 2); } else { curX += XTextWidth(lastSubFontPtr->fontStructPtr, Tcl_DStringValue(&runString), Tcl_DStringLength(&runString)); } Tcl_DStringFree(&runString); lastSubFontPtr = thisSubFontPtr; source = p; } p = next; } familyPtr = lastSubFontPtr->familyPtr; Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, &runString); if (familyPtr->isTwoByteFont) { curX += XTextWidth16(lastSubFontPtr->fontStructPtr, (XChar2b *) Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) >> 1); } else { curX += XTextWidth(lastSubFontPtr->fontStructPtr, |
︙ | ︙ | |||
886 887 888 889 890 891 892 | /* * How many chars will fit in the space allotted? This first version * may be inefficient because it measures every character * individually. */ | | | 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 | /* * How many chars will fit in the space allotted? This first version * may be inefficient because it measures every character * individually. */ next = source + TkUtfToUniChar(source, &ch); newX = curX = termX = 0; term = source; end = source + numBytes; sawNonSpace = (ch > 255) || !isspace(ch); familyPtr = lastSubFontPtr->familyPtr; |
︙ | ︙ | |||
921 922 923 924 925 926 927 | p = next; if (p >= end) { term = end; termX = curX; break; } | | | 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 | p = next; if (p >= end) { term = end; termX = curX; break; } next += TkUtfToUniChar(next, &ch); if ((ch < 256) && isspace(ch)) { if (sawNonSpace) { term = p; termX = curX; sawNonSpace = 0; } } else { |
︙ | ︙ | |||
946 947 948 949 950 951 952 | /* * Include the first character that didn't quite fit in the * desired span. The width returned will include the width of that * extra character. */ curX = newX; | | | | 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 | /* * Include the first character that didn't quite fit in the * desired span. The width returned will include the width of that * extra character. */ curX = newX; p += TkUtfToUniChar(p, &ch); } if ((flags & TK_AT_LEAST_ONE) && (term == source) && (p < end)) { term = p; termX = curX; if (term == source) { term += TkUtfToUniChar(term, &ch); termX = newX; } } else if ((p >= end) || !(flags & TK_WHOLE_WORDS)) { term = p; termX = curX; } |
︙ | ︙ | |||
1098 1099 1100 1101 1102 1103 1104 | window_width = 32768; #endif end = source + numBytes; needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike; for (p = source; p <= end; ) { if (p < end) { | | | | 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 | window_width = 32768; #endif end = source + numBytes; needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike; for (p = source; p <= end; ) { if (p < end) { next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); } else { next = p + 1; thisSubFontPtr = lastSubFontPtr; } if ((thisSubFontPtr != lastSubFontPtr) || (p == end) || (p-source > 200)) { if (p > source) { do_width = (needWidth || (p != end)) ? 1 : 0; familyPtr = lastSubFontPtr->familyPtr; Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, &runString); if (familyPtr->isTwoByteFont) { XDrawString16(display, drawable, gc, x, y, (XChar2b *) Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) / 2); if (do_width) { x += XTextWidth16(lastSubFontPtr->fontStructPtr, |
︙ | ︙ | |||
2075 2076 2077 2078 2079 2080 2081 | } } end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { int hi, lo; | | | | 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 | } } end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { int hi, lo; if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src), TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } if (isTwoByteFont) { hi = ((unsigned char *) buf)[0]; lo = ((unsigned char *) buf)[1]; } else { |
︙ | ︙ | |||
2271 2272 2273 2274 2275 2276 2277 | display = fontPtr->display; nameList = ListFonts(display, faceName, &numNames); if (numNames == 0) { return NULL; } nameListOrig = nameList; | | | 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 | display = fontPtr->display; nameList = ListFonts(display, faceName, &numNames); if (numNames == 0) { return NULL; } nameListOrig = nameList; srcLen = TkUniCharToUtf(ch, src); want.fa = fontPtr->font.fa; want.xa = fontPtr->xa; want.fa.family = Tk_GetUid(faceName); want.fa.size = (double)-fontPtr->pixelSize; |
︙ | ︙ | |||
2350 2351 2352 2353 2354 2355 2356 | } Tcl_DStringAppend(&dsEncodings, (char *) &encoding, sizeof(encoding)); numEncodings++; } Tcl_UtfToExternal(NULL, encoding, src, srcLen, | | | 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 | } Tcl_DStringAppend(&dsEncodings, (char *) &encoding, sizeof(encoding)); numEncodings++; } Tcl_UtfToExternal(NULL, encoding, src, srcLen, TCL_ENCODING_STOPONERROR, NULL, dst, sizeof(dst), &srcRead, &dstWrote, NULL); if (dstWrote == 0) { goto crossout; } /* * D. Rank each name and pick the best match. |
︙ | ︙ |
Changes to unix/tkUnixInit.c.
︙ | ︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | Tcl_Interp *interp) { TkCreateXEventSource(); GetLibraryPath(interp); Tktray_Init(interp); (void)SysNotify_Init (interp); Icu_Init(interp); return TCL_OK; } /* *---------------------------------------------------------------------- * * TkpGetAppName -- | > | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | Tcl_Interp *interp) { TkCreateXEventSource(); GetLibraryPath(interp); Tktray_Init(interp); (void)SysNotify_Init (interp); Icu_Init(interp); Cups_Init(interp); return TCL_OK; } /* *---------------------------------------------------------------------- * * TkpGetAppName -- |
︙ | ︙ | |||
143 144 145 146 147 148 149 | int foundInFramework = TCL_ERROR; char tkLibPath[PATH_MAX + 1]; foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp, "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX, tkLibPath); if (tkLibPath[0] != '\0') { | | | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | int foundInFramework = TCL_ERROR; char tkLibPath[PATH_MAX + 1]; foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp, "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX, tkLibPath); if (tkLibPath[0] != '\0') { Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY); } return foundInFramework; } #else static int GetLibraryPath( TCL_UNUSED(Tcl_Interp *)) |
︙ | ︙ |
Changes to unix/tkUnixInt.h.
︙ | ︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | * they're defined in. */ #include "tkIntPlatDecls.h" MODULE_SCOPE int Tktray_Init (Tcl_Interp* interp); MODULE_SCOPE int SysNotify_Init (Tcl_Interp* interp); #endif /* _TKUNIXINT */ /* * Local Variables: * mode: c | > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | * they're defined in. */ #include "tkIntPlatDecls.h" MODULE_SCOPE int Tktray_Init (Tcl_Interp* interp); MODULE_SCOPE int SysNotify_Init (Tcl_Interp* interp); MODULE_SCOPE int Cups_Init (Tcl_Interp* interp); #endif /* _TKUNIXINT */ /* * Local Variables: * mode: c |
︙ | ︙ |
Changes to unix/tkUnixKey.c.
︙ | ︙ | |||
156 157 158 159 160 161 162 | * Overallocate the dstring to the maximum stack amount. */ Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), | | | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | * Overallocate the dstring to the maximum stack amount. */ Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), &kePtr->keysym, &status); /* * If the buffer wasn't big enough, grow the buffer and try again. */ if (status == XBufferOverflow) { Tcl_DStringSetLength(&buf, len); |
︙ | ︙ | |||
192 193 194 195 196 197 198 | Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = (Tcl_Size)XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf), TCL_DSTRING_STATIC_SIZE, &kePtr->keysym, 0); Tcl_DStringValue(&buf)[len] = '\0'; if (len == 1) { | | | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = (Tcl_Size)XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf), TCL_DSTRING_STATIC_SIZE, &kePtr->keysym, 0); Tcl_DStringValue(&buf)[len] = '\0'; if (len == 1) { len = TkUniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], Tcl_DStringValue(dsPtr)); Tcl_DStringSetLength(dsPtr, len); } else { /* * len > 1 should only happen if someone has called XRebindKeysym. * Assume UTF-8. */ |
︙ | ︙ | |||
305 306 307 308 309 310 311 | TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; /* * X11 keycodes always lie in the inclusive range [8,255]. */ if (eventPtr->xkey.keycode > 0xff) { | | | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; /* * X11 keycodes always lie in the inclusive range [8,255]. */ if (eventPtr->xkey.keycode > 0xff) { return NoSymbol; } /* * Refresh the mapping information if it's stale. This must happen before * we do any input method processing. [Bug 3599312] */ |
︙ | ︙ |
Changes to unix/tkUnixMenu.c.
︙ | ︙ | |||
856 857 858 859 860 861 862 | const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int x, int y, TCL_UNUSED(int), int height) { if (mePtr->labelPtr != NULL) { int len; | | | | | 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 | const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int x, int y, TCL_UNUSED(int), int height) { if (mePtr->labelPtr != NULL) { int len; len = TkGetCharLength(mePtr->labelPtr); if (mePtr->underline < len && mePtr->underline >= -len) { int activeBorderWidth, leftEdge, ch; const char *label, *start, *end; label = Tcl_GetString(mePtr->labelPtr); start = TkUtfAtIndex(label, (mePtr->underline < 0) ? mePtr->underline + len : mePtr->underline); end = start + TkUtfToUniChar(start, &ch); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); leftEdge = x + mePtr->indicatorSpace + activeBorderWidth; if (menuPtr->menuType == MENUBAR) { leftEdge += 5; } |
︙ | ︙ |
Changes to unix/tkUnixMenubu.c.
︙ | ︙ | |||
275 276 277 278 279 280 281 | if (mbPtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, mbPtr->highlightWidth, mbPtr->highlightWidth, Tk_Width(tkwin) - 2*mbPtr->highlightWidth, Tk_Height(tkwin) - 2*mbPtr->highlightWidth, mbPtr->borderWidth, mbPtr->relief); } | | | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | if (mbPtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, mbPtr->highlightWidth, mbPtr->highlightWidth, Tk_Width(tkwin) - 2*mbPtr->highlightWidth, Tk_Height(tkwin) - 2*mbPtr->highlightWidth, mbPtr->borderWidth, mbPtr->relief); } if (mbPtr->highlightWidth > 0) { if (mbPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor(mbPtr->highlightBgColorPtr, pixmap); } Tk_DrawFocusHighlight(tkwin, gc, mbPtr->highlightWidth, pixmap); } |
︙ | ︙ |
Changes to unix/tkUnixPort.h.
︙ | ︙ | |||
141 142 143 144 145 146 147 148 149 150 151 152 153 154 | #define TkpButtonSetDefaults() {} #define TkpDestroyButton(butPtr) {} #define TkSelUpdateClipboard(a,b) {} #ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} #endif /* * This macro stores a representation of the window handle in a string. * This should perhaps use the real size of an XID. */ #ifndef __CYGWIN__ #define TkpPrintWindowId(buf,w) \ | > > > > > > > > > | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | #define TkpButtonSetDefaults() {} #define TkpDestroyButton(butPtr) {} #define TkSelUpdateClipboard(a,b) {} #ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} #endif /* * These calls implement native bitmaps which are not supported under * UNIX. The macros eliminate the calls. */ #define TkpDefineNativeBitmaps() #define TkpCreateNativeBitmap(display, source) None #define TkpGetNativeAppBitmap(display, name, w, h) None /* * This macro stores a representation of the window handle in a string. * This should perhaps use the real size of an XID. */ #ifndef __CYGWIN__ #define TkpPrintWindowId(buf,w) \ |
︙ | ︙ |
Added unix/tkUnixPrint.c.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | /* * tkUnixPrint.c -- * * tkUnixPrint.c implements a "::tk::print::cups" Tcl command which * interfaces the libcups2 API with the [tk print] command. * * Copyright © 2024 Emiliano Gavilán. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkUnixInt.h" #ifdef HAVE_CUPS #include <cups/cups.h> typedef int (CupsSubCmdOp)(Tcl_Interp *, int, Tcl_Obj *const []); static Tcl_ObjCmdProc Cups_Cmd; static CupsSubCmdOp DefaultPrinterOp; static CupsSubCmdOp GetPrintersOp; static CupsSubCmdOp PrintOp; static Tcl_ArgvGenFuncProc ParseEnumOptions; static Tcl_ArgvGenFuncProc ParseOptions; static Tcl_ArgvGenFuncProc ParseMargins; static Tcl_ArgvGenFuncProc ParseNup; static cups_dest_t* GetPrinterFromObj(Tcl_Obj *); static cups_dest_t * GetPrinterFromObj(Tcl_Obj *nameObj) { cups_dest_t *printer; Tcl_Size len; const char *nameStr = Tcl_GetStringFromObj(nameObj, &len); char *p; char *name, *instance = NULL; Tcl_DString ds; Tcl_DStringInit(&ds); name = Tcl_DStringAppend(&ds, nameStr, len); p = strchr(name, '/'); if (p) { *p = '\0'; instance = p+1; } printer = cupsGetNamedDest(CUPS_HTTP_DEFAULT, name, instance); Tcl_DStringFree(&ds); return printer; } static int Cups_Cmd( TCL_UNUSED(void *), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { static const struct CupsCmds { const char *subcmd; CupsSubCmdOp *subCmd; } cupsCmds[] = { {"defaultprinter" , DefaultPrinterOp}, {"getprinters" , GetPrintersOp}, {"print" , PrintOp}, {NULL, NULL} }; int index; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObjStruct(interp, objv[1], cupsCmds, sizeof(struct CupsCmds), "subcommand", 0, &index) != TCL_OK) { return TCL_ERROR; } return cupsCmds[index].subCmd(interp, objc, objv); } static int DefaultPrinterOp( Tcl_Interp *interp, TCL_UNUSED(int), TCL_UNUSED(Tcl_Obj *const *)) { cups_dest_t *printer; Tcl_Obj *resultObj; printer = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); if (printer) { if (printer->instance) { resultObj = Tcl_ObjPrintf("%s/%s", printer->name, printer->instance); } else { resultObj = Tcl_NewStringObj(printer->name, -1); } Tcl_SetObjResult(interp, resultObj); } cupsFreeDests(1, printer); return TCL_OK; } static int GetPrintersOp( Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { cups_dest_t *dests; cups_option_t *option; int num_dests, i, j; Tcl_Obj *keyPtr, *optPtr, *resultObj; if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, NULL); return TCL_ERROR; } num_dests = cupsGetDests2(CUPS_HTTP_DEFAULT, &dests); resultObj = Tcl_NewObj(); for (i = 0; i < num_dests; i++) { if (dests[i].instance) keyPtr = Tcl_ObjPrintf("%s/%s", dests[i].name, dests[i].instance); else keyPtr = Tcl_NewStringObj(dests[i].name, -1); option = dests[i].options; optPtr = Tcl_NewObj(); for(j = 0; j < dests[i].num_options; j++) { Tcl_DictObjPut(NULL, optPtr, Tcl_NewStringObj(option[j].name, -1), Tcl_NewStringObj(option[j].value, -1)); } Tcl_DictObjPut(NULL, resultObj, keyPtr, optPtr); } cupsFreeDests(num_dests, dests); Tcl_SetObjResult(interp, resultObj); return TCL_OK; } /* Information needed for parsing */ struct CupsOptions { const char *name; const char *cupsName; }; static const struct CupsOptions colormodeOpts[] = { {"auto", CUPS_PRINT_COLOR_MODE_AUTO}, {"color", CUPS_PRINT_COLOR_MODE_COLOR}, {"monochrome", CUPS_PRINT_COLOR_MODE_MONOCHROME}, {NULL, NULL} }; static const struct CupsOptions formatOpts[] = { {"auto", CUPS_FORMAT_AUTO}, {"pdf", CUPS_FORMAT_PDF}, {"postscript", CUPS_FORMAT_POSTSCRIPT}, {"text", CUPS_FORMAT_TEXT}, {NULL, NULL} }; static const struct CupsOptions mediaOpts[] = { {"a4", CUPS_MEDIA_A4}, {"legal", CUPS_MEDIA_LEGAL}, {"letter", CUPS_MEDIA_LETTER}, {NULL, NULL} }; static const struct CupsOptions orientationOpts[] = { {"portrait", CUPS_ORIENTATION_PORTRAIT}, {"landscape", CUPS_ORIENTATION_LANDSCAPE}, {NULL, NULL} }; enum {PARSECOLORMODE, PARSEFORMAT, PARSEMEDIA, PARSEORIENTATION}; static const struct ParseData { const char *message; const struct CupsOptions *optionTable; } parseData[] = { {"colormode", colormodeOpts}, {"format", formatOpts}, {"media", mediaOpts}, {"orientation", orientationOpts}, {NULL, NULL} }; static int PrintOp( Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { cups_dest_t *printer; cups_dinfo_t *info; int result = TCL_OK; int job_id; /* variables for Tcl_ParseArgsObjv */ Tcl_Obj *const *parseObjv; Tcl_Size count; /* options related vaiables */ cups_option_t *options = NULL; int num_options = 0; int copies = 0, pprint = 0; const char *media = NULL, *color = NULL, *orient = NULL, *format = NULL, *nup = NULL, *title = NULL; Tcl_Obj *marginsObj = NULL, *optionsObj = NULL; double tzoom = 1.0; /* Data to print * this is a binary buffer, since it can contain data such as * jpg or compressed pdf which might contain any bytes. * USE [encoding convertto] with a proper encoding when passing * text data to print. */ const unsigned char *buffer; Tcl_Size buflen; const Tcl_ArgvInfo argTable[] = { {TCL_ARGV_GENFUNC, "-colormode", ParseEnumOptions, &color, "color mode", (void *)&parseData[PARSECOLORMODE]}, {TCL_ARGV_INT , "-copies", NULL, &copies, "number of copies", NULL}, {TCL_ARGV_GENFUNC, "-format", ParseEnumOptions, &format, "data format", (void *)&parseData[PARSEFORMAT]}, {TCL_ARGV_GENFUNC, "-margins", ParseMargins, &marginsObj, "media page size", NULL}, {TCL_ARGV_GENFUNC, "-media", ParseEnumOptions, &media, "media page size", (void *)&parseData[PARSEMEDIA]}, {TCL_ARGV_GENFUNC, "-nup", ParseNup, &nup, "pages per sheet", NULL}, {TCL_ARGV_GENFUNC, "-options", ParseOptions, &optionsObj, "generic options", NULL}, {TCL_ARGV_GENFUNC, "-orientation", ParseEnumOptions, &orient, "page orientation", (void *)&parseData[PARSEORIENTATION]}, {TCL_ARGV_CONSTANT, "-prettyprint", (void *)1, &pprint, "print header", NULL}, {TCL_ARGV_STRING, "-title", NULL, &title, "job title", NULL}, {TCL_ARGV_FLOAT, "-tzoom", NULL, &tzoom, "text zoom", NULL}, TCL_ARGV_TABLE_END }; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, "printer data ?-opt arg ...?"); return TCL_ERROR; } printer = GetPrinterFromObj(objv[2]); if (!printer) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("unknown printer or class \"%s\"", Tcl_GetString(objv[2]))); return TCL_ERROR; } /* T_PAO discards the first arg, but we have 4 before the options */ parseObjv = objv+3; count = objc-3; if (Tcl_ParseArgsObjv(interp, argTable, &count, parseObjv, NULL)!=TCL_OK) { return TCL_ERROR; } if (copies < 0 || copies > 100) { Tcl_SetObjResult(interp, Tcl_NewStringObj("copies must be an integer" "between 0 and 100", -1)); cupsFreeDests(1, printer); return TCL_ERROR; } if (tzoom < 0.5 || tzoom > 2.0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("tzoom must be a number" "between 0.5 and 2.0", -1)); cupsFreeDests(1, printer); return TCL_ERROR; } /* Add options */ if (copies != 0) { char copiesbuf[4]; snprintf(copiesbuf, 4, "%d", copies); num_options = cupsAddOption(CUPS_COPIES, copiesbuf, num_options, &options); } if (color) { num_options = cupsAddOption(CUPS_PRINT_COLOR_MODE, color, num_options, &options); } if (media) { num_options = cupsAddOption(CUPS_MEDIA, media, num_options, &options); } if (nup) { num_options = cupsAddOption(CUPS_NUMBER_UP, nup, num_options, &options); } if (orient) { num_options = cupsAddOption(CUPS_ORIENTATION, orient, num_options, &options); } if (pprint) { num_options = cupsAddOption("prettyprint", "yes", num_options, &options); } if (marginsObj) { Tcl_Size n; Tcl_Obj **listArr; Tcl_ListObjGetElements(NULL, marginsObj, &n, &listArr); num_options = cupsAddOption("page-top", Tcl_GetString(listArr[0]), num_options, &options); num_options = cupsAddOption("page-left", Tcl_GetString(listArr[1]), num_options, &options); num_options = cupsAddOption("page-bottom", Tcl_GetString(listArr[2]), num_options, &options); num_options = cupsAddOption("page-right", Tcl_GetString(listArr[3]), num_options, &options); } if (optionsObj) { Tcl_DictSearch search; int done = 0; Tcl_Obj *key, *value; for (Tcl_DictObjFirst(interp, optionsObj, &search, &key, &value, &done) ; !done ; Tcl_DictObjNext(&search, &key, &value, &done)) { num_options = cupsAddOption(Tcl_GetString(key), Tcl_GetString(value), num_options, &options); } } /* prettyprint mess with the default values if set, so we force it */ if (tzoom != 1.0 || pprint) { char cpibuf[TCL_DOUBLE_SPACE + 1]; char lpibuf[TCL_DOUBLE_SPACE + 1]; Tcl_PrintDouble(interp, 10.0 / tzoom, cpibuf); Tcl_PrintDouble(interp, 6.0 / tzoom, lpibuf); num_options = cupsAddOption("cpi", cpibuf, num_options, &options); num_options = cupsAddOption("lpi", lpibuf, num_options, &options); } /* set title and format */ if (!title) { title = "Tk print job"; } if (!format) { format = CUPS_FORMAT_AUTO; } info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT, printer); if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, printer, info, &job_id, title, num_options, options) != IPP_STATUS_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("Error creating job: \"%s\"", cupsLastErrorString())); result = TCL_ERROR; goto cleanup; } buffer = Tcl_GetByteArrayFromObj(objv[3], &buflen); if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, printer, info, job_id, "(stdin)", format, 0, NULL, 1) != HTTP_STATUS_CONTINUE) { // Can't start document Tcl_SetObjResult(interp, Tcl_ObjPrintf("Error starting document: \"%s\"", cupsLastErrorString())); result = TCL_ERROR; goto cleanup; } if (cupsWriteRequestData(CUPS_HTTP_DEFAULT,(char *) buffer, buflen) != HTTP_STATUS_CONTINUE) { // some error ocurred Tcl_SetObjResult(interp, Tcl_ObjPrintf("Error writing data: \"%s\"", cupsLastErrorString())); result = TCL_ERROR; goto cleanup; } if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, printer, info) == IPP_STATUS_OK) { // all OK Tcl_SetObjResult(interp, Tcl_NewIntObj(job_id)); } else { // some error ocurred Tcl_SetObjResult(interp, Tcl_ObjPrintf("Error finishing document: \"%s\"", cupsLastErrorString())); result = TCL_ERROR; goto cleanup; } cleanup: cupsFreeDestInfo(info); cupsFreeOptions(num_options, options); cupsFreeDests(1, printer); return result; } static Tcl_Size ParseEnumOptions( void *clientData, Tcl_Interp *interp, TCL_UNUSED(Tcl_Size), Tcl_Obj *const *objv, void *dstPtr) { int index; const char **dest = (const char **) dstPtr; struct ParseData *pdata = (struct ParseData *)clientData; if (Tcl_GetIndexFromObjStruct(interp, objv[0], pdata->optionTable, sizeof(struct CupsOptions), pdata->message, 0, &index) != TCL_OK) { return -1; } *dest = pdata->optionTable[index].cupsName; return 1; } static Tcl_Size ParseOptions( TCL_UNUSED(void *), Tcl_Interp *interp, TCL_UNUSED(Tcl_Size), Tcl_Obj *const *objv, void *dstPtr) { Tcl_Obj **objPtr = (Tcl_Obj **) dstPtr; Tcl_Size n; /* check for a valid dictionary */ if (Tcl_DictObjSize(NULL, objv[0], &n) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_NewStringObj("options must be a proper" "dictionary", -1)); return -1; } *objPtr = objv[0]; return 1; } static Tcl_Size ParseMargins( TCL_UNUSED(void *), Tcl_Interp *interp, TCL_UNUSED(Tcl_Size), Tcl_Obj *const *objv, void *dstPtr) { Tcl_Obj **objPtr = (Tcl_Obj **) dstPtr; Tcl_Obj **listArr; Tcl_Size n; int i; if (Tcl_ListObjGetElements(NULL, objv[0], &n, &listArr) != TCL_OK || n != 4 || Tcl_GetIntFromObj(NULL, listArr[0], &i) != TCL_OK || Tcl_GetIntFromObj(NULL, listArr[1], &i) != TCL_OK || Tcl_GetIntFromObj(NULL, listArr[2], &i) != TCL_OK || Tcl_GetIntFromObj(NULL, listArr[3], &i) != TCL_OK ) { Tcl_SetObjResult(interp, Tcl_NewStringObj("margins must be a list " "of four integers: top left bottom right" , -1)); return -1; } *objPtr = objv[0]; return 1; } static Tcl_Size ParseNup( TCL_UNUSED(void *), Tcl_Interp *interp, TCL_UNUSED(Tcl_Size), Tcl_Obj *const *objv, void *dstPtr) { const char **nup = (const char **) dstPtr; int n; if (Tcl_GetIntFromObj(NULL, objv[0], &n) != TCL_OK || (n != 1 && n != 2 && n != 4 && n != 6 && n != 9 && n != 16) ) { Tcl_SetObjResult(interp, Tcl_NewStringObj("wrong number-up value: " "should be 1, 2, 4, 6, 9 or 16", -1)); return -1; } *nup = Tcl_GetString(objv[0]); return 1; } #endif /*HAVE_CUPS*/ int #ifdef HAVE_CUPS Cups_Init(Tcl_Interp *interp) { Tcl_Namespace *ns; ns = Tcl_FindNamespace(interp, "::tk::print", NULL, TCL_GLOBAL_ONLY); if (!ns) ns = Tcl_CreateNamespace(interp, "::tk::print", NULL, NULL); Tcl_CreateObjCommand(interp, "::tk::print::cups", Cups_Cmd, NULL, NULL); Tcl_Export(interp, ns, "cups", 0); #else Cups_Init(TCL_UNUSED(Tcl_Interp *)) { /* Do nothing */ #endif return TCL_OK; } |
Changes to unix/tkUnixRFont.c.
︙ | ︙ | |||
86 87 88 89 90 91 92 | * *------------------------------------------------------------------------- */ static Tcl_Size utf8ToUcs4(const char *source, FcChar32 *c, Tcl_Size numBytes) { if (numBytes >= 6) { | | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | * *------------------------------------------------------------------------- */ static Tcl_Size utf8ToUcs4(const char *source, FcChar32 *c, Tcl_Size numBytes) { if (numBytes >= 6) { return TkUtfToUniChar(source, (int *)c); } return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes); } void TkpFontPkgInit( TCL_UNUSED(TkMainInfo *)) /* The application being created. */ |
︙ | ︙ | |||
750 751 752 753 754 755 756 | -1, -1, -1, InitFontErrorProc, &errorFlag); curX = 0; curByte = 0; sawNonSpace = 0; while (numBytes > 0) { int unichar; | | | 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | -1, -1, -1, InitFontErrorProc, &errorFlag); curX = 0; curByte = 0; sawNonSpace = 0; while (numBytes > 0) { int unichar; clen = TkUtfToUniChar(source, &unichar); c = (FcChar32) unichar; if (clen <= 0) { /* * This can't happen (but see #1185640) */ |
︙ | ︙ | |||
951 952 953 954 955 956 957 | UnixFtFont *fontPtr = (UnixFtFont *) tkfont; XGCValues values; XftColor *xftcolor; int clen, nspec, xStart = x; XftGlyphFontSpec specs[NUM_SPEC]; XGlyphInfo metrics; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 | UnixFtFont *fontPtr = (UnixFtFont *) tkfont; XGCValues values; XftColor *xftcolor; int clen, nspec, xStart = x; XftGlyphFontSpec specs[NUM_SPEC]; XGlyphInfo metrics; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (fontPtr->ftDraw == 0) { DEBUG(("Switch to drawable 0x%lx\n", drawable)); fontPtr->ftDraw = XftDrawCreate(display, drawable, DefaultVisual(display, fontPtr->screen), DefaultColormap(display, fontPtr->screen)); } else { |
︙ | ︙ | |||
1084 1085 1086 1087 1088 1089 1090 | const int maxCoord = 0x7FFF;/* Xft coordinates are 16 bit values */ const int minCoord = -maxCoord-1; UnixFtFont *fontPtr = (UnixFtFont *) tkfont; XGCValues values; XftColor *xftcolor; int xStart = x, yStart = y; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 | const int maxCoord = 0x7FFF;/* Xft coordinates are 16 bit values */ const int minCoord = -maxCoord-1; UnixFtFont *fontPtr = (UnixFtFont *) tkfont; XGCValues values; XftColor *xftcolor; int xStart = x, yStart = y; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); #ifdef XFT_HAS_FIXED_ROTATED_PLACEMENT int clen, nglyph; FT_UInt glyphs[NUM_SPEC]; XGlyphInfo metrics; XftFont *currentFtFont; int originX, originY; |
︙ | ︙ | |||
1165 1166 1167 1168 1169 1170 1171 | * NOTE: * The whole algorithm has a design problem, the choice of * NUM_SPEC is arbitrary, and so the inter-glyph spacing could * look arbitrary. This algorithm has to draw the whole string * at once (or whole blocks with same font), this requires a * dynamic 'glyphs' array. In case of overflow the array has to * be divided until the maximal string will fit. (GC) | | | | | | 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | * NOTE: * The whole algorithm has a design problem, the choice of * NUM_SPEC is arbitrary, and so the inter-glyph spacing could * look arbitrary. This algorithm has to draw the whole string * at once (or whole blocks with same font), this requires a * dynamic 'glyphs' array. In case of overflow the array has to * be divided until the maximal string will fit. (GC) * Given the resolution of current displays though, this should * not be a huge issue since NUM_SPEC is 1024 and thus able to * cover about 6000 pixels for a 6 pixel wide font (which is * a very small barely readable font) */ LOCK; XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont, originX, originY, glyphs, nglyph); UNLOCK; } |
︙ | ︙ | |||
1424 1425 1426 1427 1428 1429 1430 | } void TkUnixSetXftClipRegion( Region clipRegion) /* The clipping region to install. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 | } void TkUnixSetXftClipRegion( Region clipRegion) /* The clipping region to install. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->clipRegion = clipRegion; } /* * Local Variables: * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to unix/tkUnixScale.c.
︙ | ︙ | |||
628 629 630 631 632 633 634 | if (scalePtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, scalePtr->bgBorder, scalePtr->highlightWidth, scalePtr->highlightWidth, Tk_Width(tkwin) - 2*scalePtr->highlightWidth, Tk_Height(tkwin) - 2*scalePtr->highlightWidth, scalePtr->borderWidth, scalePtr->relief); } | | | 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | if (scalePtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, scalePtr->bgBorder, scalePtr->highlightWidth, scalePtr->highlightWidth, Tk_Width(tkwin) - 2*scalePtr->highlightWidth, Tk_Height(tkwin) - 2*scalePtr->highlightWidth, scalePtr->borderWidth, scalePtr->relief); } if (scalePtr->highlightWidth > 0) { GC gc; if (scalePtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(scalePtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor( Tk_3DBorderColor(scalePtr->highlightBorder), pixmap); |
︙ | ︙ |
Changes to unix/tkUnixScrlbr.c.
︙ | ︙ | |||
124 125 126 127 128 129 130 | * operation. This means that there's no point in time where the on-sreen * image has been cleared. */ pixmap = Tk_GetPixmap(scrollPtr->display, Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); | | | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | * operation. This means that there's no point in time where the on-sreen * image has been cleared. */ pixmap = Tk_GetPixmap(scrollPtr->display, Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); if (scrollPtr->highlightWidth > 0) { GC gc; if (scrollPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(scrollPtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor(scrollPtr->highlightBgColorPtr, pixmap); } |
︙ | ︙ | |||
279 280 281 282 283 284 285 | TkpComputeScrollbarGeometry( TkScrollbar *scrollPtr) /* Scrollbar whose geometry may have * changed. */ { int width, fieldLength; | < < < | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | TkpComputeScrollbarGeometry( TkScrollbar *scrollPtr) /* Scrollbar whose geometry may have * changed. */ { int width, fieldLength; scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin) : Tk_Height(scrollPtr->tkwin); /* * Next line assumes that the arrow area is a square. */ |
︙ | ︙ |
Changes to unix/tkUnixSend.c.
︙ | ︙ | |||
305 306 307 308 309 310 311 | XFree(regPtr->property); regPtr->propLength = 0; regPtr->property = NULL; } XDeleteProperty(dispPtr->display, RootWindow(dispPtr->display, 0), dispPtr->registryProperty); | | | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | XFree(regPtr->property); regPtr->propLength = 0; regPtr->property = NULL; } XDeleteProperty(dispPtr->display, RootWindow(dispPtr->display, 0), dispPtr->registryProperty); XSync(dispPtr->display, False); } Tk_DeleteErrorHandler(handler); /* * Xlib placed an extra null byte after the end of the property, just to * make sure that it is always NULL-terminated. Be sure to include this |
︙ | ︙ | |||
519 520 521 522 523 524 525 | RegClose( NameRegistry *regPtr) /* Pointer to a registry opened with a * previous call to RegOpen. */ { Tk_ErrorHandler handler; handler = Tk_CreateErrorHandler(regPtr->dispPtr->display, -1, -1, -1, | | | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | RegClose( NameRegistry *regPtr) /* Pointer to a registry opened with a * previous call to RegOpen. */ { Tk_ErrorHandler handler; handler = Tk_CreateErrorHandler(regPtr->dispPtr->display, -1, -1, -1, NULL, NULL); if (regPtr->modified) { if (!regPtr->locked && !localData.sendDebug) { Tcl_Panic("The name registry was modified without being locked!"); } XChangeProperty(regPtr->dispPtr->display, RootWindow(regPtr->dispPtr->display, 0), |
︙ | ︙ | |||
1986 1987 1988 1989 1990 1991 1992 | } if (Tcl_GetIndexFromObjStruct(interp, objv[1], testsendOptions, sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } if (index == TESTSEND_BOGUS) { | | | | | 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 | } if (Tcl_GetIndexFromObjStruct(interp, objv[1], testsendOptions, sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } if (index == TESTSEND_BOGUS) { handler = Tk_CreateErrorHandler(winPtr->dispPtr->display, -1, -1, -1, NULL, NULL); XChangeProperty(winPtr->dispPtr->display, RootWindow(winPtr->dispPtr->display, 0), winPtr->dispPtr->registryProperty, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "This is bogus information", 6); Tk_DeleteErrorHandler(handler); } else if (index == TESTSEND_PROP) { int result, actualFormat; unsigned long length, bytesAfter; Atom actualType, propName; char *property, **propertyPtr = &property, *p, *end; Window w; |
︙ | ︙ | |||
2032 2033 2034 2035 2036 2037 2038 | } Tcl_SetObjResult(interp, Tcl_NewStringObj(property, TCL_INDEX_NONE)); } if (property != NULL) { XFree(property); } } else if (Tcl_GetString(objv[4])[0] == 0) { | | | | | | | | 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 | } Tcl_SetObjResult(interp, Tcl_NewStringObj(property, TCL_INDEX_NONE)); } if (property != NULL) { XFree(property); } } else if (Tcl_GetString(objv[4])[0] == 0) { handler = Tk_CreateErrorHandler(winPtr->dispPtr->display, -1, -1, -1, NULL, NULL); XDeleteProperty(winPtr->dispPtr->display, w, propName); Tk_DeleteErrorHandler(handler); } else { Tcl_DString tmp; Tcl_DStringInit(&tmp); for (p = Tcl_DStringAppend(&tmp, Tcl_GetString(objv[4]), (int) strlen(Tcl_GetString(objv[4]))); *p != 0; p++) { if (*p == '\n') { *p = 0; } } handler = Tk_CreateErrorHandler(winPtr->dispPtr->display, -1, -1, -1, NULL, NULL); XChangeProperty(winPtr->dispPtr->display, w, propName, XA_STRING, 8, PropModeReplace, (unsigned char*)Tcl_DStringValue(&tmp), p-Tcl_DStringValue(&tmp)); Tk_DeleteErrorHandler(handler); Tcl_DStringFree(&tmp); } } else if (index == TESTSEND_SERIAL) { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(localData.sendSerial+1)); } return TCL_OK; } |
︙ | ︙ |
Changes to unix/tkUnixSysTray.c.
︙ | ︙ | |||
86 87 88 89 90 91 92 | TKU_AddInput( Display* dpy, Window win, long add_to_mask) { XWindowAttributes xswa; TKU_NO_BAD_WINDOW_BEGIN(dpy) | | | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | TKU_AddInput( Display* dpy, Window win, long add_to_mask) { XWindowAttributes xswa; TKU_NO_BAD_WINDOW_BEGIN(dpy) XGetWindowAttributes(dpy,win,&xswa); XSelectInput(dpy,win,xswa.your_event_mask|add_to_mask); TKU_NO_BAD_WINDOW_END } /* Get Tk Window wrapper (make it exist if ny) */ static Tk_Window TKU_Wrapper( Tk_Window w, |
︙ | ︙ | |||
257 258 259 260 261 262 263 | int wcmd; int i; XWindowAttributes xwa; Window bogus; int msgid; enum {XWC_CONFIGURE = 0, XWC_CGET, XWC_BALLOON, XWC_CANCEL, | | | | | | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | int wcmd; int i; XWindowAttributes xwa; Window bogus; int msgid; enum {XWC_CONFIGURE = 0, XWC_CGET, XWC_BALLOON, XWC_CANCEL, XWC_BBOX, XWC_DOCKED, XWC_ORIENTATION}; const char *st_wcmd[] = {"configure", "cget", "balloon", "cancel", "bbox", "docked", "orientation", NULL}; long timeout = 0; Tcl_Obj* optionValue; if (objc<2) { Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?args?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], st_wcmd, "subcommand", TCL_EXACT, &wcmd) != TCL_OK) { return TCL_ERROR; } switch (wcmd) { case XWC_CONFIGURE: return TrayIconConfigureMethod(icon,interp,objc-2,objv+2,0); case XWC_CGET: if (objc != 3) { Tcl_WrongNumArgs(interp,2,objv,"option"); return TCL_ERROR; } optionValue = Tk_GetOptionValue(interp,(char*)icon, icon->options,objv[2],icon->tkwin); if (optionValue) { Tcl_SetObjResult(interp,optionValue); return TCL_OK; } else { return TCL_ERROR; } |
︙ | ︙ | |||
319 320 321 322 323 324 325 | if (msgid) CancelBalloon(icon,msgid); return TCL_OK; case XWC_BBOX: if (icon->drawingWin) { XGetWindowAttributes(Tk_Display(icon->drawingWin), | | | | | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | if (msgid) CancelBalloon(icon,msgid); return TCL_OK; case XWC_BBOX: if (icon->drawingWin) { XGetWindowAttributes(Tk_Display(icon->drawingWin), TKU_XID(icon->drawingWin), &xwa); XTranslateCoordinates(Tk_Display(icon->drawingWin), TKU_XID(icon->drawingWin), xwa.root, 0,0, &icon->x, &icon->y, &bogus); bbox[0] = icon->x; bbox[1] = icon->y; bbox[2] = bbox[0] + icon->width - 1; bbox[3] = bbox[1] + icon->height - 1; } bboxObj = Tcl_NewObj(); for (i = 0; i < 4; ++i) { |
︙ | ︙ | |||
536 537 538 539 540 541 542 | unsigned long retNitems, retBytesAfter; unsigned char *retProp = NULL; Visual *match = NULL; int depth = 0; Colormap cmap = None; TKU_NO_BAD_WINDOW_BEGIN(Tk_Display(icon->tkwin)) | | | | | | | | | | | | 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | unsigned long retNitems, retBytesAfter; unsigned char *retProp = NULL; Visual *match = NULL; int depth = 0; Colormap cmap = None; TKU_NO_BAD_WINDOW_BEGIN(Tk_Display(icon->tkwin)) XGetWindowProperty(Tk_Display(icon->tkwin), icon->trayManager, icon->a_NET_SYSTEM_TRAY_VISUAL, /* offset */ 0, /* length */ 1, /* delete */ False, /* type */ XA_VISUALID, &retType, &retFormat, &retNitems, &retBytesAfter, &retProp); TKU_NO_BAD_WINDOW_END if (retType == XA_VISUALID && retNitems == 1 && retFormat == 32) { char numeric[256]; snprintf(numeric,256,"%ld",*(long*)retProp); XFree(retProp); match = Tk_GetVisual(icon->interp, icon->tkwin, numeric, &depth, &cmap); } if (match&& depth == 32 && match->red_mask == 0xFF0000UL && match->green_mask == 0x00FF00UL && match->blue_mask == 0x0000FFUL) { icon->bestVisual = match; icon->bestColormap = cmap; |
︙ | ︙ | |||
598 599 600 601 602 603 604 | saved = Tcl_SaveInterpState(icon->interp, TCL_OK); /* Use the same name (tail) as the widget name, to enable * name-based icon management for supporting trays, as promised by * the docs. */ tkwin = icon->drawingWin = Tk_CreateWindow(icon->interp, icon->tkwin, | | | | | | | 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | saved = Tcl_SaveInterpState(icon->interp, TCL_OK); /* Use the same name (tail) as the widget name, to enable * name-based icon management for supporting trays, as promised by * the docs. */ tkwin = icon->drawingWin = Tk_CreateWindow(icon->interp, icon->tkwin, Tk_Name(icon->tkwin), ""); if (tkwin) { Tk_SetClass(icon->drawingWin,icon->classString); Tk_CreateEventHandler(icon->drawingWin,ExposureMask|StructureNotifyMask| ButtonPressMask|ButtonReleaseMask| EnterWindowMask|LeaveWindowMask|PointerMotionMask, TrayIconEvent, icon); if(icon->bestVisual) { Tk_SetWindowVisual(icon->drawingWin,icon->bestVisual, 32,icon->bestColormap); icon->flags |= ICON_FLAG_ARGB32; Tk_SetWindowBackground(tkwin, 0); } else { Tk_SetWindowBackgroundPixmap(tkwin, ParentRelative); icon->flags &= ~ICON_FLAG_ARGB32; } Tk_MakeWindowExist(tkwin); |
︙ | ︙ | |||
705 706 707 708 709 710 711 | TrayIconRequestSize( DockIcon* icon, int w, int h) { if (icon->drawingWin) { if (icon->requestedWidth != w || | | | 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | TrayIconRequestSize( DockIcon* icon, int w, int h) { if (icon->drawingWin) { if (icon->requestedWidth != w || icon->requestedHeight != h) { Tk_SetMinimumRequestSize(icon->drawingWin,w,h); Tk_GeometryRequest(icon->drawingWin,w,h); Tk_SetGrid(icon->drawingWin,1,1,w,h); icon->requestedWidth = w; icon->requestedHeight = h; } } else { |
︙ | ︙ | |||
894 895 896 897 898 899 900 | if (icon->flags & ICON_FLAG_ARGB32) { /* ARGB32 redraw: never use a ParentRelative method, and no need to clear window except FIXME when its size changed. Draw on the offscreen pixmap instead, then copy to the window. */ if (icon->offscreenPixmap == None) { icon->offscreenPixmap = Tk_GetPixmap(Tk_Display(icon->drawingWin), | | | | | | 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 | if (icon->flags & ICON_FLAG_ARGB32) { /* ARGB32 redraw: never use a ParentRelative method, and no need to clear window except FIXME when its size changed. Draw on the offscreen pixmap instead, then copy to the window. */ if (icon->offscreenPixmap == None) { icon->offscreenPixmap = Tk_GetPixmap(Tk_Display(icon->drawingWin), Tk_WindowId(icon->drawingWin), w, h, 32); } if (!icon->photo) { icon->photo = Tk_FindPhoto(icon->interp, icon->imageString); } if (!icon->photo && !icon->imageVisualInstance) { Tcl_InterpState saved = Tcl_SaveInterpState(icon->interp, TCL_OK); icon->imageVisualInstance = Tk_GetImage(icon->interp,icon->drawingWin, icon->imageString, IgnoreImageChange, NULL); Tcl_RestoreInterpState(icon->interp,saved); } if (icon->photo && !icon->offscreenImage) { icon->offscreenImage = XGetImage(Tk_Display(icon->drawingWin), icon->offscreenPixmap, 0, 0, w, h, AllPlanes, ZPixmap); } if (icon->offscreenGC == None) { XGCValues gcv; gcv.function = GXcopy; gcv.plane_mask = AllPlanes; gcv.foreground = 0; gcv.background = 0; icon->offscreenGC = Tk_GetGC(icon->drawingWin, GCFunction|GCPlaneMask|GCForeground|GCBackground, &gcv); } if (icon->flags & ICON_FLAG_DIRTY_EDGES) { XClearWindow(Tk_Display(icon->drawingWin), TKU_XID(icon->drawingWin)); icon->flags &= ~ICON_FLAG_DIRTY_EDGES; } if (icon->photo) { Tk_PhotoImageBlock pib; |
︙ | ︙ | |||
963 964 965 966 967 968 969 | } else { XFillRectangle(Tk_Display(icon->drawingWin), icon->offscreenPixmap, icon->offscreenGC, 0,0,w,h); if (icon->imageVisualInstance) { Tk_RedrawImage(icon->imageVisualInstance, | | | | | | | | | | | 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 | } else { XFillRectangle(Tk_Display(icon->drawingWin), icon->offscreenPixmap, icon->offscreenGC, 0,0,w,h); if (icon->imageVisualInstance) { Tk_RedrawImage(icon->imageVisualInstance, 0,0,w,h, icon->offscreenPixmap, 0,0); } } XCopyArea(Tk_Display(icon->drawingWin), icon->offscreenPixmap, TKU_XID(icon->drawingWin), icon->offscreenGC, imgx,imgy,outw,outh,outx,outy); } else { /* Non-argb redraw: clear window and draw an image over it. For photos it gives a correct alpha blending with a parent window background, even if it's a fancy pixmap (proved to work with lxpanel fancy backgrounds). */ XClearWindow(Tk_Display(icon->drawingWin), TKU_XID(icon->drawingWin)); if (icon->image && icon->visible) { Tk_RedrawImage(icon->image,imgx,imgy,outw,outh, TKU_XID(icon->drawingWin), outx, outy); } } } } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
1082 1083 1084 1085 1086 1087 1088 | if (icon->drawingWin) { switch(ev->type) { case ReparentNotify: /* With virtual roots and screen roots etc, the only way to check for reparent-to-root is to ask for this root first */ XGetWindowAttributes(ev->xreparent.display, | | | | 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 | if (icon->drawingWin) { switch(ev->type) { case ReparentNotify: /* With virtual roots and screen roots etc, the only way to check for reparent-to-root is to ask for this root first */ XGetWindowAttributes(ev->xreparent.display, ev->xreparent.window, &attr); if (attr.root == ev->xreparent.parent) { /* upon reparent to root, */ if (icon->drawingWin) { /* we were sent away to root */ TKU_WmWithdraw(icon->drawingWin,icon->interp); if (icon->myManager) Tk_SendVirtualEvent(icon->tkwin,Tk_GetUid("IconDestroy"), NULL); icon->myManager = None; } } /* Reparenting into some other embedder is theoretically possible, * and everything would just work in this case. */ break; } } } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
1152 1153 1154 1155 1156 1157 1158 | icon->wrapper = None; icon->myManager = None; break; case ConfigureNotify: Tk_SendVirtualEvent(icon->tkwin,Tk_GetUid("IconConfigure"), NULL); if (icon->width != ev->xconfigure.width || | | | 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | icon->wrapper = None; icon->myManager = None; break; case ConfigureNotify: Tk_SendVirtualEvent(icon->tkwin,Tk_GetUid("IconConfigure"), NULL); if (icon->width != ev->xconfigure.width || icon->height != ev->xconfigure.height) { icon->width = ev->xconfigure.width; icon->height = ev->xconfigure.height; icon->flags |= ICON_FLAG_DIRTY_EDGES; EventuallyRedrawIcon(icon); } RetargetEvent(icon,ev); break; |
︙ | ︙ | |||
1276 1277 1278 1279 1280 1281 1282 | ev.xclient.data.l[0] = CurrentTime; ev.xclient.data.l[1] = SYSTEM_TRAY_BEGIN_MESSAGE; ev.xclient.data.l[2] = timeout; ev.xclient.data.l[3] = length; ev.xclient.data.l[4] = ++icon->msgid; TKU_NO_BAD_WINDOW_BEGIN(Tk_Display(icon->tkwin)) XSendEvent(dpy, icon->myManager , True, StructureNotifyMask|SubstructureNotifyMask, &ev); | | | | | | 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 | ev.xclient.data.l[0] = CurrentTime; ev.xclient.data.l[1] = SYSTEM_TRAY_BEGIN_MESSAGE; ev.xclient.data.l[2] = timeout; ev.xclient.data.l[3] = length; ev.xclient.data.l[4] = ++icon->msgid; TKU_NO_BAD_WINDOW_BEGIN(Tk_Display(icon->tkwin)) XSendEvent(dpy, icon->myManager , True, StructureNotifyMask|SubstructureNotifyMask, &ev); XSync(dpy, False); /* Sending message elements */ while (length>0) { ev.type = ClientMessage; ev.xclient.window = icon->wrapper; ev.xclient.message_type = icon->a_NET_SYSTEM_TRAY_MESSAGE_DATA; ev.xclient.format = 8; memset(ev.xclient.data.b,0,20); strncpy(ev.xclient.data.b,utf8msg,length<20?length:20); XSendEvent(dpy, icon->myManager, True, StructureNotifyMask|SubstructureNotifyMask, &ev); XSync(dpy,False); utf8msg += 20; length -= 20; } TKU_NO_BAD_WINDOW_END; return icon->msgid; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
1336 1337 1338 1339 1340 1341 1342 | ev.xclient.message_type = icon->a_NET_SYSTEM_TRAY_OPCODE; ev.xclient.format = 32; ev.xclient.data.l[0] = CurrentTime; ev.xclient.data.l[1] = SYSTEM_TRAY_CANCEL_MESSAGE; ev.xclient.data.l[2] =msgid; TKU_NO_BAD_WINDOW_BEGIN(Tk_Display(icon->tkwin)) XSendEvent(dpy, icon->myManager , True, | | | 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 | ev.xclient.message_type = icon->a_NET_SYSTEM_TRAY_OPCODE; ev.xclient.format = 32; ev.xclient.data.l[0] = CurrentTime; ev.xclient.data.l[1] = SYSTEM_TRAY_CANCEL_MESSAGE; ev.xclient.data.l[2] =msgid; TKU_NO_BAD_WINDOW_BEGIN(Tk_Display(icon->tkwin)) XSendEvent(dpy, icon->myManager , True, StructureNotifyMask|SubstructureNotifyMask, &ev); TKU_NO_BAD_WINDOW_END } /* *---------------------------------------------------------------------- * * IconGenericHandler -- |
︙ | ︙ | |||
1427 1428 1429 1430 1431 1432 1433 | * If should be invisible and managed, * real-window is simply destroyed. * If should be invisible and not managed, * generic handler should be abandoned. */ if (mask & ICON_CONF_XEMBED) { if (icon->myManager == None && | | | | | | 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 | * If should be invisible and managed, * real-window is simply destroyed. * If should be invisible and not managed, * generic handler should be abandoned. */ if (mask & ICON_CONF_XEMBED) { if (icon->myManager == None && icon->trayManager != None && icon->docked) { CheckArgbVisual(icon); if (icon->drawingWin && ((icon->bestVisual && !(icon->flags & ICON_FLAG_ARGB32)) || (!icon->bestVisual && (icon->flags & ICON_FLAG_ARGB32)))) { icon->myManager = None; icon->wrapper = None; icon->requestedWidth = icon->requestedHeight = 0; Tk_DestroyWindow(icon->drawingWin); icon->drawingWin = NULL; } if (!icon->drawingWin) { CreateTrayIconWindow(icon); } if (icon->drawingWin) { DockToManager(icon); } } if (icon->myManager != None && icon->drawingWin != NULL && !icon->docked) { Tk_DestroyWindow(icon->drawingWin); icon->drawingWin = NULL; icon->myManager = None; icon->wrapper = None; } if (icon->drawingWin) { XembedSetState(icon, icon->visible ? XEMBED_MAPPED : 0); |
︙ | ︙ | |||
1497 1498 1499 1500 1501 1502 1503 | { Tk_SavedOptions saved; Tk_Image newImage = NULL; int mask = 0; if (objc <= 1 && !(addflags & ICON_CONF_FIRST_TIME)) { Tcl_Obj* info = Tk_GetOptionInfo(interp, (char*)icon, icon->options, | | | | | 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 | { Tk_SavedOptions saved; Tk_Image newImage = NULL; int mask = 0; if (objc <= 1 && !(addflags & ICON_CONF_FIRST_TIME)) { Tcl_Obj* info = Tk_GetOptionInfo(interp, (char*)icon, icon->options, objc? objv[0] : NULL, icon->tkwin); if (info) { Tcl_SetObjResult(interp,info); return TCL_OK; } else { return TCL_ERROR; /* msg by Tk_GetOptionInfo */ } } if (Tk_SetOptions(interp, icon,icon->options,objc,objv, icon->tkwin,&saved,&mask) != TCL_OK) { return TCL_ERROR; /* msg by Tk_SetOptions */ } mask |= addflags; /* now check option validity */ if (mask & ICON_CONF_IMAGE) { if (icon->imageString) { newImage = Tk_GetImage(interp, icon->tkwin, icon->imageString, TrayIconImageChanged, icon); if (!newImage) { Tk_RestoreSavedOptions(&saved); return TCL_ERROR; /* msg by Tk_GetImage */ } } if (icon->image) { Tk_FreeImage(icon->image); |
︙ | ︙ | |||
1604 1605 1606 1607 1608 1609 1610 | goto handleErrors; } /* It's not a toplevel window by now. It really doesn't matter, * because it's not really shown. */ icon->tkwin = Tk_CreateWindowFromPath(interp, mainWindow, | | | | | | | 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 | goto handleErrors; } /* It's not a toplevel window by now. It really doesn't matter, * because it's not really shown. */ icon->tkwin = Tk_CreateWindowFromPath(interp, mainWindow, Tcl_GetString(objv[1]),""); if (icon->tkwin == NULL) { goto handleErrors; } /* Subscribe to StructureNotify */ TKU_AddInput(Tk_Display(icon->tkwin), RootWindowOfScreen(Tk_Screen(icon->tkwin)),StructureNotifyMask); TKU_AddInput(Tk_Display(icon->tkwin), RootWindow(Tk_Display(icon->tkwin),0),StructureNotifyMask); /* Spec says "screen 0" not "default", but... */ TKU_AddInput(Tk_Display(icon->tkwin), DefaultRootWindow(Tk_Display(icon->tkwin)),StructureNotifyMask); /* Early tracking of DestroyNotify is essential */ Tk_CreateEventHandler(icon->tkwin,StructureNotifyMask, UserIconEvent, icon); /* Now try setting options */ icon->options = Tk_CreateOptionTable(interp,IconOptionSpec); /* Class name is used for retrieving defaults, so... */ Tk_SetClass(icon->tkwin, Tk_GetUid("TrayIcon")); if (Tk_InitOptions(interp,(char*)icon,icon->options,icon->tkwin) != TCL_OK) { goto handleErrors; |
︙ | ︙ | |||
1649 1650 1651 1652 1653 1654 1655 | XSelectInput(Tk_Display(icon->tkwin),icon->trayManager, StructureNotifyMask); } Tk_CreateGenericHandler(IconGenericHandler, icon); if (objc>3) { if (TrayIconConfigureMethod(icon, interp, objc-2, objv+2, | | | | 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 | XSelectInput(Tk_Display(icon->tkwin),icon->trayManager, StructureNotifyMask); } Tk_CreateGenericHandler(IconGenericHandler, icon); if (objc>3) { if (TrayIconConfigureMethod(icon, interp, objc-2, objv+2, ICON_CONF_XEMBED|ICON_CONF_IMAGE|ICON_CONF_FIRST_TIME) != TCL_OK) { goto handleErrors; } } icon->widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[1]), TrayIconObjectCmd, icon, TrayIconDeleteProc); /* Sometimes a command just can't be created... */ if (!icon->widgetCmd) { goto handleErrors; } Tcl_SetObjResult(interp,objv[1]); |
︙ | ︙ | |||
1702 1703 1704 1705 1706 1707 1708 | */ int Tktray_Init( Tcl_Interp *interp) { Tcl_CreateObjCommand(interp, "::tk::systray::_systray", | | | 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 | */ int Tktray_Init( Tcl_Interp *interp) { Tcl_CreateObjCommand(interp, "::tk::systray::_systray", TrayIconCreateCmd, Tk_MainWindow(interp), NULL); return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 79 * coding: utf-8 * End: */ |
Changes to unix/tkUnixWm.c.
︙ | ︙ | |||
1825 1826 1827 1828 1829 1830 1831 | TkFocusJoin(winPtr); Tk_UnmapWindow(frameWin); TkWmDeadWindow(winPtr); winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); RemapWindows(winPtr, winPtr->parentPtr); | | | | | | 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 | TkFocusJoin(winPtr); Tk_UnmapWindow(frameWin); TkWmDeadWindow(winPtr); winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); RemapWindows(winPtr, winPtr->parentPtr); /* * Make sure wm no longer manages this window */ Tk_ManageGeometry(frameWin, NULL, NULL); /* * Flags (above) must be cleared before calling TkMapTopFrame (below). */ TkMapTopFrame(frameWin); } else { |
︙ | ︙ | |||
2488 2489 2490 2491 2492 2493 2494 | memset(iconPropertyData, 0, sizeof(unsigned long) * size); for (i = 3 + isDefault; i < objc; i++) { photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i])); if (photo == NULL) { ckfree(iconPropertyData); Tcl_SetObjResult(interp, Tcl_ObjPrintf( | | | 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 | memset(iconPropertyData, 0, sizeof(unsigned long) * size); for (i = 3 + isDefault; i < objc; i++) { photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i])); if (photo == NULL) { ckfree(iconPropertyData); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "failed to create an iconphoto with image \"%s\"", Tcl_GetString(objv[i]))); Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", "IMAGE", NULL); return TCL_ERROR; } Tk_PhotoGetSize(photo, &width, &height); Tk_PhotoGetImage(photo, &block); |
︙ | ︙ | |||
5843 5844 5845 5846 5847 5848 5849 | static int PointInWindow( int x, int y, WmInfo *wmPtr) { XWindowChanges changes = wmPtr->winPtr->changes; return (x >= changes.x && | | | | | 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 | static int PointInWindow( int x, int y, WmInfo *wmPtr) { XWindowChanges changes = wmPtr->winPtr->changes; return (x >= changes.x && x < changes.x + changes.width && y >= changes.y - wmPtr->menuHeight && y < changes.y + changes.height); } Tk_Window Tk_CoordsToWindow( int rootX, int rootY, /* Coordinates of point in root window. If a * virtual-root window manager is in use, * these coordinates refer to the virtual |
︙ | ︙ | |||
5918 5919 5920 5921 5922 5923 5924 | } if (child == None) { Tk_DeleteErrorHandler(handler); return NULL; } for (wmPtr = (WmInfo *) dispPtr->firstWmPtr; wmPtr != NULL; wmPtr = wmPtr->nextPtr) { | | | | | | | | | | | | | | | | | | | | | | | | 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 | } if (child == None) { Tk_DeleteErrorHandler(handler); return NULL; } for (wmPtr = (WmInfo *) dispPtr->firstWmPtr; wmPtr != NULL; wmPtr = wmPtr->nextPtr) { if (wmPtr->winPtr->mainPtr == NULL) { continue; } if (child == wmPtr->reparent) { if (PointInWindow(x, y, wmPtr)) { goto gotToplevel; } else { /* * Return NULL if the point is in the title bar or border. */ return NULL; } } if (wmPtr->wrapperPtr != NULL) { if (child == wmPtr->wrapperPtr->window) { goto gotToplevel; } else if (wmPtr->winPtr->flags & TK_EMBEDDED && Tk_GetOtherWindow((Tk_Window)wmPtr->winPtr) == NULL) { /* * This toplevel is embedded in a window belonging to * a different application. */ int rx, ry; Tk_GetRootCoords((Tk_Window) wmPtr->winPtr, &rx, &ry); childX -= rx; childY -= ry; goto gotToplevel; } } else if (child == wmPtr->winPtr->window) { goto gotToplevel; } } x = childX; y = childY; parent = window; |
︙ | ︙ | |||
6046 6047 6048 6049 6050 6051 6052 | return (Tk_Window) nextPtr; } wmPtr = winPtr->wmInfoPtr; childX = x; childY = y; goto gotToplevel; } else { | | | | | 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 | return (Tk_Window) nextPtr; } wmPtr = winPtr->wmInfoPtr; childX = x; childY = y; goto gotToplevel; } else { winPtr = nextPtr; } } if (winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr) { return NULL; } return (Tk_Window) winPtr; } /* *---------------------------------------------------------------------- * |
︙ | ︙ |
Changes to win/Makefile.in.
︙ | ︙ | |||
257 258 259 260 261 262 263 | ZIP_INSTALL_OBJS = @ZIP_INSTALL_OBJS@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ -I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" \ | | > | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | ZIP_INSTALL_OBJS = @ZIP_INSTALL_OBJS@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ -I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" \ ${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=3 -DUSE_TCL_STUBS CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of # "install" around; better to use the install-sh script that comes # with the distribution, which is slower but guaranteed to work. INSTALL = cp INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} WISH_OBJS = \ winMain.$(OBJEXT) TKTEST_OBJS = \ tkSquare.$(OBJEXT) \ tkTest.$(OBJEXT) \ tkOldTest.$(OBJEXT) \ tkWinTest.$(OBJEXT) XLIB_OBJS = \ xcolors.$(OBJEXT) \ xdraw.$(OBJEXT) \ xgc.$(OBJEXT) \ ximage.$(OBJEXT) \ |
︙ | ︙ | |||
760 761 762 763 764 765 766 767 768 769 770 771 772 773 | testMain.$(OBJEXT): winMain.c $(CC) -c $(CC_SWITCHES) -DTK_TEST -DUNICODE=1 -D_UNICODE=1 @DEPARG@ $(CC_OBJNAME) tkTest.$(OBJEXT): tkTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkWinTest.$(OBJEXT): tkWinTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkSquare.$(OBJEXT): tkSquare.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkStubLib.$(OBJEXT): tkStubLib.c | > > > | 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 | testMain.$(OBJEXT): winMain.c $(CC) -c $(CC_SWITCHES) -DTK_TEST -DUNICODE=1 -D_UNICODE=1 @DEPARG@ $(CC_OBJNAME) tkTest.$(OBJEXT): tkTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkOldTest.$(OBJEXT): tkOldTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkWinTest.$(OBJEXT): tkWinTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkSquare.$(OBJEXT): tkSquare.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkStubLib.$(OBJEXT): tkStubLib.c |
︙ | ︙ |
Changes to win/README.
|
| | | 1 2 3 4 5 6 7 8 | Tk 8.7 for Windows Originally by Scott Stanton while at Sun Microsystems Labs This is the directory where you configure and compile the Windows version of Tk. This directory also contains source files for Tk that are specific to Microsoft Windows. The rest of this file contains information specific to the Windows version of Tk. |
︙ | ︙ |
Changes to win/configure.
1 2 | #! /bin/sh # Guess values for system-dependent variables and create Makefiles. | | | 1 2 3 4 5 6 7 8 9 10 | #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for tk 8.7. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation |
︙ | ︙ | |||
597 598 599 600 601 602 603 | subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' | | | | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 | subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' PACKAGE_VERSION='8.7' PACKAGE_STRING='tk 8.7' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="../generic/tk.h" # Factoring default headers for most tests. ac_includes_default="\ #include <stddef.h> |
︙ | ︙ | |||
1351 1352 1353 1354 1355 1356 1357 | # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF | | | 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 | # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures tk 8.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. |
︙ | ︙ | |||
1413 1414 1415 1416 1417 1418 1419 | cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in | | | 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 | cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tk 8.7:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] |
︙ | ︙ | |||
1511 1512 1513 1514 1515 1516 1517 | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF | | | 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tk configure 8.7 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit |
︙ | ︙ | |||
1721 1722 1723 1724 1725 1726 1727 | ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. | | | 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 | ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { |
︙ | ︙ | |||
2403 2404 2405 2406 2407 2408 2409 | # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh | | | | | | 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 | # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh TK_VERSION=8.7 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=7 TK_PATCH_LEVEL="b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then |
︙ | ︙ | |||
4087 4088 4089 4090 4091 4092 4093 | if test "${TCL_MAJOR_VERSION}" -lt 9 ; then | > > > > > | | | | 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 | if test "${TCL_MAJOR_VERSION}" -lt 9 ; then if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 fi if test "${TCL_MINOR_VERSION}" -lt 6; then as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 fi fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. |
︙ | ︙ | |||
5881 5882 5883 5884 5885 5886 5887 | if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${LIBSUFFIX}" else eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${DLLSUFFIX}.a" fi fi | > | > > > | 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 | if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${LIBSUFFIX}" else eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${DLLSUFFIX}.a" fi fi if test "${TCL_MAJOR_VERSION}" -gt 8 ; then eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ; else eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" ; fi # FIXME: All of this var junk needs to be done in tcl.m4 !!!! # I left out the other vars that also need to get defined here. # we also need to double check about spaces in path names TK_LIB_FLAG="-l" if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_LIB_FLAG="${TK_LIB_FLAG}tcl9" fi |
︙ | ︙ | |||
6556 6557 6558 6559 6560 6561 6562 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" | | | 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ |
︙ | ︙ | |||
6611 6612 6613 6614 6615 6616 6617 | _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ | | | 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 | _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ tk config.status 8.7 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." |
︙ | ︙ |
Changes to win/configure.ac.
1 2 3 4 5 | #! /bin/bash -norc # This file is an input file used by the GNU "autoconf" program to # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #! /bin/bash -norc # This file is an input file used by the GNU "autoconf" program to # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. AC_INIT([tk],[8.7]) AC_CONFIG_SRCDIR([../generic/tk.h]) AC_PREREQ([2.69]) # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh TK_VERSION=8.7 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=7 TK_PATCH_LEVEL="b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then |
︙ | ︙ | |||
73 74 75 76 77 78 79 | # Locate and source the tclConfig.sh file. #-------------------------------------------------------------------- SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then | > > > > > | | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | # Locate and source the tclConfig.sh file. #-------------------------------------------------------------------- SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) fi if test "${TCL_MINOR_VERSION}" -lt 6; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) fi fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. |
︙ | ︙ | |||
238 239 240 241 242 243 244 | if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${LIBSUFFIX}" else eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${DLLSUFFIX}.a" fi fi | > | > > > | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${LIBSUFFIX}" else eval "TK_LIB_FILE=${LIBPREFIX}tcl9tk${VER}${DLLSUFFIX}.a" fi fi if test "${TCL_MAJOR_VERSION}" -gt 8 ; then eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ; else eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" ; fi # FIXME: All of this var junk needs to be done in tcl.m4 !!!! # I left out the other vars that also need to get defined here. # we also need to double check about spaces in path names TK_LIB_FLAG="-l" if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_LIB_FLAG="${TK_LIB_FLAG}tcl9" fi |
︙ | ︙ |
Changes to win/makefile.vc.
︙ | ︙ | |||
147 148 149 150 151 152 153 154 155 156 157 158 159 160 | !endif $(TMP_DIR)\wish.res TKTESTOBJS = \ $(TMP_DIR)\testMain.obj \ $(TMP_DIR)\tkSquare.obj \ $(TMP_DIR)\tkTest.obj \ $(TMP_DIR)\tkWinTest.obj \ $(TMP_DIR)\tktest.res XLIBOBJS = \ $(TMP_DIR)\xcolors.obj \ $(TMP_DIR)\xdraw.obj \ $(TMP_DIR)\xgc.obj \ | > | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | !endif $(TMP_DIR)\wish.res TKTESTOBJS = \ $(TMP_DIR)\testMain.obj \ $(TMP_DIR)\tkSquare.obj \ $(TMP_DIR)\tkTest.obj \ $(TMP_DIR)\tkOldTest.obj \ $(TMP_DIR)\tkWinTest.obj \ $(TMP_DIR)\tktest.res XLIBOBJS = \ $(TMP_DIR)\xcolors.obj \ $(TMP_DIR)\xdraw.obj \ $(TMP_DIR)\xgc.obj \ |
︙ | ︙ | |||
332 333 334 335 336 337 338 | # Additional include and C macro definitions for the implicit rules # defined in rules.vc PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)" CONFIG_DEFS =/DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \ /DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \ | | | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | # Additional include and C macro definitions for the implicit rules # defined in rules.vc PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)" CONFIG_DEFS =/DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \ /DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \ /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=3 \ !if $(TTK_SQUARE_WIDGET) /DTTK_SQUARE_WIDGET=1 \ !endif !if $(TK_NO_DEPRECATED) /DTK_NO_DEPRECATED=1 !endif |
︙ | ︙ | |||
613 614 615 616 617 618 619 620 621 622 623 624 625 626 | git rev-parse HEAD >>$(ROOT)\manifest.uuid $(TMP_DIR)\tkUuid.h: $(ROOT)\manifest.uuid copy $(WIN_DIR)\tkUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tkUuid.h $(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkWinTest.obj: $(WIN_DIR)\tkWinTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c $(cc32) $(appcflags_nostubs) -Fo$@ $? | > > > | 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | git rev-parse HEAD >>$(ROOT)\manifest.uuid $(TMP_DIR)\tkUuid.h: $(ROOT)\manifest.uuid copy $(WIN_DIR)\tkUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tkUuid.h $(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkWinTest.obj: $(WIN_DIR)\tkWinTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c $(cc32) $(appcflags_nostubs) -Fo$@ $? |
︙ | ︙ |
Changes to win/nmakehlp.c.
︙ | ︙ | |||
15 16 17 18 19 20 21 | #define _CRT_SECURE_NO_DEPRECATE #include <windows.h> #ifdef _MSC_VER #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") #endif #include <stdio.h> | < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #define _CRT_SECURE_NO_DEPRECATE #include <windows.h> #ifdef _MSC_VER #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") #endif #include <stdio.h> /* * This library is required for x64 builds with _some_ versions of MSVC */ #if defined(_M_IA64) || defined(_M_AMD64) #if _MSC_VER >= 1400 && _MSC_VER < 1500 #pragma comment(lib, "bufferoverflowU") |
︙ | ︙ | |||
87 88 89 90 91 92 93 | SetEnvironmentVariable("LINK", ""); if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, | | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | SetEnvironmentVariable("LINK", ""); if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c <compiler option>\n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForCompilerFeature(argv[2]); |
︙ | ︙ | |||
315 316 317 318 319 320 321 | /* * Look for the commandline warning code in both streams. * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. */ return !(strstr(Out.buffer, "D4002") != NULL | | | | | | | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | /* * Look for the commandline warning code in both streams. * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. */ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL || strstr(Out.buffer, "D9002") != NULL || strstr(Err.buffer, "D9002") != NULL || strstr(Out.buffer, "D2021") != NULL || strstr(Err.buffer, "D2021") != NULL); } static int CheckForLinkerFeature( char **options, int count) { |
︙ | ︙ | |||
597 598 599 600 601 602 603 | * option here to handle autoconf style substitutions. * The substitution file is whitespace and line delimited. The file should * consist of lines matching the regular expression: * \s*\S+\s+\S*$ * * Usage is something like: * nmakehlp -S << $** > $@ | | | | | 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 | * option here to handle autoconf style substitutions. * The substitution file is whitespace and line delimited. The file should * consist of lines matching the regular expression: * \s*\S+\s+\S*$ * * Usage is something like: * nmakehlp -S << $** > $@ * @PACKAGE_NAME@ $(PACKAGE_NAME) * @PACKAGE_VERSION@ $(PACKAGE_VERSION) * << */ static int SubstituteFile( const char *substitutions, const char *filename) { |
︙ | ︙ | |||
723 724 725 726 727 728 729 | { HANDLE hSearch; char path[MAX_PATH+1]; size_t dirlen; int keylen, ret; WIN32_FIND_DATA finfo; | | > | > | > | > | > | | | | | | | > | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | { HANDLE hSearch; char path[MAX_PATH+1]; size_t dirlen; int keylen, ret; WIN32_FIND_DATA finfo; if (dir == NULL || keypath == NULL) { return 2; /* Have no real error reporting mechanism into nmake */ } dirlen = strlen(dir); if ((dirlen + 3) > sizeof(path)) { return 2; } strncpy(path, dir, dirlen); strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */ keylen = strlen(keypath); #if 0 /* This function is not available in Visual C++ 6 */ /* * Use numerics 0 -> FindExInfoStandard, * 1 -> FindExSearchLimitToDirectories, * as these are not defined in Visual C++ 6 */ hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0); #else hSearch = FindFirstFile(path, &finfo); #endif if (hSearch == INVALID_HANDLE_VALUE) { return 1; /* Not found */ } /* Loop through all subdirs checking if the keypath is under there */ ret = 1; /* Assume not found */ do { int sublen; /* * We need to check it is a directory despite the * FindExSearchLimitToDirectories in the above call. See SDK docs */ if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { continue; } sublen = strlen(finfo.cFileName); if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) { continue; /* Path does not fit, assume not matched */ } strncpy(path+dirlen+1, finfo.cFileName, sublen); path[dirlen+1+sublen] = '\\'; strncpy(path+dirlen+1+sublen+1, keypath, keylen+1); if (FileExists(path)) { /* Found a match, print to stdout */ path[dirlen+1+sublen] = '\0'; QualifyPath(path); ret = 0; break; } } while (FindNextFile(hSearch, &finfo)); FindClose(hSearch); return ret; } /* * LocateDependency -- * * Locates a dependency for a package. * keypath - a relative path within the package directory * that is used to confirm it is the correct directory. * The search path for the package directory is currently only * the parent and grandparent of the current working directory. * If found, the command prints * name_DIRPATH=<full path of located directory> * and returns 0. If not found, does not print anything and returns 1. */ static int LocateDependency(const char *keypath) { size_t i; int ret; static const char *paths[] = {"..", "..\\..", "..\\..\\.."}; for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { ret = LocateDependencyHelper(paths[i], keypath); if (ret == 0) { return ret; } } return ret; } /* * Local variables: |
︙ | ︙ |
Changes to win/rc/tktest.rc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | // // Version Resource Script // #include <windows.h> #include <tk.h> // // build-up the name suffix that defines the type of build this is. // #if STATIC_BUILD #define SUFFIX_STATIC "s" #else #define SUFFIX_STATIC "" #endif #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif | > > > > > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | // // Version Resource Script // #include <windows.h> #include <tk.h> // // build-up the name suffix that defines the type of build this is. // #if TCL_THREADS #define SUFFIX_THREADS "t" #else #define SUFFIX_THREADS "" #endif #if STATIC_BUILD #define SUFFIX_STATIC "s" #else #define SUFFIX_STATIC "" #endif #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif #define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG VS_VERSION_INFO VERSIONINFO FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL FILEFLAGSMASK 0x3fL #ifdef DEBUG |
︙ | ︙ |
Changes to win/tcl.m4.
︙ | ︙ | |||
981 982 983 984 985 986 987 | # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the tcl build dir. #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ | | | | | | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the tcl build dir. #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ if test -d ../../tcl8.7$1/win; then TCL_BIN_DEFAULT=../../tcl8.7$1/win else TCL_BIN_DEFAULT=../../tcl8.7/win fi AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.7 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) fi if test ! -f $TCL_BIN_DIR/Makefile; then AC_MSG_ERROR(There is no Makefile in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) else |
︙ | ︙ |
Changes to win/tkWinButton.c.
︙ | ︙ | |||
561 562 563 564 565 566 567 568 569 570 571 572 573 574 | Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { gc = butPtr->disabledGC; } else if ((butPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(butPtr->tkwin)) { gc = butPtr->activeTextGC; border = butPtr->activeBorder; | > > > > > | 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { gc = butPtr->disabledGC; } else if ((butPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(butPtr->tkwin)) { gc = butPtr->activeTextGC; border = butPtr->activeBorder; |
︙ | ︙ | |||
619 620 621 622 623 624 625 | /* * Compute width of default ring and offset for pushed buttons. */ if (butPtr->type == TYPE_LABEL) { defaultWidth = butPtr->highlightWidth; | | | 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | /* * Compute width of default ring and offset for pushed buttons. */ if (butPtr->type == TYPE_LABEL) { defaultWidth = butPtr->highlightWidth; offset = 0; } else if (butPtr->type == TYPE_BUTTON) { defaultWidth = ((butPtr->defaultState == DEFAULT_ACTIVE) ? butPtr->highlightWidth : 0); offset = 1; } else { defaultWidth = 0; if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) { |
︙ | ︙ | |||
920 921 922 923 924 925 926 | * Draw the border and traversal highlight last. This way, if the button's * contents overflow they'll be covered up by the border. */ if (relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, defaultWidth, defaultWidth, | | | | | | | | | | 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 | * Draw the border and traversal highlight last. This way, if the button's * contents overflow they'll be covered up by the border. */ if (relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, defaultWidth, defaultWidth, Tk_Width(tkwin) - 2 * defaultWidth, Tk_Height(tkwin) - 2 * defaultWidth, butPtr->borderWidth, relief); } if (defaultWidth != 0) { int highlightColor; dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state); if (butPtr->type == TYPE_LABEL) { highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; } else { highlightColor = (int) butPtr->highlightColorPtr->pixel; } TkWinFillRect(dc, 0, 0, Tk_Width(tkwin), defaultWidth, highlightColor); TkWinFillRect(dc, 0, 0, defaultWidth, Tk_Height(tkwin), highlightColor); TkWinFillRect(dc, 0, Tk_Height(tkwin) - defaultWidth, Tk_Width(tkwin), defaultWidth, highlightColor); |
︙ | ︙ | |||
996 997 998 999 1000 1001 1002 | /* Vertical and horizontal dialog units size in pixels. */ double vDLU, hDLU; Tk_FontMetrics fm; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); | | | | | 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | /* Vertical and horizontal dialog units size in pixels. */ double vDLU, hDLU; Tk_FontMetrics fm; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; butPtr->indicatorSpace = 0; if (!tsdPtr->initialized) { InitBoxes(butPtr->tkwin); } |
︙ | ︙ | |||
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | /* * If the button is compound (i.e., it shows both an image and text), the * new geometry is a combination of the image and text geometry. We only * honor the compound bit if the button has both text and an image, * because otherwise it is not really a compound button. */ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* * Image is above or below text. */ | > > > | 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 | /* * If the button is compound (i.e., it shows both an image and text), the * new geometry is a combination of the image and text geometry. We only * honor the compound bit if the button has both text and an image, * because otherwise it is not really a compound button. */ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* * Image is above or below text. */ |
︙ | ︙ | |||
1261 1262 1263 1264 1265 1266 1267 | width = butPtr->width; } if (butPtr->height > 0) { height = butPtr->height; } | | | | 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 | width = butPtr->width; } if (butPtr->height > 0) { height = butPtr->height; } width += 2 * butPtr->padX; height += 2 * butPtr->padY; } else if (haveImage) { if (butPtr->width > 0) { width = butPtr->width; } else { width = imgWidth; } if (butPtr->height > 0) { |
︙ | ︙ | |||
1445 1446 1447 1448 1449 1450 1451 | case BN_CLICKED: { /* * OOPS: chromium fires WM_NULL regularly to ping if plugin is still * alive. When using an external window (i.e. via the tcl plugin), this * causes all buttons to fire once a second, so we need to make sure * that we are not dealing with the chromium life check. */ | | | 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 | case BN_CLICKED: { /* * OOPS: chromium fires WM_NULL regularly to ping if plugin is still * alive. When using an external window (i.e. via the tcl plugin), this * causes all buttons to fire once a second, so we need to make sure * that we are not dealing with the chromium life check. */ if (wParam != 0 || lParam != 0) { int code; Tcl_Interp *interp = butPtr->info.interp; if (butPtr->info.state != STATE_DISABLED) { Tcl_Preserve(interp); code = TkInvokeButton((TkButton*)butPtr); if (code != TCL_OK && code != TCL_CONTINUE |
︙ | ︙ |
Changes to win/tkWinClipboard.c.
︙ | ︙ | |||
56 57 58 59 60 61 62 | int result, locale, noBackslash = 0; if ((selection != Tk_InternAtom(tkwin, "CLIPBOARD")) || (target != XA_STRING)) { goto error; } if (!OpenClipboard(NULL)) { | | | | | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | int result, locale, noBackslash = 0; if ((selection != Tk_InternAtom(tkwin, "CLIPBOARD")) || (target != XA_STRING)) { goto error; } if (!OpenClipboard(NULL)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "clipboard cannot be opened, another application grabbed it")); Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "BUSY", NULL); return TCL_ERROR; } /* * Attempt to get the data in Unicode form if available as this is less * work that CF_TEXT. */ |
︙ | ︙ |
Changes to win/tkWinDefault.h.
︙ | ︙ | |||
349 350 351 352 353 354 355 | #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG NORMAL_FG #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT HIGHLIGHT #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" | | | | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG NORMAL_FG #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT HIGHLIGHT #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" #define DEF_MESSAGE_PADX "-1" #define DEF_MESSAGE_PADY "-1" #define DEF_MESSAGE_RELIEF "flat" #define DEF_MESSAGE_TAKE_FOCUS "0" #define DEF_MESSAGE_TEXT "" #define DEF_MESSAGE_TEXT_VARIABLE "" #define DEF_MESSAGE_WIDTH "0" /* |
︙ | ︙ |
Changes to win/tkWinDialog.c.
︙ | ︙ | |||
173 174 175 176 177 178 179 | Tcl_Obj *initialTypeObj; /* Initial value of above, or NULL */ Tcl_DString utfDirString; /* Initial dir */ int multi; /* Multiple selection enabled */ int confirmOverwrite; /* Confirm before overwriting */ int mustExist; /* Used only for */ int forceXPStyle; /* XXX - Force XP style even on newer systems */ WCHAR file[TK_MULTI_MAX_PATH]; /* File name | | | | | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | Tcl_Obj *initialTypeObj; /* Initial value of above, or NULL */ Tcl_DString utfDirString; /* Initial dir */ int multi; /* Multiple selection enabled */ int confirmOverwrite; /* Confirm before overwriting */ int mustExist; /* Used only for */ int forceXPStyle; /* XXX - Force XP style even on newer systems */ WCHAR file[TK_MULTI_MAX_PATH]; /* File name XXX - fixed size because it was so historically. Why not malloc'ed ? */ } OFNOpts; /* Define the operation for which option parsing is to be done. */ enum OFNOper { OFN_FILE_SAVE, /* tk_getOpenFile */ OFN_FILE_OPEN, /* tk_getSaveFile */ OFN_DIR_CHOOSE /* tk_chooseDirectory */ |
︙ | ︙ | |||
250 251 252 253 254 255 256 | #endif /* __MSVCRT__ */ typedef struct IShellItemArray IShellItemArray; typedef struct IShellItemArrayVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( | | | | | | | | | | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | #endif /* __MSVCRT__ */ typedef struct IShellItemArray IShellItemArray; typedef struct IShellItemArrayVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IShellItemArray *, REFIID riid,void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )(IShellItemArray *); ULONG ( STDMETHODCALLTYPE *Release )(IShellItemArray *); HRESULT ( STDMETHODCALLTYPE *BindToHandler )(IShellItemArray *, IBindCtx *, REFGUID, REFIID, void **); /* flags is actually is enum GETPROPERTYSTOREFLAGS */ HRESULT ( STDMETHODCALLTYPE *GetPropertyStore )( IShellItemArray *, int, REFIID, void **); /* keyType actually REFPROPERTYKEY */ HRESULT ( STDMETHODCALLTYPE *GetPropertyDescriptionList )( IShellItemArray *, void *, REFIID, void **); HRESULT ( STDMETHODCALLTYPE *GetAttributes )(IShellItemArray *, SIATTRIBFLAGS, SFGAOF, SFGAOF *); HRESULT ( STDMETHODCALLTYPE *GetCount )( IShellItemArray *, DWORD *); HRESULT ( STDMETHODCALLTYPE *GetItemAt )( IShellItemArray *, DWORD, IShellItem **); /* ppenumShellItems actually (IEnumShellItems **) */ HRESULT ( STDMETHODCALLTYPE *EnumItems )( IShellItemArray *, void **); END_INTERFACE } IShellItemArrayVtbl; struct IShellItemArray { CONST_VTBL struct IShellItemArrayVtbl *lpVtbl; }; |
︙ | ︙ | |||
350 351 352 353 354 355 356 | typedef struct IFileDialog IFileDialog; typedef struct IFileDialogVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | typedef struct IFileDialog IFileDialog; typedef struct IFileDialogVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFileDialog *, REFIID, void **); ULONG ( STDMETHODCALLTYPE *AddRef )( IFileDialog *); ULONG ( STDMETHODCALLTYPE *Release )( IFileDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( IFileDialog *, HWND); HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileDialog *, UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )(IFileDialog *, UINT); HRESULT ( STDMETHODCALLTYPE *GetFileTypeIndex )(IFileDialog *, UINT *); /* XXX - Actually pfde is IFileDialogEvents* but we do not use this call and do not want to define IFileDialogEvents as that pulls in a whole bunch of other stuff. */ HRESULT ( STDMETHODCALLTYPE *Advise )( IFileDialog *, void *, DWORD *); HRESULT ( STDMETHODCALLTYPE *Unadvise )(IFileDialog *, DWORD); HRESULT ( STDMETHODCALLTYPE *SetOptions )( IFileDialog *, FILEOPENDIALOGOPTIONS); HRESULT ( STDMETHODCALLTYPE *GetOptions )( IFileDialog *, FILEOPENDIALOGOPTIONS *); HRESULT ( STDMETHODCALLTYPE *SetDefaultFolder )( IFileDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetFolder )( IFileDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *GetFolder )( IFileDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *GetCurrentSelection )( IFileDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *SetFileName )( IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetFileName )( IFileDialog *, LPWSTR *); HRESULT ( STDMETHODCALLTYPE *SetTitle )( IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetOkButtonLabel )( IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetFileNameLabel )( IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetResult )( IFileDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *AddPlace )( IFileDialog *, IShellItem *, FDAP); HRESULT ( STDMETHODCALLTYPE *SetDefaultExtension )( IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *Close )( IFileDialog *, HRESULT); HRESULT ( STDMETHODCALLTYPE *SetClientGuid )( IFileDialog *, REFGUID); HRESULT ( STDMETHODCALLTYPE *ClearClientData )( IFileDialog *); /* pFilter actually IShellItemFilter. But deprecated in Win7 AND we do not use it anyways. So define as void* */ HRESULT ( STDMETHODCALLTYPE *SetFilter )( IFileDialog *, void *); END_INTERFACE } IFileDialogVtbl; struct IFileDialog { CONST_VTBL struct IFileDialogVtbl *lpVtbl; }; typedef struct IFileSaveDialog IFileSaveDialog; typedef struct IFileSaveDialogVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFileSaveDialog *, REFIID, void **); ULONG ( STDMETHODCALLTYPE *AddRef )( IFileSaveDialog *); ULONG ( STDMETHODCALLTYPE *Release )( IFileSaveDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( IFileSaveDialog *, HWND); HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileSaveDialog *, UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )( IFileSaveDialog *, UINT); HRESULT ( STDMETHODCALLTYPE *GetFileTypeIndex )( IFileSaveDialog *, UINT *); /* Actually pfde is IFileSaveDialogEvents* */ HRESULT ( STDMETHODCALLTYPE *Advise )( IFileSaveDialog *, void *, DWORD *); HRESULT ( STDMETHODCALLTYPE *Unadvise )( IFileSaveDialog *, DWORD); HRESULT ( STDMETHODCALLTYPE *SetOptions )( IFileSaveDialog *, FILEOPENDIALOGOPTIONS); HRESULT ( STDMETHODCALLTYPE *GetOptions )( IFileSaveDialog *, FILEOPENDIALOGOPTIONS *); HRESULT ( STDMETHODCALLTYPE *SetDefaultFolder )( IFileSaveDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetFolder )( IFileSaveDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *GetFolder )( IFileSaveDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *GetCurrentSelection )( IFileSaveDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *SetFileName )( IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetFileName )( IFileSaveDialog *, LPWSTR *); HRESULT ( STDMETHODCALLTYPE *SetTitle )( IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetOkButtonLabel )( IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetFileNameLabel )( IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetResult )( IFileSaveDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *AddPlace )( IFileSaveDialog *, IShellItem *, FDAP); HRESULT ( STDMETHODCALLTYPE *SetDefaultExtension )( IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *Close )( IFileSaveDialog *, HRESULT); HRESULT ( STDMETHODCALLTYPE *SetClientGuid )( IFileSaveDialog *, REFGUID); HRESULT ( STDMETHODCALLTYPE *ClearClientData )( IFileSaveDialog *); /* pFilter Actually IShellItemFilter* */ HRESULT ( STDMETHODCALLTYPE *SetFilter )( IFileSaveDialog *, void *); HRESULT ( STDMETHODCALLTYPE *SetSaveAsItem )( IFileSaveDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetProperties )( IFileSaveDialog *, IPropertyStore *); HRESULT ( STDMETHODCALLTYPE *SetCollectedProperties )( IFileSaveDialog *, IPropertyDescriptionList *, BOOL); HRESULT ( STDMETHODCALLTYPE *GetProperties )( IFileSaveDialog *, IPropertyStore **); HRESULT ( STDMETHODCALLTYPE *ApplyProperties )( IFileSaveDialog *, IShellItem *, IPropertyStore *, HWND, IFileOperationProgressSink *); END_INTERFACE } IFileSaveDialogVtbl; struct IFileSaveDialog { CONST_VTBL struct IFileSaveDialogVtbl *lpVtbl; }; typedef struct IFileOpenDialog IFileOpenDialog; typedef struct IFileOpenDialogVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFileOpenDialog *, REFIID, void **); ULONG ( STDMETHODCALLTYPE *AddRef )( IFileOpenDialog *); ULONG ( STDMETHODCALLTYPE *Release )( IFileOpenDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( IFileOpenDialog *, HWND); HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileOpenDialog *, UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )( IFileOpenDialog *, UINT); HRESULT ( STDMETHODCALLTYPE *GetFileTypeIndex )( IFileOpenDialog *, UINT *); /* Actually pfde is IFileDialogEvents* */ HRESULT ( STDMETHODCALLTYPE *Advise )( IFileOpenDialog *, void *, DWORD *); HRESULT ( STDMETHODCALLTYPE *Unadvise )( IFileOpenDialog *, DWORD); HRESULT ( STDMETHODCALLTYPE *SetOptions )( IFileOpenDialog *, FILEOPENDIALOGOPTIONS); HRESULT ( STDMETHODCALLTYPE *GetOptions )( IFileOpenDialog *, FILEOPENDIALOGOPTIONS *); HRESULT ( STDMETHODCALLTYPE *SetDefaultFolder )( IFileOpenDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetFolder )( IFileOpenDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *GetFolder )( IFileOpenDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *GetCurrentSelection )( IFileOpenDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *SetFileName )( IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetFileName )( IFileOpenDialog *, LPWSTR *); HRESULT ( STDMETHODCALLTYPE *SetTitle )( IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetOkButtonLabel )( IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetFileNameLabel )( IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetResult )( IFileOpenDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *AddPlace )( IFileOpenDialog *, IShellItem *, FDAP); HRESULT ( STDMETHODCALLTYPE *SetDefaultExtension )( IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *Close )( IFileOpenDialog *, HRESULT); HRESULT ( STDMETHODCALLTYPE *SetClientGuid )( IFileOpenDialog *, REFGUID); HRESULT ( STDMETHODCALLTYPE *ClearClientData )( IFileOpenDialog *); HRESULT ( STDMETHODCALLTYPE *SetFilter )( IFileOpenDialog *, /* pFilter is actually IShellItemFilter */ void *); HRESULT ( STDMETHODCALLTYPE *GetResults )( IFileOpenDialog *, IShellItemArray **); HRESULT ( STDMETHODCALLTYPE *GetSelectedItems )( IFileOpenDialog *, IShellItemArray **); END_INTERFACE } IFileOpenDialogVtbl; struct IFileOpenDialog { CONST_VTBL struct IFileOpenDialogVtbl *lpVtbl; |
︙ | ︙ | |||
565 566 567 568 569 570 571 | static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg, LPARAM wParam, LPARAM lParam); static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static void CleanupOFNOptions(OFNOpts *optsPtr); static int ParseOFNOptions(void *clientData, | | | | | | | | | | 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg, LPARAM wParam, LPARAM lParam); static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static void CleanupOFNOptions(OFNOpts *optsPtr); static int ParseOFNOptions(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum OFNOper oper, OFNOpts *optsPtr); static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper); static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper); static int GetFileName(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum OFNOper oper); static int MakeFilterVista(Tcl_Interp *interp, OFNOpts *optsPtr, DWORD *countPtr, TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, DWORD *defaultFilterIndexPtr); static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr); static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr, Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *indexPtr); static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam); |
︙ | ︙ | |||
980 981 982 983 984 985 986 | OFNOpts *optsPtr) /* Output, uninitialized on entry */ { int i; Tcl_DString ds; enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE, FILE_MULTIPLE, FILE_CONFIRMOW, | | | 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | OFNOpts *optsPtr) /* Output, uninitialized on entry */ { int i; Tcl_DString ds; enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE, FILE_MULTIPLE, FILE_CONFIRMOW, FILE_MUSTEXIST, }; struct Options { const char *name; enum options value; }; static const struct Options saveOptions[] = { {"-confirmoverwrite", FILE_CONFIRMOW}, |
︙ | ︙ | |||
1038 1039 1040 1041 1042 1043 1044 | for (i = 1; i < objc; i += 2) { int index; const char *string; Tcl_Obj *valuePtr; if (Tcl_GetIndexFromObjStruct(interp, objv[i], options, sizeof(struct Options), "option", 0, &index) != TCL_OK) { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | for (i = 1; i < objc; i += 2) { int index; const char *string; Tcl_Obj *valuePtr; if (Tcl_GetIndexFromObjStruct(interp, objv[i], options, sizeof(struct Options), "option", 0, &index) != TCL_OK) { /* * XXX -xpstyle is explicitly checked for as it is undocumented * and we do not want it to show in option error messages. */ if (strcmp(Tcl_GetString(objv[i]), "-xpstyle")) goto error_return; if (i + 1 == objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj("value for \"-xpstyle\" missing", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); goto error_return; } if (Tcl_GetBooleanFromObj(interp, objv[i+1], &optsPtr->forceXPStyle) != TCL_OK) goto error_return; continue; } else if (i + 1 == objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", options[index].name)); Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); goto error_return; } valuePtr = objv[i + 1]; string = Tcl_GetString(valuePtr); switch (options[index].value) { case FILE_DEFAULT: optsPtr->extObj = valuePtr; break; case FILE_TYPES: optsPtr->filterObj = valuePtr; break; case FILE_INITDIR: Tcl_DStringFree(&optsPtr->utfDirString); if (Tcl_TranslateFileName(interp, string, &optsPtr->utfDirString) == NULL) goto error_return; break; case FILE_INITFILE: if (Tcl_TranslateFileName(interp, string, &ds) == NULL) goto error_return; Tcl_UtfToExternal(NULL, TkWinGetUnicodeEncoding(), Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), TCL_ENCODING_PROFILE_TCL8, NULL, (char *)&optsPtr->file[0], sizeof(optsPtr->file), NULL, NULL, NULL); Tcl_DStringFree(&ds); break; case FILE_PARENT: optsPtr->tkwin = Tk_NameToWindow(interp, string, (Tk_Window)clientData); if (optsPtr->tkwin == NULL) goto error_return; break; case FILE_TITLE: optsPtr->titleObj = valuePtr; break; case FILE_TYPEVARIABLE: optsPtr->typeVariableObj = valuePtr; optsPtr->initialTypeObj = Tcl_ObjGetVar2(interp, valuePtr, NULL, TCL_GLOBAL_ONLY); break; case FILE_MULTIPLE: if (Tcl_GetBooleanFromObj(interp, valuePtr, &optsPtr->multi) != TCL_OK) goto error_return; break; case FILE_CONFIRMOW: if (Tcl_GetBooleanFromObj(interp, valuePtr, &optsPtr->confirmOverwrite) != TCL_OK) goto error_return; break; case FILE_MUSTEXIST: if (Tcl_GetBooleanFromObj(interp, valuePtr, &optsPtr->mustExist) != TCL_OK) goto error_return; break; } } return TCL_OK; error_return: /* interp should already hold error */ /* On error, we need to clean up anything we might have allocated */ |
︙ | ︙ | |||
1147 1148 1149 1150 1151 1152 1153 | *---------------------------------------------------------------------- */ static int VistaFileDialogsAvailable(void) { HRESULT hr; IFileDialog *fdlgPtr = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 | *---------------------------------------------------------------------- */ static int VistaFileDialogsAvailable(void) { HRESULT hr; IFileDialog *fdlgPtr = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->newFileDialogsState == FDLG_STATE_INIT) { tsdPtr->newFileDialogsState = FDLG_STATE_USE_OLD; hr = CoInitialize(0); /* XXX - need we schedule CoUninitialize at thread shutdown ? */ /* Ensure all COM interfaces we use are available */ |
︙ | ︙ | |||
1194 1195 1196 1197 1198 1199 1200 | * TCL_ERROR - error return * * Side effects: * Dialogs is displayed *---------------------------------------------------------------------- */ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, | | | 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 | * TCL_ERROR - error return * * Side effects: * Dialogs is displayed *---------------------------------------------------------------------- */ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper) { HRESULT hr; HWND hWnd; DWORD flags, nfilters, defaultFilterIndex; TCLCOMDLG_FILTERSPEC *filterPtr = NULL; IFileDialog *fdlgIf = NULL; IShellItem *dirIf = NULL; |
︙ | ︙ | |||
1228 1229 1230 1231 1232 1233 1234 | hWnd = Tk_GetHWND(Tk_WindowId(optsPtr->tkwin)); /* * The only validation we need to do w.r.t caller supplied data * is the filter specification so do that before creating */ if (MakeFilterVista(interp, optsPtr, &nfilters, &filterPtr, | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 | hWnd = Tk_GetHWND(Tk_WindowId(optsPtr->tkwin)); /* * The only validation we need to do w.r.t caller supplied data * is the filter specification so do that before creating */ if (MakeFilterVista(interp, optsPtr, &nfilters, &filterPtr, &defaultFilterIndex) != TCL_OK) return TCL_ERROR; /* * Beyond this point, do not just return on error as there will be * resources that need to be released/freed. */ if (oper == OFN_FILE_OPEN || oper == OFN_DIR_CHOOSE) hr = CoCreateInstance(&ClsidFileOpenDialog, NULL, CLSCTX_INPROC_SERVER, &IIDIFileOpenDialog, (void **) &fdlgIf); else hr = CoCreateInstance(&ClsidFileSaveDialog, NULL, CLSCTX_INPROC_SERVER, &IIDIFileSaveDialog, (void **) &fdlgIf); if (FAILED(hr)) goto vamoose; /* * Get current settings first because we want to preserve existing * settings like whether to show hidden files etc. based on the * user's existing preference */ hr = fdlgIf->lpVtbl->GetOptions(fdlgIf, &flags); if (FAILED(hr)) goto vamoose; if (filterPtr) { /* * Causes -filetypes {{All *}} -defaultextension ext to return * foo.ext.ext when foo is typed into the entry box * flags |= FOS_STRICTFILETYPES; */ hr = fdlgIf->lpVtbl->SetFileTypes(fdlgIf, nfilters, filterPtr); if (FAILED(hr)) goto vamoose; hr = fdlgIf->lpVtbl->SetFileTypeIndex(fdlgIf, defaultFilterIndex); if (FAILED(hr)) goto vamoose; } /* Flags are equivalent to those we used in the older API */ /* * Following flags must be set irrespective of original setting * XXX - should FOS_NOVALIDATE be there ? Note FOS_NOVALIDATE has different * semantics than OFN_NOVALIDATE in the old API. */ flags |= FOS_FORCEFILESYSTEM | /* Only want files, not other shell items */ FOS_NOVALIDATE | /* Don't check for access denied etc. */ FOS_PATHMUSTEXIST; /* The *directory* path must exist */ if (oper == OFN_DIR_CHOOSE) { flags |= FOS_PICKFOLDERS; if (optsPtr->mustExist) flags |= FOS_FILEMUSTEXIST; /* XXX - check working */ } else flags &= ~ FOS_PICKFOLDERS; if (optsPtr->multi) flags |= FOS_ALLOWMULTISELECT; else flags &= ~FOS_ALLOWMULTISELECT; if (optsPtr->confirmOverwrite) flags |= FOS_OVERWRITEPROMPT; else flags &= ~FOS_OVERWRITEPROMPT; hr = fdlgIf->lpVtbl->SetOptions(fdlgIf, flags); if (FAILED(hr)) goto vamoose; if (optsPtr->extObj != NULL) { Tcl_DString ds; const char *src; src = Tcl_GetString(optsPtr->extObj); Tcl_DStringInit(&ds); wstr = Tcl_UtfToWCharDString(src, optsPtr->extObj->length, &ds); if (wstr[0] == '.') ++wstr; hr = fdlgIf->lpVtbl->SetDefaultExtension(fdlgIf, wstr); Tcl_DStringFree(&ds); if (FAILED(hr)) goto vamoose; } if (optsPtr->titleObj != NULL) { Tcl_DString ds; const char *src; src = Tcl_GetString(optsPtr->titleObj); Tcl_DStringInit(&ds); wstr = Tcl_UtfToWCharDString(src, optsPtr->titleObj->length, &ds); hr = fdlgIf->lpVtbl->SetTitle(fdlgIf, wstr); Tcl_DStringFree(&ds); if (FAILED(hr)) goto vamoose; } if (optsPtr->file[0]) { hr = fdlgIf->lpVtbl->SetFileName(fdlgIf, optsPtr->file); if (FAILED(hr)) goto vamoose; } if (Tcl_DStringValue(&optsPtr->utfDirString)[0] != '\0') { Tcl_Obj *normPath, *iniDirPath; iniDirPath = Tcl_NewStringObj(Tcl_DStringValue(&optsPtr->utfDirString), TCL_INDEX_NONE); Tcl_IncrRefCount(iniDirPath); normPath = Tcl_FSGetNormalizedPath(interp, iniDirPath); /* XXX - Note on failures do not raise error, simply ignore ini dir */ if (normPath) { LPCWSTR nativePath; Tcl_IncrRefCount(normPath); nativePath = (LPCWSTR)Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ if (nativePath) { hr = SHCreateItemFromParsingName( nativePath, NULL, &IIDIShellItem, (void **) &dirIf); if (SUCCEEDED(hr)) { /* Note we use SetFolder, not SetDefaultFolder - see MSDN */ fdlgIf->lpVtbl->SetFolder(fdlgIf, dirIf); /* Ignore errors */ } } Tcl_DecrRefCount(normPath); /* ALSO INVALIDATES nativePath !! */ } Tcl_DecrRefCount(iniDirPath); } oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); hr = fdlgIf->lpVtbl->Show(fdlgIf, hWnd); Tcl_SetServiceMode(oldMode); EatSpuriousMessageBugFix(); /* * Ensure that hWnd is enabled, because it can happen that we have updated * the wrapper of the parent, which causes us to leave this child disabled * (Windows loses sync). */ if (hWnd) EnableWindow(hWnd, 1); /* * Clear interp result since it might have been set during the modal loop. * https://core.tcl-lang.org/tk/tktview/4a0451f5291b3c9168cc560747dae9264e1d2ef6 */ Tcl_ResetResult(interp); if (SUCCEEDED(hr)) { if ((oper == OFN_FILE_OPEN) && optsPtr->multi) { IShellItemArray *multiIf; DWORD dw, count; IFileOpenDialog *fodIf = (IFileOpenDialog *) fdlgIf; hr = fodIf->lpVtbl->GetResults(fodIf, &multiIf); if (SUCCEEDED(hr)) { Tcl_Obj *multiObj; hr = multiIf->lpVtbl->GetCount(multiIf, &count); multiObj = Tcl_NewListObj(count, NULL); if (SUCCEEDED(hr)) { IShellItem *itemIf; for (dw = 0; dw < count; ++dw) { hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); if (FAILED(hr)) break; hr = itemIf->lpVtbl->GetDisplayName(itemIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { Tcl_DString fnds; ConvertExternalFilename(wstr, &fnds); CoTaskMemFree(wstr); Tcl_ListObjAppendElement( interp, multiObj, Tcl_NewStringObj(Tcl_DStringValue(&fnds), Tcl_DStringLength(&fnds))); Tcl_DStringFree(&fnds); } itemIf->lpVtbl->Release(itemIf); if (FAILED(hr)) break; } } multiIf->lpVtbl->Release(multiIf); if (SUCCEEDED(hr)) resultObj = multiObj; else Tcl_DecrRefCount(multiObj); } } else { IShellItem *resultIf; hr = fdlgIf->lpVtbl->GetResult(fdlgIf, &resultIf); if (SUCCEEDED(hr)) { hr = resultIf->lpVtbl->GetDisplayName(resultIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { Tcl_DString fnds; ConvertExternalFilename(wstr, &fnds); resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds), Tcl_DStringLength(&fnds)); CoTaskMemFree(wstr); Tcl_DStringFree(&fnds); } resultIf->lpVtbl->Release(resultIf); } } if (SUCCEEDED(hr)) { if (filterPtr && optsPtr->typeVariableObj) { UINT ftix; hr = fdlgIf->lpVtbl->GetFileTypeIndex(fdlgIf, &ftix); if (SUCCEEDED(hr)) { /* Note ftix is a 1-based index */ if (ftix > 0 && ftix <= nfilters) { Tcl_DString ftds; Tcl_Obj *ftobj; Tcl_DStringInit(&ftds); Tcl_WCharToUtfDString(filterPtr[ftix-1].pszName, wcslen(filterPtr[ftix-1].pszName), &ftds); ftobj = Tcl_NewStringObj(Tcl_DStringValue(&ftds), Tcl_DStringLength(&ftds)); Tcl_ObjSetVar2(interp, optsPtr->typeVariableObj, NULL, ftobj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); Tcl_DStringFree(&ftds); } } } } } else { if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)) hr = 0; /* User cancelled, return empty string */ } vamoose: /* (hr != 0) => error */ if (dirIf) dirIf->lpVtbl->Release(dirIf); if (fdlgIf) fdlgIf->lpVtbl->Release(fdlgIf); if (filterPtr) FreeFilterVista(nfilters, filterPtr); if (hr == 0) { if (resultObj) /* May be NULL if user cancelled */ Tcl_SetObjResult(interp, resultObj); return TCL_OK; } else { if (resultObj) Tcl_DecrRefCount(resultObj); Tcl_SetObjResult(interp, TkWin32ErrorObj(hr)); return TCL_ERROR; } } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
1514 1515 1516 1517 1518 1519 1520 | int cdlgerr; int filterIndex = 0, result = TCL_ERROR, winCode, oldMode; HWND hWnd; Tcl_DString utfFilterString, ds; Tcl_DString extString, filterString, dirString, titleString; const char *str; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) | | | | | | 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 | int cdlgerr; int filterIndex = 0, result = TCL_ERROR, winCode, oldMode; HWND hWnd; Tcl_DString utfFilterString, ds; Tcl_DString extString, filterString, dirString, titleString; const char *str; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); memset(&ofnData, 0, sizeof(OFNData)); Tcl_DStringInit(&utfFilterString); Tcl_DStringInit(&dirString); /* XXX - original code was missing this leaving dirString uninitialized for the unlikely code path where cwd failed */ if (MakeFilter(interp, optsPtr->filterObj, &utfFilterString, optsPtr->initialTypeObj, &filterIndex) != TCL_OK) { goto end; } Tk_MakeWindowExist(optsPtr->tkwin); hWnd = Tk_GetHWND(Tk_WindowId(optsPtr->tkwin)); memset(&ofn, 0, sizeof(OPENFILENAME)); |
︙ | ︙ | |||
1590 1591 1592 1593 1594 1595 1596 | */ Tcl_DString cwd; Tcl_DStringFree(&optsPtr->utfDirString); if ((Tcl_GetCwd(interp, &optsPtr->utfDirString) == NULL) || (Tcl_TranslateFileName(interp, | | | 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 | */ Tcl_DString cwd; Tcl_DStringFree(&optsPtr->utfDirString); if ((Tcl_GetCwd(interp, &optsPtr->utfDirString) == NULL) || (Tcl_TranslateFileName(interp, Tcl_DStringValue(&optsPtr->utfDirString), &cwd) == NULL)) { Tcl_ResetResult(interp); } else { Tcl_DStringInit(&dirString); Tcl_UtfToWCharDString(Tcl_DStringValue(&cwd), Tcl_DStringLength(&cwd), &dirString); } Tcl_DStringFree(&cwd); |
︙ | ︙ | |||
1734 1735 1736 1737 1738 1739 1740 | &listObjc, &listObjv) != TCL_OK) { result = TCL_ERROR; } else if (Tcl_ListObjGetElements(interp, listObjv[ofn.nFilterIndex - 1], &count, &typeInfo) != TCL_OK) { result = TCL_ERROR; } else { | | | | | | | | | | | | | | | | | | | | | 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 | &listObjc, &listObjv) != TCL_OK) { result = TCL_ERROR; } else if (Tcl_ListObjGetElements(interp, listObjv[ofn.nFilterIndex - 1], &count, &typeInfo) != TCL_OK) { result = TCL_ERROR; } else { /* * BUGFIX for d43a10ce2fed950e00890049f3c273f2cdd12583 * The original code was broken because it passed typeinfo[0] * directly into Tcl_ObjSetVar2. In the case of typeInfo[0] * pointing into a list which is also referenced by * typeVariableObj, TOSV2 shimmers the object into * variable intrep which loses the list representation. * This invalidates typeInfo[0] which is freed but * nevertheless stored as the value of the variable. */ Tcl_Obj *selFilterObj = typeInfo[0]; Tcl_IncrRefCount(selFilterObj); if (Tcl_ObjSetVar2(interp, optsPtr->typeVariableObj, NULL, selFilterObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { result = TCL_ERROR; } Tcl_DecrRefCount(selFilterObj); } } } else if (cdlgerr == FNERR_INVALIDFILENAME) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid filename \"%s\"", ConvertExternalFilename(ofn.lpstrFile, &ds))); Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "INVALID_FILENAME", NULL); Tcl_DStringFree(&ds); } else { result = TCL_OK; } if (ofn.lpstrTitle != NULL) { Tcl_DStringFree(&titleString); } if (ofn.lpstrInitialDir != NULL) { /* XXX - huh? lpstrInitialDir is set from Tcl_DStringValue which can never return NULL */ Tcl_DStringFree(&dirString); } Tcl_DStringFree(&filterString); if (ofn.lpstrDefExt != NULL) { Tcl_DStringFree(&extString); } |
︙ | ︙ | |||
1818 1819 1820 1821 1822 1823 1824 | * GetSaveFileName(). */ { OFNOpts ofnOpts; int result; result = ParseOFNOptions(clientData, interp, objc, objv, oper, &ofnOpts); if (result != TCL_OK) | | | | | 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 | * GetSaveFileName(). */ { OFNOpts ofnOpts; int result; result = ParseOFNOptions(clientData, interp, objc, objv, oper, &ofnOpts); if (result != TCL_OK) return result; if (VistaFileDialogsAvailable() && ! ofnOpts.forceXPStyle) result = GetFileNameVista(interp, &ofnOpts, oper); else result = GetFileNameXP(interp, &ofnOpts, oper); CleanupOFNOptions(&ofnOpts); return result; } /* |
︙ | ︙ | |||
2159 2160 2161 2162 2163 2164 2165 | * * Frees storage previously allocated by MakeFilterVista. * count is the number of elements in dlgFilterPtr[] */ static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr) { if (dlgFilterPtr != NULL) { | | | | | | | | | | 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | * * Frees storage previously allocated by MakeFilterVista. * count is the number of elements in dlgFilterPtr[] */ static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr) { if (dlgFilterPtr != NULL) { DWORD dw; for (dw = 0; dw < count; ++dw) { if (dlgFilterPtr[dw].pszName != NULL) ckfree((char *)dlgFilterPtr[dw].pszName); if (dlgFilterPtr[dw].pszSpec != NULL) ckfree((char *)dlgFilterPtr[dw].pszSpec); } ckfree(dlgFilterPtr); } } /* *---------------------------------------------------------------------- * * MakeFilterVista -- |
︙ | ︙ | |||
2191 2192 2193 2194 2195 2196 2197 | *---------------------------------------------------------------------- */ static int MakeFilterVista( Tcl_Interp *interp, /* Current interpreter. */ OFNOpts *optsPtr, /* Caller specified options */ DWORD *countPtr, /* Will hold number of filters */ TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, /* Will hold pointer to filter array. | | | | | | | | | | | | | | | | 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 | *---------------------------------------------------------------------- */ static int MakeFilterVista( Tcl_Interp *interp, /* Current interpreter. */ OFNOpts *optsPtr, /* Caller specified options */ DWORD *countPtr, /* Will hold number of filters */ TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, /* Will hold pointer to filter array. Set to NULL if no filters specified. Must be freed by calling FreeFilterVista */ DWORD *initialIndexPtr) /* Will hold index of default type */ { TCLCOMDLG_FILTERSPEC *dlgFilterPtr; const char *initial = NULL; FileFilterList flist; FileFilter *filterPtr; DWORD initialIndex = 0; Tcl_DString ds, patterns; int i; if (optsPtr->filterObj == NULL) { *dlgFilterPtrPtr = NULL; *countPtr = 0; return TCL_OK; } if (optsPtr->initialTypeObj) initial = Tcl_GetString(optsPtr->initialTypeObj); TkInitFileFilters(&flist); if (TkGetFileFilters(interp, &flist, optsPtr->filterObj, 1) != TCL_OK) return TCL_ERROR; if (flist.filters == NULL) { *dlgFilterPtrPtr = NULL; *countPtr = 0; return TCL_OK; } Tcl_DStringInit(&ds); Tcl_DStringInit(&patterns); dlgFilterPtr = (TCLCOMDLG_FILTERSPEC *)ckalloc(flist.numFilters * sizeof(*dlgFilterPtr)); for (i = 0, filterPtr = flist.filters; filterPtr; filterPtr = filterPtr->next, ++i) { const char *sep; FileFilterClause *clausePtr; size_t nbytes; /* Check if this entry should be shown as the default */ if (initial && strcmp(initial, filterPtr->name) == 0) initialIndex = i+1; /* Windows filter indices are 1-based */ /* First stash away the text description of the pattern */ Tcl_DStringInit(&ds); Tcl_UtfToWCharDString(filterPtr->name, TCL_INDEX_NONE, &ds); nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ nbytes += sizeof(WCHAR); /* Terminating \0 */ dlgFilterPtr[i].pszName = (LPCWSTR)ckalloc(nbytes); memmove((void *) dlgFilterPtr[i].pszName, Tcl_DStringValue(&ds), nbytes); Tcl_DStringFree(&ds); /* |
︙ | ︙ | |||
2268 2269 2270 2271 2272 2273 2274 | Tcl_DStringAppend(&patterns, sep, TCL_INDEX_NONE); Tcl_DStringAppend(&patterns, globPtr->pattern, TCL_INDEX_NONE); sep = ";"; } } /* Again we need a Unicode form of the string */ | | | | 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 | Tcl_DStringAppend(&patterns, sep, TCL_INDEX_NONE); Tcl_DStringAppend(&patterns, globPtr->pattern, TCL_INDEX_NONE); sep = ";"; } } /* Again we need a Unicode form of the string */ Tcl_DStringInit(&ds); Tcl_UtfToWCharDString(Tcl_DStringValue(&patterns), TCL_INDEX_NONE, &ds); nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ nbytes += sizeof(WCHAR); /* Terminating \0 */ dlgFilterPtr[i].pszSpec = (LPCWSTR)ckalloc(nbytes); memmove((void *)dlgFilterPtr[i].pszSpec, Tcl_DStringValue(&ds), nbytes); Tcl_DStringFree(&ds); Tcl_DStringSetLength(&patterns, 0); } |
︙ | ︙ | |||
2383 2384 2385 2386 2387 2388 2389 | Tcl_DString titleString; /* Title */ Tcl_DString tempString; /* temporary */ Tcl_Obj *objPtr; OFNOpts ofnOpts; const char *utfDir; result = ParseOFNOptions(clientData, interp, objc, objv, | | | | | | | | | | | | 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 | Tcl_DString titleString; /* Title */ Tcl_DString tempString; /* temporary */ Tcl_Obj *objPtr; OFNOpts ofnOpts; const char *utfDir; result = ParseOFNOptions(clientData, interp, objc, objv, OFN_DIR_CHOOSE, &ofnOpts); if (result != TCL_OK) return result; /* Use new dialogs if available */ if (VistaFileDialogsAvailable() && ! ofnOpts.forceXPStyle) { result = GetFileNameVista(interp, &ofnOpts, OFN_DIR_CHOOSE); CleanupOFNOptions(&ofnOpts); return result; } /* Older dialogs */ path[0] = '\0'; memset(&cdCBData, 0, sizeof(ChooseDir)); cdCBData.interp = interp; cdCBData.mustExist = ofnOpts.mustExist; utfDir = Tcl_DStringValue(&ofnOpts.utfDirString); if (utfDir[0] != '\0') { LPCWSTR uniStr; Tcl_DStringInit(&tempString); Tcl_UtfToWCharDString(Tcl_DStringValue(&ofnOpts.utfDirString), TCL_INDEX_NONE, &tempString); uniStr = (WCHAR *) Tcl_DStringValue(&tempString); /* Convert possible relative path to full path to keep dialog happy. */ GetFullPathNameW(uniStr, MAX_PATH, saveDir, NULL); wcsncpy(cdCBData.initDir, saveDir, MAX_PATH); } /* XXX - rest of this (original) code has no error checks at all. */ /* * Get ready to call the browser */ |
︙ | ︙ | |||
2476 2477 2478 2479 2480 2481 2482 | * user a chance to change their mind on an invalid folder if mustexist is * 0. */ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); GetCurrentDirectoryW(MAX_PATH, saveDir); if (SHGetMalloc(&pMalloc) == NOERROR) { | | | | | | 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 | * user a chance to change their mind on an invalid folder if mustexist is * 0. */ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); GetCurrentDirectoryW(MAX_PATH, saveDir); if (SHGetMalloc(&pMalloc) == NOERROR) { /* * XXX - MSDN says CoInitialize must have been called before * SHBrowseForFolder can be used but don't see that called anywhere. */ pidl = SHBrowseForFolderW(&bInfo); /* * This is a fix for Windows 2000, which seems to modify the folder * name buffer even when the dialog is canceled (in this case the * buffer contains garbage). See [Bug #3002230] */ |
︙ | ︙ | |||
2616 2617 2618 2619 2620 2621 2622 | chooseDirSharedData->retDir, NULL); if (chooseDirSharedData->mustExist) { /* * User HAS to select a valid directory. */ wsprintfW(selDir, L"Directory '%s' does not exist,\n" | | | 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 | chooseDirSharedData->retDir, NULL); if (chooseDirSharedData->mustExist) { /* * User HAS to select a valid directory. */ wsprintfW(selDir, L"Directory '%s' does not exist,\n" L"please select or enter an existing directory.", chooseDirSharedData->retDir); MessageBoxW(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK); chooseDirSharedData->retDir[0] = '\0'; return 1; } } else { /* |
︙ | ︙ |
Changes to win/tkWinDraw.c.
︙ | ︙ | |||
757 758 759 760 761 762 763 | */ static void MakeAndStrokePath( HDC dc, POINT *winPoints, int npoints, WinDrawFunc func) /* Name of the Windows GDI drawing function: | | | | | | | | | | | 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | */ static void MakeAndStrokePath( HDC dc, POINT *winPoints, int npoints, WinDrawFunc func) /* Name of the Windows GDI drawing function: this is either Polyline or Polygon. */ { BeginPath(dc); func(dc, winPoints, (int)npoints); /* * In the case of closed polylines, the first and last points * are the same. We want miter or bevel join be rendered also * at this point, this needs telling the Windows GDI that the * path is closed. */ if (func == Polyline) { if ((winPoints[0].x == winPoints[npoints-1].x) && (winPoints[0].y == winPoints[npoints-1].y)) { CloseFigure(dc); } EndPath(dc); StrokePath(dc); } else { EndPath(dc); StrokeAndFillPath(dc); } } /* *---------------------------------------------------------------------- * * RenderObject -- |
︙ | ︙ | |||
875 876 877 878 879 880 881 | * Draw the object in the foreground color and copy it to the * destination wherever the pattern is set. */ SetPolyFillMode(dcMem, (gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING); oldMemBrush = (HBRUSH)SelectObject(dcMem, CreateSolidBrush(gc->foreground)); | | | | | 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | * Draw the object in the foreground color and copy it to the * destination wherever the pattern is set. */ SetPolyFillMode(dcMem, (gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING); oldMemBrush = (HBRUSH)SelectObject(dcMem, CreateSolidBrush(gc->foreground)); MakeAndStrokePath(dcMem, winPoints, npoints, func); BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYFG); /* * If we are rendering an opaque stipple, then draw the polygon in the * background color and copy it to the destination wherever the * pattern is clear. */ if (gc->fill_style == FillOpaqueStippled) { DeleteObject(SelectObject(dcMem, CreateSolidBrush(gc->background))); MakeAndStrokePath(dcMem, winPoints, npoints, func); BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYBG); } SelectObject(dcMem, oldPen); DeleteObject(SelectObject(dcMem, oldMemBrush)); DeleteObject(SelectObject(dcMem, oldBitmap)); DeleteDC(dcMem); } else { oldPen = (HPEN)SelectObject(dc, pen); oldBrush = (HBRUSH)SelectObject(dc, CreateSolidBrush(gc->foreground)); SetROP2(dc, tkpWinRopModes[gc->function]); SetPolyFillMode(dc, (gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING); MakeAndStrokePath(dc, winPoints, npoints, func); SelectObject(dc, oldPen); } DeleteObject(SelectObject(dc, oldBrush)); } /* *---------------------------------------------------------------------- |
︙ | ︙ |
Changes to win/tkWinEmbed.c.
︙ | ︙ | |||
858 859 860 861 862 863 864 | { Container *containerPtr = (Container *)clientData; Tk_Window tkwin = (Tk_Window)containerPtr->parentPtr; if (eventPtr->type == ConfigureNotify) { /* | | | | | | | 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 | { Container *containerPtr = (Container *)clientData; Tk_Window tkwin = (Tk_Window)containerPtr->parentPtr; if (eventPtr->type == ConfigureNotify) { /* * Send a ConfigureNotify to the embedded application. */ if (containerPtr->embeddedPtr != NULL) { TkDoConfigureNotify(containerPtr->embeddedPtr); } /* * Resize the embedded window, if there is any. */ if (containerPtr->embeddedHWnd) { SetWindowPos(containerPtr->embeddedHWnd, NULL, 0, 0, |
︙ | ︙ |
Changes to win/tkWinFont.c.
︙ | ︙ | |||
841 842 843 844 845 846 847 | */ moretomeasure = 0; curX = 0; start = source; end = start + numBytes; for (p = start; p < end; ) { | | | 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | */ moretomeasure = 0; curX = 0; start = source; end = start + numBytes; for (p = start; p < end; ) { next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; WCHAR *wstr = (WCHAR *)Tcl_UtfToExternalDString(familyPtr->encoding, start, p - start, &runString); size.cx = 0; familyPtr->getTextExtentPoint32Proc(hdc, wstr, |
︙ | ︙ | |||
902 903 904 905 906 907 908 | char buf[16]; int dstWrote; int lastSize = 0; familyPtr = lastSubFontPtr->familyPtr; Tcl_DStringInit(&runString); for (p = start; p < end; ) { | | | 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 | char buf[16]; int dstWrote; int lastSize = 0; familyPtr = lastSubFontPtr->familyPtr; Tcl_DStringInit(&runString); for (p = start; p < end; ) { next = p + TkUtfToUniChar(p, &ch); Tcl_UtfToExternal(NULL, familyPtr->encoding, p, (int) (next - p), TCL_ENCODING_PROFILE_TCL8, NULL, buf, sizeof(buf), NULL, &dstWrote, NULL); Tcl_DStringAppend(&runString,buf,dstWrote); size.cx = 0; familyPtr->getTextExtentPoint32Proc(hdc, (WCHAR *) Tcl_DStringValue(&runString), |
︙ | ︙ | |||
957 958 959 960 961 962 963 | const char *lastWordBreak = NULL; int ch2; end = p; p = source; ch = ' '; while (p < end) { | | | 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 | const char *lastWordBreak = NULL; int ch2; end = p; p = source; ch = ' '; while (p < end) { next = p + TkUtfToUniChar(p, &ch2); if ((ch != ' ') && (ch2 == ' ')) { lastWordBreak = p; } p = next; ch = ch2; } |
︙ | ︙ | |||
1474 1475 1476 1477 1478 1479 1480 | lastSubFontPtr = &fontPtr->subFontArray[0]; oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle); GetTextMetricsW(hdc, &tm); end = source + numBytes; for (p = source; p < end; ) { | | | 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 | lastSubFontPtr = &fontPtr->subFontArray[0]; oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle); GetTextMetricsW(hdc, &tm); end = source + numBytes; for (p = source; p < end; ) { next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); /* * The drawing API has a limit of 32767 pixels in one go. * To avoid spending time on a rare case we do not measure each char, * instead we limit to drawing chunks of 200 bytes since that works * well in practice. |
︙ | ︙ | |||
2257 2258 2259 2260 2261 2262 2263 | * we don't know the proper Unicode -> symbol font mapping, we can * install the symbol font as the base font and access its glyphs. */ end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { if (Tcl_UtfToExternal(NULL, encoding, src, | | | 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 | * we don't know the proper Unicode -> symbol font mapping, we can * install the symbol font as the base font and access its glyphs. */ end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src), TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } bitOffset = i & (FONTMAP_BITSPERPAGE - 1); subFontPtr->fontMap[row][bitOffset >> 3] |= 1 << (bitOffset & 7); } } |
︙ | ︙ |
Changes to win/tkWinGDI.c.
︙ | ︙ | |||
570 571 572 573 574 575 576 | int n; int nbpoints = 0; POINT* bpoints; inPointList = (double *)attemptckalloc(2 * sizeof(double) * npoly); if (inPointList == 0) { /* TODO: unreachable */ | | | | | | | | | | | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | int n; int nbpoints = 0; POINT* bpoints; inPointList = (double *)attemptckalloc(2 * sizeof(double) * npoly); if (inPointList == 0) { /* TODO: unreachable */ return nbpoints; /* 0. */ } for (n=0; n<npoly; n++) { inPointList[2*n] = polypoints[n].x; inPointList[2*n + 1] = polypoints[n].y; } nbpoints = 1 + npoly * nStep; /* this is the upper limit. */ outPointList = (double *)attemptckalloc(2 * sizeof(double) * nbpoints); if (outPointList == 0) { /* TODO: unreachable */ ckfree(inPointList); return 0; } nbpoints = TkMakeBezierCurve(NULL, inPointList, npoly, nStep, NULL, outPointList); ckfree(inPointList); bpoints = (POINT *)attemptckalloc(sizeof(POINT)*nbpoints); if (bpoints == 0) { /* TODO: unreachable */ ckfree(outPointList); return 0; } for (n=0; n<nbpoints; n++) { bpoints[n].x = (long)outPointList[2*n]; bpoints[n].y = (long)outPointList[2*n + 1]; } ckfree(outPointList); *bpointptr = *bpoints; return nbpoints; } /* |
︙ | ︙ | |||
1362 1363 1364 1365 1366 1367 1368 | * Font is currently selected font for HDC if not specified. * Array name is GdiCharWidths if not specified. * Widths should be in the same measures as all other values (1/1000 inch). */ HDC hDC; LOGFONTW lf; | | < | 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 | * Font is currently selected font for HDC if not specified. * Array name is GdiCharWidths if not specified. * Widths should be in the same measures as all other values (1/1000 inch). */ HDC hDC; LOGFONTW lf; HFONT hfont, oldfont; int made_font = 0; const char *aryvarname = "GdiCharWidths"; /* For now, assume 256 characters in the font.... */ int widths[256]; int retval; if (argc < 2) { |
︙ | ︙ | |||
1416 1417 1418 1419 1420 1421 1422 | * fails, get the "extended" error code and return. Be sure to deallocate * the font if necessary. */ if (retval == FALSE) { DWORD val = GetLastError(); Tcl_SetObjResult(interp, Tcl_ObjPrintf( | | | 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 | * fails, get the "extended" error code and return. Be sure to deallocate * the font if necessary. */ if (retval == FALSE) { DWORD val = GetLastError(); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "::tk::print::_gdi character failed with code %ld", val)); if (made_font) { SelectObject(hDC, oldfont); DeleteObject(hfont); } return TCL_ERROR; } |
︙ | ︙ | |||
1478 1479 1480 1481 1482 1483 1484 | "-single -backfill"; HDC hDC; int x, y; const char *string = 0; RECT sizerect; UINT format_flags = DT_EXPANDTABS|DT_NOPREFIX; /* Like the canvas. */ | | | < | 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 | "-single -backfill"; HDC hDC; int x, y; const char *string = 0; RECT sizerect; UINT format_flags = DT_EXPANDTABS|DT_NOPREFIX; /* Like the canvas. */ Tk_Anchor anchor = 0; LOGFONTW lf; HFONT hfont, oldfont; int made_font = 0; int retval; int dotextcolor = 0; int dobgmode = 0; int bgmode; COLORREF textcolor = 0; int usesingle = 0; |
︙ | ︙ | |||
2977 2978 2979 2980 2981 2982 2983 | HANDLE hDIB; HBITMAP hBitmap; HPALETTE hPalette; /* Check for a valid window handle. */ if (!hWnd) { | | | 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 | HANDLE hDIB; HBITMAP hBitmap; HPALETTE hPalette; /* Check for a valid window handle. */ if (!hWnd) { return NULL; } switch (type) { case PTWindow: { /* Copy entire window. */ RECT rectWnd; /* Get the window rectangle. */ |
︙ | ︙ | |||
3112 3113 3114 3115 3116 3117 3118 | *---------------------------------------------------------------------- */ static HBITMAP CopyScreenToBitmap( LPRECT lpRect) { HDC hScrDC, hMemDC; /* Screen DC and memory DC. */ | | | 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 | *---------------------------------------------------------------------- */ static HBITMAP CopyScreenToBitmap( LPRECT lpRect) { HDC hScrDC, hMemDC; /* Screen DC and memory DC. */ HBITMAP hBitmap, hOldBitmap; /* Handles to deice-dependent bitmaps. */ int nX, nY, nX2, nY2; /* Coordinates of rectangle to grab. */ int nWidth, nHeight; /* DIB width and height */ int xScrn, yScrn; /* Screen resolution. */ /* Check for an empty rectangle. */ if (IsRectEmpty(lpRect)) { |
︙ | ︙ | |||
3146 3147 3148 3149 3150 3151 3152 | xScrn = GetDeviceCaps(hScrDC, HORZRES); yScrn = GetDeviceCaps(hScrDC, VERTRES); /* Make sure bitmap rectangle is visible. */ if (nX < 0) { | | | | | | 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 | xScrn = GetDeviceCaps(hScrDC, HORZRES); yScrn = GetDeviceCaps(hScrDC, VERTRES); /* Make sure bitmap rectangle is visible. */ if (nX < 0) { nX = 0; } if (nY < 0) { nY = 0; } if (nX2 > xScrn) { nX2 = xScrn; } if (nY2 > yScrn) { nY2 = yScrn; } nWidth = nX2 - nX; nHeight = nY2 - nY; /* Create a bitmap compatible with the screen DC. */ hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight); |
︙ | ︙ | |||
3184 3185 3186 3187 3188 3189 3190 | /* Clean up. */ DeleteDC(hScrDC); DeleteDC(hMemDC); /* Return handle to the bitmap. */ | | | 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 | /* Clean up. */ DeleteDC(hScrDC); DeleteDC(hMemDC); /* Return handle to the bitmap. */ return hBitmap; } /* *---------------------------------------------------------------------- * * BitmapToDIB-- * |
︙ | ︙ | |||
3216 3217 3218 3219 3220 3221 3222 | HANDLE h; HDC hDC; WORD biBits; /* Check if bitmap handle is valid. */ if (!hBitmap) { | | | | | | | | | 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 | HANDLE h; HDC hDC; WORD biBits; /* Check if bitmap handle is valid. */ if (!hBitmap) { return NULL; } /* Fill in BITMAP structure, return NULL if it didn't work. */ if (!GetObjectW(hBitmap, sizeof(bm), (LPWSTR)&bm)) { return NULL; } /* Ff no palette is specified, use default palette. */ if (hPal == NULL) { hPal = GetStockObject(DEFAULT_PALETTE); } /* Calculate bits per pixel. */ biBits = bm.bmPlanes * bm.bmBitsPixel; /* Make sure bits per pixel is valid. */ if (biBits <= 1) { biBits = 1; } else if (biBits <= 4) { biBits = 4; } else if (biBits <= 8) { biBits = 8; } else { /* If greater than 8-bit, force to 24-bit. */ biBits = 24; } /* Initialize BITMAPINFOHEADER. */ bi.biSize = sizeof(BITMAPINFOHEADER); bi.biWidth = bm.bmWidth; bi.biHeight = bm.bmHeight; |
︙ | ︙ | |||
3311 3312 3313 3314 3315 3316 3317 | /* get the info. returned by GetDIBits and unlock memory block. */ bi = *lpbi; GlobalUnlock(hDIB); /* If the driver did not fill in the biSizeImage field, make one up. */ if (bi.biSizeImage == 0) { | | | | 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 | /* get the info. returned by GetDIBits and unlock memory block. */ bi = *lpbi; GlobalUnlock(hDIB); /* If the driver did not fill in the biSizeImage field, make one up. */ if (bi.biSizeImage == 0) { bi.biSizeImage = (((((DWORD)bm.bmWidth * biBits) + 31) / 32) * 4) * bm.bmHeight; } /* Realloc the buffer big enough to hold all the bits. */ dwLen = bi.biSize + DIBNumColors(&bi) * sizeof(RGBQUAD) + bi.biSizeImage; if ((h = GlobalReAlloc(hDIB, dwLen, 0)) != 0) { hDIB = h; } else { /* Clean up and return NULL. */ GlobalFree(hDIB); SelectPalette(hDC, hPal, TRUE); RealizePalette(hDC); ReleaseDC(NULL, hDC); |
︙ | ︙ | |||
3438 3439 3440 3441 3442 3443 3444 | LPLOGPALETTE lpLogPal; /* Pointer to a logical palette. */ int nColors; /* Number of colors. */ /* Find out how many palette entries we want.. */ hDC = GetDC(NULL); if (!hDC) { | | | | 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 | LPLOGPALETTE lpLogPal; /* Pointer to a logical palette. */ int nColors; /* Number of colors. */ /* Find out how many palette entries we want.. */ hDC = GetDC(NULL); if (!hDC) { return NULL; } nColors = PalEntriesOnDevice(hDC); /* Number of palette entries. */ /* Allocate room for the palette and lock it.. */ hLogPal = GlobalAlloc(GHND, sizeof(LOGPALETTE) + nColors * sizeof(PALETTEENTRY)); if (!hLogPal) { /* If we didn't get a logical palette, return NULL. */ return NULL; } /* get a pointer to the logical palette. */ lpLogPal = (LPLOGPALETTE)GlobalLock(hLogPal); /* Set some important fields. */ |
︙ | ︙ | |||
3641 3642 3643 3644 3645 3646 3647 | } /* * Store print properties and link variables so they can be accessed from * script level. */ if (localPrinterName != NULL) { | | | | | | | | | | | | | | | | | | 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 | } /* * Store print properties and link variables so they can be accessed from * script level. */ if (localPrinterName != NULL) { char* varlink1 = (char*)ckalloc(100 * sizeof(char)); char** varlink2 = (char**)ckalloc(sizeof(char*)); *varlink2 = varlink1; WideCharToMultiByte(CP_UTF8, 0, localPrinterName, -1, varlink1, 0, NULL, NULL); Tcl_LinkVar(interp, "::tk::print::printer_name", (char*)varlink2, TCL_LINK_STRING | TCL_LINK_READ_ONLY); Tcl_LinkVar(interp, "::tk::print::copies", (char*)&copies, TCL_LINK_INT | TCL_LINK_READ_ONLY); Tcl_LinkVar(interp, "::tk::print::dpi_x", (char*)&dpi_x, TCL_LINK_INT | TCL_LINK_READ_ONLY); Tcl_LinkVar(interp, "::tk::print::dpi_y", (char*)&dpi_y, TCL_LINK_INT | TCL_LINK_READ_ONLY); Tcl_LinkVar(interp, "::tk::print::paper_width", (char*)&paper_width, TCL_LINK_INT | TCL_LINK_READ_ONLY); Tcl_LinkVar(interp, "::tk::print::paper_height", (char*)&paper_height, TCL_LINK_INT | TCL_LINK_READ_ONLY); } return TCL_OK; } /* * -------------------------------------------------------------------------- |
︙ | ︙ |
Changes to win/tkWinIco.c.
︙ | ︙ | |||
167 168 169 170 171 172 173 | bmInfo.bmiHeader.biWidth = width; bmInfo.bmiHeader.biHeight = -height; bmInfo.bmiHeader.biPlanes = 1; bmInfo.bmiHeader.biBitCount = 32; bmInfo.bmiHeader.biCompression = BI_RGB; iconInfo.hbmColor = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS, | | | | | | | | | | | | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | bmInfo.bmiHeader.biWidth = width; bmInfo.bmiHeader.biHeight = -height; bmInfo.bmiHeader.biPlanes = 1; bmInfo.bmiHeader.biBitCount = 32; bmInfo.bmiHeader.biCompression = BI_RGB; iconInfo.hbmColor = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS, &bgraPixel.voidPtr, NULL, 0); if (!iconInfo.hbmColor) { return NULL; } /* * Convert the photo image data into BGRA format (RGBQUAD). */ bufferSize = height * width * 4; for (idx = 0 ; idx < bufferSize ; idx += 4) { bgraPixel.ptr[idx] = block.pixelPtr[idx+2]; bgraPixel.ptr[idx+1] = block.pixelPtr[idx+1]; bgraPixel.ptr[idx+2] = block.pixelPtr[idx+0]; bgraPixel.ptr[idx+3] = block.pixelPtr[idx+3]; } /* * Create a dummy mask bitmap. The contents of this don't appear to * matter, as CreateIconIndirect will setup the icon mask based on the * alpha channel in our color bitmap. */ bmInfo.bmiHeader.biBitCount = 1; iconInfo.hbmMask = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS, &bgraMask.voidPtr, NULL, 0); if (!iconInfo.hbmMask) { DeleteObject(iconInfo.hbmColor); return NULL; } memset(bgraMask.ptr, 0, width*height/8); /* * Create an icon from the bitmaps. */ hIcon = CreateIconIndirect(&iconInfo); DeleteObject(iconInfo.hbmColor); DeleteObject(iconInfo.hbmMask); if (hIcon == NULL) { return NULL; } return hIcon; } /* * Local Variables: * mode: c |
︙ | ︙ |
Changes to win/tkWinIco.h.
︙ | ︙ | |||
82 83 84 85 86 87 88 | /* * The following are implemented in tkWinIco.c and also used in tkWinWm.c and tkWinSysTray.c. */ DWORD BytesPerLine(LPBITMAPINFOHEADER lpBMIH); LPSTR FindDIBBits(LPSTR lpbi); | | < | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | /* * The following are implemented in tkWinIco.c and also used in tkWinWm.c and tkWinSysTray.c. */ DWORD BytesPerLine(LPBITMAPINFOHEADER lpBMIH); LPSTR FindDIBBits(LPSTR lpbi); HICON CreateIcoFromPhoto(int width, int height, Tk_PhotoImageBlock block); /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 |
︙ | ︙ |
Changes to win/tkWinKey.c.
︙ | ︙ | |||
109 110 111 112 113 114 115 | } } else if (keyEv->send_event == -3) { /* * Special case for WM_UNICHAR and win2000 multilingual IME input */ | | | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | } } else if (keyEv->send_event == -3) { /* * Special case for WM_UNICHAR and win2000 multilingual IME input */ len = TkUniCharToUtf(keyEv->keycode, buf); Tcl_DStringAppend(dsPtr, buf, len); } else { /* * This is an event generated from generic code. It has no nchars or * trans_chars members. */ KeySym keysym = KeycodeToKeysym(keyEv->keycode, keyEv->state, 0); if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { len = TkUniCharToUtf(keysym & 255, buf); Tcl_DStringAppend(dsPtr, buf, len); } } return Tcl_DStringValue(dsPtr); } /* |
︙ | ︙ | |||
354 355 356 357 358 359 360 | * pressed, return the appropriate keycode. Otherwise, we fall through * and rely on the keymap table to hold the correct keysym value. * Note: this little trick only works for KeyPress, not for KeyRelease, * for reasons stated in bug [2945130] */ case VK_CONTROL: | | | | | | | | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | * pressed, return the appropriate keycode. Otherwise, we fall through * and rely on the keymap table to hold the correct keysym value. * Note: this little trick only works for KeyPress, not for KeyRelease, * for reasons stated in bug [2945130] */ case VK_CONTROL: if (state & EXTENDED_MASK) { return XK_Control_R; } break; case VK_SHIFT: if (GetKeyState(VK_RSHIFT) & 0x80) { return XK_Shift_R; } break; case VK_MENU: if (state & EXTENDED_MASK) { return XK_Alt_R; } break; } return keymap[keycode]; } /* *---------------------------------------------------------------------- |
︙ | ︙ |
Changes to win/tkWinMenu.c.
︙ | ︙ | |||
505 506 507 508 509 510 511 | int i; const char *label = (mePtr->labelPtr == NULL) ? "" : Tcl_GetString(mePtr->labelPtr); const char *accel = ((menuPtr->menuType == MENUBAR) || (mePtr->accelPtr == NULL)) ? "" : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; | | | | | 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | int i; const char *label = (mePtr->labelPtr == NULL) ? "" : Tcl_GetString(mePtr->labelPtr); const char *accel = ((menuPtr->menuType == MENUBAR) || (mePtr->accelPtr == NULL)) ? "" : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; int ch = 0; /* * We have to construct the string with an ampersand preceeding the * underline character, and a tab seperating the text and the accel * text. We have to be careful with ampersands in the string. */ Tcl_DStringInit(&itemString); for (p = label, i = 0; *p != '\0'; i++, p = next) { if (i == mePtr->underline) { Tcl_DStringAppend(&itemString, "&", 1); } if (*p == '&') { Tcl_DStringAppend(&itemString, "&", 1); } next = p + TkUtfToUniChar(p, &ch); Tcl_DStringAppend(&itemString, p, (int) (next - p)); } ch = 0; if (mePtr->accelLength > 0) { Tcl_DStringAppend(&itemString, "\t", 1); for (p = accel, i = 0; *p != '\0'; i++, p = next) { if (*p == '&') { Tcl_DStringAppend(&itemString, "&", 1); } next = p + TkUtfToUniChar(p, &ch); Tcl_DStringAppend(&itemString, p, (int) (next - p)); } } itemText = (char *)ckalloc(Tcl_DStringLength(&itemString) + 1); strcpy(itemText, Tcl_DStringValue(&itemString)); Tcl_DStringFree(&itemString); |
︙ | ︙ | |||
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 | TkActivateMenuEntry(parentEntryPtr->menuPtr, parentEntryPtr->index); } } interp = menuPtr->interp; Tcl_Preserve(interp); code = TkInvokeMenu(interp, menuPtr, mePtr->index); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (menu invoke)"); Tcl_BackgroundException(interp, code); } Tcl_Release(interp); *plResult = 0; returnResult = 1; } break; case WM_MENUCHAR: { | > > | 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 | TkActivateMenuEntry(parentEntryPtr->menuPtr, parentEntryPtr->index); } } interp = menuPtr->interp; Tcl_Preserve(interp); Tcl_Preserve(menuPtr); code = TkInvokeMenu(interp, menuPtr, mePtr->index); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (menu invoke)"); Tcl_BackgroundException(interp, code); } Tcl_Release(menuPtr); Tcl_Release(interp); *plResult = 0; returnResult = 1; } break; case WM_MENUCHAR: { |
︙ | ︙ | |||
1597 1598 1599 1600 1601 1602 1603 | } else { int borderWidth; Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); *widthPtr = indicatorDimensions[1] - borderWidth; | | | | | | | | | | 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 | } else { int borderWidth; Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); *widthPtr = indicatorDimensions[1] - borderWidth; /* * Quite dubious about the above (why would borderWidth play a role?) * and about how indicatorDimensions[1] is obtained in SetDefaults(). * At least don't let the result be negative! */ if (*widthPtr < 0) { *widthPtr = 0; } } } /* *---------------------------------------------------------------------- * * GetMenuAccelGeometry -- |
︙ | ︙ | |||
1635 1636 1637 1638 1639 1640 1641 | Tk_Font tkfont, /* The precalculated font */ const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int *widthPtr, /* The resulting width */ int *heightPtr) /* The resulting height */ { *heightPtr = fmPtr->linespace; if (mePtr->type == CASCADE_ENTRY) { | | | | | | | | 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 | Tk_Font tkfont, /* The precalculated font */ const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int *widthPtr, /* The resulting width */ int *heightPtr) /* The resulting height */ { *heightPtr = fmPtr->linespace; if (mePtr->type == CASCADE_ENTRY) { /* * Cascade entries have no accelerator but do show an arrow. Set * this field width to the width of the OBM_MNARROW system bitmap * used to display the arrow. I couldn't find how to query the * system for this value, therefore I resort to hardcoding. */ *widthPtr = CASCADE_ARROW_WIDTH; } else if ((menuPtr->menuType != MENUBAR) && (mePtr->accelPtr != NULL)) { const char *accel = Tcl_GetString(mePtr->accelPtr); *widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength); } else { *widthPtr = 0; |
︙ | ︙ | |||
1904 1905 1906 1907 1908 1909 1910 | int height) /* Height of menu entry */ { int baseline; int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth; const char *accel; if (menuPtr->menuType == MENUBAR) { | | | 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 | int height) /* Height of menu entry */ { int baseline; int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth; const char *accel; if (menuPtr->menuType == MENUBAR) { return; } if (mePtr->accelPtr != NULL) { accel = Tcl_GetString(mePtr->accelPtr); } else { accel = NULL; } |
︙ | ︙ | |||
1987 1988 1989 1990 1991 1992 1993 | /* * Don't draw the arrow if a submenu is not attached to this * cascade entry. */ if ((mePtr->childMenuRefPtr == NULL) | | | | 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 | /* * Don't draw the arrow if a submenu is not attached to this * cascade entry. */ if ((mePtr->childMenuRefPtr == NULL) || (mePtr->childMenuRefPtr->menuPtr == NULL)) { return; } oldFgColor = gc->foreground; oldBgColor = gc->background; /* * Set bitmap bg to highlight color if the menu is highlighted. |
︙ | ︙ | |||
2098 2099 2100 2101 2102 2103 2104 | int y, /* Top Edge */ TCL_UNUSED(int), /* Width of entry */ int height) /* Height of entry */ { if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) { int len; | | | | | 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 | int y, /* Top Edge */ TCL_UNUSED(int), /* Width of entry */ int height) /* Height of entry */ { if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) { int len; len = TkGetCharLength(mePtr->labelPtr); if (mePtr->underline < len) { const char *label, *start, *end; int ch; label = Tcl_GetString(mePtr->labelPtr); start = TkUtfAtIndex(label, mePtr->underline); end = start + TkUtfToUniChar(start, &ch); Tk_UnderlineChars(menuPtr->display, d, gc, tkfont, label, x + mePtr->indicatorSpace, y + (height + fmPtr->ascent - fmPtr->descent) / 2, (int) (start - label), (int) (end - label)); } } } |
︙ | ︙ | |||
2945 2946 2947 2948 2949 2950 2951 | Tk_GetReliefFromObj(NULL, menuPtr->activeReliefPtr, &relief); } Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, activeBorderWidth, relief); } else { | | | | 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 | Tk_GetReliefFromObj(NULL, menuPtr->activeReliefPtr, &relief); } Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, activeBorderWidth, relief); } else { Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, 0, TK_RELIEF_FLAT); } } /* *-------------------------------------------------------------- * * TkpComputeStandardMenuGeometry -- |
︙ | ︙ |
Changes to win/tkWinPointer.c.
︙ | ︙ | |||
373 374 375 376 377 378 379 | /* * A multi-screen system may have different logical pixels/inch, with * Windows applying behind-the-scenes scaling on secondary screens. * Don't try and emulate that, instead fall back to SetCursor if the * requested position is off the primary screen. */ if ( x < 0 || x > xscreen || y < 0 || y > yscreen ) { | | | | | 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | /* * A multi-screen system may have different logical pixels/inch, with * Windows applying behind-the-scenes scaling on secondary screens. * Don't try and emulate that, instead fall back to SetCursor if the * requested position is off the primary screen. */ if ( x < 0 || x > xscreen || y < 0 || y > yscreen ) { SetCursorPos(x, y); return; } input.type = INPUT_MOUSE; input.mi.dx = (x * 65535 + xscreen/2) / xscreen; input.mi.dy = (y * 65535 + yscreen/2) / yscreen; /* * Horrible workaround here. There is a bug on Win 10: when warping to * pixel (x = 0, y = 0) the SendInput() below just does not move the * mouse pointer. However, as soon as dx or dy is non zero it moves as * expected. Given the scaling factor of 65535 (see above), * (dx = 1 , dy = 0) still means pixel (x = 0, y = 0). * See ticket [69b48f427e]. */ if (input.mi.dx == 0 && input.mi.dy == 0) { input.mi.dx = 1; } input.mi.mouseData = 0; input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; input.mi.time = 0; input.mi.dwExtraInfo = 0; SendInput(1, &input, sizeof(input)); |
︙ | ︙ |
Changes to win/tkWinPort.h.
︙ | ︙ | |||
120 121 122 123 124 125 126 127 | /* * The following Tk functions are implemented as macros under Windows. */ #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \ | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000) #endif /* _WINPORT */ | > > > > > > > > > | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | /* * The following Tk functions are implemented as macros under Windows. */ #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \ | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000) /* * These calls implement native bitmaps which are not currently * supported under Windows. The macros eliminate the calls. */ #define TkpDefineNativeBitmaps() #define TkpCreateNativeBitmap(display, source) None #define TkpGetNativeAppBitmap(display, name, w, h) None #endif /* _WINPORT */ |
Changes to win/tkWinScrlbr.c.
︙ | ︙ | |||
390 391 392 393 394 395 396 | int fieldLength, minThumbSize; /* * Windows doesn't use focus rings on scrollbars, but we still perform * basic sanity checks to appease backwards compatibility. */ | < < < < | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | int fieldLength, minThumbSize; /* * Windows doesn't use focus rings on scrollbars, but we still perform * basic sanity checks to appease backwards compatibility. */ if (scrollPtr->vertical) { scrollPtr->arrowLength = vArrowHeight; fieldLength = Tk_Height(scrollPtr->tkwin); minThumbSize = vThumb; } else { scrollPtr->arrowLength = hArrowWidth; fieldLength = Tk_Width(scrollPtr->tkwin); |
︙ | ︙ |
Changes to win/tkWinSendCom.h.
︙ | ︙ | |||
42 43 44 45 46 47 48 | #define TKWINSENDCOM_DISPID_ASYNC 2 /* * TkWinSendCom public functions */ MODULE_SCOPE HRESULT TkWinSendCom_CreateInstance(Tcl_Interp *interp, | | | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #define TKWINSENDCOM_DISPID_ASYNC 2 /* * TkWinSendCom public functions */ MODULE_SCOPE HRESULT TkWinSendCom_CreateInstance(Tcl_Interp *interp, REFIID riid, void **ppv); MODULE_SCOPE int TkWinSend_QueueCommand(Tcl_Interp *interp, Tcl_Obj *cmdPtr); MODULE_SCOPE void TkWinSend_SetExcepInfo(Tcl_Interp *interp, EXCEPINFO *pExcepInfo); #endif /* _tkWinSendCom_h_INCLUDE */ /* * Local Variables: * mode: c * End: |
︙ | ︙ |
Changes to win/tkWinSysTray.c.
︙ | ︙ | |||
32 33 34 35 36 37 38 | */ #define GETHINSTANCE Tk_GetHINSTANCE() typedef struct IcoInfo { HICON hIcon; /* icon handle returned by LoadIcon. */ unsigned id; /* Identifier for command; used to | | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | */ #define GETHINSTANCE Tk_GetHINSTANCE() typedef struct IcoInfo { HICON hIcon; /* icon handle returned by LoadIcon. */ unsigned id; /* Identifier for command; used to * cancel it. */ Tcl_Obj *taskbar_txt; /* text to display in the taskbar */ Tcl_Interp *interp; /* interp which created the icon */ Tcl_Obj *taskbar_command; /* command to eval if events in the taskbar * arrive */ int taskbar_flags; /* taskbar related flags*/ HWND hwndFocus; struct IcoInfo *nextPtr; } IcoInfo; /* Per-interp struture */ typedef struct IcoInterpInfo { |
︙ | ︙ | |||
98 99 100 101 102 103 104 | RECT Rect, LPLPICONIMAGE lpIcon) { int x, y; /* Sanity checks */ if (lpIcon == NULL) | | | | | | | | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | RECT Rect, LPLPICONIMAGE lpIcon) { int x, y; /* Sanity checks */ if (lpIcon == NULL) return FALSE; if (lpIcon->lpBits == NULL) return FALSE; /* Account for height*2 thing */ lpIcon->lpbi->bmiHeader.biHeight /= 2; /* Locate it */ x = Rect.left + ((RectWidth(Rect) - lpIcon->lpbi->bmiHeader.biWidth) / 2); y = Rect.top + ((RectHeight(Rect) - lpIcon->lpbi->bmiHeader.biHeight) / 2); /* Blast it to the screen */ SetDIBitsToDevice(hDC, x, y, lpIcon->lpbi->bmiHeader.biWidth, lpIcon->lpbi->bmiHeader.biHeight, 0, 0, 0, lpIcon->lpbi->bmiHeader.biHeight, lpIcon->lpXOR, lpIcon->lpbi, DIB_RGB_COLORS); /* UnAccount for height*2 thing */ lpIcon->lpbi->bmiHeader.biHeight *= 2; return TRUE; } |
︙ | ︙ | |||
149 150 151 152 153 154 155 | LPLPICONIMAGE lpIcon) { LPBITMAPINFO lpbi; int x, y; /* Sanity checks */ if (lpIcon == NULL) | | | | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | LPLPICONIMAGE lpIcon) { LPBITMAPINFO lpbi; int x, y; /* Sanity checks */ if (lpIcon == NULL) return FALSE; if (lpIcon->lpBits == NULL) return FALSE; /* Need a bitmap header for the mono mask */ lpbi = ckalloc(sizeof(BITMAPINFO) + (2 * sizeof(RGBQUAD))); lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); lpbi->bmiHeader.biWidth = lpIcon->lpbi->bmiHeader.biWidth; lpbi->bmiHeader.biHeight = lpIcon->lpbi->bmiHeader.biHeight / 2; lpbi->bmiHeader.biPlanes = 1; |
︙ | ︙ | |||
181 182 183 184 185 186 187 | /* Locate it */ x = Rect.left + ((RectWidth(Rect) - lpbi->bmiHeader.biWidth) / 2); y = Rect.top + ((RectHeight(Rect) - lpbi->bmiHeader.biHeight) / 2); /* Blast it to the screen */ SetDIBitsToDevice(hDC, x, y, | | | | | | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | /* Locate it */ x = Rect.left + ((RectWidth(Rect) - lpbi->bmiHeader.biWidth) / 2); y = Rect.top + ((RectHeight(Rect) - lpbi->bmiHeader.biHeight) / 2); /* Blast it to the screen */ SetDIBitsToDevice(hDC, x, y, lpbi->bmiHeader.biWidth, lpbi->bmiHeader.biHeight, 0, 0, 0, lpbi->bmiHeader.biHeight, lpIcon->lpAND, lpbi, DIB_RGB_COLORS); /* clean up */ ckfree(lpbi); return TRUE; } #endif /* ICO_DRAW */ |
︙ | ︙ | |||
226 227 228 229 230 231 232 | ni.hWnd = icoInterpPtr->hwnd; ni.uID = icoPtr->id; ni.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE; ni.uCallbackMessage = ICON_MESSAGE; ni.hIcon = icoPtr->hIcon; if (icoPtr->taskbar_txt != NULL) { | | | | | | | | | | | | | | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | ni.hWnd = icoInterpPtr->hwnd; ni.uID = icoPtr->id; ni.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE; ni.uCallbackMessage = ICON_MESSAGE; ni.hIcon = icoPtr->hIcon; if (icoPtr->taskbar_txt != NULL) { Tcl_DString dst; Tcl_DStringInit(&dst); str = (WCHAR *)Tcl_UtfToWCharDString(Tcl_GetString(icoPtr->taskbar_txt), TCL_INDEX_NONE, &dst); wcsncpy(ni.szTip, str, (Tcl_DStringLength(&dst) + 2) / 2); Tcl_DStringFree(&dst); } else { ni.szTip[0] = 0; } if (Shell_NotifyIconW(oper, &ni) == 1) { if (oper == NIM_ADD || oper == NIM_MODIFY) { icoPtr->taskbar_flags |= TASKBAR_ICON; } if (oper == NIM_DELETE) { icoPtr->taskbar_flags &= ~TASKBAR_ICON; } } /* Silently ignore error? */ return TCL_OK; } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
308 309 310 311 312 313 314 | static void FreeIcoPtr( IcoInterpInfo *icoInterpPtr, IcoInfo *icoPtr) { IcoInfo *prevPtr; if (icoInterpPtr->firstIcoPtr == icoPtr) { | | | | | | | | | | | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | static void FreeIcoPtr( IcoInterpInfo *icoInterpPtr, IcoInfo *icoPtr) { IcoInfo *prevPtr; if (icoInterpPtr->firstIcoPtr == icoPtr) { icoInterpPtr->firstIcoPtr = icoPtr->nextPtr; } else { for (prevPtr = icoInterpPtr->firstIcoPtr; prevPtr->nextPtr != icoPtr; prevPtr = prevPtr->nextPtr) { /* Empty loop body. */ } prevPtr->nextPtr = icoPtr->nextPtr; } if (icoPtr->taskbar_flags & TASKBAR_ICON) { TaskbarOperation(icoInterpPtr, icoPtr, NIM_DELETE); } if (icoPtr->taskbar_txt != NULL) { Tcl_DecrRefCount(icoPtr->taskbar_txt); } if (icoPtr->taskbar_command != NULL) { Tcl_DecrRefCount(icoPtr->taskbar_command); } ckfree(icoPtr); } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
356 357 358 359 360 361 362 | { IcoInfo *icoPtr; unsigned id; const char *start; char *end; if (strncmp(string, "ico#", 4) != 0) { | | | | | | | | 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | { IcoInfo *icoPtr; unsigned id; const char *start; char *end; if (strncmp(string, "ico#", 4) != 0) { goto notfound; } start = string + 4; id = strtoul(start, &end, 10); if ((end == start) || (*end != 0)) { goto notfound; } for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { if (icoPtr->id == id) { return icoPtr; } } notfound: Tcl_AppendResult(interp, "icon \"", string, "\" doesn't exist", NULL); return NULL; } /* *---------------------------------------------------------------------- * * GetInt -- |
︙ | ︙ | |||
462 463 464 465 466 467 468 | #define SPACELEFT (*aftersize-(dst-after)-1) #define AFTERLEN ((*aftersize>0)?(*aftersize*2):1024) #define ALLOCLEN ((len>AFTERLEN)?(len*2):AFTERLEN) char buffer[TCL_INTEGER_SPACE + 5]; char* dst; dst = after; while (*before) { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 | #define SPACELEFT (*aftersize-(dst-after)-1) #define AFTERLEN ((*aftersize>0)?(*aftersize*2):1024) #define ALLOCLEN ((len>AFTERLEN)?(len*2):AFTERLEN) char buffer[TCL_INTEGER_SPACE + 5]; char* dst; dst = after; while (*before) { const char *ptr = before; int len = 1; if(*before == '%') { switch(before[1]){ case 'M': case 'm': { before++; len = strlen(msgstring); ptr = msgstring; break; } /* case 'W': { before++; len = (int)strlen(winstring); ptr = winstring; break; } */ case 'i': { before++; snprintf(buffer, sizeof(buffer) - 1, "ico#%d", icoPtr->id); len = strlen(buffer); ptr = buffer; break; } case 'w': { before++; len = GetInt((long)wParam,buffer, sizeof(buffer)); ptr = buffer; break; } case 'l': { before++; len = GetInt((long)lParam,buffer, sizeof(buffer)); ptr = buffer; break; } case 't': { before++; len = GetInt((long)GetTickCount(), buffer, sizeof(buffer)); ptr = buffer; break; } case 'x': { POINT pt; GetCursorPos(&pt); before++; len = GetIntDec((long)pt.x, buffer, sizeof(buffer)); ptr = buffer; break; } case 'y': { POINT pt; GetCursorPos(&pt); before++; len = GetIntDec((long)pt.y,buffer, sizeof(buffer)); ptr = buffer; break; } case 'X': { DWORD dw; dw = GetMessagePos(); before++; len = GetIntDec((long)LOWORD(dw),buffer, sizeof(buffer)); ptr = buffer; break; } case 'Y': { DWORD dw; dw = GetMessagePos(); before++; len = GetIntDec((long)HIWORD(dw),buffer, sizeof(buffer)); ptr = buffer; break; } case 'H': { before++; len = GetInt(PTR2INT(icoPtr->hwndFocus), buffer, sizeof(buffer)); ptr = buffer; break; } case '%': { before++; len = 1; ptr = "%"; break; } } } if (SPACELEFT < len) { char *newspace; ptrdiff_t dist = dst - after; int alloclen = ALLOCLEN; newspace = (char *)ckalloc(alloclen); if (dist>0) memcpy(newspace, after, dist); if (after && *aftersize) { ckfree(after); } *aftersize =alloclen; after = newspace; dst = after + dist; } if (len > 0) { memcpy(dst, ptr, len); } dst += len; if ((dst-after)>(*aftersize-1)) { printf("oops\n"); } before++; } *dst = 0; return after; } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
608 609 610 611 612 613 614 | char evalspace[200]; int evalsize = 200; char *expanded; int fixup = 0; switch (lParam) { case WM_MOUSEMOVE: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | char evalspace[200]; int evalsize = 200; char *expanded; int fixup = 0; switch (lParam) { case WM_MOUSEMOVE: msgstring = "WM_MOUSEMOVE"; icoPtr->hwndFocus = GetFocus(); break; case WM_LBUTTONDOWN: msgstring = "WM_LBUTTONDOWN"; fixup = 1; break; case WM_LBUTTONUP: msgstring = "WM_LBUTTONUP"; fixup = 1; break; case WM_LBUTTONDBLCLK: msgstring = "WM_LBUTTONDBLCLK"; fixup = 1; break; case WM_RBUTTONDOWN: msgstring = "WM_RBUTTONDOWN"; fixup = 1; break; case WM_RBUTTONUP: msgstring = "WM_RBUTTONUP"; fixup = 1; break; case WM_RBUTTONDBLCLK: msgstring = "WM_RBUTTONDBLCLK"; fixup = 1; break; case WM_MBUTTONDOWN: msgstring = "WM_MBUTTONDOWN"; fixup = 1; break; case WM_MBUTTONUP: msgstring = "WM_MBUTTONUP"; fixup = 1; break; case WM_MBUTTONDBLCLK: msgstring = "WM_MBUTTONDBLCLK"; fixup = 1; break; default: msgstring = "WM_NULL"; fixup = 0; } expanded = TaskbarExpandPercents(icoPtr, msgstring, wParam, lParam, Tcl_GetString(icoPtr->taskbar_command), evalspace, &evalsize); if (icoPtr->interp != NULL) { int result; HWND hwnd = NULL; /* See http://support.microsoft.com/kb/q135788/ * Seems to have moved to https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/135788 */ if (fixup) { if (icoPtr->hwndFocus != NULL && IsWindow(icoPtr->hwndFocus)) { hwnd = icoPtr->hwndFocus; } else { Tk_Window tkwin = Tk_MainWindow(icoPtr->interp); if (tkwin != NULL) { hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); } } if (hwnd != NULL) { SetForegroundWindow(hwnd); } } result = Tcl_GlobalEval(icoPtr->interp, expanded); if (hwnd != NULL) { /* See http://support.microsoft.com/kb/q135788/ * Seems to have moved to https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/135788 */ PostMessageW(hwnd, WM_NULL, 0, 0); } if (result != TCL_OK) { char buffer[100]; snprintf(buffer, 100, "\n (command bound to taskbar-icon ico#%d)", icoPtr->id); Tcl_AddErrorInfo(icoPtr->interp, buffer); Tcl_BackgroundError(icoPtr->interp); } } if (expanded != evalspace) { ckfree(expanded); } } /* *---------------------------------------------------------------------- * * TaskbarHandlerProc -- |
︙ | ︙ | |||
722 723 724 725 726 727 728 | { static UINT msgTaskbarCreated = 0; IcoInterpInfo *icoInterpPtr; IcoInfo *icoPtr; switch (message) { case WM_CREATE: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 | { static UINT msgTaskbarCreated = 0; IcoInterpInfo *icoInterpPtr; IcoInfo *icoPtr; switch (message) { case WM_CREATE: msgTaskbarCreated = RegisterWindowMessage(TEXT("TaskbarCreated")); break; case ICON_MESSAGE: for (icoInterpPtr = firstIcoInterpPtr; icoInterpPtr != NULL; icoInterpPtr = icoInterpPtr->nextPtr) { if (icoInterpPtr->hwnd == hwnd) { for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { if (icoPtr->id == wParam) { if (icoPtr->taskbar_command != NULL) { TaskbarEval(icoPtr, wParam, lParam); } break; } } break; } } break; default: /* * Check to see if explorer has been restarted and we need to * re-add our icons. */ if (message == msgTaskbarCreated) { for (icoInterpPtr = firstIcoInterpPtr; icoInterpPtr != NULL; icoInterpPtr = icoInterpPtr->nextPtr) { if (icoInterpPtr->hwnd == hwnd) { for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { if (icoPtr->taskbar_flags & TASKBAR_ICON) { TaskbarOperation(icoInterpPtr, icoPtr, NIM_ADD); } } break; } } } return DefWindowProc(hwnd, message, wParam, lParam); } return 0; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
819 820 821 822 823 824 825 | */ static HWND CreateTaskbarHandlerWindow(void) { static int registered = 0; HINSTANCE hInstance = GETHINSTANCE; if (!registered) { | | | | | | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 | */ static HWND CreateTaskbarHandlerWindow(void) { static int registered = 0; HINSTANCE hInstance = GETHINSTANCE; if (!registered) { if (!RegisterHandlerClass(hInstance)) return 0; registered = 1; } return CreateWindow(HANDLER_CLASS, "", WS_OVERLAPPED, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); } /* *---------------------------------------------------------------------- * * WinIcoDestroy -- * |
︙ | ︙ | |||
856 857 858 859 860 861 862 | { IcoInterpInfo *icoInterpPtr = (IcoInterpInfo*) clientData; IcoInterpInfo *prevIcoInterpPtr; IcoInfo *icoPtr; IcoInfo *nextPtr; if (eventPtr->type != DestroyNotify) { | | | | | | | | | | | 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 | { IcoInterpInfo *icoInterpPtr = (IcoInterpInfo*) clientData; IcoInterpInfo *prevIcoInterpPtr; IcoInfo *icoPtr; IcoInfo *nextPtr; if (eventPtr->type != DestroyNotify) { return; } if (firstIcoInterpPtr == icoInterpPtr) { firstIcoInterpPtr = icoInterpPtr->nextPtr; } else { for (prevIcoInterpPtr = firstIcoInterpPtr; prevIcoInterpPtr->nextPtr != icoInterpPtr; prevIcoInterpPtr = prevIcoInterpPtr->nextPtr) { /* Empty loop body. */ } prevIcoInterpPtr->nextPtr = icoInterpPtr->nextPtr; } DestroyWindow(icoInterpPtr->hwnd); for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = nextPtr) { nextPtr = icoPtr->nextPtr; FreeIcoPtr(icoInterpPtr, icoPtr); } ckfree(icoInterpPtr); } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
901 902 903 904 905 906 907 | WinSystrayCmd( void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { static const char *const cmdStrings[] = { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | WinSystrayCmd( void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { static const char *const cmdStrings[] = { "add", "delete", "modify", NULL }; enum { CMD_ADD, CMD_DELETE, CMD_MODIFY }; static const char *const optStrings[] = { "-callback", "-image", "-text", NULL }; enum { OPT_CALLBACK, OPT_IMAGE, OPT_TEXT }; int cmd, opt; HICON hIcon; int i; IcoInterpInfo *icoInterpPtr = (IcoInterpInfo*) clientData; IcoInfo *icoPtr = NULL; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "command ..."); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], cmdStrings, "command", 0, &cmd) == TCL_ERROR) { return TCL_ERROR; } switch (cmd) { case CMD_ADD: case CMD_MODIFY: { Tcl_Obj *imageObj = NULL, *textObj = NULL, *callbackObj = NULL; int optStart; int oper; if (cmd == CMD_ADD) { optStart = 2; oper = NIM_ADD; } else { optStart = 3; oper = NIM_MODIFY; if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "id option value"); return TCL_ERROR; } icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); if (icoPtr == NULL) { return TCL_ERROR; } } for (i = optStart; i < objc; i += 2) { if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option", 0, &opt) == TCL_ERROR) { return TCL_ERROR; } if (i+1 >= objc) { Tcl_AppendResult(interp, "missing value for option \"", Tcl_GetString(objv[i]), "\"", NULL); return TCL_ERROR; } switch (opt) { case OPT_IMAGE: imageObj = objv[i+1]; break; case OPT_TEXT: textObj = objv[i+1]; break; case OPT_CALLBACK: callbackObj = objv[i+1]; break; } } if (cmd == CMD_ADD && imageObj == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("missing required option \"-image\"", TCL_INDEX_NONE)); return TCL_ERROR; } if (imageObj != NULL) { Tk_PhotoHandle photo; int width, height; Tk_PhotoImageBlock block; photo = Tk_FindPhoto(interp, Tcl_GetString(imageObj)); if (photo == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image \"%s\" doesn't exist", Tcl_GetString(imageObj))); return TCL_ERROR; } Tk_PhotoGetSize(photo, &width, &height); Tk_PhotoGetImage(photo, &block); hIcon = CreateIcoFromPhoto(width, height, block); if (hIcon == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "failed to create an iconphoto with image \"%s\"", Tcl_GetString(imageObj))); return TCL_ERROR; } } if (cmd == CMD_ADD) { icoPtr = NewIcon(interp, icoInterpPtr, hIcon); } else { if (imageObj != NULL) { DestroyIcon(icoPtr->hIcon); icoPtr->hIcon = hIcon; } } if (callbackObj != NULL) { if (icoPtr->taskbar_command != NULL) { Tcl_DecrRefCount(icoPtr->taskbar_command); } icoPtr->taskbar_command = callbackObj; Tcl_IncrRefCount(icoPtr->taskbar_command); } if (textObj != NULL) { if (icoPtr->taskbar_txt != NULL) { Tcl_DecrRefCount(icoPtr->taskbar_txt); } icoPtr->taskbar_txt = textObj; Tcl_IncrRefCount(icoPtr->taskbar_txt); } TaskbarOperation(icoInterpPtr, icoPtr, oper); if (cmd == CMD_ADD) { char buffer[5 + TCL_INTEGER_SPACE]; int n; n = snprintf(buffer, sizeof(buffer) - 1, "ico#%d", icoPtr->id); buffer[n] = 0; Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, n)); } return TCL_OK; } case CMD_DELETE: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "id"); return TCL_ERROR; } icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); if (icoPtr == NULL) { return TCL_ERROR; } FreeIcoPtr(icoInterpPtr, icoPtr); return TCL_OK; } return TCL_OK; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
1070 1071 1072 1073 1074 1075 1076 | Tcl_DString infodst; Tcl_DString titledst; NOTIFYICONDATAW ni; char *msgtitle; char *msginfo; if (objc < 2) { | | | | | | | | | | | | | | | | | | | | 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | Tcl_DString infodst; Tcl_DString titledst; NOTIFYICONDATAW ni; char *msgtitle; char *msginfo; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "command ..."); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[1]), "notify") != 0) { Tcl_AppendResult(interp, "unknown subcommand \"", Tcl_GetString(objv[1]), "\": must be notify", NULL); return TCL_ERROR; } if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "id title detail"); return TCL_ERROR; } icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); if (icoPtr == NULL) { return TCL_ERROR; } ni.cbSize = sizeof(NOTIFYICONDATAW); ni.hWnd = icoInterpPtr->hwnd; ni.uID = icoPtr->id; ni.uFlags = NIF_INFO; ni.uCallbackMessage = ICON_MESSAGE; ni.hIcon = icoPtr->hIcon; ni.dwInfoFlags = NIIF_INFO; /* Use a sane platform-specific icon here.*/ msgtitle = Tcl_GetString(objv[3]); msginfo = Tcl_GetString(objv[4]); /* Balloon notification for system tray icon. */ if (msgtitle != NULL) { WCHAR *title; Tcl_DStringInit(&titledst); title = Tcl_UtfToWCharDString(msgtitle, TCL_INDEX_NONE, &titledst); wcsncpy(ni.szInfoTitle, title, (Tcl_DStringLength(&titledst) + 2) / 2); Tcl_DStringFree(&titledst); } if (msginfo != NULL) { WCHAR *info; Tcl_DStringInit(&infodst); info = Tcl_UtfToWCharDString(msginfo, TCL_INDEX_NONE, &infodst); wcsncpy(ni.szInfo, info, (Tcl_DStringLength(&infodst) + 2) / 2); Tcl_DStringFree(&infodst); } Shell_NotifyIconW(NIM_MODIFY, &ni); return TCL_OK; } /* |
︙ | ︙ | |||
1144 1145 1146 1147 1148 1149 1150 | Tcl_Interp *interp) { IcoInterpInfo *icoInterpPtr; Tk_Window mainWindow; mainWindow = Tk_MainWindow(interp); if (mainWindow == NULL) { | | | | | | | 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 | Tcl_Interp *interp) { IcoInterpInfo *icoInterpPtr; Tk_Window mainWindow; mainWindow = Tk_MainWindow(interp); if (mainWindow == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("main window has been destroyed", TCL_INDEX_NONE)); return TCL_ERROR; } icoInterpPtr = (IcoInterpInfo*) ckalloc(sizeof(IcoInterpInfo)); icoInterpPtr->counter = 0; icoInterpPtr->firstIcoPtr = NULL; icoInterpPtr->hwnd = CreateTaskbarHandlerWindow(); icoInterpPtr->nextPtr = firstIcoInterpPtr; firstIcoInterpPtr = icoInterpPtr; Tcl_CreateObjCommand(interp, "::tk::systray::_systray", WinSystrayCmd, icoInterpPtr, NULL); Tcl_CreateObjCommand(interp, "::tk::sysnotify::_sysnotify", WinSysNotifyCmd, icoInterpPtr, NULL); Tk_CreateEventHandler(mainWindow, StructureNotifyMask, WinIcoDestroy, icoInterpPtr); return TCL_OK; } /* * Local variables: * mode: c * indent-tabs-mode: nil * End: */ |
Changes to win/tkWinTest.c.
︙ | ︙ | |||
94 95 96 97 98 99 100 | */ HWND TestFindControl(HWND root, int id) { struct TestFindControlState fcs; fcs.control = GetDlgItem(root, id); if (fcs.control == NULL) { | | | | | | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | */ HWND TestFindControl(HWND root, int id) { struct TestFindControlState fcs; fcs.control = GetDlgItem(root, id); if (fcs.control == NULL) { /* Control is not a direct child. Look in descendents */ fcs.id = id; fcs.control = NULL; EnumChildWindows(root, TestFindControlCallback, (LPARAM) &fcs); } return fcs.control; } /* *---------------------------------------------------------------------- |
︙ | ︙ | |||
356 357 358 359 360 361 362 | case WM_GETTEXT: { Tcl_DString ds; char buf[256]; #if 0 GetDlgItemTextA(hwnd, id, buf, 256); #else | | | | | | | | | | | 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | case WM_GETTEXT: { Tcl_DString ds; char buf[256]; #if 0 GetDlgItemTextA(hwnd, id, buf, 256); #else control = TestFindControl(hwnd, id); if (control == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("Could not find control with id %d", id)); return TCL_ERROR; } buf[0] = 0; SendMessageA(control, WM_GETTEXT, (WPARAM)sizeof(buf), (LPARAM) buf); #endif Tcl_AppendResult(interp, Tcl_ExternalToUtfDString(NULL, buf, TCL_INDEX_NONE, &ds), NULL); Tcl_DStringFree(&ds); break; } case WM_SETTEXT: { Tcl_DString ds; |
︙ | ︙ | |||
439 440 441 442 443 444 445 | int r = TCL_OK; DWORD myPid; Tcl_DStringInit(&classString); Tcl_DStringInit(&titleString); if (objc < 2 || objc > 3) { | | | | | | | | | | | | | | | | | | 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | int r = TCL_OK; DWORD myPid; Tcl_DStringInit(&classString); Tcl_DStringInit(&titleString); if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "title ?class?"); return TCL_ERROR; } Tcl_DStringInit(&titleString); title = Tcl_UtfToWCharDString(Tcl_GetString(objv[1]), TCL_INDEX_NONE, &titleString); if (objc == 3) { Tcl_DStringInit(&classString); windowClass = Tcl_UtfToWCharDString(Tcl_GetString(objv[2]), TCL_INDEX_NONE, &classString); } if (title[0] == 0) title = NULL; /* We want find a window the belongs to us and not some other process */ hwnd = NULL; myPid = GetCurrentProcessId(); while (1) { DWORD pid, tid; hwnd = FindWindowExW(NULL, hwnd, windowClass, title); if (hwnd == NULL) break; tid = GetWindowThreadProcessId(hwnd, &pid); if (tid == 0) { /* Window has gone */ hwnd = NULL; break; } if (pid == myPid) break; /* Found it */ } if (hwnd == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to find window: ", TCL_INDEX_NONE)); AppendSystemError(interp, GetLastError()); r = TCL_ERROR; } else { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(PTR2INT(hwnd))); } Tcl_DStringFree(&titleString); Tcl_DStringFree(&classString); return r; } |
︙ | ︙ |
Changes to win/tkWinWm.c.
︙ | ︙ | |||
1429 1430 1431 1432 1433 1434 1435 | Tcl_SetObjResult(interp, Tcl_ObjPrintf( "error opening file \"%s\" for reading: %s", Tcl_GetString(fileName), Tcl_PosixError(interp))); return NULL; } if (Tcl_SetChannelOption(interp, channel, "-translation", "binary") != TCL_OK) { | < < < < < | 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | Tcl_SetObjResult(interp, Tcl_ObjPrintf( "error opening file \"%s\" for reading: %s", Tcl_GetString(fileName), Tcl_PosixError(interp))); return NULL; } if (Tcl_SetChannelOption(interp, channel, "-translation", "binary") != TCL_OK) { Tcl_Close(NULL, channel); return NULL; } /* * Allocate memory for the resource structure */ |
︙ | ︙ |
Changes to win/tkWinX.c.
︙ | ︙ | |||
657 658 659 660 661 662 663 | ckfree(display->display_name); } if (ScreenOfDisplay(display, 0) != NULL) { if (DefaultVisualOfScreen(ScreenOfDisplay(display, 0)) != NULL) { ckfree(DefaultVisualOfScreen(ScreenOfDisplay(display, 0))); } if (RootWindowOfScreen(ScreenOfDisplay(display, 0)) != None) { | | | 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | ckfree(display->display_name); } if (ScreenOfDisplay(display, 0) != NULL) { if (DefaultVisualOfScreen(ScreenOfDisplay(display, 0)) != NULL) { ckfree(DefaultVisualOfScreen(ScreenOfDisplay(display, 0))); } if (RootWindowOfScreen(ScreenOfDisplay(display, 0)) != None) { ckfree((char *)RootWindowOfScreen(ScreenOfDisplay(display, 0))); } if (DefaultColormapOfScreen(ScreenOfDisplay(display, 0)) != None) { XFreeColormap(display, DefaultColormapOfScreen(ScreenOfDisplay(display, 0))); } ckfree(ScreenOfDisplay(display, 0)); } ckfree(display); |
︙ | ︙ | |||
802 803 804 805 806 807 808 | case TK_SETMENU: case TK_STATE: case TK_INFO: result = TkWinEmbeddedEventProc(hwnd, message, wParam, lParam); break; case WM_UNICHAR: | | | | | | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 | case TK_SETMENU: case TK_STATE: case TK_INFO: result = TkWinEmbeddedEventProc(hwnd, message, wParam, lParam); break; case WM_UNICHAR: if (wParam == UNICODE_NOCHAR) { /* If wParam is UNICODE_NOCHAR and the application processes * this message, then return TRUE. */ result = 1; } else { /* If the event was translated, we must return 0 */ if (TkTranslateWinEvent(hwnd, message, wParam, lParam, &result)) { result = 0; } else { result = 1; } } break; default: if (!TkTranslateWinEvent(hwnd, message, wParam, lParam, &result)) { result = DefWindowProcW(hwnd, message, wParam, lParam); |
︙ | ︙ | |||
868 869 870 871 872 873 874 | if (winPtr) { TkWinClipboardRender(winPtr->dispPtr, wParam); } return 1; } case WM_RENDERALLFORMATS: { | | | | | | | | | | | | | | 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 | if (winPtr) { TkWinClipboardRender(winPtr->dispPtr, wParam); } return 1; } case WM_RENDERALLFORMATS: { TkWindow *winPtr = (TkWindow *) Tk_HWNDToWindow(hwnd); if (winPtr && OpenClipboard(hwnd)) { /* * Make sure that nobody had taken ownership of the clipboard * before we opened it. */ if (GetClipboardOwner() == hwnd) { TkWinClipboardRender(winPtr->dispPtr, CF_TEXT); } CloseClipboard(); } return 1; } case WM_COMMAND: case WM_NOTIFY: case WM_VSCROLL: case WM_HSCROLL: { /* |
︙ | ︙ | |||
1217 1218 1219 1220 1221 1222 1223 | * MBCS characters that came from the TranslateMessage call. */ event.x.type = KeyPress; event.x.xany.send_event = -1; event.x.xkey.keycode = wParam; GetTranslatedKey(&event.key, (message == WM_KEYDOWN) ? WM_CHAR : | | | 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 | * MBCS characters that came from the TranslateMessage call. */ event.x.type = KeyPress; event.x.xany.send_event = -1; event.x.xkey.keycode = wParam; GetTranslatedKey(&event.key, (message == WM_KEYDOWN) ? WM_CHAR : WM_SYSCHAR); break; case WM_SYSKEYUP: case WM_KEYUP: /* * We don't check for translated characters on keyup because Tk * won't know what to do with them. Instead, we wait for the |
︙ | ︙ | |||
1290 1291 1292 1293 1294 1295 1296 | event.key.nbytes = 1; event.key.trans_chars[0] = (char) wParam; if (IsDBCSLeadByte((BYTE) wParam)) { MSG msg; if ((PeekMessageW(&msg, NULL, WM_CHAR, WM_CHAR, | | | 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 | event.key.nbytes = 1; event.key.trans_chars[0] = (char) wParam; if (IsDBCSLeadByte((BYTE) wParam)) { MSG msg; if ((PeekMessageW(&msg, NULL, WM_CHAR, WM_CHAR, PM_NOREMOVE) != 0) && (msg.message == WM_CHAR)) { GetMessageW(&msg, NULL, WM_CHAR, WM_CHAR); event.key.nbytes = 2; event.key.trans_chars[1] = (char) msg.wParam; } } } |
︙ | ︙ |
Changes to win/ttkWinMonitor.c.
︙ | ︙ | |||
118 119 120 121 122 123 124 | case WM_SYSCOLORCHANGE: RegisterSystemColors(interp); break; case WM_THEMECHANGED: /* | | | | | | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | case WM_SYSCOLORCHANGE: RegisterSystemColors(interp); break; case WM_THEMECHANGED: /* * Reset the application theme. * On windows, it is possible to sign in as a second user, change * the theme to 'winnative' (by setting the ui to 'best performance'), * which is a machine-wide change, and then sign back on to the original user. * Ttk_UseTheme needs to be executed again in order to process the fallback * from vista/xpnative to winnative. */ theme = Ttk_GetCurrentTheme(interp); if (theme) { Ttk_UseTheme(interp, theme); /* @@@ What to do about errors here? */ } |
︙ | ︙ |
Changes to win/ttkWinTheme.c.
︙ | ︙ | |||
617 618 619 620 621 622 623 | int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumbPtr = (ThumbElement *)elementRecord; Ttk_Orient orient; | | | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumbPtr = (ThumbElement *)elementRecord; Ttk_Orient orient; TtkGetOrientFromObj(NULL, thumbPtr->orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = GetSystemMetrics(SM_CXHTHUMB); *heightPtr = GetSystemMetrics(SM_CYHSCROLL); } else { *widthPtr = GetSystemMetrics(SM_CXVSCROLL); *heightPtr = GetSystemMetrics(SM_CYVTHUMB); } |
︙ | ︙ | |||
682 683 684 685 686 687 688 | int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; | | | 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; TtkGetOrientFromObj(NULL, slider->orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = (GetSystemMetrics(SM_CXHTHUMB) / 2) | 1; *heightPtr = GetSystemMetrics(SM_CYHSCROLL); } else { *widthPtr = GetSystemMetrics(SM_CXVSCROLL); *heightPtr = (GetSystemMetrics(SM_CYVTHUMB) / 2) | 1; } |
︙ | ︙ | |||
960 961 962 963 964 965 966 | { Ttk_Theme themePtr, parentPtr; const FrameControlElementData *fce = FrameControlElements; parentPtr = Ttk_GetTheme(interp, "alt"); themePtr = Ttk_CreateTheme(interp, "winnative", parentPtr); if (!themePtr) { | | | 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | { Ttk_Theme themePtr, parentPtr; const FrameControlElementData *fce = FrameControlElements; parentPtr = Ttk_GetTheme(interp, "alt"); themePtr = Ttk_CreateTheme(interp, "winnative", parentPtr); if (!themePtr) { return TCL_ERROR; } Ttk_RegisterElementSpec(themePtr, "border", &BorderElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "Button.border", &ButtonBorderElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "field", &FieldElementSpec, NULL); Ttk_RegisterElementSpec(themePtr, "focus", &FocusElementSpec, NULL); |
︙ | ︙ |
Changes to win/ttkWinXPTheme.c.
︙ | ︙ | |||
21 22 23 24 25 26 27 | #include <vssym32.h> #include "ttk/ttkThemeInt.h" typedef HTHEME (STDAPICALLTYPE OpenThemeDataProc)(HWND hwnd, LPCWSTR pszClassList); typedef HRESULT (STDAPICALLTYPE CloseThemeDataProc)(HTHEME hTheme); typedef HRESULT (STDAPICALLTYPE DrawThemeBackgroundProc)(HTHEME hTheme, | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #include <vssym32.h> #include "ttk/ttkThemeInt.h" typedef HTHEME (STDAPICALLTYPE OpenThemeDataProc)(HWND hwnd, LPCWSTR pszClassList); typedef HRESULT (STDAPICALLTYPE CloseThemeDataProc)(HTHEME hTheme); typedef HRESULT (STDAPICALLTYPE DrawThemeBackgroundProc)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect); typedef HRESULT (STDAPICALLTYPE DrawThemeEdgeProc)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pDestRect, unsigned int uEdge, unsigned int uFlags, OPTIONAL RECT *pContentRect); typedef HRESULT (STDAPICALLTYPE GetThemePartSizeProc)(HTHEME,HDC, int iPartId, int iStateId, RECT *prc, enum THEMESIZE eSize, SIZE *psz); |
︙ | ︙ | |||
422 423 424 425 426 427 428 | * then the info member is dynamically allocated. Otherwise it was * static data from the C object and only the ElementData needs freeing. */ static void DestroyElementData(void *clientData) { ElementData *elementData = (ElementData *)clientData; if (elementData->info->flags & HEAP_ELEMENT) { | | | | | | 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | * then the info member is dynamically allocated. Otherwise it was * static data from the C object and only the ElementData needs freeing. */ static void DestroyElementData(void *clientData) { ElementData *elementData = (ElementData *)clientData; if (elementData->info->flags & HEAP_ELEMENT) { ckfree((char *)elementData->info->statemap); ckfree((char *)elementData->info->className); ckfree((char *)elementData->info->elementName); ckfree((char *)elementData->info); } ckfree(clientData); } /* * InitElementData -- * Looks up theme handle. If Drawable argument is non-NULL, |
︙ | ︙ | |||
801 802 803 804 805 806 807 | RECT rc = BoxToRect(b); if (!InitElementData(elementData, tkwin, d)) return; if (nbTabsStickBit == TTK_STICK_S) { | | | 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | RECT rc = BoxToRect(b); if (!InitElementData(elementData, tkwin, d)) return; if (nbTabsStickBit == TTK_STICK_S) { if (state & TTK_STATE_FIRST) { partId = TABP_TABITEMLEFTEDGE; } /* * Draw the border and fill into rc */ elementData->procs->DrawThemeBackground( |
︙ | ︙ | |||
888 889 890 891 892 893 894 | }; static void TreeIndicatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { if (!(state & TTK_STATE_LEAF)) { | | | 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | }; static void TreeIndicatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { if (!(state & TTK_STATE_LEAF)) { GenericElementDraw(clientData,elementRecord,tkwin,d,b,state); } } static const Ttk_ElementSpec TreeIndicatorElementSpec = { TK_STYLE_VERSION_2, sizeof(NullElement), |
︙ | ︙ | |||
1027 1028 1029 1030 1031 1032 1033 | TTK_GROUP("Button.padding", TTK_FILL_BOTH, TTK_NODE("Button.label", TTK_FILL_BOTH))))) TTK_LAYOUT("TMenubutton", TTK_NODE("Menubutton.dropdown", TTK_PACK_RIGHT|TTK_FILL_Y) TTK_GROUP("Menubutton.button", TTK_FILL_BOTH, TTK_GROUP("Menubutton.padding", TTK_FILL_X, | | | 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | TTK_GROUP("Button.padding", TTK_FILL_BOTH, TTK_NODE("Button.label", TTK_FILL_BOTH))))) TTK_LAYOUT("TMenubutton", TTK_NODE("Menubutton.dropdown", TTK_PACK_RIGHT|TTK_FILL_Y) TTK_GROUP("Menubutton.button", TTK_FILL_BOTH, TTK_GROUP("Menubutton.padding", TTK_FILL_X, TTK_NODE("Menubutton.label", 0)))) TTK_LAYOUT("Horizontal.TScrollbar", TTK_GROUP("Horizontal.Scrollbar.trough", TTK_FILL_X, TTK_NODE("Horizontal.Scrollbar.leftarrow", TTK_PACK_LEFT) TTK_NODE("Horizontal.Scrollbar.rightarrow", TTK_PACK_RIGHT) TTK_GROUP("Horizontal.Scrollbar.thumb", TTK_FILL_BOTH|TTK_UNIT, TTK_NODE("Horizontal.Scrollbar.grip", 0)))) |
︙ | ︙ | |||
1405 1406 1407 1408 1409 1410 1411 | /* * Create the new style engine. */ parentPtr = Ttk_GetTheme(interp, "winnative"); themePtr = Ttk_CreateTheme(interp, "xpnative", parentPtr); if (!themePtr) | | | 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 | /* * Create the new style engine. */ parentPtr = Ttk_GetTheme(interp, "winnative"); themePtr = Ttk_CreateTheme(interp, "xpnative", parentPtr); if (!themePtr) return TCL_ERROR; /* * Set theme data and cleanup proc */ themeData = (XPThemeData *)ckalloc(sizeof(XPThemeData)); themeData->procs = procs; |
︙ | ︙ |
Changes to win/winMain.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ | < < < < < < < < < < < < < < < < < < < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tk.h" #define WIN32_LEAN_AND_MEAN #include <windows.h> #undef WIN32_LEAN_AND_MEAN #include <locale.h> #include <stdlib.h> #include <tchar.h> |
︙ | ︙ |
Changes to xlib/X11/keysymdef.h.
︙ | ︙ | |||
253 254 255 256 257 258 259 260 261 262 263 264 265 266 | #define XK_Prior 0xff55 /* Prior, previous */ #define XK_Page_Up 0xff55 /* deprecated alias for Prior */ #define XK_Next 0xff56 /* Next */ #define XK_Page_Down 0xff56 /* deprecated alias for Next */ #define XK_End 0xff57 /* EOL */ #define XK_Begin 0xff58 /* BOL */ /* Misc functions */ #define XK_Select 0xff60 /* Select, mark */ #define XK_Print 0xff61 #define XK_Execute 0xff62 /* Execute, run, do */ #define XK_Insert 0xff63 /* Insert, insert here */ | > > > > > > > > > | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | #define XK_Prior 0xff55 /* Prior, previous */ #define XK_Page_Up 0xff55 /* deprecated alias for Prior */ #define XK_Next 0xff56 /* Next */ #define XK_Page_Down 0xff56 /* deprecated alias for Next */ #define XK_End 0xff57 /* EOL */ #define XK_Begin 0xff58 /* BOL */ #ifndef TK_NO_DEPRECATED /* Special Windows keyboard keys */ #define XK_Win_L 0xFF5B /* Left-hand Windows */ #define XK_Win_R 0xFF5C /* Right-hand Windows */ #define XK_App 0xFF5D /* Menu key */ #endif /* Misc functions */ #define XK_Select 0xff60 /* Select, mark */ #define XK_Print 0xff61 #define XK_Execute 0xff62 /* Execute, run, do */ #define XK_Insert 0xff63 /* Insert, insert here */ |
︙ | ︙ | |||
2578 2579 2580 2581 2582 2583 2584 | #define XK_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */ #define XK_Sinh_au2 0x1000dde /* U+0DDE SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */ #define XK_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA VOWEL SIGN GAYANUKITTA */ #define XK_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA VOWEL SIGN DIGA GAETTA-PILLA */ #define XK_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA VOWEL SIGN DIGA GAYANUKITTA */ #define XK_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA PUNCTUATION KUNDDALIYA */ #endif /* XK_SINHALA */ | > > > > > > > > > > > > > > > | 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 | #define XK_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */ #define XK_Sinh_au2 0x1000dde /* U+0DDE SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */ #define XK_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA VOWEL SIGN GAYANUKITTA */ #define XK_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA VOWEL SIGN DIGA GAETTA-PILLA */ #define XK_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA VOWEL SIGN DIGA GAYANUKITTA */ #define XK_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA PUNCTUATION KUNDDALIYA */ #endif /* XK_SINHALA */ /* Multimedia keys, defined same as on Linux * /usr/include/pkg/libxkbcommon/xkbcommon/xkbcommon-keysyms.h */ #ifndef TK_NO_DEPRECATED #define XK_XF86AudioLowerVolume 0x1008FF11 /* Volume control down */ #define XK_XF86AudioMute 0x1008FF12 /* Mute sound from the system */ #define XK_XF86AudioRaiseVolume 0x1008FF13 /* Volume control up */ #define XK_XF86AudioPlay 0x1008FF14 /* Start playing of audio > */ #define XK_XF86AudioStop 0x1008FF15 /* Stop playing audio */ #define XK_XF86AudioPrev 0x1008FF16 /* Previous track */ #define XK_XF86AudioNext 0x1008FF17 /* Next track */ #endif /* !TK_NO_DEPRECATED */ |