User Tools

Site Tools


ask_display_window_and_process_its_events_windowmanager_.htm
Navigation:  ABC Library Reference > WindowManager > WindowManager Methods >====== Ask (display window and process its events:WindowManager) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

Ask, VIRTUAL

blk2blue.jpg

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.

TipBox.jpg

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.

TipBox.jpg

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

See Also:     Dead, Init, Kill, Run, TakeEvent

ask_display_window_and_process_its_events_windowmanager_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1