Toolbar sizing on windows

This code worked fine in wxPython 2.8. In wxPython 3.0.0 the combo box labels are chopped at the bottom and truncated on the right (see attached picture).

I am just learning wxPython. Is there a better way to make the toolbar to get it to autosize?

Thanks!

Chris

import wx

class DemoFrame(wx.Frame):

def init(self):

wx.Frame.init(self, None, -1, “Test”, size=(800,800))

self.toolbar = wx.ToolBar(self, style=wx.NO_BORDER|wx.TB_FLAT)

cb = wx.ComboBox(self.toolbar, style=wx.CB_DROPDOWN|wx.CB_READONLY)

cb.Insert(“Active Nodes”,0)

cb.Insert(“All Nodes”,1)

cb.SetSelection(0)

self.toolbar.AddControl(cb)

self.toolbar.Realize()

if name == “main”:

app = wx.App()

frame = DemoFrame()

frame.Show()

app.MainLoop()

wxPythonExample.jpg

Your code is ok on windows7 with Wxpython 3.0.0.0.b20131219.

···

On Friday, April 25, 2014 4:52:21 PM UTC+1, Christopher Cantrell wrote:

This code worked fine in wxPython 2.8. In wxPython 3.0.0 the combo box labels are chopped at the bottom and truncated on the right (see attached picture).

I am just learning wxPython. Is there a better way to make the toolbar to get it to autosize?

Thanks!

Chris

import wx

class DemoFrame(wx.Frame):

def init(self):

wx.Frame.init(self, None, -1, “Test”, size=(800,800))

self.toolbar = wx.ToolBar(self, style=wx.NO_BORDER|wx.TB_FLAT)

cb = wx.ComboBox(self.toolbar, style=wx.CB_DROPDOWN|wx.CB_READONLY)

cb.Insert(“Active Nodes”,0)

cb.Insert(“All Nodes”,1)

cb.SetSelection(0)

self.toolbar.AddControl(cb)

self.toolbar.Realize()

if name == “main”:

app = wx.App()

frame = DemoFrame()

frame.Show()

app.MainLoop()