Issue #20067: Tkinter variables now work when wantobjects is false.
This commit is contained in:
parent
dfd21d3538
commit
5e11655156
|
@ -223,10 +223,12 @@ class Variable:
|
|||
_varnum += 1
|
||||
if value is not None:
|
||||
self.set(value)
|
||||
elif not self._tk.call("info", "exists", self._name):
|
||||
elif not self._tk.getboolean(self._tk.call("info", "exists", self._name)):
|
||||
self.set(self._default)
|
||||
def __del__(self):
|
||||
"""Unset the variable in Tcl."""
|
||||
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…
Reference in New Issue