Discussion:
Application.ProcessMessages alternative
Graeme Geldenhuys
2007-08-23 15:02:06 UTC
Permalink
Hi,

Anybody know what is a alternative (non-GUI) way for the
Application.ProcessMessages call?

I'm trying to make tiOPF's Core code non-GUI, but not sure what to do
with this call. It's used in a TerminateThreads() method.

Regards,
- Graeme -
Michael Van Canneyt
2007-08-23 16:46:14 UTC
Permalink
Post by Graeme Geldenhuys
Hi,
Anybody know what is a alternative (non-GUI) way for the
Application.ProcessMessages call?
There isn't.

Under Linux, the following works

While Not Terminated do
fppause;

But that doesn't translate to windows.

Michael.
Graeme Geldenhuys
2007-08-23 17:47:49 UTC
Permalink
Post by Michael Van Canneyt
Post by Graeme Geldenhuys
Anybody know what is a alternative (non-GUI) way for the
Application.ProcessMessages call?
There isn't.
Under Linux, the following works
While Not Terminated do
fppause;
That's interesting. What's everything happening in the
"ProcessMessages" method that only relates to GUI's then? Wouldn't
Service (Daemon) type applications also require something like that?

I hope the 'fppause' method has been documented. :-) I've never used it before.
Post by Michael Van Canneyt
But that doesn't translate to windows.
That's actually ok I guess. Windows doesn't have a true non-GUI
platform like Linux does. By that I mean, if it's a Windows
application, it's pretty much guaranteed that it has a GUI available.
The same can't be said for Linux executables.

At the moment I wrapped the Application.ProcessMessages with a IFDEF
MSWINDOWS and nothing for Linux. As I mentioned, I would have to test
how this affects Linux of implement your hint from above.

BTW:
tiOPF Core is now finally GUI free! :-) Tomorrow I can start
porting the GUI Mediators for fpGUI controls. (at last!)


Regards,
- Graeme -
Marc Santhoff
2007-08-23 22:13:42 UTC
Permalink
Post by Graeme Geldenhuys
Hi,
Anybody know what is a alternative (non-GUI) way for the
Application.ProcessMessages call?
I'm trying to make tiOPF's Core code non-GUI, but not sure what to do
with this call. It's used in a TerminateThreads() method.
In a program using only fpc with gtk1 (no lazarus/LCL) I've used the
gtk-way of doing it:

while (gtk_events_pending()=gtk_true) do gtk_main_iteration ();

I'm pretty sure nearly each windowing library has it's own message loop.

HTH,
Marc

Loading...