471,351 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,351 software developers and data experts.

Tkinter "Expected boolean value"


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
Jul 18 '05 #1
4 4926

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

On Thu, 27 Nov 2003, Grzegorz Dostatni wrote:

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


Jul 18 '05 #2
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

Jul 18 '05 #3
Grzegorz Dostatni <gr******@ee.ualberta.ca> wrote:
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
Jul 18 '05 #4
Grzegorz Dostatni <gr******@ee.ualberta.ca> wrote:
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

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jon | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.