|
From: Daniel J S. <dan...@ie...> - 2004-09-21 16:54:37
|
Petr Mikulik wrote: >Yes, every x11 windows should have its own copy of the palette. When there >is a new (re)plot, x11 should copy the current gnuplot palette into palette >of the active window, and use that. > >Can you please implement this? > Petr, I'll take a look this weekend. I don't like hacking stuff, and this may take some consideration. I'm wondering how this should be structured, and whether we should be conservative with palette usage in order to not consume too much memory. Are palettes memory consumers? If so, it might be wise to not save a color map with every plot. That is, say there is a fairly large palette, and then someone creates twenty plots. If all those plots have a similar palette, it may be an inefficient use of memory. Rather, it might be wise to have a linked-list of palettes. Whenever a new palette is created, it is put in the linked list. Then, when a palette is changed at the gnuplot command line, gplt_x11.c will search through the plot list and see if any of the plots is using the old palette. If not, that color map can be discarded from the list. It sounds unnecessarily tedious, but it really does seem like the thing to do, and it actually might simplify the various uses of XAllocColor and XFreeColors. Dan |