[Python-bugs-list] [ python-Bugs-671741 ] Tk.IntVar.get fails after set(True) in 2.3a1
SourceForge.net
noreply@sourceforge.net
Tue, 21 Jan 2003 04:06:35 -0800
Bugs item #671741, was opened at 2003-01-21 12:06
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=671741&group_id=5470
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Edward K. Ream (edream)
Assigned to: Nobody/Anonymous (nobody)
Summary: Tk.IntVar.get fails after set(True) in 2.3a1
Initial Comment:
Executing the following fails in 2.3a1. Similar code
works in 2.1 and 2.2.
def truebug():
import Tkinter
Tk = Tkinter
top = Tk.Toplevel()
f = Tk.Frame(top)
f.pack()
var = Tk.IntVar()
box = Tk.Checkbutton(f, anchor="w",
text="box",variable=var)
box.pack()
var.set(True)
val = var.get()
Example:
Microsoft Windows XP [Version 5.1.2600]
...
Python 2.3a1 (#38, Dec 31 2002, 17:53:59) [MSC
v.1200 32 bit (Intel)] on win32
...
>>> import truebug
>>> truebug.truebug()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "c:\prog\test\truebug.py", line 15, in truebug
val = var.get()
File "C:\PYTHON23\lib\lib-tk\Tkinter.py", line 239, in get
return getint(self._tk.globalgetvar(self._name))
ValueError: invalid literal for int(): True
>>>
Edward
--------------------------------------------------------------------
Edward K. Ream email: edream@tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=671741&group_id=5470