Forums > Dev


Feb 18 2011 | 5:25 pm

Following code fragment:

t_max_err myErr = MAX_ERR_NONE;
tMyObj*	  me = object_alloc(gObjectClass);
Object*	  myPatcher;

post("%s(): try to hide patcher", __func__);
object_obex_lookup(me, gensym("#P"), &myPatcher);
myErr = patcherview_set_visible(jpatcher_get_toppatcher(myPatcher), false);
post("  patcherview_set_visible() returned %ld", myErr);

patcherview_set_visible() Returns -1 (MAX_ERR_GENERIC) and doesn’t hide the main patcher window (which I was hoping to do).

This is called from the object’s instantiation method. (As the call to object_alloc() sort of indicates.-)

gObjectClass is a properly allocated t_class.

Is there any way for an object to hide its top-level patcher (or any patcher)? I also tried jpatcher_set_rect() with an offscreen rect with no love (but it at least returns MAX_ERR_NONE).

In this case I just want to hide the top-level patcher when it’s in a standalone, and only then during initialization. Once initialization is finished it gets put back onscreen. As it is, it gets covered by a splash screen, but there a couple of seconds with the top-level patcher on screen before the splash gets drawn. Any ideas?

I never thought I’d want to do something like this,-

Feb 18 2011 | 7:46 pm

Right, I hadn’t looked into the patcherview API. But still, if it doesn’t work or crashes that’s sort of a deal breaker;-

Some more research, and it looks like I’ll eventually have to implement one of Ben’s suggestions in <>.

Still it would be nice to have some way to hide a window.

Viewing 2 posts - 1 through 2 (of 2 total)

Forums > Dev