Action of Button on the closest objectHello,
What is the best way to create several analysis objects and to put a button near each one of them?
The button will run some action on the relevant object.
I don't want to use references to the variables but some keywords like "this/parent" etc.
Example:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New window("Window",
VlistBox(
hlistbox(Distribution( Column( :weight ) ),Button Box("Remove Box Plot")),
hlistbox(Distribution( Column( :height ) ),Button Box("Remove Box Plot")),
)
);
Thank you.
Tom.
Re: Action of Button on the closest objectThank you very much. Your answer is very helpful.Re: Action of Button on the closest objectCool question and the answer is yes. Learned something new because I was curious about the answer myself. Here's how I did it:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
bbFunc = Function({this},
dist_ob = ((this << parent) << child) << Get Scriptable Object();
dist_ob << Outlier Box Plot( 0 );
);
New Window( "Window",
V List Box(
H List Box( Distribution( Column( :weight ) ), Button Box( "Remove Box Plot" , << Set Function(bbFunc)) ),
H List Box( Distribution( Column( :height ) ), Button Box( "Remove Box Plot" , << Set Function(bbFunc)) )
)
);Using the << Set Function message instead of just putting bbFunc as the secondond argument was critical. It didn't work otherwise. I found an example for using "this" in the scripting index under Set Function.