wxpython toolbar not shown in os x
<p>I have a python script for GUI using wxpython. It works perfectly fine in Windows, however, when I run the script in OS X, the toolbar is now shown (I installed wxpython from its official website and used the cocoa version, and I am using OS X 10.10 and python 2.7). Following is the part of the code regarding the toolbar:</p>

<pre><code>self.toolBar = wx.ToolBar(self, -1, style=wx.TB_HORIZONTAL|wx.TB_FLAT|wx.TB_DOCKABLE)
self.myChoice = ComboBoxWithHelp(self.toolBar, wx.NewId(), size=(200, -1), value=..., choices=..., style=wx.CB_DROPDOWN,)
self.toolBar.AddControl(self.myChoice)

iconname = 'icons/new.png'
self.toolBar.AddSimpleTool(1, wx.Image(iconname, wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'New', 'New')

...
self.toolBar.Realize()
self.SetToolBar(self.toolBar)
</code></pre>

<p>Nothing is shown below the menu bar, however the space is left there. Did I installed the wxpython wrongly or use the function wrongly?</p>

<p>By the way, the above code also works for Ubuntu.</p>

<p>What is <code>self</code> in this code?  Toolbars are a little different on OSX, and and can be a bit tricky, so there may be some issues if <code>self</code> is not a <code>wx.Frame</code> or a class derived from <code>wx.Frame</code>.  This is because the native toolbars are actually part of the frame rather than an independent widget.  It should be switching to a non-native toolbar if the parent is not the frame, but then you'll need to manage its size and layout yourself.  </p>

<p>If <code>self</code> is already the frame then you may want to try not specifying the style flags and let it just use the default style, or you can try creating the toolbar like this instead and let the frame create it:</p>

<pre><code>self.toolBar = self.CreateToolBar()
</code></pre>

python wxpython