Accelerator keys cross-platform

Kevin Walzer <[email protected]>
Newsgroups gmane.comp.python.tkinter
Organization WordTech Communications LLC
Message-ID <[email protected]>
I'm porting a Tkinter application from Mac to Windows and I need a 
cross-platform way to implement accelerator keys for menu entries. In 
Tcl, this is very simple:

  -accelerator "$Command-C"

where $Command can be set to "Command" or "Control" depending on the 
platform.

Python does not have as flexible a string substitution as Tcl, so I'm 
looking for a Pythonic way to do this. Most examples I've seen load 
entirely separate menus depending on the platform, and I'd rather avoid 
duplicating code that way.  Any suggestions or examples that anyone can 
share?

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.