GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 by serhiy-storchaka · Pull Request #120213 · python/cpython

gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 #120213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
serhiy-storchaka merged 1 commit into python:main from serhiy-storchaka:ttk-tk-9
Jun 7, 2024

Uh oh!

There was an error while loading. Please reload this page.

Merged

gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 #120213

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
b03627f
gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0
serhiy-storchaka Jun 7, 2024
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0
* Use new methods for tracing Tcl variable.
* Fix Combobox.current() for empty combobox.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
serhiy-storchaka committed Jun 7, 2024
commit b03627f43504b5ed7ee042a2cf20a587792eff8f

There are no files selected for viewing

9 changes: 6 additions & 3 deletions 9 Lib/tkinter/ttk.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,10 @@ def current(self, newindex=None):
returns the index of the current value in the list of values
or -1 if the current value does not appear in the list."""
if newindex is None:
return self.tk.getint(self.tk.call(self._w, "current"))
res = self.tk.call(self._w, "current")
if res == '':
return -1
return self.tk.getint(res)
return self.tk.call(self._w, "current", newindex)


Expand Down Expand Up @@ -1522,15 +1525,15 @@ def __init__(self, master=None, variable=None, from_=0, to=10, **kw):
self.label.place(anchor='n' if label_side == 'top' else 's')

# update the label as scale or variable changes
self.__tracecb = self._variable.trace_variable('w', self._adjust)
self.__tracecb = self._variable.trace_add('write', self._adjust)
self.bind('<Configure>', self._adjust)
self.bind('<Map>', self._adjust)


def destroy(self):
"""Destroy this widget and possibly its associated variable."""
try:
self._variable.trace_vdelete('w', self.__tracecb)
self._variable.trace_remove('write', self.__tracecb)
except AttributeError:
pass
else:
Expand Down
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/Library/2024-06-07-13-21-11.gh-issue-120211.Rws_gf.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix :mod:`tkinter.ttk` with Tcl/Tk 9.0.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.