Re: [gtk-list] Re: colors
- From: newsham lava net (Tim Newsham)
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: colors
- Date: Thu, 27 Jan 2000 01:02:36 -1000 (HST)
> > I have several widgets I made which allocate their own colors.
> > Is this a bad idea? Would it be better to use a style file some
> > how to designate colors, and if so, how is this done?
>
> This depends on a lot of factors:
>
> - Are the widgets for general use? for use within an application?
> For use within your computer?
I made the widgets for my application. But, some of the widgets
may be useful outside of the application (for example, a knob widget).
> - How many colors are you using?
About 4 or 5.
> - Do you care if your stuff works on pseudocolor (i.e., 8-bit) displays?
The colors dont have to be exact, but yah, the application shouldn't
be broken. I dont think this is a problem though, is it? Given
that I have only a handful of colors and they are well seperated
from each other.
> - Should users be able to configure the colors?
This isn't strictly necessary, but it would be nice if the application
let the user change the colors.
> It's hard to give a general answer except to say that in most cases,
> general purpose widgets should constrain themselves to the colors
> in the standard style structure. And in fact, most general purpose
> widgets should try to draw themselves entirely with GTK+'s paint
> functions (gtk_paint_*) if possible.
well, I don't think gtk_paint_* had all the primitives I needed.
I suppose I could make the widgets use the default colors, but only
if I have a decent way to control what those colors are in my
particular application. It seems like I should be able to do this
with a gtk style file, but I haven't figured out the details of that
yet. But that would require that a style file be installed when
the user runs the program, unless there is some way to compile in
a default style?
> > Also, I want to change the background color of a window that I create.
> > What is the proper way to do this?
>
> Either gtk_style_set_background() or gdk_window_set_background() depending
> on what you want to set the background to.
danke.
> Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]