hide patcher/patcherview when opened

Mar 20, 2013 at 7:26pm

hide patcher/patcherview when opened

Hey,

is there a way to open a patcher with a invisible patcherview(hidden patcher window)?
When opening it with stringload(“xy”) and setting it invisible two line after, like this:

t_object* opened_patch = stringload("xy");
t_object* open_p_topview = jpatcher_get_firstview(opened_patch);
patcherview_set_visible(open_p_topview, 0);

it is shown for a small moment.

I would like to set the position and size first
and make the patcher/patcherview visible just after that.

Is it somehow possible? With intload(“…”) maybe?

Greetings,
Alex

#67218
Mar 21, 2013 at 3:51pm

Hi,

It works fine for me (max 5.1.9 / SDK-5.1.7 / os X.4.11), not you ?

void flop_bang(t_flop *x)
{
//
t_object *p = NULL;
t_object *v = NULL;     

if ((p = (t_object *)stringload("HabemusPapam.maxpat"))
    && (v = jpatcher_get_firstview(p))) {
    patcherview_set_visible(v, 0);
}
//
}
Attachments:
  1. flop.zip
#241879
Mar 22, 2013 at 5:10pm

Hi,

not really, I can see the window for the glimpse of a second before it dissappears.
I want the window to be hidden when opened, not after.

#241880
Mar 22, 2013 at 6:50pm

Hi,

On my computer i don’t have any window on the screen (and to be honest, that surprised me). I have no idea how to avoid that and i’m pretty sure it is impossible to do by this way ; i’m afraid that you will be forced to implement yourself a “stringload” workaround.

#241881
Mar 22, 2013 at 8:07pm

Hey,

…got this working through forcing another window to stay above the created one during the init.

#241882
Mar 23, 2013 at 8:17am

Hi,

IMHO, i should not rely on the portability of this kind of trick ; can’t you use something like “newobject_fromdictionary” instead ?

#241883
Mar 23, 2013 at 1:59pm

Hi,

you’re right this is not really clean. I can’t use newobject_fromdictionary
because it does not create a top-level patcher. It creates a (sub)patcher into a patcher.
But there’s something like jpatcher_load_fromdictionary. That looks promising. Good idea!

#241884
Mar 23, 2013 at 2:34pm

Hi,

I understand your problem ; and i’m not used with toppatcher creation sufficiently to submit a valuable solution ; please let me know if you find a way with jpatcher_load_fromdictionary or not ;-)

#241885
Mar 23, 2013 at 2:52pm

Hi,

don’t mind, that dict idea was quite good. Of course I’ll post it if I find a solution.

#241886
Mar 26, 2013 at 7:59pm
#241887

You must be logged in to reply to this topic.