Hi,
is self-reference possible in the hot-spot commands ("<< Set Menu Script"), similar to "<
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></APPEND> What I'd like to have is something like below:
New Window( "Example",
For( i = 1, i <= N Items( names ), i++,
<<APPEND> },
)
)
)
)
);</APPEND>Assigning each outline box to variable is not an option. I need to be able to do it dynamically. Any ideas?
Thanks
Thanks! Excellent, just what I need.
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;