What is the point of using the ampersand in wxPython? I see it in almost all the tutorials. For instance, they use:
menubar.Append(fileMenu, '&File')
instead of:
menubar.Append(fileMenu, 'File')
What is the difference? Should I always use the ampersand for naming?
Btw I found these examples from this famous wxPython Tutorial: http://zetcode.com/wxpython/menustoolbars/
The ampersand is to define a shortcut key. In your first example (i.e. "&File"), you can use 'Ctrl-F' to access the 'File' menu item
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With