Home   Archive   Permalink



Close views in reverse order

I am attempting the following code, however unview out1 closes out2 rather than out1 as expected.
    
     out1: layout [text 'out1' button 'Close 2' [unview out2]]
     out2: layout [button 'Close 1' [unview out1]]
     view/new out1
     view/new out2
     do-events
    


posted by:   OneArb     28-Mar-2017/15:41:58-7:00



UNVIEW doesn't take an argument. To close a specific face, you need to use UNVIEW/ONLY.

posted by:   Chris     28-Mar-2017/15:54:47-7:00



I got that example from
    
http://www.rebol.com/docs/words/wunview.html
    
which stipulates a face can be an argument.

posted by:   OneArb     28-Mar-2017/21:17:37-7:00



The explanations at http://www.rebol.com/docs/words/wunview.html are correct:
    
"To close a specific window, use the /only refinement and specify the window's face"
    
The explanation for the code you referenced:
    
"The next example will open two windows, then use UNVIEW/only to close each one separately."
    
Yes, there is a clear error in the example code.

posted by:   Nick     29-Mar-2017/3:53:32-7:00



I imagine rebol.com creator has been asked before.
    
+1 to power-up community to curate rebol.com

posted by:   OneArb     29-Mar-2017/8:09:07-7:00