Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Tk hidden binding

by Anonymous Monk
on Jul 24, 2011 at 10:28 UTC ( #916389=note: print w/ replies, xml ) Need Help??


in reply to Tk hidden binding

As far as I can tell, this is a bug in Tk :) Run one of these and type Ctrl+[

perl -MTk -le " tkinit->Text->pack->focus; MainLoop; " perl -MTk -le ' tkinit->Text->pack->focus; MainLoop; '
or type Ctrl+] and you'll get esc(\033) and gs(\035) respectively

This is a bug

$ perl -MTk -le " print for Tk->VERSION, $^V " 804.0295 v5.12.2 $ perl -MTk -le " print for Tk->VERSION, $] " 804.028 5.008009
Ctrl+g results in bel(\a)

This isn't supposed to happen :)

Checking the Tk bug cue i find Bug #47173 for Tk: "Modifier" key releases don't track key presses correctly

perl/Tk is built upon Tcl/Tk 8.5.7

Tcl/Tk 8.6 doesn't have this problem

#!/usr/bin/perl -- use strict; use warnings; use Tcl::pTk; my $int = new Tcl::pTk; $int->Eval(<<'EOS'); # pure-tcl code to create widgets (e.g. generated by some GUI builder) text .e ## http://wiki.tcl.tk/1626#tk_version .e insert end "tcl_version $tcl_version\n" .e insert end "tcl_patchLevel $tcl_patchLevel\n" .e insert end "tk_version $tk_version\n" .e insert end "tk_patchLevel $tk_patchLevel\n" .e insert end "tk_library $tk_library\n" pack .e EOS my $e = $int->widget('.e'); # get .e entry into play $e->insert( "end", " Tcl::pTk $Tcl::pTk::VERSION Tcl $Tcl::VERSION \$^V $^V \$] $] "); $int->MainLoop; __END__ tcl_version 8.6 tcl_patchLevel 8.6b1.2 tk_version 8.6 tk_patchLevel 8.6b1.2 tk_library C:/Tcl8.6/lib/tk8.6 Tcl::pTk 0.85 Tcl 1.02 $^V v5.12.2 $] 5.012002


Comment on Re: Tk hidden binding
Select or Download Code
Re^2: Tk hidden binding
by zentara (Archbishop) on Jul 24, 2011 at 11:24 UTC
    On my Tk (Tk-804.029_500) a <control ]> prints a # character to the Text area. I don't know for sure if this is what is normal or not, I'm running Slackware 1337 for AMD64 , if that makes any difference in keyboard setups.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

      I don't know for sure if this is what is normal or not, I'm running Slackware 1337 for AMD64 , if that makes any difference in keyboard setups.

      I think it is not normal , I've yet to see a toolkit where a text widget does that by default going back some 20 years :)

      Nice catch with the subwidget in Re^3: Tk hidden binding, I also get the same thing you describe

        I think it is not normal , I've yet to see a toolkit where a text widget does that by default going back some 20 years :)

        Where would the fault be in my system to cause such a thing? Would that be the the xmodmap?


        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh
Re^2: Tk hidden binding
by emilbarton (Scribe) on Jul 24, 2011 at 13:02 UTC
    It's amazing how things can get complicated quickly. I get \x{1b} and \x{1d}. Thank you for the various informations in your answer.
      Hey, thats almost the same thing ;)
      $ perl -le " print qq[\033\035] " |od -tacx1 0000000 esc gs cr nl 033 035 \r \n 1b 1d 0d 0a 0000004

        huh? far beyond my skills!

        Ah ok, yes almost the same, just an openness detail:
        perl -le " print qq[\033\035] " |od -tacx1 0000000 esc gs nl 033 035 \n 1b 1d 0a 0000003

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://916389]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-08-23 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls