I'm working on a project where I store information in scalars and would like to be able to delete a scalar to both free the pointer and to avoid a memory leak. Currently I am drawing a polygon to represent the scalar (with the x y information inherent in the data) and I use simulated mouse movements to select and delete the scalar graphically.
One problem I have stumbled on (which I am assuming is common to people using simulated mouse movements) is that pd doesn't seem to like deleting objects/scalars in a window that isn't visible (this makes sense since it might be hard to simulate mousing over something that isn't there).
Am I correct in assuming that this is still the preferred way of deleting scalars (as opposed to a clear message)? I also happen to be using the scalar information to coincide with GUI abstractions in a different window, and I'm trying to avoid as many glitches as possible.
Any feedback is appreciated.
Thanks, -Stephen