pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/d68a22e7a68ae09f7db61d5a1a3bd9c0360cf3ee

97560d244c08.css" /> gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213) · python/cpython@d68a22e · GitHub
Skip to content

Commit d68a22e

Browse files
gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213)
* Use new methods for tracing Tcl variable. * Fix Combobox.current() for empty combobox.
1 parent 6646a9d commit d68a22e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Lib/tkinter/ttk.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,10 @@ def current(self, newindex=None):
690690
returns the index of the current value in the list of values
691691
or -1 if the current value does not appear in the list."""
692692
if newindex is None:
693-
return self.tk.getint(self.tk.call(self._w, "current"))
693+
res = self.tk.call(self._w, "current")
694+
if res == '':
695+
return -1
696+
return self.tk.getint(res)
694697
return self.tk.call(self._w, "current", newindex)
695698

696699

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

15241527
# update the label as scale or variable changes
1525-
self.__tracecb = self._variable.trace_variable('w', self._adjust)
1528+
self.__tracecb = self._variable.trace_add('write', self._adjust)
15261529
self.bind('<Configure>', self._adjust)
15271530
self.bind('<Map>', self._adjust)
15281531

15291532

15301533
def destroy(self):
15311534
"""Destroy this widget and possibly its associated variable."""
15321535
try:
1533-
self._variable.trace_vdelete('w', self.__tracecb)
1536+
self._variable.trace_remove('write', self.__tracecb)
15341537
except AttributeError:
15351538
pass
15361539
else:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix :mod:`tkinter.ttk` with Tcl/Tk 9.0.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy