RE: [gtk-list] Re: Color Confusion




On 10-Feb-98 Owen Taylor wrote:
>
>John Kodis <kodis@jagunet.com> writes:
>> I'd be most appreciative if someone could take a look at the exposure
>> handler in the attached test program and give me a hint as to what
>> I've done wrong here, or what general approach should be used in
>> getting a properly set up GC from a symbolic color name.  TIA.
>
>gdk_color_parse only gets the color definition, to actually allocate
>the color, you need to call gdk_color_alloc. (With a colormap)
>
>  GdkColormap colormap = gdk_widget_get_colormap (widgt);
>  gdk_color_parse("blue", &blue);
>  gdk_color_alloc (colormap, &blue);
>  gdk_gc_set_foreground(blu_gc, &blue);
>
>(Untested)
>
>Regards,
>                                        Owen
>
>(Yes, it is a confusing area....)

What would be really nice is a simple example program to demonstrate
setting up of palettes/drawing etc...anyone have anything like this?

What I'm doing currently is creating an Image and poking data into it directly
(like gtktv.c does), not a very nice solution but much simpler to write.

C-YA
Jon



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