Quantcast

Changing the colour of a wx.RadioBox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Changing the colour of a wx.RadioBox

Simon Garrett
Hi All, 

Is it possible to change the text colour of a RadioBox, programatically?  I know something like,

  rb = wx.RadioBox( ... )
  rb.SetForegroundColour(col)

doesn't work, probably because RadioBox objects are composed of Radio button objects and various wx.DC calls.  And I can't access the dc internal to the RadioBox object, presumably, can I?

I also know that the standard RadioBox is set up so that ShouldInheritColours returns True (I tried subclassing RadioBox, overloading ShouldInheritColours to return False, and it still didn't let me change the colour of the text).

I've tried making sure the parent window has its Foreground colour set to the desired colour (#eeeeee), so the RadioBox inherits it, but that doesn't seem to work either. 

My only option seems to be writing my own radio box class from scratch, but that seems insane!  Is there another option?

I'm on Mac OS 10.4, Python2.5.1, wx2.8.4.0.

Any help would be wonderful, I've been banging my head against a figurative brick wall for days now...

Best regards,

Simon.

--Dr. Simon Garrett--
This is my home account.  Work contacts are:
Aispire:  [hidden email]




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing the colour of a wx.RadioBox

Vadim Zeitlin-4
[this seems to be wrong list for this kind of questions, you'll find many
 more participants on wx-users, this list is for (non technical)
 discussions of wx itself rather than about how to use it]

On Fri, 4 Jan 2008 14:30:57 +0000 Simon Garrett <[hidden email]> wrote:

SG> Is it possible to change the text colour of a RadioBox,  
SG> programatically?

 My guess would be that it isn't under Mac. What you do should be enough to
change it under the other platforms (e.g. MSW) so if it doesn't work under
Mac, it must be because either it's not implemented in wxMac or it's not
supported by the native radio box at all.

 Regards,
VZ

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Changing the colour of a wx.RadioBox

Simon Garrett
Many thanks for the speedy reply.

On 4 Jan 2008, at 14:35, Vadim Zeitlin wrote:

[this seems to be wrong list for this kind of questions, you'll find many
 more participants on wx-users, this list is for (non technical)
 discussions of wx itself rather than about how to use it]

Ah, ok, that makes sense.  Sorry for inadvertently spamming wx-discuss  :(


On Fri, 4 Jan 2008 14:30:57 +0000 Simon Garrett <[hidden email]> wrote:

SG> Is it possible to change the text colour of a RadioBox,  
SG> programatically?

 My guess would be that it isn't under Mac. What you do should be enough to
change it under the other platforms (e.g. MSW) so if it doesn't work under
Mac, it must be because either it's not implemented in wxMac or it's not
supported by the native radio box at all.


I had hoped to get a different reply, but at least I have a definitive answer now -- after all, I think I saw your name at the top of radiobox.cpp? :D  Thanks again.

Best regards,

Simon.

--Dr. Simon Garrett--
This is my home account.  Work contacts are:
Aispire:  [hidden email]




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re[2]: Changing the colour of a wx.RadioBox

Vadim Zeitlin-4
[we really should take this to wx-users or wx-dev...]

On Fri, 4 Jan 2008 16:14:02 +0000 Simon Garrett <[hidden email]> wrote:

SG> I had hoped to get a different reply, but at least I have a  
SG> definitive answer now -- after all, I think I saw your name at the  
SG> top of radiobox.cpp?

 No, I really don't know this code and my guess was just this -- a guess. I
did look at the code now (mainly to correct the header comment, but in fact
I don't see my name there so there is nothing to correct) and it seems that
maybe it's wxMac deficiency after all: if you can change the colour of an
individual wxRadioButton, it should be possible to do it for the wxRadioBox
buttons too (rather easily). Let me know if you manage to do this (you can
just run the widgets sample under Mac and use the menu commands on the
radio button page).

 Regards,
VZ

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...