looks like code after the view/modal is ignored ...
view [ title "Main Window" button "Open" on-action [ cmd: none view/modal [ title "Child Window" hpanel [ label "Cmd:" f: field button "set command" on-action [ set 'cmd get-face f print cmd close-window face ] ] ] print "this is not evaluated, and how do I set cmd in this context from the modal window" ] ]
The toggle suggests another approach I hadn't thought about. Thanks. However, it doesn't solve my original problem. Here is some obvious pseudo-code that doesn't work. Any ideas/
num: 3 view [ when [enter] on-action [ while [num = 3] [ print num wait 1 ] ] button on-action [ num: 2 ] ]
All action blocks in r3-gui are closures. Set-words will access the local context only. But when searching for a the value of a word, the system/contexts/user is searched after a word is not found in the local context.. So, the enter action block accesses num from system/contexts/user but the button action block is setting a new local of num to 2.
To fix the issue, change num: 2 to set 'num 2, or system/contexts/user/num: 2
Ie. when the closure is created, the action block searches for set-words and creates locals. This is the same as what we used to call 'funct, and now 'function
system/contexts/user/num: 2 works. I knew it was a closure problem, but I don't recall seeing this path in any docs. Thanks.
Well, that's interesting. enter ? system/contexts/user and it looks like a handle on most everything.