elbumpo has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to realize a dictionary in Perl Tkx (using ActiveState Perl 12).
The dictionary has an entry field for the searched word. The dictionary happens to be Japanese to German. In Windows one is using IME to input Japanese. This is working fine for for example HTML entry fields, but not in Tkx (at least at the moment ...). I put the cursor focus into the Tkx entry field, switch the keyboard to Japanese, type a japanese word, which appears in Hiragana (a way to write something in japanese without the meaning based Kanji), press the space bar and then IME gives me some possible writings in Kanji. I choose one and I have to confirm this by pressing the RETURN key. This produces an error message:
"alloc: invalid block: 0145F78C: 4b 5
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information"

On the other hand: if I copy Japanese into the entry field, everything is fine. But of course I'd like to type in my searched word into the field directly, not having to first write it somewhere and then copy it into the field. Did anybody have the same problem and found a solution?

To simulate this problem, the following programm should be sufficient:

use Tkx; Tkx::ttk__frame(".c", -padding => "3 3 12 12"); Tkx::grid( ".c", -column => 0, -row => 0, -sticky => "nwes"); Tkx::grid_columnconfigure( ".", 0, -weight => 1); Tkx::grid_rowconfigure(".", 0, -weight => 1); Tkx::ttk__entry(".c.feet", -width => 7, -textvariable => \$feet); Tkx::grid(".c.feet", -column => 2, -row => 1, -sticky => "we"); Tkx::ttk__button(".c.calc", -text => "Search", -command => sub {search +();}); Tkx::grid(".c.calc", -column => 3, -row => 3, -sticky => "w"); sub search { #...; } Tkx::MainLoop();

Replies are listed 'Best First'.
Re: japanese input fails in Tkx
by vkon (Curate) on Feb 09, 2011 at 08:06 UTC
    Tkx module is just a syntax for Tcl.pm perl module, which in turn just a thin layer to tcl/tk.

    This means that most probably you're facing problem in tcl/tk itself.

    what I see is tcl/tk 8.5.8 has problems with pinyin input, and tcl/tk 8.4.19 have not. http://community.activestate.com/forum/activetcl-8581-crashed-when-input-chinese-char

    What is your OS?

    Unfortunately I do not know good support user list for tcl/tk (well, I will ask people this question)

    Meanwhile, you could repost your question to tcltk@perl.org mailing list, which is suport ML for users and developers for these Perl modules.

    regards,
    vkon

Re: japanese input fails in Tkx
by vkon (Curate) on Feb 18, 2011 at 11:28 UTC
    the problem is identified and resolved in Tk 5.8.9
    This means that if you're using ActivePerl you need to use and update of their "tkkit.dll", which is not available right now.

    read this explanation at http://www.mail-archive.com/tcltk@perl.org/msg00512.html

    For me, I can't reproduce the problem, but I do not use Hiragana input either.
    I do use pinyin input sometimes, and - just tried - it is working in all my Tk versions available