Re: [Tkinter-discuss] Accelerator keys cross-platform

2015-12-27 Thread Michael Lange
Hi, On Sat, 26 Dec 2015 10:47:47 -0500 Kevin Walzer wrote: > On 12/26/15 9:42 AM, Kevin Walzer wrote: > > window.bind(', lambda event: window.hide()) > I found the string formatter call, cf: > > >>> mod = 'Control' > >>> print("<{}-f>".format(mod)) > or simply >>> mod = 'Control' >>> print

Re: [Tkinter-discuss] Accelerator keys cross-platform

2015-12-26 Thread Kevin Walzer
On 12/26/15 9:42 AM, Kevin Walzer wrote: window.bind(', lambda event: window.hide()) I found the string formatter call, cf: >>> mod = 'Control' >>> print("<{}-f>".format(mod)) Looks like I'm in business! Thanks for the help. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codeb

Re: [Tkinter-discuss] Accelerator keys cross-platform

2015-12-26 Thread Kevin Walzer
Mick, On 12/26/15 2:57 AM, Michael O'Donnell wrote: Hi Kevin, I initially do: if sys.platform == "darwin": CmdKey="Command-" else: CmdKey="Control-" ...and then I define menu items as: myMenu.add_command(label="Quit", command=self.mainWin.Quit, accelerator=CmdKey+'

Re: [Tkinter-discuss] Accelerator keys cross-platform

2015-12-25 Thread Michael O'Donnell
Hi Kevin, I initially do: if sys.platform == "darwin": CmdKey="Command-" else: CmdKey="Control-" ...and then I define menu items as: myMenu.add_command(label="Quit", command=self.mainWin.Quit, accelerator=CmdKey+'Q') Mick On 26 December 2015 at 03:19, Kevin Walzer wro

[Tkinter-discuss] Accelerator keys cross-platform

2015-12-25 Thread Kevin Walzer
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 a