Menu

#3030 Virtual Bindings incompatible with previous versions of Tk

current: 8.6.0
open
5
2012-12-18
2012-11-03
No

Since 8.6b3, bindings do not appear to work the same way as before in applications. See for example this thread on c.l.t about tkcon -
https://groups.google.com/forum/?fromgroups=#!searchin/comp.lang.tcl/tkcon$20bindings/comp.lang.tcl/7ki8-TxMNdk/bn7lr7LTmUwJ

dkf suggested in that thread this might be a result of the new virtual event definitions added for 8.6b3.

Is this a temporary state of affairs that will be fixed for 8.6 final? If not, is there any document that describes the changes applications will have to make, and does this not spoil Tcl/Tk's great backward compatibility.

/Ashok

Discussion

  • Jan Nijtmans

    Jan Nijtmans - 2012-11-03

    For the Windows console in Tk, the same happened:
    For the fix there see: <http://core.tcl.tk/tk/ci/6249d7ae63?sbs=1>

    It only happens with Virtual Key bindings, not so many
    applications use that. For tkCon, is the only application
    I know of that has this problem, the cause is that tkCon
    choose its own name for its own virtual events. Letting
    the name match the - now generic - virtual events
    will fix the problem.

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-11-03
    • summary: Bindings incompatible with previous versions of Tk --> Virtual Bindings incompatible with previous versions of Tk
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-11-03

    My proposed solution attached (tkcon.diff)

     
  • Ashok P. Nadkarni

    Ok, fair enough thanks. Unfortunately, for me tkcon is not an app but an embeddable package as well. Only a couple of programs though, so I'll just use your patch for new versions.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2012-11-03

    While I could add the PrevLine/NextLine changes (and that will work for pre-8.6 as well), I'm concerned that this is an interesting aspect of compat violation. I have other software out there (the console as a megawidget) that is very widespread in various user's code. The same goes with tkcon as an embedded console - very popular, and this change breaks all those installs.

    Was this really a necessary change? Where is the reference core change?

     
  • Don Porter

    Don Porter - 2012-11-05
    • milestone: --> 3071256
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-11-05

    The lesson leared here is that virtual events should
    not be defined by extensions/applications, but only
    by Tk.

    Let's look at the virtual events defined by console.tcl. They
    can be divided into 3 groups:
    - <<Console_Expand>>, <<Console_Tab>>, <<Console_Eval>>
    Multiple keys which have the same binding
    - <<Console_FontSizeIncr>>, <<Console_FontSizeDecr>>, <<Console_Transpose>>
    Bindings are different for X11/Mac/Windows
    - All other virtual events in console.tcl serve no purpose, as far as I can see. All bindings could just as well be done against the real events directly. Done so (as experiment) in the "bug-3582795" branch. Jeff, is there any added value in using virtual events here?

    Removing those unnecessary virtual events, 6 are left which seen useful.
    Would it help if Tk defined virtual events for those 6? Then console.tcl
    does not need to define its own virtual events any more, so any
    risk in future compatibility is gone. The pain is felt only once.

    (For TkCon, the virtual events have the form <<TkCon_*>>,
    but apart from that it looks very similar to console.tcl)

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-11-05

    See:
    <http://core.tcl.tk/tk/ci/4712ce4f04>

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-12-18

    suggested fix

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-12-18
    • milestone: 3071256 --> current: 8.6.0
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-12-18

    Better fix for tkcon, which handles <Control-Key-n> and <Control-Key-p> as well.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.