title: wxPython Button Shortcut Accelerator How to '&spam'
body: <p>How should I go about adding a button shortcut / accelerator?</p>
  <pre><code>self.newItemButton = wx.Button(self.mainPanel, label='Scan &amp;New Item')
  </code></pre>
  <p>Doesn't seem to work on my platform.</p>
  <pre><code>Python 2.7.3 (default, Sep 26 2013, 20:08:41) 
  [GCC 4.6.3] on linux2
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt; import wx, os
  &gt;&gt;&gt; wx.version();print(os.system('uname -a&amp;&amp;lsb_release -a'))
  '2.8.12.1 (gtk2-unicode)'
  Linux NE-522 3.2.0-53-lowlatency-pae #55-Ubuntu SMP PREEMPT Mon Aug 26 22:52:24 UTC 2013 i686 i686 i386 GNU/Linux
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 12.04.3 LTS
  Release:    12.04
  Codename:   precise
  </code></pre>
  <p>Articles Found:</p>
  <ul>
  <li><a href="http://wiki.wxpython.org/Using%20Multi-key%20Shortcuts%20" rel="nofollow noreferrer">http://wiki.wxpython.org/Using%20Multi-key%20Shortcuts%20</a></li>
  <li><a href="http://wxpython-users.1045709.n5.nabble.com/wxPython-Shortcuts-for-buttons-td2288314.html" rel="nofollow noreferrer">http://wxpython-users.1045709.n5.nabble.com/wxPython-Shortcuts-for-buttons-td2288314.html</a></li>
  </ul>
  <p>Example Code:</p>
  <pre><code>import wx
  class SpamButton(wx.Frame):
      def __init__(self, parent, title):
          wx.Frame.__init__(self, parent, title=title)
          self.mainPanel = wx.Panel(self)
          self.thisSpamButton()
          self.Show()
  
      def thisSpamButton(self):
              self.sizer = wx.BoxSizer(wx.VERTICAL)
              #---------------------------------------------
              # So the letter 's' should be underlined right?       | Here it is
              #-----------------------------------------------------v
              self.newItemButton = wx.Button(self.mainPanel, label='&amp;spam')
              self.sizer.Add(self.newItemButton, 0, wx.ALL, 2)
              self.mainPanel.Layout()
  
  def main():
      app = wx.App(False)
      MainFrame = SpamButton(None, 'This Button Short Cut is weird')
      app.MainLoop()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p>Results in:</p>
  <p><img src="https://i.stack.imgur.com/465rk.png" alt="Shouldn't the S be underlined?" /></p>
  <h1>Update:</h1>
  <p>I didn't actually try the hot key, until just now, just because I wasn't curious enough.</p>
  <p>Okay so when pressing <code>alt+hot_key</code> in this example for &amp;spam... it WORKS!</p>
  <p><strong>However:</strong></p>
  <p>The hotkey letter isn't initially rendered underlined.</p>
  <p>The underline only renders when alt is pressed. :(</p>