Version 68 of The TK GUI - Q&A

Updated 2004-11-04 06:52:00 by PS

Hm, empty page -- might as well ask a Question to get things started:

What's an easy way to add keyboard accelerators for buttons and menus?

With the bind command, typically binding the accelerator to either "all" or ".", e.g.:

    bind all <F1> help

MAK As a style choice, you may want to consider binding to the invoke command for the button/menu you're adding an accelerator to, for two reasons: (1) if the button/menu is disabled then the accelerator will be as well, and (2) if the command you want to call when that button/menu/accelerator is used gets changed you only need to change it one place. As another alternate, you might consider using event generate as the command (with a custom event).