dynamically adding "custom" GUI objects
Is there a way to dynamically script add UI objects to a patch, such that their visual parameters are already set? Like if I wanted to add a number box, but have the arrow not showing, the background a certain color, size a specific size, etc..?
Or do I have to create a "default" one first, and then script modify it after it's created?
Following up my own question - what I really would like to do is to be able to script create a saved "prototype". Is that possible? And if so, could I do it in a standalone?
heya,
you can use things like "@fontface bold @fontcolor 1. 1. 1. 1." with your "script newobject" just as with "script newdefault".
you can also use a list of just the values, but because that is nowhere documented you would want to run a copy of max 4 somewhere, create a GUI object with everything set once, then export the patch as text and open it as text to see the values' order.
the latter could have limits when it comes to functions of the object which are newer.
i have never tried mixing both systems.
Very cool, will try Roman, thanks!
It's actually right there in the thispatcher help file... facepalm!
And also to get the attribute names, you can just option-drag the attribute from the inspector onto the patch, and it gives you the option to make a message box with the current parameters, makes it very easy to incorporate into the script message.