I'm running into a bug where I setup a toolbar with some tools (bitmap
icons), a separator, and some text buttons.
It works fine on Linux, but OS-X doesn't show the buttons (the tools
and separator are there).
Any hints on what's going wrong?
I'm running the ports build of wxwidgets-3.0 (3.0.0) and
py27-wxpython-3.0 (2.9.5.0)
-Dan
Code exerpt is below.
tb = wx.ToolBar(self, -1, style=wx.TB_FLAT)
tb.SetToolBitmapSize((22, 22))
tb.AddTool(ID_START, wx.Bitmap(FindIcon(ICON_OK)),
shortHelpString="Start", longHelpString="Start test run")
tb.AddTool(ID_STOP, wx.Bitmap(FindIcon(ICON_NOK)),
shortHelpString="Stop", longHelpString="Stop test run")
tb.AddTool(ID_RELOAD, wx.Bitmap(FindIcon(ICON_DEFAULT)),
shortHelpString="Reload/Clear",
longHelpString="Reload test and clear results")
self.tb = tb
self.SetMode(False)
self.stop_on_fail = True
if app_conf["meup_console"]:
if app_conf["items_path"]:
self.item_map = upcutil.ItemMap()
try:
self.item_map.ParseItemFile(
open(app_conf["items_path"], "r"), app_conf["items_path"],
upcutil.NormalizeFilter)
except IOError:
print "Failed to load %s (ignoring)" % app_conf["items_path"]
self.item_map = None
else:
self.item_map = None
hsizer = wx.BoxSizer(wx.HORIZONTAL)
self.tree = wx.TreeCtrl(self, size=(-1, 90),
style=wx.TR_HAS_BUTTONS | wx.TR_LINES_AT_ROOT)
font1 = wx.Font(11, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL)
self.text_ctrl = wx.TextCtrl(self, style=wx.TE_MULTILINE)
self.text_ctrl.SetFont(font1)
hsizer.Add(self.tree, 1, wx.EXPAND)
hsizer.Add(self.MakeConsoleDisplay(self), 0, wx.EXPAND)
splitter = wx.BoxSizer(wx.VERTICAL)
splitter.Add(hsizer, 0, wx.EXPAND)
splitter.Add(self.text_ctrl, 1, wx.EXPAND)
self.file_menu.Append(ID_CONFIG,
"Config...", "Edit test configuration")
wx.EVT_MENU(self, ID_CONFIG, self.OnConfig)
# TODO(dchristian): add app settings menu entry
tb.AddSeparator()
# TODO(dchristian): gray these out when not running a test
tb.AddControl(wx.Button(self.tb, ID_CARRY_ON, label="Carry On"))
tb.AddControl(wx.Button(self.tb, ID_ABORT, label="Abort"))
self.Bind(wx.EVT_BUTTON, self._OnCarryOn, id=ID_CARRY_ON)
self.Bind(wx.EVT_BUTTON, self._OnAbort, id=ID_ABORT)
else:
splitter = wx.SplitterWindow(self, -1, style=0)
self.an_line1 = None
self.an_line2 = None
self.tree = wx.TreeCtrl(splitter,
style=wx.TR_HAS_BUTTONS | wx.TR_LINES_AT_ROOT)
self.text_ctrl = wx.TextCtrl(splitter,
style=(wx.TE_MULTILINE|wx.TE_READONLY))
splitter.SplitHorizontally(self.tree, self.text_ctrl)
splitter.SetMinimumPaneSize(40)
splitter.SetSashPosition(250, True)
self.tb.Realize()
self.file_menu.Append(ID_SETTINGS,
"Settings...", "Edit application settings")
menu_help = wx.Menu()
menu_help.Append(wx.ID_HELP, "Manual\tF1", "Show manual window")
menu_help.Append(ID_ABOUT, "&About...", "Show version info")
menubar.Append(menu_help, "&Help")
wx.EVT_MENU(self, ID_SETTINGS, self.OnSettings)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(tb, 0, wx.EXPAND)
sizer.Add(splitter, 1, wx.EXPAND)