It seems that AquaButton currently doesn't change colour when disabled - is this correct or am I missing something.
If correct any chance that something like this could be added? I know a patch would be great - any tips:-) ?
Werner
It seems that AquaButton currently doesn't change colour when disabled - is this correct or am I missing something.
If correct any chance that something like this could be added? I know a patch would be great - any tips:-) ?
Werner
Hi Werner,
It seems that AquaButton currently doesn’t change colour when disabled - is this correct or am I missing something.
No, you’re not missing anything, you are correct.
If correct any chance that something like this could be added? I know a patch would be great - any tips:-) ?
I believe it should be fairly easy to add it. Simply selecting a proper “disabled colour” as a main colour for AquaButton (and possibly a proper “disabled colour” for the text as well) should be enough. In the OnPaint method, a modification like this:
def OnPaint(self, event):
"""
Handles the ``wx.EVT_PAINT`` event for L{AquaButton}.
:param `event`: a `wx.PaintEvent` event to be processed.
"""
dc = wx.BufferedPaintDC(self)
gc = wx.GraphicsContext.Create(dc)
xpos, ypos, width, height = self.GetClientRect()
dc.SetBackground(wx.Brush(self.GetParent().GetBackgroundColour()))
dc.Clear()
gc.SetBrush(wx.WHITE_BRUSH)
shadowOffset = 5
btnOffset = 0
clr = self._backColour
if self._mouseAction == CLICK:
shadowOffset = 3
clr = self._hoverColour
btnOffset = 2
elif self._mouseAction == HOVER:
clr = self._hoverColour
elif not self.IsEnabled():
clr = wx.SystemSettings.GetColour(wx.SYS_COLOUR_GREYTEXT)
Should be enough. Keep in mind that, as AquaButton doesn't have a plain solid colour as a background, the choice of the "disabled colour" may clash with the colour the developer has chosen to be the AquaButton main colour. However, short of adding a new method like "SetDisabledColour" to AquaButton (hint hint), there isn't much we can do about this. I am not sure the choice I made for the colour in the code above is good enough, if you could experiment a bit with it it would be more than helpful. I can't test that much at the moment (I am at work), but if you can come up with a patch along the lines I have suggested above (and maybe the "SetDisabledColour" method as well) I'll be happy to review it and apply it.
Thank you!
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.alice.it/infinity77/
import PyQt4.QtGui
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named PyQt4.QtGui
import pygtk
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named pygtk
On 15 September 2011 16:47, werner wrote:
import wx
Hi Andrea,
What about the attached, limited testing done but it works for me.
Werner
aquabutton.patch (1.8 KB)
Hi Werner,
Hi Andrea,
What about the attached, limited testing done but it works for me.
Thank you for the patch, I have applied it in SVN (using SetDisabledColour instead of SetDisableColour - notice the “d”)
Thank you again!
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.alice.it/infinity77/
import PyQt4.QtGui
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named PyQt4.QtGui
import pygtk
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named pygtk
On 16 September 2011 14:51, werner wrote:
import wx
Hi Andrea,
I still have a little issue with the Aqua button, as you can see on the image the square background is in grey instead of my background colour "yellowish" in this case.
Can you give me a tip on what I need to look at to customize that colour as SetBackGroundColour is setting in my case the "violetish" one.
Just had another look, I think it is line 303 to 305 "br2" I need to change, is this correct?
What would be a good name for it? shadowColour?
Werner
Gave it a try, it wasn’t 303 to 305 but I think it should be
changable too.
Attached a patch which allows to set the shadow colour and it allows
also to set a colour for the background background colour, in other
words the rectangular.
Is this acceptable?
Werner
aquaButtonBackground.patch (2.96 KB)
Hi,
On 20/11/2012 14:39, werner wrote:
-- To unsubscribe, send email to
or visit
Hi Andrea,
I still have a little issue with the Aqua button, as you can see
on the image the square background is in grey instead of my
background colour “yellowish” in this case.
Can you give me a tip on what I need to look at to customize
that colour as SetBackGroundColour is setting in my case the
“violetish” one.
Just had another look, I think it is line 303 to 305 "br2" I
need to change, is this correct?
What would be a good name for it? shadowColour?
Werner
wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en
Hi Werner,
Hi,
Hi Andrea,
I still have a little issue with the Aqua button, as you can see
on the image the square background is in grey instead of my
background colour “yellowish” in this case.Can you give me a tip on what I need to look at to customize
that colour as SetBackGroundColour is setting in my case the
“violetish” one.<img src="cid:part1.05080601.09000401@sfr.fr" alt=""> Just had another look, I think it is line 303 to 305 "br2" I
need to change, is this correct?
What would be a good name for it? shadowColour?
Gave it a try, it wasn't 303 to 305 but I think it should be
changable too.
Attached a patch which allows to set the shadow colour and it allows
also to set a colour for the background background colour, in other
words the rectangular.Is this acceptable?
I think it’s very good. Give me a few days to get back to Denmark and I’ll apply your patch.
Thank you!
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
http://www.infinity77.net
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
On 20 November 2012 17:23, Werner wrote:
On 20/11/2012 14:39, werner wrote:
HI Werner,
Hi Werner,
Hi,
Hi Andrea,
I still have a little issue with the Aqua button, as you can see
on the image the square background is in grey instead of my
background colour “yellowish” in this case.Can you give me a tip on what I need to look at to customize
that colour as SetBackGroundColour is setting in my case the
“violetish” one.<img src="cid:part1.05080601.09000401@sfr.fr" alt=""> Just had another look, I think it is line 303 to 305 "br2" I
need to change, is this correct?
What would be a good name for it? shadowColour?
Gave it a try, it wasn't 303 to 305 but I think it should be
changable too.
Attached a patch which allows to set the shadow colour and it allows
also to set a colour for the background background colour, in other
words the rectangular.Is this acceptable?
I think it’s very good. Give me a few days to get back to Denmark and I’ll apply your patch.
Patch applied to Classic and Phoenix, sorry for the delay!
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
On 24 November 2012 23:15, Andrea Gavana wrote:
On 20 November 2012 17:23, Werner wrote:
On 20/11/2012 14:39, werner wrote: