'Welcome' screen functionality in standalone

goodparleyandorfing's icon

I'm wondering if anyone knows how to achieve the same functionality as the 'welcome' screen in Max 6 inside one's own standalone application? That is, a patch that opens automatically the first time the application is used, and then the operator can choose to show it or not the next time the app opens. The 'welcome' file in max shows how it is done, but there are a number of '; max messages' in there that don't seem to be documented. I wonder if they are bespoke functions created just for that one purpose. On the other hand, there may be a simpler way using pattr / thispatcher that I haven't discovered yet.

Any guidance on this would be appreciated.

nealriley's icon

There are a few ways to accomplish this, but [thispatcher] is probably the easiest. Have a look at the helpfile, but you will probably want to use the front and wclose methods.

Basically, you would create your subpatch (presumably with presentation mode on), make a thispatcher object with a loadbang >> front message attached. When you're ready to close the window, you can either use the built-in [x], or make a button that links to a wclose message >> thispatcher, which does the same thing.

Hope this helps!

Ernest's icon

I agree with Neal. To add a curious phenomenon though, the first time you put a welcome screen in, it could works fine; then after you edit some other patches, Max may load the other patches first, so if they are big and take a while to load, your welcome screen may not show up for quite a while.

I'm still not entirely certain how to be sure of it, but I think if the welcome subpatch is higher up in the patcher hierarchy than other big slow parts, it shows up before them and isn't delayed; but if it's at the same level or deeper than the big slow parts, Max loads the most recently edited subpatchers first, slowing down down the splash display

goodparleyandorfing's icon

Hi both,

Thanks for this. Using [thispatcher] in this way will cause the 'welcome' subpatch to be brought to the front upon open, but, unless I am mistaken, it won't retain any settings for next time the app is opened. I am wondering how to get one-time-only behaviour, something like [loadbang] > [open 'welcomescreen' 1] the first time the app is opened, and [loadbang] > [open 'welcomescreen' 0] the second time. In the max welcome screen document there is a ubutton whose state, 0 or 1, is retained for next time without asking you to save. The patch seems to rely on two messages to max, '; max send attr', and '; max showwelcome', that I can't find documentation for.

I think the solution will be to write a new preset / pattrstorage file everytime a 'show on startup' box is ticked, and then have the stored 0/1 determine whether the subpatch is opened.

Thanks for your help!

Peter Castine's icon

Probably your best bet is to make your Welcome page (aka Splash Screen) your main, top-level patch. Then, when you've processed your last loadbang (or whenever the final loading is complete), set presentation mode on your "welcome" items to false and move the real top-level items into presentation (or hide the main window).

I haven't actually done this, but I've taken over a couple of projects with Splash Screens implemented as sub-patches, and they've always required lots of tinkering after any edits to make sure that the subpatch for the Splash loads first. I think main-patch-as-welcome is the way to go.

Note that Splash Screens have been pretty much deprecated, at least on Mac OS, for the last couple of OS/UI releases. But Max standalones often don't launch as fast as one would desire, so some kind of quickly displayed UI is often needed. Still, it would arguably be better invest effort to get your app launching faster, if at all possible.

goodparleyandorfing's icon

Ah, of course. I have it working the way I described now, but you are right, it's not really as elegant as one would hope. I'll do this presentation trick -- thanks for the suggestion.

Connor Pogue's icon

on the welcome screen, you could have a check box of some sort that says "don't show this again"