nw = new window("graphs", vlb = v list box());
dirname = "jpegs";
set default directory(dirname);
foreach({jpeg}, files in directory(dirname), // dexter.jpg, samurai_jack.jpg, spongebob.jpg
img = new image(jpeg);
msg = eval insert("\!"^jpeg^\!"");
h = graphbox(
<<Add Image(
image( img ),
bounds( top( 90 ), Left( 10 ), Bottom( 10 ), Right( 90 ) )
),
mouse trap(
statusmsg( msg )
)
);
vlb<<append( h )
)The above gives me
- 3 graphboxes :white_heavy_check_mark:
- with three correctly rendered images, :white_heavy_check_mark:
- but StatusMsg always sends "Spongebob.jpg". (Without the evalinsert(), just sending jpeg to StatusMsg, it throws an error.)
I want StatusMsg to give me the name of the image whose graphbox I clicked on.
Basically, I can kinda sorta imagine two routes:
1. Eval and related functions? I still haven't dug into that side of JSL very deeply.
2. Xpath? Maybe log the image name in a List; index will correspond with the frame box number.