Re: Question about gdk_colormap_free_colors()



Yes, you have. 

When you allocate colors with both flags set to true (nearest color and
allocate color), GDK looks for any existing color with same rgb
components. If found, the "pixel" field of your color structure is
updated and an internal counter is increased (to know how many "clients"
use it). If it's not found or nearest color flag is set to false, a new
entry is allocated and counter is set to 1 (GdkERROR occurs if colormap
is full).

When freeing color, this counter is decreased and deleted as soon as it
reaches 0.

Hope it will help
FB

Tara M a écrit :

When I first allocate a color using:

 gdk_colormap_alloc_color(colormap, &c, TRUE, TRUE);

Do I have to at some point deallocate it with:

 gdk_colormap_free_colors(colormap, &c, 1);

What happens if another resource was using the color
in question, would gdk_colormap_free_colors() on
the same color mess it up?

--
--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
.__                          ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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