Re: Colors



Dnia 2005-09-03 18:39, Liam R E Quin napisał:
On Sat, 2005-09-03 at 11:08 +0200, Przemysław Sitek wrote:


I am writing a widget that draws a custom background under its child. I do this by subclassing GtkEventBox (since it has its own window) and overwriting expose virtual method. How can I get background color (or base color) ina a "selected" state (I want background to be drawn in that color).


Not an answer (sorry) but a caution --
* make sure that a user whose theme has white text on a black background
  can still read your widget's text.
* make sure that a user who needs reduced contrast is not presented
  with black and white, but the appropriate greys.
* remember to handle the case that the window is partially obscured
  and loses focus

   I know this - that's why I'm asking how to obtain colors from
current theme. I want to "invert colors" - thus I decided to use colors
normally used for selected widgets (selected text, selected row in a
treeview).

Having said all that, it sounds like really you could just use the
widget's style.

   That's what my question is about:-)

But do ask yourself why you are doing this.  If it's to draw the
user's attention to something maybe it should be an alert box.  If
it's for decoration, better not to do it :-)  If it's for displaying
a colour swatch, there's already a widget for that.

   It'll be some kind of a decoration:-)

--
  Przemysław Sitek



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]