Re: [gtk-list] allocating colors





On Mon, 9 Nov 1998, Mario Motta wrote:

> Adrian Feiguin wrote:
> > 
> > I have to initialize some attributes before my widget is realized. How can
> > I initizalize a color, I mean: RGB & pixel, before I realize a widget. The
> > problem is that widget->style->colormap is NULL and I can't use
> > gdk_color_alloc(widget->style->colormap, &mycolor).
> > 
> > Any hint?
> > 
> > Thanks,
> > <ADRIAN>
> > 
> > --
> > To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> i'm not sure but you can't, since to allocate a color you need a pointer
> to an X window that is available only after widget is realized. You
> should force widget realizing with gtk_widget_realize().
> In Gtksheet some operations can be done only after widget himself is
> showed.
> -- 
> Mario Motta
> AI Research Group - Rimini
> mmotta@guest.net
> http://www.guest.net/homepages/mmotta/VDKHome/index.htm
> 

Actually my problem is that I can parse a color and obtain the RGB
components, but I need to know information about the environment in order
to  calculate the pixel. In TrueColor displays I can use the formula: 
pixel=red*65536+green*256+blue, but this formula works only in this case.
Maybe I could use gdk_colormap_get_system, and gdk_color_alloc to obtain
the pixel value.

<ADRIAN>







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