Toolbar anomaly between windows and linux

Hello,
i'm developing an application plugin based in wxPython

The core application has a toolbar. When a plugin is showed up this
should clear the main toolbar and load his own toolbar.

I realize it with a method called FillUpToolbar() like the method
pasted below (the method pasted below clear the toolbar, and add his
own icons)

On linux it works perfectly, but under windows the app crash invoching this...
Does exist a better method to refresh the toolbar of an application?

def FillUpToolbar(self):
    self.MainView.toolbar.ClearTools()
    toolbarIconSize=(24,24)
    self.MainView.toolbar.AddSimpleTool(1,
wx.ArtProvider.GetBitmap(wx.ART_ADD_BOOKMARK, wx.ART_TOOLBAR,
toolbarIconSize), 'Add', '')
    self.MainView.toolbar.AddSimpleTool(1,
wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR,
toolbarIconSize), 'Help', '')

Thanks all.

···

--
Marco Meoni (Sbaush)

Marco Meoni - Sbaush wrote:

Hello,
i’m developing an application plugin based in wxPython

The core application has a toolbar. When a plugin is showed up this
should clear the main toolbar and load his own toolbar.

I realize it with a method called FillUpToolbar() like the method
pasted below (the method pasted below clear the toolbar, and add his
own icons)

On linux it works perfectly, but under windows the app crash invoching

this…
Does exist a better method to refresh the toolbar of an application?

def FillUpToolbar(self):
self.MainView.toolbar.ClearTools()
toolbarIconSize=(24,24)

    self.MainView.toolbar.AddSimpleTool(1,

wx.ArtProvider.GetBitmap(wx.ART_ADD_BOOKMARK, wx.ART_TOOLBAR,
toolbarIconSize), ‘Add’, ‘’)
self.MainView.toolbar.AddSimpleTool
(1,
wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR,
toolbarIconSize), ‘Help’, ‘’)

Do you call self.MainView.toolbar.Realize() anywhere?

mhh now with Realize it seems well on windows…

Thank you very much for this precisation.
Tomorrow we will see better the code.

If that doesn’t help then I’d just create a new toolbar, pass it to the
frame’s SetToolBar, and then Destroy() the old one.

Good night

···

On 4/23/07, Robin Dunn robin@alldunn.com wrote:


Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org


Iacopo Masi