Toolbar button alpha channel problem in matplotlib

The matplotlib 0.81 version disables buttons on the toolbar which are not usable at the time.

Doing this shows a black square instead of applying the alpha channel (correct terminology?).

To ensure that the icon file actually is o.k. I created a toolbar with the icon in question and it shows correctly as a black and white version when it is in-active and a colored version when it is active.

Matplotlib uses "AddSimpleTool" to create the tools, so I tried "AddLabelTool" and "DoAddTool". With the later two calls the image is now in color if active or in-active - still not showing the black and white version.

Here some code snippets:
        self.AddLabelTool(label = 'Back',
                bitmap = _load_bitmap2('back.png'),
                bmpDisabled = wx.NullBitmap,
                id = self._NTB2_BACK,
                longHelp = '',
                shortHelp = '')

_load_bitmap2 is just checking that the image exists and returns a wx.Bitmap instance.

The attached "toolbartest.png" shows what we like to see and the "matplottoolbar.png" shows the back button in color using the "AddLabelTool" and the grey square is for the forward button which uses "AddSimpleTool".

Any hints on how to fix this would be very welcome.

See you
Werner

matplottoolbar.png

toolbartest.png

Werner F. Bruhin wrote:

The attached "toolbartest.png" shows what we like to see and the "matplottoolbar.png" shows the back button in color using the "AddLabelTool" and the grey square is for the forward button which uses "AddSimpleTool".

Any hints on how to fix this would be very welcome.

Both AddSimpleTool and AddLabelTool call DoAddTool, so there must be some other difference between the two cases. What is the platform and version? Can you send a small sample (including the images) that shows the problem?

···

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

Hi Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

The attached "toolbartest.png" shows what we like to see and the "matplottoolbar.png" shows the back button in color using the "AddLabelTool" and the grey square is for the forward button which uses "AddSimpleTool".

Any hints on how to fix this would be very welcome.

Both AddSimpleTool and AddLabelTool call DoAddTool, so there must be some other difference between the two cases. What is the platform and version? Can you send a small sample (including the images) that shows the problem?

I am running on Windows XP but I believe Andrea is seeing the same and if I recall correctly she is on Windows XP.

Small sample with matplotlib (you would need to get the 0.8.1 version)?! I only see the problem in matplotlib with the WXAgg, I can't reproduce it in a small test program (at least not yet).

Just in case you have matplotlib try running wxcursor_demo (I attach it in case you don't have the matplotlib example stuff).

See you
Werner

wxcursor_demo.py (3.96 KB)

dude :slight_smile: she is a he :slight_smile:
http://xoomer.virgilio.it/infinity77/
In Italy Andrea is a boy name :wink:
honest mistake tho :slight_smile: my future wife's name is Andreea. :slight_smile:

Peter

···

On Fri, 10 Jun 2005 10:37:55 +0300, Werner F. Bruhin <werner.bruhin@free.fr> wrote:

Hi Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

The attached "toolbartest.png" shows what we like to see and the
"matplottoolbar.png" shows the back button in color using the
"AddLabelTool" and the grey square is for the forward button which
uses "AddSimpleTool".

Any hints on how to fix this would be very welcome.

Both AddSimpleTool and AddLabelTool call DoAddTool, so there must be
some other difference between the two cases. What is the platform and
version? Can you send a small sample (including the images) that
shows the problem?

I am running on Windows XP but I believe Andrea is seeing the same and
if I recall correctly she is on Windows XP.

I am running on Windows XP but I believe Andrea is seeing the same and
if I recall correctly she is on Windows XP.

dude :slight_smile: she is a he :slight_smile:
http://xoomer.virgilio.it/infinity77/
In Italy Andrea is a boy name :wink:
honest mistake tho :slight_smile: my future wife's name is Andreea. :slight_smile:

Hehehehehehe... it is normal, everywhere I go people keep saying "from your
name I was expecting a woman..."
No rpoblem for that :wink:
However, when I posted my first controls (like FoldPanelBar, HyperLinkCtrl,
ExtendedChoice and so on), I was somehow impressed by the number of nice
replies/comments I got. Did the "he/she" confusion influenced your suggestions/comments?
;-)))))

Andrea.

Hello Andrea,

in your first posts, I wasn't really sure.
You could be a "she" or "he", but that should make no difference.

At the same time I remembered a former Formula One driver
"Andrea de Cesaris".

In german "Andrea" is a woman forename (not sure, how it is in english)
in oppostition to Andreas.
But more often, woman forenames are longer than the man counterparts.

man -> woman

Franz -> Franziska
Martin -> Martina
Stefan -> Stefanie
Daniel -> Daniela

···

On Fri, 10 Jun 2005 10:57:12 +0200, andrea_gavana@tin.it wrote:

I am running on Windows XP but I believe Andrea is seeing the same and
if I recall correctly she is on Windows XP.

dude :slight_smile: she is a he :slight_smile:
http://xoomer.virgilio.it/infinity77/
In Italy Andrea is a boy name :wink:
honest mistake tho :slight_smile: my future wife's name is Andreea. :slight_smile:

Hehehehehehe... it is normal, everywhere I go people keep saying "from your
name I was expecting a woman..."
No rpoblem for that :wink:
However, when I posted my first controls (like FoldPanelBar, HyperLinkCtrl,
ExtendedChoice and so on), I was somehow impressed by the number of nice
replies/comments I got. Did the "he/she" confusion influenced your suggestions/comments?
;-)))))

Andrea.

--
Franz Steinhaeusler

Hi Andrea,

andrea_gavana@tin.it wrote:

I am running on Windows XP but I believe Andrea is seeing the same and
if I recall correctly she is on Windows XP.
     

dude :slight_smile: she is a he :slight_smile:
http://xoomer.virgilio.it/infinity77/
In Italy Andrea is a boy name :wink:
honest mistake tho :slight_smile: my future wife's name is Andreea. :slight_smile:
   
Hehehehehehe... it is normal, everywhere I go people keep saying "from your
name I was expecting a woman..."
No rpoblem for that :wink:
However, when I posted my first controls (like FoldPanelBar, HyperLinkCtrl,
ExtendedChoice and so on), I was somehow impressed by the number of nice
replies/comments I got. Did the "he/she" confusion influenced your suggestions/comments?
;-)))))

Absolutely :smiley:

Being Swiss I should not have missed that one :-[ , hope you'll forgive me!

Coming back to this toolbar issue, created a small test program to try to imitate the stuff matplotlib does with the toolbar but on my system (XP) it works like a charm, but within matplotlib I still get this damn grey squares.

It is obviously way above my head!

See you
Werner

···

Andrea.

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

Just to make the she/he subject complete:
Andrea stems from greek meaning 'man' ...
Being a German myself, I wonder what language got confused :wink:
But seriously,
with me affection only has me for the nice controls you have posted.
Keep hanging in there! I really like them a lot!

···

--
Best regards,
the_shelter mailto:pdftex@the-shelter.de

well to make the subject complete you should have posted
this:

or this...

now let's face it... we all like Andrea for the widgets he brought to wxPython... but... it wouldn't have hurt to look a little bit like this:
http://devone.de/pics/linux_chick.jpg

:slight_smile:

Peter.

···

On Fri, 10 Jun 2005 16:23:18 +0300, the_shelter <pdftex@the-shelter.de> wrote:

Just to make the she/he subject complete:
Andrea stems from greek meaning 'man' ...
Being a German myself, I wonder what language got confused :wink:
But seriously,
with me affection only has me for the nice controls you have posted.
Keep hanging in there! I really like them a lot!

Hi Robin,

The mystery of the color or grey square button is me forgetting what I
am doing!

The grey square is the due to matplotlib using "xpm" file format and
wxPython only supports alpha channel with "png" file format, according
to the documentation.

However I still can't figure out why the color version is shown (when
using "png" files) when the tool button is disabled, it should show the
grey & white version.

Had no success in creating a small test program showing the problem,
will have another go at it next week.

See you
Werner

Werner F. Bruhin wrote:

···

Hi Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

The attached "toolbartest.png" shows what we like to see and the "matplottoolbar.png" shows the back button in color using the "AddLabelTool" and the grey square is for the forward button which uses "AddSimpleTool".

Any hints on how to fix this would be very welcome.

Both AddSimpleTool and AddLabelTool call DoAddTool, so there must be some other difference between the two cases. What is the platform and version? Can you send a small sample (including the images) that shows the problem?

I am running on Windows XP but I believe Andrea is seeing the same and if I recall correctly she is on Windows XP.

Small sample with matplotlib (you would need to get the 0.8.1 version)?! I only see the problem in matplotlib with the WXAgg, I can't reproduce it in a small test program (at least not yet).

Just in case you have matplotlib try running wxcursor_demo (I attach it in case you don't have the matplotlib example stuff).

See you
Werner

------------------------------------------------------------------------

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

now let's face it... we all like Andrea for the widgets he brought to

wxPython... but... it wouldn't have hurt to look a little bit like this:
http://devone.de/pics/linux_chick.jpg

Wow... what a nice programmer this chick :wink:
No luck for me, I have never met a Linux/Windows/Unix/Mac/Debian/Whatever
programmer like that... mhm, do I have to switch to another GUI tool to
find her? :wink:

Andrea.

Werner F. Bruhin wrote:

Hi Robin,

The mystery of the color or grey square button is me forgetting what I
am doing!

The grey square is the due to matplotlib using "xpm" file format and
wxPython only supports alpha channel with "png" file format, according
to the documentation.

XPM files do support a mask, or in other words a 1-bit alpha where each pixel is either fully transparent or fully opaque, (so there is no blending.)

However I still can't figure out why the color version is shown (when
using "png" files) when the tool button is disabled, it should show the
grey & white version.

That I don't know...

···

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

Hello Peter,

thank you for this interesting site.

For me applies:

"
German form of Franciscus (see FRANCIS). This name was borne by the influential author Franz Kafka, writer of 'The Trial' and 'The
Castle' among other works.

Also, rulers of Austria and the Holy Roman Empire have had this name.
"

Wow, what honour :wink:

···

On Fri, 10 Jun 2005 16:35:14 +0300, "Peter Damoc" <pdamoc@gmx.net> wrote:

On Fri, 10 Jun 2005 16:23:18 +0300, the_shelter <pdftex@the-shelter.de> >wrote:

Just to make the she/he subject complete:
Andrea stems from greek meaning 'man' ...
Being a German myself, I wonder what language got confused :wink:
But seriously,
with me affection only has me for the nice controls you have posted.
Keep hanging in there! I really like them a lot!

well to make the subject complete you should have posted
this:
Names Starting with A - Behind the Name
or this...
Meaning, origin and history of the name Andrea (1) - Behind the Name

Peter.

--
Franz Steinhäusler

DrPython (Project Developer)
http://mitglied.lycos.de/drpython/