colors and cursors

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 28 Nov 96 10:52:51 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I have allready tried to use -private, with no result. Forms seem to
> ignore my command! (i have done everything ok with fl_initiate(),
> i've checked it ...) Is there a way to free colors that you dont
> need any more from server's colormap?

fl_free_colors( FL_COLOR *cols, int n );

See Chapter 23, Drawing objects.

> Also the problem is not that i ask for example for orange and i get
> a red, but changes colors that are not supposed to ghange: for
> example the forms background is gray (col_1) and when color
> substitude begin changes color continiously (!!!) and may result
> that the col_1 in ALL FORMS of my application change to green, or
> blue. I cannot figure what is happening inside the lib, so i cannot
> solve it.

What do you mean by "changes color continiously?" Do you mean that
every time you add a color from there on in the displayed value for
COL_1 changes or something more dramatic?

How are you changing/adding colors? With fl_map_color() or by
directly accessing the X Colormap with XAllocColor()? Bear in mind
that the color indices in XForms are not the same as the pixel
indices in the X Colormap -- this can be terribly confusing sometimes.

For anything other than simple XForms operations, I generally just
work with the DefaultColormap directly. I've never had a problem with
tromping on XForms colors as long as I'm careful to use only the cells
allocated with XAllocColorCells() or XAllocColorPlanes(). Anything
else belongs to someone else and is "hands off."

> PS: About the cursor error i take:
> This happen when i change the cursor for 27th time. Is 26 a "magic"
> number for cursors in forms??? ( Can handle for example only 26
> cursor at a time??)

I don't recall seeing the original post to which this refers. What
error are you getting?

As far as I know there is not limit to the number of times you can
change either an XForms or X cursor. I have an application that does
it a fair amount and have not ever had any problem with cursors that
wasn't my error.

spl

To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html