Search code examples
pythonwxpythonwxwidgets

How to hide an element in a toolbar? wxpython


is it possible to hide (and later show) an element in a toolbar?

    toolbar = self.CreateToolBar()
    element = toolbar.AddLabelTool(wx.ID_ANY, 'Hi', wx.Bitmap('hello.png'))
    toolbar.Realize()

Using element.Hide() returns an error,

Thanks for any support


Solution

  • I don't think the wx.Toolbar supports hiding individual items. However, the FlatMenu seems to: http://www.wxpython.org/docs/api/wx.lib.agw.flatmenu-module.html I would recommend giving that a try.