remove xpm flag in _load_bitmap function of backend_wx.py and alternate tool bar icons

Hi,

I apologize if this isn't the right forum for this email; I'm not actually a matplotlib developer.

I was trying to use custom icons for the mpl Wx backend, but the version of mpl I was using had a _load_bitmap method that only read xpm bitmaps. This requirement is enforced by the wx.BITMAP_TYPE_XPM flag on:

line 1398 of backend_wx.py in trunk
line 1458 of backend_wx.py in v0_91_maint

The default flag wx.BITMAP_TYPE_ANY allows wx to autodetect the format. Deleting the wx. BITMAP_TYPE_XPM argument allows me to change to toolbar icons to png files. I noticed that the trunk and v0_91_maint versions of mpl have a _load_pngicon method to load png icons. This additional method seems unnecessary (or am I missing something) if the offending argument is deleted.

One final note: I made some new icons for the toolbars of the plot windows. I'm not sure if many people would be interested in them since I've made them following a OS X aesthetic (also, I replaced the home icon with a reload icon because that made more sense to me). In any case, I'd like to make these available as an alternative, but I'm not sure where to post them.

Thanks in advance for reading my ramblings.

-Tony

Hi,

I apologize if this isn't the right forum for this email; I'm not
actually a matplotlib developer.

I was trying to use custom icons for the mpl Wx backend, but the
version of mpl I was using had a _load_bitmap method that only read
xpm bitmaps. This requirement is enforced by the wx.BITMAP_TYPE_XPM
flag on:

line 1398 of backend_wx.py in trunk
line 1458 of backend_wx.py in v0_91_maint

The default flag wx.BITMAP_TYPE_ANY allows wx to autodetect the
format. Deleting the wx. BITMAP_TYPE_XPM argument allows me to change
to toolbar icons to png files. I noticed that the trunk and
v0_91_maint versions of mpl have a _load_pngicon method to load png
icons. This additional method seems unnecessary (or am I missing
something) if the offending argument is deleted.

We made these changes recently on the advice of a user, but I am no wx
guru. If you can post a patch that behaves properly and uses the png
icons (the xpms don't render properly on some platforms). that would
be great.

One final note: I made some new icons for the toolbars of the plot
windows. I'm not sure if many people would be interested in them since
I've made them following a OS X aesthetic (also, I replaced the home
icon with a reload icon because that made more sense to me). In any
case, I'd like to make these available as an alternative, but I'm not
sure where to post them.

post them here as a small screenshot or just attach the icons. They
can't be that large. I'm the list moderator so I can approve it if
there is a problem. What I'd really like to see is a patch that
allows users to customize the toolbar, eg by adding buttons, removing
buttons, or changing the icons. This is not easy, especially across
the user interfaces. Our toolbars would need to expose some common
api for this...

JDH

···

On Fri, May 23, 2008 at 2:00 PM, Tony Yu <tsyu80@...149...> wrote:

Hi,

I apologize if this isn't the right forum for this email; I'm not
actually a matplotlib developer.

I was trying to use custom icons for the mpl Wx backend, but the
version of mpl I was using had a _load_bitmap method that only read
xpm bitmaps. This requirement is enforced by the wx.BITMAP_TYPE_XPM
flag on:

line 1398 of backend_wx.py in trunk
line 1458 of backend_wx.py in v0_91_maint

The default flag wx.BITMAP_TYPE_ANY allows wx to autodetect the
format. Deleting the wx. BITMAP_TYPE_XPM argument allows me to change
to toolbar icons to png files. I noticed that the trunk and
v0_91_maint versions of mpl have a _load_pngicon method to load png
icons. This additional method seems unnecessary (or am I missing
something) if the offending argument is deleted.

We made these changes recently on the advice of a user, but I am no wx
guru. If you can post a patch that behaves properly and uses the png
icons (the xpms don't render properly on some platforms). that would
be great.

I'd like to try, but I've never contributed to a software project so submitting a patch seems pretty daunting. I'll have to read up on how to do this.

One final note: I made some new icons for the toolbars of the plot
windows. I'm not sure if many people would be interested in them since
I've made them following a OS X aesthetic (also, I replaced the home
icon with a reload icon because that made more sense to me). In any
case, I'd like to make these available as an alternative, but I'm not
sure where to post them.

post them here as a small screenshot or just attach the icons. They
can't be that large. I'm the list moderator so I can approve it if
there is a problem. What I'd really like to see is a patch that
allows users to customize the toolbar, eg by adding buttons, removing
buttons, or changing the icons. This is not easy, especially across
the user interfaces. Our toolbars would need to expose some common
api for this...

Here are the pngs:

home.png

back.png

forward.png

move.png

zoom_to_rect.png

subplots.png

filesave.png

···

On May 23, 2008, at 4:47 PM, John Hunter wrote:

On Fri, May 23, 2008 at 2:00 PM, Tony Yu <tsyu80@...149...> wrote: