The Solution? Just ask the window if it is closing! Use retstack to see which programs are running, if WINDOW.CLOSE is in the stack, you are already closing. The code is as follows:
0001 declare function retstack
0002 * Pre-write ... Do some stuff ...
0003 Call Forward_Event()
0004 * Post-Write ... Do some stuff ...
0005 stack = retStack()
0006 cmd = "CLOSE.WINDOW"
0007 is_closing = IndexC(stack,cmd,1)
0008 if is_closing else
0009 Call Send_Event(@window, 'CLOSE')
0010 end
0002 * Pre-write ... Do some stuff ...
0003 Call Forward_Event()
0004 * Post-Write ... Do some stuff ...
0005 stack = retStack()
0006 cmd = "CLOSE.WINDOW"
0007 is_closing = IndexC(stack,cmd,1)
0008 if is_closing else
0009 Call Send_Event(@window, 'CLOSE')
0010 end
No comments:
Post a Comment