Dumb question re color allocation



Hi,

This is probably a dumb question, but what the hell ;-)

The have a color defined i.e.

 GdkColor guiColourPurple  = {0, 0xffff, 0x0000, 0xffff};

I want to use this multiple times, in various windows.

Do I need to allocate just ONCE or for each usage ? (my gtk books
are a little vague on this)... i.e.

gdk_color_alloc (gdk_colormap_get_system () , &guiColourPurple); 

If I know I have finished with a colour, can I/should I,  de-allocate it ?

At present I am getting the following:

Gdk-ERROR **: BadAlloc (insufficient resources for operation)
  serial 68077 error_code 11 request_code 84 minor_code 0


(I am on Solaris BTW)...

Many thanks in advance...

/colin.





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