[Tkinter-discuss] Weird bug in input widgets?

Michael Lange klappnase at web.de
Sat Jan 31 10:29:35 CET 2015


Hi Raphaël,

I cannot reproduce this behavior here (debian wheezy, Tk-8.5.11), however
I could only test it with a german keyboard layout with X-Composite key or
with dead keys temporarily enabled in xfce. I don't think that should
matter, though, here everything seems to work fine.
 
I can only guess, but it sounds to me like a platform- and/or Tk-version
specific issue. If you are running OS X and a recent version of Tk it
might or might not have something to do with the bug described here:
    http://sourceforge.net/p/tktoolkit/bugs/2722/
resp. with the fix that was supplied for that bug. That is is just a shot
in the dark of course.

Regards

Michael


On Sat, 31 Jan 2015 09:20:06 +0100
Raphaël SEBAN <motus at laposte.net> wrote:

> Hi all,
> 
> While working on my latest software (tkScenarist on GitHub), I 
> encountered a really weird issue: once cleared, input widgets such as 
> Text, Entry, ttk.Entry do *NOT* accept composite-accented letters 
> (french ê, ë, etc) any more.
> 
> So, to get sure, I made the following test code:
> 
> [CODE]
> #!/usr/bin/env python3
> # -*- coding: utf-8 -*-
> 
> from tkinter import *
> 
> def clear_all (event=None):
>      # clear stringvars
>      for svar in cvars:
>          svar.set("")
>      # end for
>      # clear text widgets
>      for wtext in texts:
>          wtext.delete("1.0", END)
>      # end for
> # end def
> 
> def test (nb_of_widgets):
>      global root, cvars, texts
>      root = Tk()
>      root.title("test #{}".format(nb_of_widgets))
>      cvars = list()
>      for n in range(nb_of_widgets):
>          svar = StringVar()
>          cvars.append(svar)
>          Entry(root, textvariable=svar).pack()
>      # end for
>      texts = list()
>      for n in range(nb_of_widgets):
>          wtext = Text(root, height=2, width=20)
>          wtext.pack()
>          texts.append(wtext)
>      # end for
>      Button(root, text="Clear all", command=clear_all).pack(side=LEFT)
>      Button(root, text="Quit", command=root.destroy).pack(side=RIGHT)
>      # events main loop
>      root.mainloop()
> # end def
> 
> if __name__ == "__main__":
>      # launch test series
>      for n in range(1, 4):
>          test(n)
>      # end for
> # end if
> [/CODE]
> 
> Detailed description of the issue:
> 
> * French keyboards are arranged in such a way that you must compose 
> accented letters as ê (e circumflex) or ë (e diaeresis) by pressing 
> first the '^' key and then the letter to compose with (e.g. a, e, i, o, 
> u, y) in order to get the final composite-accented letter (â, ä, ê, ë, 
> and so on);
> 
> * when you launch the test script (cited above) and then type, let's 
> say, the e circumflex letter (ê) into the Entry widget and into the
> Text widget, respectively:
> 
> 	* the first time, you'll get the right letters inserted into
> the input widgets;
> 	* then click on 'Clear all' button and enter once again the
> same composite-accented letter into *ALL* the input widgets;
> 	* secund time, only the last pack()-ed input widget will get
> the right input, all other widgets will show unaccented letters;
> 
> * the test script tries with 1 Entry and 1 Text input widgets, then
> with 2 input widgets and finally with 3 input widgets;
> 
> * each time you get the same issue: only the last pack()-ed input
> widget shows the right input letter, all the rest showing unaccented
> letters.
> 
> This issue is quite embarrassing for me as my latest software manages 
> with movie scenario scriptwriting, which *MUST* be written with correct 
> accents in French, otherwise all the purpose of the software would
> collapse.
> 
> Is this a known issue?
> 
> Thank you for your expert advice.
> 
> Regards.
> 
> Raphaël SEBAN alias tarball69.
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Compassion -- that's the one things no machine ever had.  Maybe it's
the one thing that keeps men ahead of them.
		-- McCoy, "The Ultimate Computer", stardate 4731.3


More information about the Tkinter-discuss mailing list