Re: Colors



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

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

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.

Best,

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org
Liam on the Web: http://www.holoweb.net/~liam/




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