From: Werner F. B. <wer...@fr...> - 2005-06-10 15:04:58
|
Hi John and Andrea, John Hunter wrote: >>>>>>"andrea" == andrea gavana <and...@ti...> writes: > > > andrea> Hello John & NG, I have just downloaded matplotlib 0.81, > andrea> and I am having some problems with the ToolBar. The "Back" > andrea> and "Forward" icons in the ToolBar2 are not shown. The > andrea> buttons are completely grey and they seem inactive. Is > andrea> this the expected behavior? I think it is not. However, > andrea> my configuration is: > > andrea> - Windows XP - wxPython 2.6.1.0 - MatPlotLib 0.81 - WXAgg > andrea> backend - ToolBar2 > > This is a feature and a bug. The feature part is that Werner Bruhin > added a patch to "gray out" the forward and back buttons when clicking > them produces no effect. Eg, if there is no back (your first view of > the figure) the button should be grayed out. If you navigate > somewhere, the button will be enabled. The grey square is due to using "xpm" file formats for the button images (disabled state). Attached is a version backend_wx.py which uses "png" files for the "back" and "forward" button. In theory this should show a black & white version of the button when it is disabled (applying the alpha channel, only supported by wx with png files). However for whatever reason this does not work with matplotlib's toolbar, it works very nicely when I create a test toolbar (see the image sent with my previous mail on this thread, or run the attached wx_cursor_demoToolbar.py using the attached backend_wx.py). I tried to narrow it down but but up to now without any luck. I attached a demo file which shows how the button should look (hacked together toolbar with only back and forward button). If you change the two lines below in the demo (comment the myadd_toolbar line and uncomment the other one you will get the normal matplotlib toolbar, but the disable button stuff doesn't work. ## self.add_toolbar() # comment this out for no toolbar self.myadd_toolbar() Maybe someone else who know matplotlib better then I do might have an idea on what is going on. See you Werner > > The bug is that on win32 with wxpython 2.6.1 instead of presenting a > grayed out version of the button the button is a solid gray rectangle, > and it is visually very disturbing to see it toggle between an arrow > and a gray rectangle. On linux with wx 2.5.3, the arrow button still > looks like an arrow, but is gray to indicate "not enabled" > > Does this feature work properly for anyone on windows? Other > WX/Windows users, please send me your wxpython version numbers and let > me know if this is working for you so we can file a bug report to the > wx list. You can get your wxpython version by running your script > with > > > python myscript.py -dWXAgg --verbose-helpful > > Thanks! > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput > a projector? How fast can you ride your desk chair down the office luge track? > If you want to score the big prize, get to know the little guy. > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 |