mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #20067: Tkinter variables now work when wantobjects is false.
This commit is contained in:
commit
1b97ed5abc
3 changed files with 14 additions and 9 deletions
|
@ -220,12 +220,12 @@ class Variable:
|
|||
_varnum += 1
|
||||
if value is not None:
|
||||
self.initialize(value)
|
||||
elif not self._tk.call("info", "exists", self._name):
|
||||
elif not self._tk.getboolean(self._tk.call("info", "exists", self._name)):
|
||||
self.initialize(self._default)
|
||||
def __del__(self):
|
||||
"""Unset the variable in Tcl."""
|
||||
if (self._tk is not None and self._tk.call("info", "exists",
|
||||
self._name)):
|
||||
if (self._tk is not None and
|
||||
self._tk.getboolean(self._tk.call("info", "exists", self._name))):
|
||||
self._tk.globalunsetvar(self._name)
|
||||
def __str__(self):
|
||||
"""Return the name of the variable in Tcl."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue