Quote:

I've found that all you really need to do is use the .flags parameter and just use = FLAG or = ~FLAG. the "~" is a bitwise inverter. it essentially reverses the effect of the flag (example: element.flags= VISIBLE; element is VISIBLE. element.flags= ~VISIBLE; element is now INVISIBLE).




This is purely a wrong way to toggle a bit flag. All other bits of other flags would be reset if done this way. A Flag is a variable whose every bit is pointing to a flag. So you have to alter only the bit of the flag you are interested in. & and | operators are necessary for this kind of operation. These preserve the other bits of the flag while altering the requested bits of the flag.


My Specialities Limited.