jsui
Description
Provides an environment to make user interface elements using Javascript. This provides all of the programming tools available in the js object, but also exposes the mgraphics and sketch drawing routines for visual output.
Examples

Discussion
The jsui object is a general purpose user interface object driven by javascript. There are a number of templates already built to use (some of which are shown below). While the patcher is in edit mode, you can ctrl-click (mac) or right-click (pc) to bring up the contextual menu which will let you view and edit the currently loaded javascript file, or select one of the template files from jsui-library. If the javascript file also has a help file associated with it (as do all of the template objects contained in this patch), the associated help file will be loaded instead of jsui.maxhelp. The inspector lets you set the javascript file, javascript arguments, size, border flag, and disable full scene anti-aliasing (fsaa).
At the present time, mouse position and object redrawing will only be reported correctly in the jsui object if the patching and Presentation mode sizes of the object are the same.
Arguments
None.
Attributes
border [int] (default: 1)
Toggles the drawing of a border around the jsui object. The default is 1 (draw border).
filename [symbol] (default: none)
The word
, followed by a symbol that specifies a pathname, designates the Javascript file to be loaded.jsarguments [256 atoms] (default: )
Specifies any arguments to be passed to the Javascript code contained in the jsui object.
nofsaa [int] (default: 0)
Toggle full screen anti-aliasing
parameter_enable [int]
Enables use of this object with Max for Live Parameters.
parameter_mappable [int] (default: 1)
When parameter_mappable is enabled, the object will be available for mapping to keyboard or MIDI input using the Mappings feature.
Common Box Attributes
Parameter Attributes
Messages
bang
int
Arguments
float
Arguments
list
Arguments
anything
Arguments
(drag)
autowatch
Arguments
compile
Arguments
delprop
Arguments
editfontsize
Arguments
getprop
Arguments
jsargs
Arguments
jsfile
Arguments
loadbang
(mouse)
open
setprop
Arguments
size
Arguments
height [int]
statemessage
Arguments
wclose
Output
anything
Numbers, lists, or symbols are sent out the jsui object's outlets when the Javascript code executing within the jsui object invokes the outlet function.
See Also
Name | Description |
---|---|
JavaScript Usage | JavaScript Usage |
js | |
jstrigger | |
mxj | |
Javascript in Max | Javascript in Max |
Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals | Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals |
JS Painter Guide | JS Painter Guide |