Figured it out. Rather than reach for the value of `key` at eval time, we can save it when initializing the GB. Here, we're calling it `beta`, but key/beta are just references to one of words("a b c")
toggle = expr(
x = random integer(10,90);
y = random integer(10,90);
foreach({key}, map,
gb = map[key];
f = gb[framebox(1)];
f << add graphics script(
eval(eval expr( text({x,y}, expr(beta)) )) // change #1
)
)
);
vlb = vlistbox();
map = [=>];
foreach({alpha}, words("a b c"),
map[alpha] = eval(eval expr(graphbox(suppress axes, frame size(100,100),
beta = expr(alpha); // change #2 (plus wrapping GB in eval/eval expr
)));
vlb<<append( map[alpha] )
);
nw3 = new window("ex",outlinebox("what",
{"toggggggle", toggle, "toggle2", toggle2},
vlb
))