Migration to 8.4: Tk Private Commands

Page to record guidelines for dealing with the private commands renamed in Tk 8.4.

An example:

Hey, my script doesn't work with Tk 8.4! It says "invalid command name "tkTabToWindow""

Tk 8.3 defined a private, or unsupported, command [tkTabToWindow]. Tk 8.4 no longer does. It was never a public interface, and when you use private interfaces you risk getting caught by changes like this.

Quick workaround. Add this to your script:

    tk::unsupported::ExposePrivateCommand tkTabToWindow

That will restore the existence of the [tkTabToWindow] command. If you've used other private commands you will need to do the same for each of them.

NOTE: even quicker workaround! Before releasing Tk 8.4.0, the command [tk::unsupported::ExposePrivateCommand] was extended to accept glob patterns, so a

    tk::unsupported::ExposePrivateCommand *

should workaround all problems in this area.

Do not let the presence of an easy workaround prevent you from correcting the underlying problem. Stop using private interfaces, or start the process of getting the interfaces made public.

Longer term, you should re-write your script so that it doesn't make use of Tk's private commands. If you find that this is too limiting, and access to the private commands is necessary, then get to work making a TIP proposal for Tk to provide that functionality in a public way:


See also