Index: .github/workflows/linux-build.yml
==================================================================
--- .github/workflows/linux-build.yml
+++ .github/workflows/linux-build.yml
@@ -33,15 +33,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Setup Environment (compiler=${{ matrix.compiler }})
         run: |
           sudo apt-get install libxss-dev libxft-dev
           mkdir "$HOME/install dir"
@@ -137,15 +137,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Setup Environment (compiler=${{ matrix.compiler }})
         run: |
           sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev xfonts-75dpi xfonts-100dpi xfonts-scalable libxfont2 unifont
           mkdir "$HOME/install dir"

DELETED .github/workflows/linux-with-tcl91-build.yml
Index: .github/workflows/linux-with-tcl91-build.yml
==================================================================
--- .github/workflows/linux-with-tcl91-build.yml
+++ /dev/null
@@ -1,178 +0,0 @@
-name: Linux (with Tcl 9.1)
-on:
-  push:
-    branches:
-    - "main"
-    - "core-9-0-branch"
-    - "revised_text"
-    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"
-        config:
-          - ""
-          - "CFLAGS=-DTK_NO_DEPRECATED=1"
-          - "--disable-shared"
-          - "--disable-xft"
-          - "--disable-xss"
-          - "--enable-symbols"
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v4
-        with:
-          path: tk
-      - name: Checkout Tcl 9.1
-        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.config }}
-          COMPILER: ${{ matrix.compiler }}
-          OPTS: ${{ matrix.compiler }}${{ matrix.config }}
-      - 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.config }})
-        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"
-        config:
-          - ""
-          - "--disable-xft"
-          - "--enable-symbols"
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v4
-        with:
-          path: tk
-      - name: Checkout Tcl 9.1
-        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 xfonts-75dpi xfonts-100dpi xfonts-scalable libxfont2 unifont
-          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.config }}
-          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.config }}
-        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

Index: .github/workflows/mac-build.yml
==================================================================
--- .github/workflows/mac-build.yml
+++ .github/workflows/mac-build.yml
@@ -21,15 +21,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Check out Tcl 9.0
+      - name: Check out Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Prepare checked out repositories
         run: |
           touch tk/generic/tkStubInit.c
           mkdir build
@@ -73,15 +73,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Check out Tcl 9.0
+      - name: Check out Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Prepare checked out repositories
         env:
           SET_DISPLAY: ${{ contains(matrix.options, '--disable-aqua') }}
         run: |

Index: .github/workflows/onefiledist.yml
==================================================================
--- .github/workflows/onefiledist.yml
+++ .github/workflows/onefiledist.yml
@@ -21,15 +21,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Setup Environment
         run: |
           sudo apt-get install libxss-dev libxft-dev
           touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c
@@ -55,11 +55,11 @@
           make binaries libraries install
         working-directory: tk/unix
         # TODO: need the Tk version separately for distro naming below
       - name: Package
         run: |
-          cp bin/wish9.0 ${BUILD_NAME}
+          cp bin/wish9.1 ${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
@@ -85,15 +85,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Checkout create-dmg
         uses: actions/checkout@v4
         with:
           repository: create-dmg/create-dmg
@@ -173,15 +173,15 @@
           install: git mingw-w64-x86_64-toolchain make zip
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Setup Environment
         run: |
           mkdir -p install/combined
           touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c

Index: .github/workflows/win-build.yml
==================================================================
--- .github/workflows/win-build.yml
+++ .github/workflows/win-build.yml
@@ -28,15 +28,15 @@
     steps:
       - name: Checkout Tk
         uses: actions/checkout@v4
         with:
           path: tk
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Init MSVC
         uses: ilammy/msvc-dev-cmd@v1
       - name: Make Install Location
         working-directory: tcl
@@ -118,15 +118,15 @@
         with:
           msystem: MINGW64
           install: git mingw-w64-x86_64-toolchain make zip
       - name: Checkout Tk
         uses: actions/checkout@v4
-      - name: Checkout Tcl 9.0
+      - name: Checkout Tcl 9.1
         uses: actions/checkout@v4
         with:
           repository: tcltk/tcl
-          ref: core-9-0-branch
+          ref: main
           path: tcl
       - name: Prepare
         run: |
           touch tkStubInit.c
           touch "${HOME}/forWinDialog-5.12.7"

Index: .project
==================================================================
--- .project
+++ .project
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>tk9.0</name>
+	<name>tk9.1</name>
 	<comment></comment>
 	<projects>
 	</projects>
 	<buildSpec>
 	</buildSpec>

Index: README.md
==================================================================
--- README.md
+++ README.md
@@ -1,29 +1,29 @@
 # README:  Tk
 
-This is the **Tk 9.0.2** source distribution.
+This is the **Tk 9.1a0** source distribution.
 
 You can get any source release of Tk from [our distribution
 site](https://sourceforge.net/projects/tcl/files/Tcl/).
 
-9.0 (production release, daily build)
+9.1 (in development, daily build)
 [![Build Status](https://github.com/tcltk/tk/actions/workflows/linux-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tk/actions/workflows/linux-build.yml?query=branch%3Amain)
 [![Build Status](https://github.com/tcltk/tk/actions/workflows/win-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tk/actions/workflows/win-build.yml?query=branch%3Amain)
 [![Build Status](https://github.com/tcltk/tk/actions/workflows/mac-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tk/actions/workflows/mac-build.yml?query=branch%3Amain)
 <br>
-8.6 (legacy release, daily build)
-[![Build Status](https://github.com/tcltk/tk/actions/workflows/linux-build.yml/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions/workflows/linux-build.yml?query=branch%3Acore-8-6-branch)
-[![Build Status](https://github.com/tcltk/tk/actions/workflows/win-build.yml/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions/workflows/win-build.yml?query=branch%3Acore-8-6-branch)
-[![Build Status](https://github.com/tcltk/tk/actions/workflows/mac-build.yml/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions/workflows/mac-build.yml?query=branch%3Acore-8-6-branch)
+9.0 (production release, daily build)
+[![Build Status](https://github.com/tcltk/tk/actions/workflows/linux-build.yml/badge.svg?branch=core-9-0-branch)](https://github.com/tcltk/tk/actions/workflows/linux-build.yml?query=branch%3Acore-9-0-branch)
+[![Build Status](https://github.com/tcltk/tk/actions/workflows/win-build.yml/badge.svg?branch=core-9-0-branch)](https://github.com/tcltk/tk/actions/workflows/win-build.yml?query=branch%3Acore-9-0-branch)
+[![Build Status](https://github.com/tcltk/tk/actions/workflows/mac-build.yml/badge.svg?branch=core-9-0-branch)](https://github.com/tcltk/tk/actions/workflows/mac-build.yml?query=branch%3Acore-9-0-branch)
 
 ## <a id="intro">1.</a> Introduction
 
 This directory contains the sources and documentation for Tk, a
 cross-platform GUI toolkit implemented with the Tcl scripting language.
 
 For details on features, incompatibilities, and potential problems with
-this release, see [the Tcl/Tk 9.0 Web page](https://www.tcl-lang.org/software/tcltk/9.0.html)
+this release, see [the Tcl/Tk 9.1 Web page](https://www.tcl-lang.org/software/tcltk/9.1.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

Index: changes.md
==================================================================
--- changes.md
+++ changes.md
@@ -2,103 +2,12 @@
 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 9.0.2 arises from the check-in with tag `core-9-0-2`.
-
-Tk 9.0.2 continues the Tk 9.0 series of releases.  The Tk 9.0 series
-does not support Tcl 8.6.  The Tk 9.0 series extends the Tcl 9.0 series.
-To make use of Tk 9.0.2, first a Tcl 9.0 release must be present.
-As new Tk features are developed, expect them to appear in Tk 9, but not
-necessarily in Tk 8.
-
-Tk patch releases have the primary purpose of delivering bug fixes
-to the userbase.
-
-# Bug fixes
- - [inaccurate scrollbar error-message](https://core.tcl-lang.org/tk/tktview/f88118)
- - [Build tk 9.0.1 failed on macos 10.13](https://core.tcl-lang.org/tk/tktview/cb5d77)
- - [image svg upstream out of bound read nanosvg#262](https://core.tcl-lang.org/tk/tktview/121786)
- - [wm iconbitmap does not correctly set the icon pixmap hint on macOS](https://core.tcl-lang.org/tk/tktview/13ac26)
- - [Backspace crashes 9.0 interpreter on FreeBSD](https://core.tcl-lang.org/tk/tktview/1da19a)
- - [Bug in the ttk::scale widget of the "default" theme](https://core.tcl-lang.org/tk/tktview/126d07)
- - [Wrong appearance of the ttk::menubutton indicator of the "xpnative" theme](https://core.tcl-lang.org/tk/tktview/525536)
- - [English shortcuts for Chinese locale](https://core.tcl-lang.org/tk/tktview/c99266)
- - [No grip element in ttk::panedwindow sashes of most built-in themes](https://core.tcl-lang.org/tk/tktview/9902d8)
- - [Tk_Get3DBorderColors broken by design](https://core.tcl-lang.org/tk/tktview/517165)
-
-Release Tk 9.0.1 arises from the check-in with tag `core-9-0-1`.
-
-Tk 9.0.1 continues the Tk 9.0 series of releases.  The Tk 9.0 series
-does not support Tcl 8.6.  The Tk 9.0 series extends the Tcl 9.0 series.
-To make use of Tk 9.0.1, first a Tcl 9.0 release must be present.
-As new Tk features are developed, expect them to appear in Tk 9, but not
-necessarily in Tk 8.
-
-Tk patch releases have the primary purpose of delivering bug fixes
-to the userbase.  As the first patch release in the Tk 9.0 series,
-Tk 9.0.1 also includes a small number of interface changes that complete
-some incomplete features first delivered in Tk 9.0.0.
-
-# Completed 9.0 Features and Interfaces
- - [TIP #706: Expose three Tk "In Context" functions via stubs table](https://core.tcl-lang.org/tips/doc/trunk/tip/706.md)
- - [Tilde file syntax not available on 9.0 but used by "~/.Xdefaults"](https://core.tcl-lang.org/tk/tktview/fcfddc)
- - [leftover use of tilde in filename string](https://core.tcl-lang.org/tk/tktview/767702)
-
-# Bug fixes
- - [Canvas widget handles pixel objects incorrectly in Tk 9.0](https://core.tcl-lang.org/tk/tktview/610a73)
- - [SIGABRT from Tk_DeleteErrorHandler()](https://core.tcl-lang.org/tk/tktview/f52986)
- - [build failure on macOS < 10.13](https://core.tcl-lang.org/tk/tktview/d48cbf)
- - [Two potentially bogus binding scripts for <TouchpadScroll>](https://core.tcl-lang.org/tk/tktview/73c5e3)
- - [Aqua: canvas items are not always redrawn](https://core.tcl-lang.org/tk/tktview/5869c2)
- - [Aqua: color rgb values do not behave as expected when appearance is changed](https://core.tcl-lang.org/tk/tktview/01f58b)
- - [Aqua: winfo rgb . systemLabelColor returns a weird result on aqua](https://core.tcl-lang.org/tk/tktview/23b57a)
- - [Aqua: background thread became slower](https://core.tcl-lang.org/tk/tktview/547cc6)
- - [Use of Tcl_Obj vs char * in Widget storage](https://core.tcl-lang.org/tk/tktview/f91aa2)
- - [cannot build .chm help file (Windows)](https://core.tcl-lang.org/tk/tktview/bb110c)
- - [Tk initialization overwrites thread specific data](https://core.tcl-lang.org/tk/tktview/bcbf4c)
- - [File clamTheme.tcl misses code related to the -indicatorforeground option](https://core.tcl-lang.org/tk/tktview/a69fd7)
- - [Segfault when using menu(button) with the -font option](https://core.tcl-lang.org/tk/tktview/8ce672)
- - [Bind mechanism vs. GNOME](https://core.tcl-lang.org/tk/tktview/6bdf1a)
- - [many PIXEL options don't keep their configured value](https://core.tcl-lang.org/tk/tktview/29ba53)
- - [Menu entry underline does not consider activeborderwidth](https://core.tcl-lang.org/tk/tktview/844c0b)
-
-Release Tk 9.0.0 arises from the check-in with tag `core-9-0-0`.
-
-Highlighted differences between Tk 9.0 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.9 or later
-
-## New commands and options
- - `tk sysnotify` — Access to the OS notifications system
- - `tk systray` — Access to the OS tray facility
- - `tk print` — Access to the OS printing facility
-
-## Widget options
- - New `ttk::progressbar` option: **-text**
- - `$frame ... -backgroundimage $img -tile $bool`
- - `$menu id`, `$menu add|insert ... ?$id? ...`
- - `$image get ... -withalpha ...`
- - All indices now accept the forms **end**, **end-int**, **int+|-int**
-
-## Improved widget appearance
- - `ttk::notebook` with nondefault tab positions
-
-## Images
- - Partial SVG support
- - Read/write access to photo image metadata
-
-## Known bugs
- - [Inconsistent reporting of child geometry changes to grid container](https://core.tcl-lang.org/tk/tktview/beaa8e)
- - [Inconsistency in whether widgets allow negative borderwidths](https://core.tcl-lang.org/tk/tktview/5f739d)
- - [slow widget creation if default font is not used](https://core.tcl-lang.org/tk/tktview/8da7af)
- - [The wm manage command does not work on current macOS versions](https://core.tcl-lang.org/tk/tktview/8a6012)
- - [Slow processing irregular transparencies](https://core.tcl-lang.org/tk/tktview/919066)
- - [text's cursor width on 0th column](https://core.tcl-lang.org/tk/tktview/47fbfc)
- - [text widget breaks graphemes with combining diacritical marks](https://core.tcl-lang.org/tk/tktview/442208)
-
+Release Tk 9.1a0 arises from the check-in with tag `core-9.1a0`.
+
+Tk 9.1a0 continues the Tk 9.x series of releases.  The Tk 9.x series
+do not support Tcl 8.6.  The Tk 9.1 series extends the Tcl 9.0 series.
+To make use of Tk 9.1a0, first a Tcl 9.0 or 9.1 release must be present.
+As new Tk features are developed, expect them to appear in Tk 9, but not
+necessarily in Tk 8.

Index: doc/menu.n
==================================================================
--- doc/menu.n
+++ doc/menu.n
@@ -223,14 +223,19 @@
 .SH "MENUBARS"
 .PP
 Any menu can be set as a menubar for a toplevel window (see
 \fBtoplevel\fR command for syntax). On the Macintosh, whenever the
 toplevel is in front, this menu's cascade items will appear in the
-menubar across the top of the main monitor. On Windows and Unix, this
+menubar across the top of the main screen. On Windows and Unix, this
 menu's items will be displayed in a menubar across the top of the
 window. These menus will behave according to the interface guidelines
-of their platforms. For every menu set as a menubar, a clone menu is
+of their platforms. In particular, since macOS requires that a
+menubar always be displayed for the active app, if no menu is assigned
+by a \fBconfigure -menu\fR for a certain toplevel then a standard default
+menu will be displayed whenever that toplevel has focus.
+
+For every menu set as a menubar, a clone menu is
 made. See the \fBCLONES\fR section for more information.
 .PP
 As noted, menubars may behave differently on different platforms.  One
 example of this concerns the handling of checkbuttons and radiobuttons
 within the menu.  While it is permitted to put these menu elements on

Index: generic/tk.h
==================================================================
--- generic/tk.h
+++ generic/tk.h
@@ -15,12 +15,12 @@
 
 #ifndef _TK
 #define _TK
 
 #include <tcl.h>
-#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7)
-#	error Tk 9.0 must be compiled with tcl.h from Tcl 8.7 or better
+#if (TCL_MAJOR_VERSION < 9)
+#	error Tk 9.1 must be compiled with tcl.h from Tcl 9.0 or better
 #endif
 
 #ifndef EXTERN
 #   define EXTERN extern TCL_STORAGE_CLASS
 #endif
@@ -66,16 +66,16 @@
 
 #ifndef TK_MAJOR_VERSION
 #   define TK_MAJOR_VERSION 9
 #endif
 #if TK_MAJOR_VERSION == 9
-#   define TK_MINOR_VERSION	0
-#   define TK_RELEASE_LEVEL	TCL_FINAL_RELEASE
-#   define TK_RELEASE_SERIAL	2
+#   define TK_MINOR_VERSION	1
+#   define TK_RELEASE_LEVEL	TCL_ALPHA_RELEASE
+#   define TK_RELEASE_SERIAL	0
 
-#   define TK_VERSION		"9.0"
-#   define TK_PATCH_LEVEL		"9.0.2"
+#   define TK_VERSION		"9.1"
+#   define TK_PATCH_LEVEL		"9.1a0"
 #endif /* TK_MAJOR_VERSION */
 
 /*
  * 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.
@@ -225,15 +225,11 @@
  * 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_NULL_OK		TCL_NULL_OK
 #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
@@ -283,11 +279,10 @@
     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 > 8
     long 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
@@ -294,13 +289,10 @@
 				 * 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
-    double internalForm;
-#endif
 } Tk_SavedOption;
 
 #ifdef TCL_MEM_DEBUG
 #   define TK_NUM_SAVED_OPTIONS 2
 #else
@@ -413,15 +405,11 @@
  */
 
 #define TK_CONFIG_COLOR_ONLY		(1 << 1)
 #define TK_CONFIG_MONO_ONLY		(1 << 2)
 #define TK_CONFIG_DONT_SET_DEFAULT	(1 << 3)
-#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_NULL_OK		TCL_NULL_OK
 #define TK_CONFIG_USER_BIT		0x100
 #endif /* __NO_OLD_CONFIG */
 
 /*
  * Structure used to specify how to handle argv options.
@@ -799,13 +787,11 @@
     unsigned int dummy6;	/* dirtyChanges */
     XSetWindowAttributes atts;
     unsigned long dummy7;	/* dirtyAtts */
     unsigned int flags;
     char *dummy8;		/* handlerList */
-#if defined(TK_USE_INPUT_METHODS) || (TCL_MAJOR_VERSION > 8)
     XIC dummy9;			/* inputContext */
-#endif /* TK_USE_INPUT_METHODS */
     void **dummy10;	/* tagPtr */
     Tcl_Size dummy11;		/* numTags */
     Tcl_Size dummy12;		/* optionLevel */
     char *dummy13;		/* selHandlerList */
     char *dummy14;		/* geomMgrPtr */
@@ -819,19 +805,13 @@
     int internalBorderRight;
     int internalBorderTop;
     int internalBorderBottom;
     int minReqWidth;
     int minReqHeight;
-#if defined(TK_USE_INPUT_METHODS) || (TCL_MAJOR_VERSION > 8)
     int dummy20;
-#endif /* TK_USE_INPUT_METHODS */
     char *dummy21;		/* geomMgrName */
     Tk_Window dummy22;		/* maintainerPtr */
-#if !defined(TK_USE_INPUT_METHODS) && (TCL_MAJOR_VERSION < 9)
-    XIC dummy9;			/* inputContext */
-    int dummy20;
-#endif /* TK_USE_INPUT_METHODS */
 } Tk_FakeWin;
 
 /*
  * Flag values for TkWindow (and Tk_FakeWin) structures are:
  *

Index: generic/tkBusy.c
==================================================================
--- generic/tkBusy.c
+++ generic/tkBusy.c
@@ -331,15 +331,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyBusy(
-#if TCL_MAJOR_VERSION > 8
     void *data)			/* Busy window structure record */
-#else
-    char *data)
-#endif
 {
     Busy *busyPtr = (Busy *)data;
 
     if (busyPtr->hashPtr != NULL) {
 	Tcl_DeleteHashEntry(busyPtr->hashPtr);

Index: generic/tkButton.h
==================================================================
--- generic/tkButton.h
+++ generic/tkButton.h
@@ -108,17 +108,12 @@
 				 * color for background (and border) when
 				 * window isn't active. */
     Tk_3DBorder activeBorder;	/* Value of -activebackground option: this is
 				 * the color used to draw 3-D border and
 				 * background when widget is active. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Value of -borderWidth option: specifies
 				 * width of border in pixels. Always >= 0. */
-#else
-    Tcl_Obj *borderWidthPtr;
-    int borderWidth;
-#endif
     int relief;			/* Value of -relief option: specifies 3-d
 				 * effect for border, such as
 				 * TK_RELIEF_RAISED. */
     int overRelief;		/* Value of -overrelief option: specifies a
 				 * 3-d effect for the border, such as
@@ -127,19 +122,14 @@
     int offRelief;		/* Value of -offrelief option: specifies a 3-d
 				 * effect for the border, such as
 				 * TK_RELIEF_RAISED, to be used when a
 				 * checkbutton or radiobutton without
 				 * indicator is off. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *highlightWidthObj;	/* Value of -highlightthickness option:
 				 * specifies width in pixels of highlight to
 				 * draw around widget when it has the focus.
 				 * 0 means don't draw a highlight. Always >= 0. */
-#else
-    Tcl_Obj *highlightWidthPtr;
-    int highlightWidth;
-#endif
     Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
 				 * specifies background with which to draw 3-D
 				 * default ring and focus highlight area when
 				 * highlight is off. */
     XColor *highlightColorPtr;	/* Value of -highlightcolor option: specifies
@@ -170,11 +160,10 @@
 				 * images when disabled. */
     Pixmap gray;		/* Pixmap for displaying disabled text if
 				 * disabledFg is NULL. */
     GC copyGC;			/* Used for copying information from an
 				 * off-screen pixmap to the screen. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *widthObj;		/* Value of -width option. */
     Tcl_Obj *heightObj;		/* Value of -height option. */
     Tcl_Obj *wrapLengthObj;	/* Value of -wraplength option: specifies line
 				 * length (in pixels) at which to wrap onto
 				 * next line. <= 0 means don't wrap except at
@@ -185,22 +174,10 @@
 				 * images. */
     Tcl_Obj *padYObj;		/* Value of -padx option: specifies how many
 				 * pixels of extra space to leave above and
 				 * below text. Ignored for bitmaps and
 				 * images. */
-#else
-    Tcl_Obj *widthPtr;
-    int width;
-    Tcl_Obj *heightPtr;
-    int height;
-    Tcl_Obj *wrapLengthPtr;
-    int wrapLength;
-    Tcl_Obj *padXPtr;
-    int padX;
-    Tcl_Obj *padYPtr;
-    int padY;
-#endif
     Tk_Anchor anchor;		/* Value of -anchor option: specifies where
 				 * text/bitmap should be displayed inside
 				 * button region. */
     Tk_Justify justify;		/* Value of -justify option: specifies how to
 				 * align lines of multi-line text. */

Index: generic/tkCanvas.c
==================================================================
--- generic/tkCanvas.c
+++ generic/tkCanvas.c
@@ -2186,15 +2186,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyCanvas(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Info about canvas widget. */
-#else
-    char *memPtr)
-#endif
 {
     TkCanvas *canvasPtr = (TkCanvas *)memPtr;
     Tk_Item *itemPtr;
     TagSearchExpr *expr, *next;
 

Index: generic/tkCanvas.h
==================================================================
--- generic/tkCanvas.h
+++ generic/tkCanvas.h
@@ -58,25 +58,17 @@
 
     /*
      * Information used when displaying widget:
      */
 
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Width of 3-D border around window. */
-#else
-    int borderWidth;
-#endif
     Tk_3DBorder bgBorder;	/* Used for canvas background. */
     int relief;			/* Indicates whether window as a whole is
 				 * raised, sunken, or flat. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *highlightWidthObj;	/* Width in pixels of highlight to draw around
 				 * widget when it has the focus. 0 means
 				 * don't draw a highlight. */
-#else
-    int highlightWidth;
-#endif
     XColor *highlightBgColorPtr;
 				/* Color for drawing traversal highlight area
 				 * when highlight is off. */
     XColor *highlightColorPtr;	/* Color for drawing traversal highlight. */
     int inset;			/* Total width of all borders, including
@@ -84,16 +76,12 @@
 				 * Indicates how much interior stuff must be
 				 * offset from outside edges to leave room for
 				 * borders. */
     GC pixmapGC;		/* Used to copy bits from a pixmap to the
 				 * screen and also to clear the pixmap. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *widthObj, *heightObj;		/* Dimensions to request for canvas window,
 				 * specified in pixels. */
-#else
-    int width, height;
-#endif
     int redrawX1, redrawY1;	/* Upper left corner of area to redraw, in
 				 * pixel coordinates. Border pixels are
 				 * included. Only valid if REDRAW_PENDING flag
 				 * is set. */
     int redrawX2, redrawY2;	/* Lower right corner of area to redraw, in
@@ -179,23 +167,18 @@
 				 * these numbers determine the size and
 				 * location of the sliders on scrollbars).
 				 * Units are pixels in canvas coords. */
     Tcl_Obj *regionObj;		/* The option string from which scrollX1 etc.
 				 * are derived. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *xScrollIncrementObj;	/* If >0, defines a grid for horizontal
 				 * scrolling. This is the size of the "unit",
 				 * and the left edge of the screen will always
 				 * lie on an even unit boundary. */
     Tcl_Obj *yScrollIncrementObj;	/* If >0, defines a grid for vertical
 				 * scrolling. This is the size of the "unit",
 				 * and the top edge of the screen will always
 				 * lie on an even unit boundary. */
-#else
-    int xScrollIncrement;
-    int yScrollIncrement;
-#endif
     /*
      * Information used for scanning:
      */
 
     int scanX;			/* X-position at which scan started (e.g.

Index: generic/tkConsole.c
==================================================================
--- generic/tkConsole.c
+++ generic/tkConsole.c
@@ -220,11 +220,11 @@
 
     /*
      * Ensure that we are getting a compatible version of Tcl.
      */
 
-    if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
+    if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
 	return;
     }
 
     consoleInitPtr = (int *)Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int));
     if (*consoleInitPtr) {

Index: generic/tkDecls.h
==================================================================
--- generic/tkDecls.h
+++ generic/tkDecls.h
@@ -1820,20 +1820,10 @@
 #endif
 EXTERN int Tk_Init(Tcl_Interp *interp);
 EXTERN int Tk_SafeInit(Tcl_Interp *interp);
 EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
 
-#if TK_MAJOR_VERSION < 9
-/* Restore 8.x signature of Tk_ConfigureWidget, but panic if TK_CONFIG_OBJS flag is not set */
-#undef Tk_ConfigureWidget
-#define Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags) \
-	((int (*)(Tcl_Interp *, Tk_Window, const Tk_ConfigSpec *, \
-	int, const char **, char *, int))(void *)(tkStubsPtr->tk_ConfigureWidget)) \
-	(((flags & TK_CONFIG_OBJS) ? interp : (Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory in Tk_ConfigureWidget"), \
-	NULL)), tkwin, specs, argc, argv, widgRec, flags)
-#endif
-
 #undef TCL_STORAGE_CLASS
 #define TCL_STORAGE_CLASS DLLIMPORT
 
 #undef TkUnusedStubEntry
 

Index: generic/tkEntry.c
==================================================================
--- generic/tkEntry.c
+++ generic/tkEntry.c
@@ -1029,15 +1029,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyEntry(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Info about entry widget. */
-#else
-    char *memPtr)
-#endif
 {
     Entry *entryPtr = (Entry *)memPtr;
 
     /*
      * Free up all the stuff that requires special handling, then let

Index: generic/tkEntry.h
==================================================================
--- generic/tkEntry.h
+++ generic/tkEntry.h
@@ -79,57 +79,37 @@
 				 * in disabled state, plus used for
 				 * background. */
     Tk_3DBorder readonlyBorder;	/* Used for drawing border around whole window
 				 * in readonly state, plus used for
 				 * background. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Width of 3-D border around window. */
-#else
-    int borderWidth;
-#endif
     Tk_Cursor cursor;		/* Current cursor for window, or NULL. */
     int exportSelection;	/* Non-zero means tie internal entry selection
 				 * to X selection. */
     Tk_Font tkfont;		/* Information about text font, or NULL. */
     XColor *fgColorPtr;		/* Text color in normal mode. */
     XColor *dfgColorPtr;	/* Text color in disabled mode. */
     XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
 				 * when highlight is off. */
     XColor *highlightColorPtr;	/* Color for drawing traversal highlight. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *highlightWidthObj;	/* Width in pixels of highlight to draw around
 				 * widget when it has the focus. <= 0 means
 				 * don't draw a highlight. */
-#else
-    int highlightWidth;
-#endif
     Tk_3DBorder insertBorder;	/* Used to draw vertical bar for insertion
 				 * cursor. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *insertBorderWidthObj;	/* Width of 3-D border around insert cursor. */
-#else
-    int insertBorderWidth;
-#endif
     int insertOffTime;		/* Number of milliseconds cursor should spend
 				 * in "off" state for each blink. */
     int insertOnTime;		/* Number of milliseconds cursor should spend
 				 * in "on" state for each blink. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *insertWidthObj;	/* Total width of insert cursor. */
-#else
-    int insertWidth;
-#endif
     Tk_Justify justify;		/* Justification to use for text within
 				 * window. */
     int relief;			/* 3-D effect: TK_RELIEF_RAISED, etc. */
     Tk_3DBorder selBorder;	/* Border and background for selected
 				 * characters. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *selBorderWidthObj;	/* Width of border around selection. */
-#else
-    int selBorderWidth;
-#endif
     XColor *selFgColorPtr;	/* Foreground color for selected text. */
     int state;			/* Normal or disabled. Entry is read-only when
 				 * disabled. */
     Tcl_Obj *textVarNameObj;		/* Name of variable (malloc'ed) or NULL. If
 				 * non-NULL, entry's string tracks the

Index: generic/tkFrame.c
==================================================================
--- generic/tkFrame.c
+++ generic/tkFrame.c
@@ -821,15 +821,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyFrame(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Info about frame widget. */
-#else
-    char *memPtr)
-#endif
 {
     Frame *framePtr = (Frame *)memPtr;
     Labelframe *labelframePtr = (Labelframe *)memPtr;
 
     if (framePtr->type == TYPE_LABELFRAME) {

Index: generic/tkGrid.c
==================================================================
--- generic/tkGrid.c
+++ generic/tkGrid.c
@@ -2846,15 +2846,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyGrid(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Info about window that is now dead. */
-#else
-    char *memPtr)
-#endif
 {
     Gridder *gridPtr = (Gridder *)memPtr;
 
     if (gridPtr->flags & REQUESTED_RELAYOUT) {
 	Tcl_CancelIdleCall(ArrangeGrid, gridPtr);

Index: generic/tkImage.c
==================================================================
--- generic/tkImage.c
+++ generic/tkImage.c
@@ -951,15 +951,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DeleteImage(
-#if TCL_MAJOR_VERSION > 8
     void *blockPtr)	/* Pointer to main data structure for image. */
-#else
-    char *blockPtr)
-#endif
 {
     Image *imagePtr;
     Tk_ImageType *typePtr;
     ImageModel *modelPtr = (ImageModel *)blockPtr;
 

Index: generic/tkImgPhoto.h
==================================================================
--- generic/tkImgPhoto.h
+++ generic/tkImgPhoto.h
@@ -85,21 +85,14 @@
  */
 
 struct ColorTable {
     ColorTableId id;		/* Information used in selecting this color
 				 * table. */
-#if TCL_MAJOR_VERSION > 8
     size_t	refCount;		/* Number of instances using this map. */
     size_t liveRefCount;		/* Number of instances which are actually in
 				 * use, using this map. */
     int	flags;			/* See below. */
-#else
-    int	flags;			/* See below. */
-    unsigned int	refCount;		/* Number of instances using this map. */
-    unsigned int liveRefCount;		/* Number of instances which are actually in
-				 * use, using this map. */
-#endif
     int	numColors;		/* Number of colors allocated for this map. */
 
     XVisualInfo	visualInfo;	/* Information about the visual for windows
 				 * using this color table. */
 
@@ -202,15 +195,11 @@
     Display *display;		/* Display for windows using this instance. */
     Colormap colormap;		/* The image may only be used in windows with
 				 * this particular colormap. */
     PhotoInstance *nextPtr;	/* Pointer to the next instance in the list of
 				 * instances associated with this model. */
-#if TCL_MAJOR_VERSION > 8
     size_t refCount;		/* Number of instances using this structure. */
-#else
-    unsigned int refCount;	/* Number of instances using this structure. */
-#endif
     Tk_Uid palette;		/* Palette for these particular instances. */
     double gamma;		/* Gamma value for these instances. */
     Tk_Uid defaultPalette;	/* Default palette to use if a palette is not
 				 * specified for the model. */
     ColorTable *colorTablePtr;	/* Pointer to information about colors

Index: generic/tkInt.h
==================================================================
--- generic/tkInt.h
+++ generic/tkInt.h
@@ -531,15 +531,13 @@
 
     /*
      * Miscellaneous information:
      */
 
-#if defined(TK_USE_INPUT_METHODS) || (TCL_MAJOR_VERSION > 8)
     XIM inputMethod;		/* Input method for this display. */
     XIMStyle inputStyle;	/* Input style selected for this display. */
     XFontSet inputXfs;		/* XFontSet cached for over-the-spot XIM. */
-#endif /* TK_USE_INPUT_METHODS */
     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
@@ -561,15 +559,10 @@
 				 * display. This is not a pointer. */
 
     int iconDataSize;		/* Size of default iconphoto image data. */
     unsigned char *iconDataPtr;	/* Default iconphoto image data, if set. */
     int ximGeneration;          /* Used to invalidate XIC */
-#if !defined(TK_USE_INPUT_METHODS) && (TCL_MAJOR_VERSION < 9)
-    XIM inputMethod;		/* Input method for this display. */
-    XIMStyle inputStyle;	/* Input style selected for this display. */
-    XFontSet inputXfs;		/* XFontSet cached for over-the-spot XIM. */
-#endif /* TK_USE_INPUT_METHODS */
 } TkDisplay;
 
 /*
  * Flag values for TkDisplay flags.
  *  TK_DISPLAY_COLLAPSE_MOTION_EVENTS:	(default on)
@@ -644,15 +637,11 @@
     struct TkWindow *winPtr;	/* Pointer to main window. */
     Tcl_Interp *interp;		/* Interpreter associated with application. */
     Tcl_HashTable nameTable;	/* Hash table mapping path names to TkWindow
 				 * structs for all windows related to this
 				 * main window. Managed by tkWindow.c. */
-#if TCL_MAJOR_VERSION > 8
     size_t deletionEpoch;		/* Incremented by window deletions. */
-#else
-    long deletionEpoch;
-#endif
     Tk_BindingTable bindingTable;
 				/* Used in conjunction with "bind" command to
 				 * bind events to Tcl commands. */
     TkBindInfo bindInfo;	/* Information used by tkBind.c on a per
 				 * application basis. */
@@ -689,16 +678,14 @@
     Tcl_HashTable busyTable;	/* Information used by [tk busy] command. */
     Tcl_ObjCmdProc *tclUpdateObjProc;
 				/* Saved Tcl [update] command, used to restore
 				 * Tcl's version of [update] after Tk is shut
 				 * down */
-#if TCL_MAJOR_VERSION > 8
     Tcl_ObjCmdProc2 *tclUpdateObjProc2;
 				/* Saved Tcl [update] command, used to restore
 				 * Tcl's version of [update] after Tk is shut
 				 * down, in case it's a Tcl_ObjCmdProc2 */
-#endif
     unsigned int ttkNbTabsStickBit;
 				/* Information used by ttk::notebook. */
     int troughInnerX, troughInnerY, troughInnerWidth, troughInnerHeight;
 				/* Information used by ttk::scale. */
 } TkMainInfo;
@@ -799,13 +786,11 @@
      * Information kept by the event manager (tkEvent.c):
      */
 
     TkEventHandler *handlerList;/* First in list of event handlers declared
 				 * for this window, or NULL if none. */
-#if defined(TK_USE_INPUT_METHODS) || (TCL_MAJOR_VERSION > 8)
     XIC inputContext;		/* XIM input context. */
-#endif /* TK_USE_INPUT_METHODS */
 
     /*
      * Information used for event bindings (see "bind" and "bindtags" commands
      * in tkCmds.c):
      */
@@ -880,22 +865,16 @@
     int internalBorderTop;
     int internalBorderBottom;
 
     int minReqWidth;		/* Minimum requested width. */
     int minReqHeight;		/* Minimum requested height. */
-#if defined(TK_USE_INPUT_METHODS) || (TCL_MAJOR_VERSION > 8)
     int ximGeneration;          /* Used to invalidate XIC */
-#endif /* TK_USE_INPUT_METHODS */
     char *geomMgrName;          /* Records the name of the geometry manager. */
     struct TkWindow *maintainerPtr;
 				/* The geometry container for this window. The
 				 * value is NULL if the window has no container or
 				 * if its container is its parent. */
-#if !defined(TK_USE_INPUT_METHODS) && (TCL_MAJOR_VERSION < 9)
-    XIC inputContext;		/* XIM input context. */
-    int ximGeneration;          /* Used to invalidate XIC */
-#endif /* TK_USE_INPUT_METHODS */
 } TkWindow;
 
 /*
  * String tables:
  */
@@ -943,14 +922,10 @@
 /*
  * 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)
-#define Tcl_ObjCmdProc2 Tcl_ObjCmdProc
-#endif
-
 typedef struct TkEnsemble {
     const char *name;
     Tcl_ObjCmdProc2 *proc;
     const struct TkEnsemble *subensemble;
 } TkEnsemble;
@@ -1316,14 +1291,10 @@
 
 #if !defined(__cplusplus) && !defined(c_plusplus)
 # define c_class class
 #endif
 
-#if defined(_WIN32) && !defined(STATIC_BUILD) && (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION)
-#   define tcl_CreateFileHandler reserved9
-#endif
-
 MODULE_SCOPE  void       Icu_Init(Tcl_Interp* interp);
 
 /*
  * Unsupported commands.
  */

Index: generic/tkListbox.c
==================================================================
--- generic/tkListbox.c
+++ generic/tkListbox.c
@@ -1436,15 +1436,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyListbox(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Info about listbox widget. */
-#else
-    char *memPtr)
-#endif
 {
     Listbox *listPtr = (Listbox *)memPtr;
     Tcl_HashEntry *entry;
     Tcl_HashSearch search;
 

Index: generic/tkMain.c
==================================================================
--- generic/tkMain.c
+++ generic/tkMain.c
@@ -187,11 +187,11 @@
 
     /*
      * Ensure that we are getting a compatible version of Tcl.
      */
 
-    if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
+    if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
 	if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
 	    abort();
 	} else {
 	    Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp)));
 	}
@@ -251,12 +251,10 @@
 	/*
 	 * 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])) {

Index: generic/tkMenu.c
==================================================================
--- generic/tkMenu.c
+++ generic/tkMenu.c
@@ -1431,15 +1431,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyMenuEntry(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Pointer to entry to be freed. */
-#else
-    char *memPtr)
-#endif
 {
     TkMenuEntry *mePtr = (TkMenuEntry *)memPtr;
     TkMenu *menuPtr = mePtr->menuPtr;
 
     if (menuPtr->postedCascade == mePtr) {

Index: generic/tkMenu.h
==================================================================
--- generic/tkMenu.h
+++ generic/tkMenu.h
@@ -181,13 +181,11 @@
     int entryFlags;		/* Various flags. See below for
 				 * definitions. */
     int index;			/* Need to know which index we are. This is
 				 * zero-based. This is the top-left entry of
 				 * the menu. */
-#if TK_MAJOR_VERSION > 8
     Tcl_HashEntry *entryPtr;	/* Back-pointer to hash table entry */
-#endif
     /*
      * Bookeeping for main menus and cascade menus.
      */
 
     struct TkMenuReferences *childMenuRefPtr;
@@ -203,13 +201,10 @@
 				 * yet exist. */
     TkMenuPlatformEntryData platformEntryData;
 				/* The data for the specific type of menu.
 				 * Depends on platform and menu type what kind
 				 * of options are in this structure. */
-#if TK_MAJOR_VERSION < 9
-    Tcl_HashEntry *entryPtr;	/* Back-pointer to hash table entry */
-#endif
 } TkMenuEntry;
 
 /*
  * Flag values defined for menu entries:
  *
@@ -281,24 +276,16 @@
      * Information used when displaying widget:
      */
 
     Tcl_Obj *borderPtr;		/* Structure used to draw 3-D border and
 				 * background for menu. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Width of border around whole menu. */
-#else
-    Tcl_Obj *borderWidthPtr;
-#endif
     Tcl_Obj *activeBorderPtr;	/* Used to draw background and border for
 				 * active element (if any). */
     Tcl_Obj *activeBorderWidthPtr;
 				/* Width of border around active element. */
-#if TK_MAJOR_VERSION > 8
     int relief;		/* 3-d effect: TK_RELIEF_RAISED, etc. */
-#else
-    Tcl_Obj *reliefPtr;
-#endif
     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. */

Index: generic/tkMenubutton.h
==================================================================
--- generic/tkMenubutton.h
+++ generic/tkMenubutton.h
@@ -85,23 +85,15 @@
 				 * background when window isn't active. NULL
 				 * means no such border exists. */
     Tk_3DBorder activeBorder;	/* Structure used to draw 3-D border and
 				 * background when window is active. NULL
 				 * means no such border exists. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Width of border. */
-#else
-    int borderWidth;
-#endif
     int relief;			/* 3-d effect: TK_RELIEF_RAISED, etc. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *highlightWidthObj;	/* Width in pixels of highlight to draw around
 				 * widget when it has the focus. 0 means
 				 * don't draw a highlight. */
-#else
-    int highlightWidth;
-#endif
     XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
 				 * when highlight is off. */
     XColor *highlightColorPtr;	/* Color for drawing traversal highlight. */
     int inset;			/* Total width of all borders, including
 				 * traversal highlight and 3-D border.
@@ -133,20 +125,15 @@
 				 * for window, in characters for text and in
 				 * pixels for bitmaps. In this case the actual
 				 * size of the text string or bitmap is
 				 * ignored in computing desired window
 				 * size. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *wrapLengthObj;	/* Line length (in pixels) at which to wrap
 				 * onto next line. 0 means don't wrap
 				 * except at newlines. */
     Tcl_Obj *padXObj, *padYObj;	/* Extra space around text or bitmap (pixels
 				 * on each side). */
-#else
-    int wrapLength;
-    int padX, padY;
-#endif
     Tk_Anchor anchor;		/* Where text/bitmap should be displayed
 				 * inside window region. */
     Tk_Justify justify;		/* Justification to use for multi-line
 				 * text. */
     int textWidth;		/* Width needed to display text as requested,

Index: generic/tkObj.c
==================================================================
--- generic/tkObj.c
+++ generic/tkObj.c
@@ -70,16 +70,12 @@
  */
 
 typedef struct WindowRep {
     Tk_Window tkwin;		/* Cached window; NULL if not found. */
     TkMainInfo *mainPtr;	/* MainWindow associated with tkwin. */
-#if TCL_MAJOR_VERSION > 8
     size_t epoch;			/* Value of mainPtr->deletionEpoch at last
 				 * successful lookup. */
-#else
-    long epoch;
-#endif
 } WindowRep;
 
 /*
  * Prototypes for functions defined later in this file:
  */

Index: generic/tkPack.c
==================================================================
--- generic/tkPack.c
+++ generic/tkPack.c
@@ -1072,15 +1072,11 @@
  *----------------------------------------------------------------------
  */
 
 static void
 DestroyPacker(
-#if TCL_MAJOR_VERSION > 8
     void *memPtr)		/* Info about packed window that is now dead. */
-#else
-    char *memPtr)
-#endif
 {
     Packer *packPtr = (Packer *)memPtr;
 
     if (packPtr->flags & REQUESTED_REPACK) {
 	Tcl_CancelIdleCall(ArrangePacking, packPtr);

Index: generic/tkScale.h
==================================================================
--- generic/tkScale.h
+++ generic/tkScale.h
@@ -51,18 +51,14 @@
     Tcl_Command widgetCmd;	/* Token for scale's widget command. */
     Tk_OptionTable optionTable;	/* Table that defines configuration options
 				 * available for this widget. */
     enum orient orient;		/* Orientation for window (vertical or
 				 * horizontal). */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *widthObj;		/* Desired narrow dimension of scale, in
 				 * pixels. */
     Tcl_Obj *lengthObj;	/* Desired long dimension of scale, in
 				 * pixels. */
-#else
-    int width, length;
-#endif
     double value;		/* Current value of scale. */
     Tcl_Obj *varNamePtr;	/* Name of variable or NULL. If non-NULL,
 				 * scale's value tracks the contents of this
 				 * variable and vice versa. */
     double fromValue;		/* Value corresponding to left or top of
@@ -97,15 +93,11 @@
 
     /*
      * Information used when displaying widget:
      */
 
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Width of 3-D border around window. */
-#else
-    int borderWidth;
-#endif
     Tk_3DBorder bgBorder;	/* Used for drawing slider and other
 				 * background areas. */
     Tk_3DBorder activeBorder;	/* For drawing the slider when active. */
     int sliderRelief;		/* Is slider to be drawn raised, sunken,
 				 * etc. */
@@ -115,17 +107,13 @@
     Tk_Font tkfont;		/* Information about text font, or NULL. */
     XColor *textColorPtr;	/* Color for drawing text. */
     GC textGC;			/* GC for drawing text in normal mode. */
     int relief;			/* Indicates whether window as a whole is
 				 * raised, sunken, or flat. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *highlightWidthObj;	/* Width in pixels of highlight to draw around
 				 * widget when it has the focus. <= 0 means
 				 * don't draw a highlight. */
-#else
-    int highlightWidth;
-#endif
     Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
 				 * specifies background with which to draw 3-D
 				 * default ring and focus highlight area when
 				 * highlight is off. */
     XColor *highlightColorPtr;	/* Color for drawing traversal highlight. */
@@ -132,16 +120,12 @@
     int inset;			/* Total width of all borders, including
 				 * traversal highlight and 3-D border.
 				 * Indicates how much interior stuff must be
 				 * offset from outside edges to leave room for
 				 * borders. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *sliderLengthObj;	/* Length of slider, measured in pixels along
 				 * long dimension of scale. */
-#else
-    int sliderLength;
-#endif
     int showValue;		/* Non-zero means to display the scale value
 				 * below or to the left of the slider; zero
 				 * means don't display the value. */
 
     /*

Index: generic/tkScrollbar.h
==================================================================
--- generic/tkScrollbar.h
+++ generic/tkScrollbar.h
@@ -31,17 +31,12 @@
 				 * freed even after tkwin has gone away. */
     Tcl_Interp *interp;		/* Interpreter associated with scrollbar. */
     Tcl_Command widgetCmd;	/* Token for scrollbar's widget command. */
     int vertical;		/* Non-zero means vertical orientation
 				 * requested, zero means horizontal. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *widthObj;		/* Desired narrow dimension of scrollbar, in
 				 * pixels. */
-#else
-    int width;			/* Desired narrow dimension of scrollbar, in
-				 * pixels. */
-#endif
     Tcl_Obj *commandObj;		/* Command prefix to use when invoking
 				 * scrolling commands. NULL means don't invoke
 				 * commands. */
     int repeatDelay;		/* How long to wait before auto-repeating on
 				 * scrolling actions (in ms). */
@@ -50,45 +45,33 @@
 
     /*
      * Information used when displaying widget:
      */
 
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *borderWidthObj;	/* Width of 3-D borders. */
-#else
-    int borderWidth;
-#endif
     Tk_3DBorder bgBorder;	/* Used for drawing background (all flat
 				 * surfaces except for trough). */
     Tk_3DBorder activeBorder;	/* For drawing backgrounds when active (i.e.
 				 * when mouse is positioned over element). */
     XColor *troughColorPtr;	/* Color for drawing trough. */
     int relief;			/* Indicates whether window as a whole is
 				 * raised, sunken, or flat. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *highlightWidthObj;	/* Width in pixels of highlight to draw around
 				 * widget when it has the focus. <= 0 means
 				 * don't draw a highlight. */
-#else
-    int highlightWidth;
-#endif
     XColor *highlightBgColorPtr;
 				/* Color for drawing traversal highlight area
 				 * when highlight is off. */
     XColor *highlightColorPtr;	/* Color for drawing traversal highlight. */
     int inset;			/* Total width of all borders, including
 				 * traversal highlight and 3-D border.
 				 * Indicates how much interior stuff must be
 				 * offset from outside edges to leave room for
 				 * borders. */
-#if TK_MAJOR_VERSION > 8
     Tcl_Obj *elementBorderWidthObj;	/* Width of border to draw around elements
 				 * inside scrollbar (arrows and slider). -1
 				 * means use borderWidth. */
-#else
-    int elementBorderWidth;
-#endif
     int arrowLength;		/* Length of arrows along long dimension of
 				 * scrollbar, including space for a small gap
 				 * between the arrow and the slider.
 				 * Recomputed on window size changes. */
     int sliderFirst;		/* Pixel coordinate of top or left edge of
@@ -105,13 +88,10 @@
     /*
      * Information describing the application related to the scrollbar, which
      * is provided by the application by invoking the "set" widget command.
      */
 
-#if TK_MAJOR_VERSION < 9
-    int dummy1, dummy2, dummy3, dummy4; /* deprecated, for "old" form. */
-#endif
     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. */
 

Index: generic/tkSelect.h
==================================================================
--- generic/tkSelect.h
+++ generic/tkSelect.h
@@ -23,18 +23,14 @@
  */
 
 typedef struct TkSelectionInfo {
     Atom selection;		/* Selection name, e.g. XA_PRIMARY. */
     Tk_Window owner;		/* Current owner of this selection. */
-#if TCL_MAJOR_VERSION > 8
     unsigned long serial;	/* Serial number of last XSelectionSetOwner
 				 * request made to server for this selection
 				 * (used to filter out redundant
 				 * SelectionClear events). */
-#else
-    int serial;
-#endif
     Time time;			/* Timestamp used to acquire selection. */
     Tk_LostSelProc *clearProc;	/* Procedure to call when owner loses
 				 * selection. */
     void *clearData;	/* Info to pass to clearProc. */
     struct TkSelectionInfo *nextPtr;

Index: generic/tkTest.c
==================================================================
--- generic/tkTest.c
+++ generic/tkTest.c
@@ -54,14 +54,10 @@
 EXTERN int		Tktest_Init(Tcl_Interp *interp);
 #ifdef __cplusplus
 }
 #endif
 
-#if TCL_MAJOR_VERSION < 9
-#   undef Tcl_CreateObjCommand2
-#   define Tcl_CreateObjCommand2 Tcl_CreateObjCommand
-#endif
 /*
  * The following data structure represents the model for a test image:
  */
 
 typedef struct TImageModel {
@@ -206,11 +202,11 @@
 Tktest_Init(
     Tcl_Interp *interp)		/* Interpreter for application. */
 {
     static int initialized = 0;
 
-    if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
+    if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
 	return TCL_ERROR;
     }
     if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
 	return TCL_ERROR;
     }

Index: generic/tkText.c
==================================================================
--- generic/tkText.c
+++ generic/tkText.c
@@ -11857,14 +11857,10 @@
 extern TkTextLine *	TkTextIndexGetLine(const TkTextIndex *indexPtr);
 extern TkTextSegment *	TkTextIndexGetSegment(const TkTextIndex *indexPtr);
 extern TkSharedText *	TkTextIndexGetShared(const TkTextIndex *indexPtr);
 extern int		TkTextIndexSameLines(const TkTextIndex *indexPtr1, const TkTextIndex *indexPtr2);
 extern void		TkTextIndexSave(TkTextIndex *indexPtr);
-# if TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 7 && TCL_UTF_MAX <= 4
-extern int		TkUtfToUniChar(const char *src, int *chPtr);
-# endif
-
 
 /*
  * Local Variables:
  * mode: c
  * c-basic-offset: 4

Index: generic/tkTextDisp.c
==================================================================
--- generic/tkTextDisp.c
+++ generic/tkTextDisp.c
@@ -14439,29 +14439,13 @@
 	    ciPtr->baseOffset, -1, chunkPtr->x, maxX, spaceMode, TK_ISOLATE_END, &nextX);
 
     if (bytesThatFit < maxBytes) {
 	if (bytesThatFit == 0 && noCharsYet) {
 	    int chLen;
-
-#if 0 && TCL_UTF_MAX > 4
-	    /*
-	     * HACK: Support of pseudo UTF-8 strings. Needed because of this
-	     * bad hack with TCL_UTF_MAX > 4, the whole thing is amateurish.
-	     * (See function GetLineBreakFunc() about the very severe problems
-	     * with TCL_UTF_MAX > 4).
-	     */
-
-	    int ch;
-	    chLen = TkUtfToUniChar(p, &ch);
-#else
-	    /*
-	     * Proper implementation for UTF-8 strings:
-	     */
-
 	    Tcl_UniChar ch;
+
 	    chLen = Tcl_UtfToUniChar(p, &ch);
-#endif
 
 	    /*
 	     * At least one character should be contained in current display line.
 	     */
 

Index: generic/tkTextPriv.h
==================================================================
--- generic/tkTextPriv.h
+++ generic/tkTextPriv.h
@@ -1049,35 +1049,8 @@
 	return dispLineInfo->entry[dispLineInfo->numDispLines].pixels;
     }
     return dispLineInfo->numDispLines;
 }
 
-#if TCL_UTF_MAX <= 4 && TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 7
-/*
- *----------------------------------------------------------------------
- *
- * TkUtfToUniChar --
- *
- *	Only needed for backporting, see source of version 8.7 about
- *	this function.
- *
- *	IMO this function is only a bad hack, Tcl should provide the
- *	appropriate functionality.
- *
- *----------------------------------------------------------------------
- */
-
-inline
-int
-TkUtfToUniChar(const char *src, int *chPtr)
-{
-    Tcl_UniChar ch;
-    int result = Tcl_UtfToUniChar(src, &ch);
-    *chPtr = ch;
-    return result;
-}
-
-#endif /* end of backport for 8.6/8.5 */
-
 #undef _TK_NEED_IMPLEMENTATION
 #endif /* _TK_NEED_IMPLEMENTATION */
 /* vi:set ts=8 sw=4: */

Index: generic/tkUtil.c
==================================================================
--- generic/tkUtil.c
+++ generic/tkUtil.c
@@ -1219,17 +1219,12 @@
 	fqdnObj = Tcl_NewStringObj(Tcl_DStringValue(&ds),
 		Tcl_DStringLength(&ds));
 	Tcl_AppendStringsToObj(fqdnObj, "::", map[i].name, (char *)NULL);
 	Tcl_DictObjPut(NULL, dictObj, nameObj, fqdnObj);
 	if (map[i].proc) {
-#if TCL_MAJOR_VERSION > 8
 	    Tcl_CreateObjCommand2(interp, Tcl_GetString(fqdnObj),
 		    map[i].proc, clientData, NULL);
-#else
-	    Tcl_CreateObjCommand(interp, Tcl_GetString(fqdnObj),
-		    map[i].proc, clientData, NULL);
-#endif
 	} else if (map[i].subensemble) {
 	    TkMakeEnsemble(interp, Tcl_DStringValue(&ds),
 		    map[i].name, clientData, map[i].subensemble);
 	}
     }

Index: generic/tkWindow.c
==================================================================
--- generic/tkWindow.c
+++ generic/tkWindow.c
@@ -894,13 +894,11 @@
     mainPtr->optionRootPtr = NULL;
     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", &mainPtr->strictMotif,
 	    TCL_LINK_BOOLEAN) != TCL_OK) {
 	Tcl_ResetResult(interp);
     }
     if (Tcl_CreateNamespace(interp, "::tk", NULL, NULL) == NULL) {
@@ -960,16 +958,13 @@
 	    clientData = NULL;
 	}
 	if ((cmdPtr->flags & SAVEUPDATECMD) &&
 	    Tcl_GetCommandInfo(interp, cmdPtr->name, &cmdInfo) &&
 	    cmdInfo.isNativeObjectProc && !cmdInfo.deleteProc) {
-#if TCL_MAJOR_VERSION > 8
 	    if ((cmdInfo.isNativeObjectProc == 2) && !cmdInfo.objClientData2) {
 		mainPtr->tclUpdateObjProc2 = cmdInfo.objProc2;
-	    } else
-#endif
-	    if (!cmdInfo.objClientData) {
+	    } else if (!cmdInfo.objClientData) {
 		mainPtr->tclUpdateObjProc = cmdInfo.objProc;
 	    }
 	}
 	if (cmdPtr->flags & USEINITPROC) {
 	    ((TkInitProc *)(void *)cmdPtr->objProc)(interp, clientData);
@@ -1048,21 +1043,18 @@
 #endif
 #if !defined(_WIN32) && !defined(MAC_OSX_TK)
 		".x11"
 #endif
 		;
-#if TCL_MAJOR_VERSION > 8
 	if (info.isNativeObjectProc == 2) {
 	    Tcl_CreateObjCommand2(interp, "::tk::build-info",
-		    info.objProc2, (void *)
-		    version, NULL);
-
-	} else
-#endif
-	Tcl_CreateObjCommand(interp, "::tk::build-info",
-		info.objProc, (void *)
-		version, NULL);
+		    info.objProc2, (void *)version, NULL);
+
+	} else {
+	    Tcl_CreateObjCommand(interp, "::tk::build-info",
+		    info.objProc, (void *)version, NULL);
+	}
     }
 
     /*
      * Set variables for the interpreter.
      */
@@ -1653,19 +1645,16 @@
 	    if ((winPtr->mainPtr->interp != NULL) &&
 		!Tcl_InterpDeleted(winPtr->mainPtr->interp)) {
 		for (cmdPtr = commands; cmdPtr->name != NULL; cmdPtr++) {
 		    if (cmdPtr->flags & SAVEUPDATECMD) {
 			/* Restore Tcl's version of [update] */
-#if TCL_MAJOR_VERSION > 8
 			if (winPtr->mainPtr->tclUpdateObjProc2 != NULL) {
 			    Tcl_CreateObjCommand2(winPtr->mainPtr->interp,
 				    cmdPtr->name,
 				    winPtr->mainPtr->tclUpdateObjProc2,
 				    NULL, NULL);
-			} else
-#endif
-			if (winPtr->mainPtr->tclUpdateObjProc != NULL) {
+			} else if (winPtr->mainPtr->tclUpdateObjProc != NULL) {
 			    Tcl_CreateObjCommand(winPtr->mainPtr->interp,
 				    cmdPtr->name,
 				    winPtr->mainPtr->tclUpdateObjProc,
 				    NULL, NULL);
 			}
@@ -3021,15 +3010,11 @@
     /* construct "<path>/libtcl9tk9.?.dll", from "<path>/tcl9tk9?.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"libtcl9tk9", 10 * sizeof(WCHAR));
-#else
-    memcpy(name+len-8, L"libtk9", 6 * sizeof(WCHAR));
-#endif
 
     tkcygwindll = LoadLibraryW(name);
     if (tkcygwindll) {
 	tkmainex = (void (*)(Tcl_Size, char **, Tcl_AppInitProc *, Tcl_Interp *))
 		(void *)GetProcAddress(tkcygwindll, "Tk_MainEx");
@@ -3224,11 +3209,11 @@
 
     /*
      * Ensure that we are getting a compatible version of Tcl.
      */
 
-    if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
+    if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
 	return TCL_ERROR;
     }
 
     /*
      * TIP #59: Make embedded configuration information available.

Index: generic/ttk/ttkWidget.h
==================================================================
--- generic/ttk/ttkWidget.h
+++ generic/ttk/ttkWidget.h
@@ -104,19 +104,13 @@
 
 /* Widget constructor:
  */
 MODULE_SCOPE Tcl_ObjCmdProc2 TtkWidgetConstructorObjCmd;
 
-#if TCL_MAJOR_VERSION > 8
 #define RegisterWidget(interp, name, specPtr) \
     Tcl_CreateObjCommand2(interp, name, \
 	TtkWidgetConstructorObjCmd, (void *)specPtr,NULL)
-#else
-#define RegisterWidget(interp, name, specPtr) \
-    Tcl_CreateObjCommand(interp, name, \
-	TtkWidgetConstructorObjCmd, (void *)specPtr,NULL)
-#endif
 
 /* WIDGET_TAKEFOCUS_TRUE --
  * WIDGET_TAKEFOCUS_FALSE --
  *	Add one or the other of these to each OptionSpecs table
  *	to indicate whether the widget should take focus

Index: library/tk.tcl
==================================================================
--- library/tk.tcl
+++ library/tk.tcl
@@ -9,11 +9,11 @@
 #
 # 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  9.0.2
+package require -exact tk  9.1a0
 
 # Create a ::tk namespace
 namespace eval ::tk {
     # Set up the msgcat commands
     namespace eval msgcat {

Index: macosx/README
==================================================================
--- macosx/README
+++ macosx/README
@@ -368,11 +368,11 @@
 	Note that the non-SDK configurations have their deployment target set to
 	10.6 (Tk.xcodeproj).
 The Xcode projects refer to the toplevel tcl and tk source directories via the
 the TCL_SRCROOT and TK_SRCROOT user build settings, by default these are set to
 the project-relative paths '../../tcl' and '../../tk', if your source
-directories are named differently, e.g. '../../tcl9.0' and '../../tk9.0', you
+directories are named differently, e.g. '../../tcl9.1' and '../../tk9.1', you
 need to manually change the TCL_SRCROOT and TK_SRCROOT settings by editing your
 ${USER}.pbxuser file (located inside the Tk.xcodeproj bundle directory) with a
 text editor.
 
 Detailed Instructions for building with macosx/GNUmakefile

Index: macosx/tkMacOSXFont.c
==================================================================
--- macosx/tkMacOSXFont.c
+++ macosx/tkMacOSXFont.c
@@ -22,30 +22,10 @@
 #ifdef TK_MAC_DEBUG
 #define TK_MAC_DEBUG_FONTS
 #endif
 */
 
-/*
- * TclNumUtfChars() is the same as Tcl_NumUtfChars(), but counting
- * in UTF-16 in stead of UTF-32. For Tcl 8.7 it's a little bit
- * tricky to get this function, because we are compiling with
- * TCL_UTF_MAX=4. Same for TclUtfAtIndex()
- */
-#if TCL_MAJOR_VERSION < 9
-#   undef TclNumUtfChars
-#   undef TclUtfAtIndex
-#   ifdef USE_TCL_STUBS
-#	define TclNumUtfChars \
-	    (tclStubsPtr->tcl_NumUtfChars) /* 312 */
-#	define TclUtfAtIndex \
-	    (tclStubsPtr->tcl_UtfAtIndex) /* 325 */
-#   else
-#	define TclNumUtfChars Tcl_NumUtfChars
-#	define TclUtfAtIndex Tcl_UtfAtIndex
-#   endif
-#endif
-
 /*
  * The following structure represents our Macintosh-specific implementation
  * of a font object.
  */
 

Index: macosx/tkMacOSXMenu.c
==================================================================
--- macosx/tkMacOSXMenu.c
+++ macosx/tkMacOSXMenu.c
@@ -1139,14 +1139,13 @@
  * Tk_SetMainMenubar --
  *
  *	Puts the menu associated with a window into the menubar. Should only be
  *	called when the window is in front.
  *
- *      This is a no-op on all other platforms.  On OS X it is a no-op when
- *      passed a NULL menuName or a nonexistent menuName, with an exception for
- *      the first call in a new interpreter.  In that special case, passing a
- *      NULL menuName installs the default menu.
+ *      This is a no-op on all other platforms.  On OS X it installs the
+ *      menubar with the specified menuName, if possible.  If the name is NULL
+ *      it installs the default menu.
  *
  * Results:
  *	None.
  *
  * Side effects:
@@ -1200,17 +1199,14 @@
 	    }
 	}
     }
 
     /*
-     * If we couldn't find a menu, do nothing unless the window belongs to a
-     * different application.  In that case, install the default menubar.
+     * If we couldn't find a menu this will install the default menubar.
      */
 
-    if (menu || interp != currentInterp) {
-	[NSApp tkSetMainMenu:menu];
-    }
+    [NSApp tkSetMainMenu:menu];
     currentInterp = interp;
 }
 
 /*
  *----------------------------------------------------------------------

Index: macosx/tkMacOSXWindowEvent.c
==================================================================
--- macosx/tkMacOSXWindowEvent.c
+++ macosx/tkMacOSXWindowEvent.c
@@ -134,11 +134,11 @@
     NSWindow *w = [notification object];
     TkWindow *winPtr = TkMacOSXGetTkWindow(w);
     if (winPtr && winPtr->wmInfoPtr->hints.initial_state == IconicState) {
 	winPtr->wmInfoPtr->hints.initial_state =
 		TkMacOSXIsWindowZoomed(winPtr) ? ZoomState : NormalState;
-	TkWmUnmapWindow(winPtr);
+	TkWmMapWindow(winPtr);
 
 	/*
 	 * NSWindowDidDeminiaturizeNotification is received after
 	 * NSWindowDidBecomeKeyNotification, so activate manually
 	 */

Index: macosx/tkMacOSXWm.c
==================================================================
--- macosx/tkMacOSXWm.c
+++ macosx/tkMacOSXWm.c
@@ -1285,12 +1285,21 @@
 	    }
 	    wmPtr2 = winPtr2->wmInfoPtr;
 	    isOnScreen = (wmPtr2->hints.initial_state != IconicState &&
 			  wmPtr2->hints.initial_state != WithdrawnState);
 	    if (w != deadNSWindow && isOnScreen && [w canBecomeKeyWindow]) {
+		TkWindow *frontPtr = TkMacOSXGetTkWindow(w); 
 		[w makeKeyAndOrderFront:NSApp];
-		newTkEventTarget = TkMacOSXGetTkWindow(w);
+		newTkEventTarget = frontPtr;
+		/* Set the menubar for the new front window. */
+		if (frontPtr->wmInfoPtr &&
+		    frontPtr->wmInfoPtr->menuPtr &&
+		    frontPtr->wmInfoPtr->menuPtr->mainMenuPtr) {
+		    Tk_Window menubar = frontPtr->wmInfoPtr->menuPtr->mainMenuPtr->tkwin;
+		    TKMenu *menu = (TKMenu *) frontPtr->wmInfoPtr->menuPtr->platformData;
+		    [NSApp tkSetMainMenu:menu];
+		}
 		break;
 	    }
 	}
 
 	[NSApp setTkEventTarget:newTkEventTarget];

Index: tests/event.test
==================================================================
--- tests/event.test
+++ tests/event.test
@@ -1136,10 +1136,11 @@
     toplevel .two
     pack propagate .two 0
     wm geometry .two 300x300+100+100
     create_and_pack_frames .two
     wm deiconify .two
+    update idletasks; # make sure two is there
     toplevel .three
     pack propagate .three 0
     wm geometry .three 300x300+110+110
     create_and_pack_frames .three
     wm deiconify .three

Index: unix/Makefile.in
==================================================================
--- unix/Makefile.in
+++ unix/Makefile.in
@@ -110,11 +110,11 @@
 
 # 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: -ltcl9.0)
+# The linker flags needed to link in the Tcl library (ex: -ltcl9.1)
 TCL_LIB_FLAG		= @TCL_LIB_FLAG@
 
 # Flag, 1: we're building a shared lib, 0 we're not
 TK_SHARED_BUILD		= @TK_SHARED_BUILD@
 
@@ -245,12 +245,10 @@
 
 TK_STUB_LIB_FLAG	= @TK_STUB_LIB_FLAG@
 #TK_STUB_LIB_FLAG	= -ltkstub
 
 TK_LIB_FILE		= @TK_LIB_FILE@
-TK_LIB_FILE_TCL8	= @TK_LIB_FILE_TCL8@
-TK_LIB_FILE_TCL9	= @TK_LIB_FILE_TCL9@
 #TK_LIB_FILE		= libtk.a
 
 # Generic lib name used in rules that apply to tcl and tk
 LIB_FILE		= ${TK_LIB_FILE}
 
@@ -337,11 +335,11 @@
 
 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=4 @EXTRA_CC_SWITCHES@
+${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@
 
 CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@
 
 APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@
 
@@ -798,32 +796,20 @@
 	    done;
 	@if test "x$(TK_SHARED_BUILD)" = "x1"; then \
 	    echo "Creating package index $(PKG_INDEX)"; \
 	    rm -f "$(PKG_INDEX)"; \
 	    (\
-	    echo "if {![package vsatisfies [package provide Tcl] 8.7-]} return";\
+	    echo "if {![package vsatisfies [package provide Tcl] 9.0]} return";\
 	    relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\
 	    if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \
-	    echo "if {[package vsatisfies [package provide Tcl] 9.0]} {";\
-	    echo "    package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}$(TK_LIB_FILE_TCL9)]]]";\
-	    echo "} else {";\
-	    echo "    package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}$(TK_LIB_FILE_TCL8)]]]";\
-	    echo "}";\
+	    echo "package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}$(TK_LIB_FILE)]]]";\
 	    else \
 	    echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\
 	    echo "	|| ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\
-	    echo "    if {[package vsatisfies [package provide Tcl] 9.0]} {";\
-	    echo "	package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE_TCL9)]]]";\
-	    echo "    } else {";\
-	    echo "	package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE_TCL8)]]]";\
-	    echo "    }";\
+	    echo "    package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)]]]";\
 	    echo "} else {";\
-	    echo "    if {[package vsatisfies [package provide Tcl] 9.0]} {";\
-	    echo "	package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll]]]";\
-	    echo "    } else {";\
-	    echo "	package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll]]]";\
-	    echo "    }";\
+	    echo "    package ifneeded tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll]]]";\
 	    echo "}";\
 	    fi; \
 	    echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list package require -exact tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL)]"\
 	    ) > "$(PKG_INDEX)"; \
 	    fi
@@ -1829,11 +1815,11 @@
 
 #
 # This target creates the HTML folder for Tcl & Tk and places it
 # in DISTDIR/html.  It uses the tcltk-man2html.tcl tool from
 # the Tcl group's tool workspace.  It depends on the Tcl & Tk being
-# in directories called tcl9.0 & tk9.0 up two directories from the
+# in directories called tcl9.1 & tk9.1 up two directories from the
 # TOOL_DIR.
 #
 
 html:
 	$(BUILD_HTML)

Index: unix/configure
==================================================================
--- unix/configure
+++ unix/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for tk 9.0.
+# Generated by GNU Autoconf 2.72 for tk 9.1.
 #
 #
 # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
 # Inc.
 #
@@ -599,12 +599,12 @@
 MAKEFLAGS=
 
 # Identity of this package.
 PACKAGE_NAME='tk'
 PACKAGE_TARNAME='tk'
-PACKAGE_VERSION='9.0'
-PACKAGE_STRING='tk 9.0'
+PACKAGE_VERSION='9.1'
+PACKAGE_STRING='tk 9.1'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
 # Factoring default headers for most tests.
 ac_includes_default="\
@@ -673,12 +673,10 @@
 TK_STUB_LIB_SPEC
 TK_STUB_LIB_FLAG
 TK_STUB_LIB_FILE
 TK_LIB_SPEC
 TK_LIB_FLAG
-TK_LIB_FILE_TCL9
-TK_LIB_FILE_TCL8
 TK_LIB_FILE
 TK_YEAR
 TK_PATCH_LEVEL
 TK_MINOR_VERSION
 TK_MAJOR_VERSION
@@ -1374,11 +1372,11 @@
 #
 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 9.0 to adapt to many kinds of systems.
+'configure' configures tk 9.1 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.
@@ -1440,11 +1438,11 @@
 _ACEOF
 fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tk 9.0:";;
+     short | recursive ) echo "Configuration of tk 9.1:";;
    esac
   cat <<\_ACEOF
 
 Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
@@ -1557,11 +1555,11 @@
 fi
 
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tk configure 9.0
+tk configure 9.1
 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.
@@ -1923,11 +1921,11 @@
 
 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 9.0, which was
+It was created by tk $as_me 9.1, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   $ $0$ac_configure_args_raw
 
 _ACEOF
@@ -2602,14 +2600,14 @@
 
 
 
 
 
-TK_VERSION=9.0
+TK_VERSION=9.1
 TK_MAJOR_VERSION=9
-TK_MINOR_VERSION=0
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=1
+TK_PATCH_LEVEL="a0"
 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
@@ -2698,15 +2696,15 @@
 			`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/tcl9.0 2>/dev/null` \
+			`ls -d /usr/lib/tcl9.1 2>/dev/null` \
 			`ls -d /usr/lib 2>/dev/null` \
 			`ls -d /usr/lib64 2>/dev/null` \
-			`ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
-			`ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \
+			`ls -d /usr/local/lib/tcl9.1 2>/dev/null` \
+			`ls -d /usr/local/lib/tcl/tcl9.1 2>/dev/null` \
 			; do
 		    if test -f "$i/tclConfig.sh" ; then
 			ac_cv_c_tclconfig="`(cd $i; pwd)`"
 			break
 		    fi
@@ -2801,14 +2799,12 @@
 
 
 
 
 if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MINOR_VERSION}" -lt 7 ; then
-    as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+
+    as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 9.0+
 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; }
@@ -8779,17 +8775,11 @@
 #	building libtk as a shared library instead of a static library.
 #--------------------------------------------------------------------
 
 eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
 eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
-eval "TK_LIB_FILE_TCL8=libtk${LIB_SUFFIX}"
-if test ${TCL_MAJOR_VERSION} = 8 ; then
-eval "TK_LIB_FILE=libtk${LIB_SUFFIX}"
-else
 eval "TK_LIB_FILE=libtcl9tk${LIB_SUFFIX}"
-fi
-eval "TK_LIB_FILE_TCL9=libtcl9tk${LIB_SUFFIX}"
 
 # tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed
 # since on some platforms TK_LIB_FILE contains shell escapes.
 
 eval "TK_LIB_FILE=${TK_LIB_FILE}"
@@ -8879,17 +8869,11 @@
     LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
     if test "${libdir}" = '${exec_prefix}/lib'; then
 	# override libdir default
 	libdir="/Library/Frameworks"
     fi
-    if test ${TCL_MAJOR_VERSION} = 8 ; then
-	TK_LIB_FILE="Tk"
-    else
-	TK_LIB_FILE="Tk"
-    fi
-    TK_LIB_FILE_TCL8="Tk"
-    TK_LIB_FILE_TCL9="Tk"
+    TK_LIB_FILE="Tk"
     TK_LIB_FLAG="-framework Tk"
     TK_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tk"
     TK_LIB_SPEC="-F${libdir} -framework Tk"
     libdir="${libdir}/Tk.framework/Versions/\${VERSION}"
     TK_LIBRARY="${libdir}/Resources/Scripts"
@@ -8924,14 +8908,11 @@
     if test $tk_aqua = yes; then
 	EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done'
     fi
     # libdir must be a fully qualified path and not ${exec_prefix}/lib
     eval libdir="$libdir"
-    TK_LIB_FLAG="-l"
-    if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
-	TK_LIB_FLAG="${TK_LIB_FLAG}tcl9"
-    fi
+    TK_LIB_FLAG="-ltcl9"
     if test "${ac_cv_cygwin}" = "yes" -a "$SHARED_BUILD" = "1"; then
 	TK_LIB_FLAG="${TK_LIB_FLAG}tk`echo ${TK_VERSION} | tr -d .`"
 	TK_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win ${TK_LIB_FLAG}"
     else
 	if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
@@ -9183,12 +9164,10 @@
 #------------------------------------------------------------------------
 # tkConfig.sh refers to this by a different name
 #------------------------------------------------------------------------
 
 TK_SHARED_BUILD=${SHARED_BUILD}
-
-
 
 
 
 
 
@@ -9776,11 +9755,11 @@
 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 9.0, which was
+This file was extended by tk $as_me 9.1, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -9835,11 +9814,11 @@
 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 9.0
+tk config.status 9.1
 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

Index: unix/configure.ac
==================================================================
--- unix/configure.ac
+++ unix/configure.ac
@@ -1,11 +1,11 @@
 ! /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],[9.0])
+AC_INIT([tk],[9.1])
 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])
@@ -21,14 +21,14 @@
     /* override */ #undef PACKAGE_VERSION
     /* override */ #undef PACKAGE_STRING
     #endif /* _TKCONFIG */])
 ])
 
-TK_VERSION=9.0
+TK_VERSION=9.1
 TK_MAJOR_VERSION=9
-TK_MINOR_VERSION=0
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=1
+TK_PATCH_LEVEL="a0"
 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
@@ -36,14 +36,12 @@
 
 SC_PATH_TCLCONFIG
 SC_LOAD_TCLCONFIG
 
 if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MINOR_VERSION}" -lt 7 ; then
-    AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+
+    AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 9.0+
 Found config for Tcl ${TCL_VERSION}])
-fi
 fi
 
 SC_PROG_TCLSH
 SC_BUILD_TCLSH
 
@@ -539,17 +537,11 @@
 #	building libtk as a shared library instead of a static library.
 #--------------------------------------------------------------------
 
 eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
 eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
-eval "TK_LIB_FILE_TCL8=libtk${LIB_SUFFIX}"
-if test ${TCL_MAJOR_VERSION} = 8 ; then
-eval "TK_LIB_FILE=libtk${LIB_SUFFIX}"
-else
 eval "TK_LIB_FILE=libtcl9tk${LIB_SUFFIX}"
-fi
-eval "TK_LIB_FILE_TCL9=libtcl9tk${LIB_SUFFIX}"
 
 # tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed
 # since on some platforms TK_LIB_FILE contains shell escapes.
 
 eval "TK_LIB_FILE=${TK_LIB_FILE}"
@@ -602,17 +594,11 @@
     LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
     if test "${libdir}" = '${exec_prefix}/lib'; then
 	# override libdir default
 	libdir="/Library/Frameworks"
     fi
-    if test ${TCL_MAJOR_VERSION} = 8 ; then
-	TK_LIB_FILE="Tk"
-    else
-	TK_LIB_FILE="Tk"
-    fi
-    TK_LIB_FILE_TCL8="Tk"
-    TK_LIB_FILE_TCL9="Tk"
+    TK_LIB_FILE="Tk"
     TK_LIB_FLAG="-framework Tk"
     TK_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tk"
     TK_LIB_SPEC="-F${libdir} -framework Tk"
     libdir="${libdir}/Tk.framework/Versions/\${VERSION}"
     TK_LIBRARY="${libdir}/Resources/Scripts"
@@ -647,14 +633,11 @@
     if test $tk_aqua = yes; then
 	EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done'
     fi
     # libdir must be a fully qualified path and not ${exec_prefix}/lib
     eval libdir="$libdir"
-    TK_LIB_FLAG="-l"
-    if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
-	TK_LIB_FLAG="${TK_LIB_FLAG}tcl9"
-    fi
+    TK_LIB_FLAG="-ltcl9"
     if test "${ac_cv_cygwin}" = "yes" -a "$SHARED_BUILD" = "1"; then
 	TK_LIB_FLAG="${TK_LIB_FLAG}tk`echo ${TK_VERSION} | tr -d .`"
 	TK_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win ${TK_LIB_FLAG}"
     else
 	if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
@@ -751,12 +734,10 @@
 AC_SUBST(TK_MINOR_VERSION)
 AC_SUBST(TK_PATCH_LEVEL)
 AC_SUBST(TK_YEAR)
 
 AC_SUBST(TK_LIB_FILE)
-AC_SUBST(TK_LIB_FILE_TCL8)
-AC_SUBST(TK_LIB_FILE_TCL9)
 AC_SUBST(TK_LIB_FLAG)
 AC_SUBST(TK_LIB_SPEC)
 AC_SUBST(TK_STUB_LIB_FILE)
 AC_SUBST(TK_STUB_LIB_FLAG)
 AC_SUBST(TK_STUB_LIB_SPEC)

Index: unix/tcl.m4
==================================================================
--- unix/tcl.m4
+++ unix/tcl.m4
@@ -91,15 +91,15 @@
 			`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/tcl9.0 2>/dev/null` \
+			`ls -d /usr/lib/tcl9.1 2>/dev/null` \
 			`ls -d /usr/lib 2>/dev/null` \
 			`ls -d /usr/lib64 2>/dev/null` \
-			`ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
-			`ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \
+			`ls -d /usr/local/lib/tcl9.1 2>/dev/null` \
+			`ls -d /usr/local/lib/tcl/tcl9.1 2>/dev/null` \
 			; do
 		    if test -f "$i/tclConfig.sh" ; then
 			ac_cv_c_tclconfig="`(cd $i; pwd)`"
 			break
 		    fi
@@ -224,15 +224,15 @@
 			`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/tk9.0 2>/dev/null` \
+			`ls -d /usr/lib/tk9.1 2>/dev/null` \
 			`ls -d /usr/lib 2>/dev/null` \
 			`ls -d /usr/lib64 2>/dev/null` \
-			`ls -d /usr/local/lib/tk9.0 2>/dev/null` \
-			`ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \
+			`ls -d /usr/local/lib/tk9.1 2>/dev/null` \
+			`ls -d /usr/local/lib/tcl/tk9.1 2>/dev/null` \
 			; do
 		    if test -f "$i/tkConfig.sh" ; then
 			ac_cv_c_tkconfig="`(cd $i; pwd)`"
 			break
 		    fi
@@ -2085,11 +2085,11 @@
 
 AC_DEFUN([SC_TIME_HANDLER], [
     AC_CHECK_HEADERS(sys/time.h)
     AC_CHECK_HEADERS_ONCE([sys/time.h])
 
-    AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
+    AC_CHECK_FUNCS(gmtime_r localtime_r)
 
     AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; (void)tm.tm_tzadj;]])],
 	    [tcl_cv_member_tm_tzadj=yes],
 	    [tcl_cv_member_tm_tzadj=no])])

Index: unix/tk.spec
==================================================================
--- unix/tk.spec
+++ unix/tk.spec
@@ -2,19 +2,19 @@
 
 %{!?directory:%define directory /usr/local}
 
 Name:          tk
 Summary:       Tk graphical toolkit for the Tcl scripting language.
-Version:       9.0.2
+Version:       9.1a0
 Release:       2
 License:       BSD
 Group:         Development/Languages
 Source:        https://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.7.0
-Requires:      tcl >= 8.7.0
+Buildrequires: XFree86-devel tcl >= 9.0.0
+Requires:      tcl >= 9.0.0
 
 %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

Index: unix/tkAppInit.c
==================================================================
--- unix/tkAppInit.c
+++ unix/tkAppInit.c
@@ -17,12 +17,12 @@
  * What's going on is related to TIP #596:
  *  Stubs support for Embedding Tcl in other applications
  *
  * If an application using Tcl_Main() is compiled with USE_TCL_STUBS,
  * Tcl_Main() will be replaced by a stub function, which loads
- * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If
- * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens.
+ * libtcl9.1.so/tcl91.dll and then calls its Tcl_MainEx(). If
+ * libtcl9.1.so/tcl91.dll is not present (at runtime), a crash is what happens.
  *
  * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS
  * (unless you want to use the TIP #596 functionality)
  *
  * The proper solution is to make sure that Makefile.in doesn't use

Index: win/Makefile.in
==================================================================
--- win/Makefile.in
+++ win/Makefile.in
@@ -135,12 +135,10 @@
 TK_VFS_ROOT		= libtk.vfs
 
 TK_STUB_LIB_FILE	= @TK_STUB_LIB_FILE@
 TK_LIB_FILE		= @TK_LIB_FILE@
 TK_DLL_FILE		= @TK_DLL_FILE@
-TK_DLL_FILE_TCL8	= @TK_DLL_FILE_TCL8@
-TK_DLL_FILE_TCL9	= @TK_DLL_FILE_TCL9@
 TEST_DLL_FILE		= tktest$(VER)${DLLSUFFIX}
 TEST_LIB_FILE		= @LIBPREFIX@tktest$(VER)${DLLSUFFIX}${LIBSUFFIX}
 
 SHARED_LIBRARIES	= $(TK_DLL_FILE) $(TK_STUB_LIB_FILE)
 STATIC_LIBRARIES	= $(TK_LIB_FILE)
@@ -259,11 +257,11 @@
 
 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=4 -DUSE_TCL_STUBS
+${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DUSE_TCL_STUBS
 
 CC_OBJNAME = @CC_OBJNAME@
 CC_EXENAME = @CC_EXENAME@
 
 # Tk used to let the configure script choose which program to use
@@ -536,24 +534,16 @@
 	    fi; \
 	    done
 	@echo "Creating package index $(PKG_INDEX)";
 	@$(RM) $(PKG_INDEX);
 	@(\
-	echo "if {![package vsatisfies [package provide Tcl] 8.7-]} return";\
+	echo "if {![package vsatisfies [package provide Tcl] 9.0]} return";\
 	echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\
 	echo "	|| ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\
-	echo "    if {[package vsatisfies [package provide Tcl] 9.0]} {";\
-	echo "	package ifneeded tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin libtcl9tk$(VERSION).dll]]]";\
-	echo "    } else {";\
-	echo "	package ifneeded tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin libtk$(VERSION).dll]]]";\
-	echo "    }";\
+	echo "    package ifneeded tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin libtcl9tk$(VERSION).dll]]]";\
 	echo "} else {";\
-	echo "    if {[package vsatisfies [package provide Tcl] 9.0]} {";\
-	echo "	package ifneeded tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin $(TK_DLL_FILE_TCL9)]]]";\
-	echo "    } else {";\
-	echo "	package ifneeded tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin $(TK_DLL_FILE_TCL8)]]]";\
-	echo "    }";\
+	echo "    package ifneeded tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin $(TK_DLL_FILE)]]]";\
 	echo "}";\
 	echo "package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list package require -exact tk $(VERSION)$(PATCH_LEVEL)]";\
 	) > $(PKG_INDEX);
 	@for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \
 	    do \

Index: win/README
==================================================================
--- win/README
+++ win/README
@@ -1,6 +1,6 @@
-Tk 9.0 for Windows
+Tk 9.1 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

Index: win/configure
==================================================================
--- win/configure
+++ win/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for tk 9.0.
+# Generated by GNU Autoconf 2.72 for tk 9.1.
 #
 #
 # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
 # Inc.
 #
@@ -599,12 +599,12 @@
 MAKEFLAGS=
 
 # Identity of this package.
 PACKAGE_NAME='tk'
 PACKAGE_TARNAME='tk'
-PACKAGE_VERSION='9.0'
-PACKAGE_STRING='tk 9.0'
+PACKAGE_VERSION='9.1'
+PACKAGE_STRING='tk 9.1'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
 ac_unique_file="../generic/tk.h"
 # Factoring default headers for most tests.
@@ -689,12 +689,10 @@
 TK_BIN_DIR
 TK_SRC_DIR
 TK_BUILD_STUB_LIB_SPEC
 TK_STUB_LIB_FLAG
 TK_STUB_LIB_FILE
-TK_DLL_FILE_TCL9
-TK_DLL_FILE_TCL8
 TK_DLL_FILE
 TK_LIB_FILE
 TK_PATCH_LEVEL
 TK_MINOR_VERSION
 TK_MAJOR_VERSION
@@ -1353,11 +1351,11 @@
 #
 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 9.0 to adapt to many kinds of systems.
+'configure' configures tk 9.1 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.
@@ -1415,11 +1413,11 @@
 _ACEOF
 fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tk 9.0:";;
+     short | recursive ) echo "Configuration of tk 9.1:";;
    esac
   cat <<\_ACEOF
 
 Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
@@ -1513,11 +1511,11 @@
 fi
 
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tk configure 9.0
+tk configure 9.1
 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.
@@ -1723,11 +1721,11 @@
 
 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 9.0, which was
+It was created by tk $as_me 9.1, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   $ $0$ac_configure_args_raw
 
 _ACEOF
@@ -2405,14 +2403,14 @@
 # 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=9.0
+TK_VERSION=9.1
 TK_MAJOR_VERSION=9
-TK_MINOR_VERSION=0
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=1
+TK_PATCH_LEVEL="a0"
 VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
 
 #------------------------------------------------------------------------
 # Handle the --prefix=... option
 #------------------------------------------------------------------------
@@ -4089,15 +4087,13 @@
 
 
 
 
 if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MINOR_VERSION}" -lt 7; then
     as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better." "$LINENO" 5
-fi
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 9.0+.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 9.0 or better." "$LINENO" 5
 fi
 
 #--------------------------------------------------------------------
 # The statements below define a collection of compile flags.  This
 # macro depends on the value of SHARED_BUILD, and should be called
@@ -5865,49 +5861,27 @@
 TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
 TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
 
 eval "TK_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
 
-eval "TK_DLL_FILE_TCL8=tk$VER${DLLSUFFIX}"
-eval "TK_DLL_FILE_TCL9=tcl9tk$VER${DLLSUFFIX}"
-if test ${TCL_MAJOR_VERSION} = 8 ; then
-eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
-if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
- eval "TK_LIB_FILE=${LIBPREFIX}tk${VER}${LIBSUFFIX}"
-else
- eval "TK_LIB_FILE=${LIBPREFIX}tk${VER}${DLLSUFFIX}.a"
-fi
-else
 eval "TK_DLL_FILE=tcl9tk$VER${DLLSUFFIX}"
 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
+eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ;
 # 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
+TK_LIB_FLAG="-ltcl9"
 eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}tk${VER}${LIBFLAGSUFFIX}\""
 TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
 eval "TK_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_LIB_FLAG}\""
 
-if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
-    eval "TK_STUB_LIB_FLAG=\"-ltkstub${LIBFLAGSUFFIX}\""
-else
-    eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\""
-fi
+eval "TK_STUB_LIB_FLAG=\"-ltkstub${LIBFLAGSUFFIX}\""
 eval "TK_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_STUB_LIB_FLAG}\""
 
 TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}"
 TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}"
 eval "TK_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TK_STUB_LIB_FILE}\""
@@ -5942,12 +5916,10 @@
      *)   TK_RELEASE_LEVEL=2 ;;
 esac
 TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`"
 
 # X86|AMD64|IA64 for manifest
-
-
 
 
 
 
 
@@ -6562,11 +6534,11 @@
 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 9.0, which was
+This file was extended by tk $as_me 9.1, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -6617,11 +6589,11 @@
 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 9.0
+tk config.status 9.1
 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

Index: win/configure.ac
==================================================================
--- win/configure.ac
+++ win/configure.ac
@@ -1,23 +1,23 @@
 #! /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],[9.0])
+AC_INIT([tk],[9.1])
 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=9.0
+TK_VERSION=9.1
 TK_MAJOR_VERSION=9
-TK_MINOR_VERSION=0
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=1
+TK_PATCH_LEVEL="a0"
 VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
 
 #------------------------------------------------------------------------
 # Handle the --prefix=... option
 #------------------------------------------------------------------------
@@ -75,15 +75,13 @@
 
 SC_PATH_TCLCONFIG($TK_PATCH_LEVEL)
 SC_LOAD_TCLCONFIG
 
 if test "${TCL_MAJOR_VERSION}" -lt 9 ; then
-if test "${TCL_MINOR_VERSION}" -lt 7; then
     AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better.])
-fi
+Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 9.0+.
+Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 9.0 or better.])
 fi
 
 #--------------------------------------------------------------------
 # The statements below define a collection of compile flags.  This
 # macro depends on the value of SHARED_BUILD, and should be called
@@ -222,49 +220,27 @@
 TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
 TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
 
 eval "TK_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
 
-eval "TK_DLL_FILE_TCL8=tk$VER${DLLSUFFIX}"
-eval "TK_DLL_FILE_TCL9=tcl9tk$VER${DLLSUFFIX}"
-if test ${TCL_MAJOR_VERSION} = 8 ; then
-eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
-if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
- eval "TK_LIB_FILE=${LIBPREFIX}tk${VER}${LIBSUFFIX}"
-else
- eval "TK_LIB_FILE=${LIBPREFIX}tk${VER}${DLLSUFFIX}.a"
-fi
-else
 eval "TK_DLL_FILE=tcl9tk$VER${DLLSUFFIX}"
 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
+eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${LIBSUFFIX}" ;
 # 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
+TK_LIB_FLAG="-ltcl9"
 eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}tk${VER}${LIBFLAGSUFFIX}\""
 TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
 eval "TK_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_LIB_FLAG}\""
 
-if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
-    eval "TK_STUB_LIB_FLAG=\"-ltkstub${LIBFLAGSUFFIX}\""
-else
-    eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\""
-fi
+eval "TK_STUB_LIB_FLAG=\"-ltkstub${LIBFLAGSUFFIX}\""
 eval "TK_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_STUB_LIB_FLAG}\""
 
 TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}"
 TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}"
 eval "TK_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TK_STUB_LIB_FILE}\""
@@ -307,12 +283,10 @@
 AC_SUBST(TK_MAJOR_VERSION)
 AC_SUBST(TK_MINOR_VERSION)
 AC_SUBST(TK_PATCH_LEVEL)
 AC_SUBST(TK_LIB_FILE)
 AC_SUBST(TK_DLL_FILE)
-AC_SUBST(TK_DLL_FILE_TCL8)
-AC_SUBST(TK_DLL_FILE_TCL9)
 AC_SUBST(TK_STUB_LIB_FILE)
 AC_SUBST(TK_STUB_LIB_FLAG)
 AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
 AC_SUBST(TK_SRC_DIR)
 AC_SUBST(TK_BIN_DIR)

Index: win/makefile.vc
==================================================================
--- win/makefile.vc
+++ win/makefile.vc
@@ -87,16 +87,10 @@
 
 # The rules.vc file does much of the hard work in terms of defining
 # the build configuration, macros, output directories etc.
 !include "rules-ext.vc"
 
-!if ($(TCL_MAJOR_VERSION) > 8) || ($(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) > 6)
-USING_PRE87_TCL = 0
-!else
-USING_PRE87_TCL = 1
-!endif
-
 # TCLINSTALL is set to 1 by rules.vc to indicate we are building against
 # an installed Tcl and 0 if building against Tcl source. Tk needs the latter.
 !if $(TCLINSTALL)
 !message *** Warning: Tk requires the source distribution of Tcl to build from,
 !message ***    at this time, sorry.  Please set the TCLDIR macro to point to the
@@ -121,14 +115,10 @@
 !message *** Tk script library will be appended to the binary.
 TK_EMBED_SCRIPTS = 1
 !endif
 !endif
 
-!if $(USING_PRE87_TCL)
-TK_EMBED_SCRIPTS = 0
-!endif
-
 TK_NO_DEPRECATED = 0
 !if "$(CHECKS)" != "" && ![nmakehlp -f "$(CHECKS)" "none"]
 !if [nmakehlp -f $(CHECKS) "nodep"]
 TK_NO_DEPRECATED = 1
 !endif
@@ -339,11 +329,11 @@
 # 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=4 \
+		 /DHAVE_STRINGS_H=1 \
 !if $(TTK_SQUARE_WIDGET)
 		 /DTTK_SQUARE_WIDGET=1 \
 !endif
 !if $(TK_NO_DEPRECATED)
 		 /DTK_NO_DEPRECATED=1
@@ -364,14 +354,11 @@
 
 #---------------------------------------------------------------------
 # Project specific targets
 #---------------------------------------------------------------------
 
-release:  setup $(TKSTUBLIB) $(WISH)
-!if !$(USING_PRE87_TCL)
-release:  libtkzip embed
-!endif
+release:  setup $(TKSTUBLIB) $(WISH) libtkzip embed
 all:	  release $(CAT32)
 core:	  setup $(TKSTUBLIB) $(TKLIB)
 cwish:	  $(WISHC)
 libtkzip: setup $(TKSCRIPTZIP)
 !if $(TK_EMBED_SCRIPTS)
@@ -745,24 +732,16 @@
 	@$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\"
 	@$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\"
 !if !$(STATIC_BUILD)
 	@echo creating package index
 	@type << > $(OUT_DIR)\pkgIndex.tcl
-if {![package vsatisfies [package provide Tcl] 8.7-]} return
+if {![package vsatisfies [package provide Tcl] 9.0]} return
 if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)]
 	|| ([info exists ::argv] && ("-display" in $$::argv)))} {
-    if {[package vsatisfies [package provide Tcl] 9.0]} {
-	package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin libtcl9tk$(DOTVERSION).dll]]]
-    } else {
-	package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin libtk$(DOTVERSION).dll]]]
-    }
-} else {
-    if {[package vsatisfies [package provide Tcl] 9.0]} {
-	package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin $(TKLIBNAME9)]]]
-    } else {
-	package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin $(TKLIBNAME8)]]]
-    }
+    package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin libtcl9tk$(DOTVERSION).dll]]]
+} else {
+    package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin $(TKLIBNAME)]]]
 }
 package ifneeded Tk $(TK_PATCH_LEVEL) [list package require -exact tk $(TK_PATCH_LEVEL)]
 <<
 	@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\"
 !endif
@@ -774,13 +753,11 @@
 	@$(CPY) "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\"
 	@$(CPY) "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\"
 	@$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
 	@$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\"
 	@$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\"
-!if !$(USING_PRE87_TCL)
 	@$(CPY) "$(TKSCRIPTZIP)" "$(LIB_INSTALL_DIR)"
-!endif
 !if !$(TK_EMBED_SCRIPTS)
 	@echo installing script library
 	@$(CPY) "$(LIBDIR)\*" "$(SCRIPT_INSTALL_DIR)\"
 	@echo installing theme library
 	@$(CPY) "$(LIBDIR)\ttk\*" "$(SCRIPT_INSTALL_DIR)\ttk\"

Index: win/rules.vc
==================================================================
--- win/rules.vc
+++ win/rules.vc
@@ -1646,20 +1646,20 @@
 
 default-target: $(DEFAULT_BUILD_TARGET)
 
 !if $(MULTIPLATFORM_INSTALL)
 default-pkgindex:
-	@echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl
+	@echo if {[package vsatisfies [package provide Tcl] 9.0]} { > $(OUT_DIR)\pkgIndex.tcl
 	@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
 	    [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME9)]] >> $(OUT_DIR)\pkgIndex.tcl
 	@echo } else { >> $(OUT_DIR)\pkgIndex.tcl
 	@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
 	    [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME8)]] >> $(OUT_DIR)\pkgIndex.tcl
 	@echo } >> $(OUT_DIR)\pkgIndex.tcl
 !else
 default-pkgindex:
-	@echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl
+	@echo if {[package vsatisfies [package provide Tcl] 9.0]} { > $(OUT_DIR)\pkgIndex.tcl
 	@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
 	    [list load [file join $$dir $(PRJLIBNAME9)]] >> $(OUT_DIR)\pkgIndex.tcl
 	@echo } else { >> $(OUT_DIR)\pkgIndex.tcl
 	@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
 	    [list load [file join $$dir $(PRJLIBNAME8)]] >> $(OUT_DIR)\pkgIndex.tcl

Index: win/tcl.m4
==================================================================
--- win/tcl.m4
+++ win/tcl.m4
@@ -983,17 +983,17 @@
 #	Defines the following vars:
 #		TCL_BIN_DIR	Full path to the tcl build dir.
 #------------------------------------------------------------------------
 
 AC_DEFUN([SC_WITH_TCL], [
-    if test -d ../../tcl9.0$1/win;  then
-	TCL_BIN_DEFAULT=../../tcl9.0$1/win
+    if test -d ../../tcl9.1$1/win;  then
+	TCL_BIN_DEFAULT=../../tcl9.1$1/win
     else
-	TCL_BIN_DEFAULT=../../tcl9.0/win
+	TCL_BIN_DEFAULT=../../tcl9.1/win
     fi
 
-    AC_ARG_WITH(tcl, [  --with-tcl=DIR          use Tcl 9.0 binaries from DIR],
+    AC_ARG_WITH(tcl, [  --with-tcl=DIR          use Tcl 9.x 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

Index: win/winMain.c
==================================================================
--- win/winMain.c
+++ win/winMain.c
@@ -17,12 +17,12 @@
  * What's going on is related to TIP #596:
  *  Stubs support for Embedding Tcl in other applications
  *
  * If an application using Tcl_Main() is compiled with USE_TCL_STUBS,
  * Tcl_Main() will be replaced by a stub function, which loads
- * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If
- * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens.
+ * libtcl9.1.so/tcl91.dll and then calls its Tcl_MainEx(). If
+ * libtcl9.1.so/tcl91.dll is not present (at runtime), a crash is what happens.
  *
  * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS
  * (unless you want to use the TIP #596 functionality)
  *
  * The proper solution is to make sure that Makefile.in doesn't use