Chaco background color

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Chaco background color

Neil Hodgson
Hi,

I think this came up before but googling didn't yeild anything useful.

When I add a Chaco plot to a traitsui view (using a PlotContainer) or to and Enaml window using EnableCanvas, the default component background is often different to the parent window (usally either white or lightgray).

Is there a why to get the background color of the parent so I can set the bgcolor of the plot component to be identical? I imagine it's easier in Enaml, but also want to update some legacy traitsui code.

Thanks,
Neil

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco background color

Robert Kern
On Wed, Mar 20, 2013 at 8:30 AM, Neil Hodgson <[hidden email]> wrote:

> Hi,
>
> I think this came up before but googling didn't yeild anything useful.
>
> When I add a Chaco plot to a traitsui view (using a PlotContainer) or to and
> Enaml window using EnableCanvas, the default component background is often
> different to the parent window (usally either white or lightgray).
>
> Is there a why to get the background color of the parent so I can set the
> bgcolor of the plot component to be identical? I imagine it's easier in
> Enaml, but also want to update some legacy traitsui code.

There is no general way to do this across toolkits and platforms and
contexts for either Traits UI or Enaml. For example, on OS X, the
Groups with borders use a native group box widget that darkens the
background by a certain amount. Nested group boxes will have
progressively darker backgrounds. There is no API to ask what
background color a particular group box in that hierarchy is using. In
some contexts, the background may even be a gradient.

At least on some toolkit/platform combinations (wx/OS X at least, but
not Qt/OS X, not sure about any others), you can use
ComponentEditor(bgcolor='transparent'). The combinations that don't
work may be fixable with some investigation.

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev