Hi folks, I opened an issue about this on github, but since there was no answer I'm hoping to get some attention and a possible answer here on the dev list.
In Pd, if you have graphical objects in a GOP subpatch that are out of the visible range, it's possible they get drawn, and I opened the issue to mention that [vradio], for instance, does that (here it is:
https://github.com/pure-data/pure-data/issues/1053 ). I also mentioned n there how graphs inside a GOP subpatch can also do that. But I also have this issue with some GUI externals I take care of.
So, is there a way for an object to know if it is visible in the parent pacth so we do not tell it to get drawn?
The error gives me hope there's a way to check if it is possible to do it, and then not tell it to do it if it's not possible...
I used the "(glist_isvisible())" function to check if it's visible. It doesn't work as a check because the object is in a GOP, so it'll say it is visible, even though the object itself is actually out of bounds. Now, in the case of scope~, it tries to delete the GUI by referring to the subpatch canvas, and I assume it doesn't work because that window isn't active/opened.
So if I change the lines below
sys_vgui(".x%lx.c delete all%lx\n", x->x_cv, x);
scope_draw(x, x->x_cv);
To refer to the parent canvas (and not "x->x_cv"), I don't get an error, but I get the object getting redrawn in the parent patch outside the graph, just like the issue I reported with [vradio].
Again, when bumping into this, I thought, since the object knows it can't delete and redraw (that is, since it gives an error), there could be a way to check it.
What do you say?
Thanks