Problem (or even bug?) with Tkinter

Eric Brunel eric_brunel at despammed.com
Fri Aug 19 07:01:52 EDT 2005


On Fri, 19 Aug 2005 09:53:20 +0100, Matt Hammond <matt.hammond at rd.bbc.co.uk> wrote:

> Here's a strange one in Tkinter that has me stumped:
> (I'm running python 2.4 on Suse Linux 9.3 64bit)
>
> I'm trying to make a set of Entry widgets with Label widgets to the left
> of each one, using the grid layout. If I make and grid the Label *before*
> the Entry then the Entry widget doesn't seem to work - it lets me put the
> cursor in it, but I can't type! See example code below.
>
> Is this just me doing something really really silly, or is there a bug
> here?

I tested with Python 2.1 on Mandrake Linux 8.0 and it works fine. My tcl/tk version is 8.3.4

Do you know the tcl/tk version you have? If you don't, you can get it via:

 from Tkinter import Tk()
root = Tk()
root.tk.eval('puts $tk_patchLevel')

I suspect a bug at tcl level. So can you execute the following tcl script:

-------
entry .en1
grid .en1 -row 0 -column 1

label .lb1 -text "CAN WRITE ->"
grid .lb1 -row 0 -column 0


label .lb2 -text "CAN'T WRITE ->"
grid .lb2 -row 1 -column 0

entry .en2
grid .en2 -row 1 -column 1
-------

It is exactly the same as yours in tcl syntax. To execute it, just save it to the file script.tcl and type in a shell:
wish script.tcl

(The "wish" command may include a version number, such as "wish8.4")

If the script above shows the same behaviour as your Python script, then it's not Tkinter's fault, but tk's. You should then report the bug to comp.lang.tcl.

HTH
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.zmz5(17;8(%,5.Z65\'*9--56l7+-'])"



More information about the Python-list mailing list