Navigation: ABC Library Reference > WindowManager > WindowManager Methods >====== Ask (display window and process its events:WindowManager) ====== | |
Ask, VIRTUAL
The Ask method displays the window and processes its events.
Implementation:
The Run method calls the Ask method only if the Init method returns Level:Benign. Ask RETURNs immediately if the Dead property is True. The Kill method sets the Dead property to True, so calling the Kill method before the Ask method has the effect of shutting down the window procedure before Ask displays the WINDOW.
The Ask method implements the ACCEPT loop for the window and calls the TakeEvent method to handle all events. The ACCEPT loop continues until TakeEvent RETURNs Level:Fatal.
To shut down the window procedure while the Ask method is running, RETURN Level:Fatal from any of the “Take” methods.
The ACCEPT loop CYCLEs when TakeEvent returns Level:Notify.
To immediately stop processing for an event (including stopping resizing and alerted keys), RETURN Level:Notify from any of the “Take” methods.
Example:
WindowManager.Run PROCEDURE
CODE
IF ~SELF.Init()
SELF.Ask
END
SELF.Kill
WindowManager.Ask PROCEDURE
CODE
IF SELF.Dead THEN RETURN .
CLEAR(SELF.LastInsertedPosition)
ACCEPT
CASE SELF.TakeEvent()
OF Level:Fatal
BREAK
OF Level:Notify
CYCLE !Not as dopey at it looks, it is for 'short-stopping' certain events
END
END