matplotlib custom navigation toolbar cross platform

You probably need to call self.Realize() so the wx.Toolbar class will rebuild the native toolbar with the new buttons.

···

On 7/4/11 4:47 AM, Neacsa Bogdan Valentin wrote:

So I integrated matplotlib in wx, and part of my task was to add some
functions to the standard NavigationToolbar2WxAgg. I've googled around
found some good examples and got it working like in my atachement. Now I
was working on my application on Mac OS and everything worked fine. But
now I'm testing it on Windows XP and my custom buttons from the
navigation toolbar seem to dissapear for the Windows based OS. Any
suggestions ?

--
Robin Dunn
Software Craftsman

Please make a runnable, small as possible, sample application that demonstrates the problem with matplotlib being the only extra dependency, and let us know the platform and wx version. MakingSampleApps - wxPyWiki

···

On 7/6/11 1:06 AM, Neacsa Bogdan Valentin wrote:

Hello,

I've tried using self.Realize() with weird results. I've atached some
prints with my mac_os look and the look on windows with and without the
call to self.Realize(). My call is made right at the end of the __init__
from the custom toolbar.

--
Robin Dunn
Software Craftsman

Try using images that are 32x32, not 300x300 or 600x264... It seems pretty obvious that if the toolbar is more than 300 pixels tall when you start using 300 px high images that maybe the image is the problem.

···

On 7/8/11 12:11 AM, Neacsa Bogdan Valentin wrote:

Ok,

I've atached a minimal implementation of my problem. mycustomtoolbar.py
is the toolbar I'm trying to get to work on windows XP and testmodule a
simple frame to display a graph. The rest are just the jpg-s for the
custom buttons I'm trying to add to the toolbar. Versions are the
following : on my Mac machine where everything works fine: 2.8.12.0
(mac-unicode) on my Windows machine where it doesnt work as expected
it's 2.8.10.1 (msw-unicode).

--
Robin Dunn
Software Craftsman