Page 1 of 1

MessageLoop

Posted: 26 Dec 2015 16:23
by Ferenc Nagy
What does the messageLoop:run do in the following main program?

Code: Select all

implement main     open core   clauses     run() :-         _ = mainForm::display(window::getScreenWindow()),         messageLoop::run().   end implement main   goal     mainExe::run(main::run).
What happens if I omit it?

Posted: 26 Dec 2015 20:45
by Thomas Linder Puls
Then your program will simply terminate having done nothing.

The message loop receives windows messages from the message queue and dispatch them to the relevant handling code.

How to run a program without task window

Posted: 27 Dec 2015 12:34
by Ferenc Nagy
Thank you, Thomas.
Explanation for other readers
The quoted main program invokes a form without task window, menu, and other ornaments.
The corresponding two lines of a main program for a MDI project look like this:

Code: Select all

TaskWindow = taskWindow::new(),         TaskWindow:show(),
Hint: I have found the asked main program in the Russian example program Life
among other interesting example programs.

Posted: 27 Dec 2015 14:05
by Thomas Linder Puls
Actually, the vpi::init call in an MDI application corresponds to the messageLoop::run call.