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

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to