Tkinter "Expected boolean value"

G

Grzegorz Dostatni

Good morning.

I've got a Tkinter problem:

File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 2310, in selection_present
return self.tk.getboolean(
TclError: expected boolean value but got ""

Now a few weeks ago there was a similar problem with the boolean value.
That's when the tcl started returning "???" for unknown fields in a
callback. This looks to be related. I am running the newest cygwin version
of python (Python 2.3 (#1, Aug 5 2003, 09:49:11)) with libtk and libtcl
8.4.

Is it possible to fix this without re-compiling? I've got a lot of
c-modules/wrappers etc. I'll have to do an installation of my program soon
and so far I've been able to use only the stock versions of cygwin.

Greg

"Many a man may look respectable, and yet be able to hide at will behind a
spiral staircase."
- Pelham (Plum) Grenville Wodehouse
 
G

Grzegorz Dostatni

I am sorry to be reposting this after only 20 hours, but this newsgroup is
very busy and I am quite desperate for an answer.

Please, if you know anything about this problem - let me know.
I am running the newest version of both python and tcl/tk available for
cygwin.

Grzegorz Dostatni
 
J

Jeff Epler

You'd do better with tk8.3 than 8.4. There were some incompatible
changes in Tk 8.4's "bind" command that cause Python problems. I'm not
sure in what version of Python this problem is fixed.

As for your 'expected boolean value' problem, there's not enough
information for me to guess the cause. It's not something I've heard of
before. If you want help, your best bet would be to post a small
program that is runnable and demonstrates the problem.

Jeff
 
M

Mike Abel

Grzegorz Dostatni said:
File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 2310, in selection_present
return self.tk.getboolean(
TclError: expected boolean value but got ""

I guess: Tcl needs a boolean value and gets an empty string?

Try to look in this direction.

Mike
 
M

Mike Abel

Grzegorz Dostatni said:
File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 2310, in selection_present
return self.tk.getboolean(
TclError: expected boolean value but got ""

After looking in the man-page of Tcl_GetBoolean here is a more precise
answer.

"Tcl_GetBoolean expects string to specify a boolean value. If string is
any of 0, false, no, or off, then Tcl_GetBoolean stores a zero value at
*boolPtr. If string is any of 1, true, yes, or on, then 1 is stored at
*boolPtr. Any of these values may be abbreviated, and upper-case
spellings are also acceptable."

Hope that helps.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top