Button Color

--001a11478870dbe5ec052f9cfb32
Content-Type: text/plain; charset=UTF-8

Hello All:

Is there any way to change the background and/or foreground color of a
Wx::Button?

Thanks,
James

--001a11478870dbe5ec052f9cfb32
Content-Type: text/html; charset=UTF-8

<div dir="ltr"><div><div><div>Hello All:<br><br></div>Is there any way to change the background and/or foreground color of a Wx::Button?<br><br></div>Thanks,<br></div>James<br><br></div>

--001a11478870dbe5ec052f9cfb32--
0
jmlynesjr
4/3/2016 11:29:30 PM
perl.wxperl.users 3070 articles. 0 followers. Follow

3 Replies
256 Views

Similar Articles

[PageSpeed] 41

On 04/03/2016 07:29 PM, James Lynes wrote:
> Hello All:
>
> Is there any way to change the background and/or foreground color of a
> Wx::Button?
>
> Thanks,
> James
>

The orange-y buttons on this page:

 
http://bruceravel.github.io/demeter/documents/Athena/intro.html#first-look-at-athena

are made like so:

   $button  = Wx::Button -> new($toolpanel, -1, 'E');
   $button -> SetBackgroundColour( Wx::Colour->new('#FCDD9F') );

This works for me on linux and Windows.

On the Mac, however, those same buttons are the default color, but
with a feint glow in the selected color around each button:

 
https://raw.githubusercontent.com/bruceravel/demeter/master/documentation/_images/athena_mac.png

I have never figured out how to fix this on the Mac.  (In fairness, I
haven't tried very hard.)

Cheers,
Bruce


-- 
  Bruce Ravel  ------------------------------------ bravel@bnl.gov

  National Institute of Standards and Technology
  Synchrotron Science Group at NSLS-II
  Building 535A
  Upton NY, 11973

  Homepage:    http://bruceravel.github.io/home/
  Software:    https://github.com/bruceravel
  Demeter:     http://bruceravel.github.io/demeter/
0
bravel
4/4/2016 1:06:01 PM
--001a11397c92163f30052fadde96
Content-Type: text/plain; charset=UTF-8

Bruce:

Thanks! I'll give it a try. Should have found that one myself...duh...

James


On Sun, Apr 3, 2016 at 7:29 PM, James Lynes <jmlynesjr@gmail.com> wrote:

> Hello All:
>
> Is there any way to change the background and/or foreground color of a
> Wx::Button?
>
> Thanks,
> James
>
>

--001a11397c92163f30052fadde96
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>Bruce:<br><br></div>Thanks! I&#39;ll give it a t=
ry. Should have found that one myself...duh...<br><br></div>James<br><br></=
div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sun, Apr 3=
, 2016 at 7:29 PM, James Lynes <span dir=3D"ltr">&lt;<a href=3D"mailto:jmly=
nesjr@gmail.com" target=3D"_blank">jmlynesjr@gmail.com</a>&gt;</span> wrote=
:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div><div>Hello A=
ll:<br><br></div>Is there any way to change the background and/or foregroun=
d color of a Wx::Button?<br><br></div>Thanks,<br></div>James<br><br></div>
</blockquote></div><br></div>

--001a11397c92163f30052fadde96--
0
jmlynesjr
4/4/2016 7:38:05 PM
On 04/04/2016 03:38 PM, James Lynes wrote:
> Bruce:
>
> Thanks! I'll give it a try. Should have found that one myself...duh...

You needs to dig through the inheritance list of the widget to find such 
things.  In the case of Wx::Button, SetBackgroundColour is inherited 
from Wx::Window.

B

> James
>
>
> On Sun, Apr 3, 2016 at 7:29 PM, James Lynes <jmlynesjr@gmail.com
> <mailto:jmlynesjr@gmail.com>> wrote:
>
>     Hello All:
>
>     Is there any way to change the background and/or foreground color of
>     a Wx::Button?
>
>     Thanks,
>     James
>
>


-- 
  Bruce Ravel  ------------------------------------ bravel@bnl.gov

  National Institute of Standards and Technology
  Synchrotron Science Group at NSLS-II
  Building 535A
  Upton NY, 11973

  Homepage:    http://bruceravel.github.io/home/
  Software:    https://github.com/bruceravel
  Demeter:     http://bruceravel.github.io/demeter/
0
bravel
4/4/2016 7:52:28 PM
Reply: