[Xcircuit-dev] investigate Cvt
Brought to you by:
rtedwards
From: Eric Y. C. <er...@al...> - 2002-05-11 23:45:52
|
Hi Tim. I tried a couple of things, both of which were successful. The first was to close Netscape. The menus looked fine then. So, this is caused by running out of colors, since Netscape takes up so many. Actually, it must take up some pretty crucial ones, since the page it was open to is the tutorial, with all the screenshots! So, one workaround is to close Netscape every time XCircuit is running, but this is a hassle, since I have to open it every now and then as I read the tutorial. The second thing that worked is to just revert the Cvt routine. That works just fine, and the old colors come back. This works even if Netscape is showing the tutorial. The reason why it works is that there is one major difference in the 2.5.4 code. If a non-zero code is returned from the color lookup, the 2.3.3 code will call findanothercolor (or something like that). This will build a private color table, and every subsequent call to Cvt will succeed rather than leaving the pixel member un-initialized. Obviously, the line was taken out for a reason, but I cannot figure out why. If there is a non-zero return code, .pixel should still be set, or else who knows what its value will be. This might even give a memory error. I will also try moving XtAppAddConverter up, but I don't see how this will help, especially since I am not sure how this routine works. I am not very fluent in Xt. Eric |