cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • See how to design an experiment, explore factor-response relationships, assess tradeoffs, and ID best settings. Register for Sep. 11 Mastering JMP.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
AlterEgo
Level III

Self-reference in the hot-spot script ("Set Menu Script"). Is it possible?

Hi,

 

is self-reference possible in the hot-spot commands ("<< Set Menu Script"), similar to "<<Set Function".

E.g., in the example below I'd like to have a hot-spot commands instead of the buttons:

 

Names Default To Here( 1 );

names = {"AAAA", "BBBB", "CCCC", "DDDD"};

New Window( "Example",
	For( i = 1, i <= N Items( names ), i++,
		<<append(
			Outline Box( names[i], Button Box( "Show my name", <<Set Function( Function( {self}, Show( (self << parent) << get title ) ) ) ), )
		)
	)
);

 What I'd like to have is something like below:

 

New Window( "Example",
	For( i = 1, i <= N Items( names ), i++,
		<<append(
			Outline Box( names[i],
				<<Set Menu Script(
					{ "Show my name", <function with reference to self here> },
				)
			)
		)
	)
);

Assigning each outline box to variable is not an option. I need to be able to do it dynamically. Any ideas?

 

 

Thanks

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: Self-reference in the hot-spot script ("Set Menu Script"). Is it possible?

Not sure if there is anything like << set function for outline boxes and their context menu, but you can use Eval(EvalExpr()) (or other methods, Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute ) for quite similar effect

Names Default To Here(1);

names = {"AAAA", "BBBB", "CCCC", "DDDD"};
vlb = V List Box();

For Each({name}, names,
	vlb << append(ob = Outline Box(name));
	Eval(EvalExpr(ob << Set Menu Script(
		{"Show my name", Show(Expr(ob) << get title)}
	)));
);

nw = New Window( "Example", vlb);

(nw << XPath("//OutlineBox")) << Get Menu Script;
-Jarmo

View solution in original post

AlterEgo
Level III

Re: Self-reference in the hot-spot script ("Set Menu Script"). Is it possible?

Thanks! Excellent, just what I need.

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Self-reference in the hot-spot script ("Set Menu Script"). Is it possible?

Not sure if there is anything like << set function for outline boxes and their context menu, but you can use Eval(EvalExpr()) (or other methods, Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute ) for quite similar effect

Names Default To Here(1);

names = {"AAAA", "BBBB", "CCCC", "DDDD"};
vlb = V List Box();

For Each({name}, names,
	vlb << append(ob = Outline Box(name));
	Eval(EvalExpr(ob << Set Menu Script(
		{"Show my name", Show(Expr(ob) << get title)}
	)));
);

nw = New Window( "Example", vlb);

(nw << XPath("//OutlineBox")) << Get Menu Script;
-Jarmo
AlterEgo
Level III

Re: Self-reference in the hot-spot script ("Set Menu Script"). Is it possible?

Thanks! Excellent, just what I need.

Recommended Articles