diff options
Diffstat (limited to 'iup/src/mot/iupmot_loop.c')
-rwxr-xr-x | iup/src/mot/iupmot_loop.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/iup/src/mot/iupmot_loop.c b/iup/src/mot/iupmot_loop.c index 828ddcd..c1f92ec 100755 --- a/iup/src/mot/iupmot_loop.c +++ b/iup/src/mot/iupmot_loop.c @@ -56,7 +56,7 @@ void iupdrvSetIdleFunction(Icallback f) mot_idle_id = XtAppAddWorkProc(iupmot_appcontext, motIdlecbWorkProc, NULL); } -static int motLoopStep(void) +static int motLoopProcessEvent(void) { XtAppProcessEvent(iupmot_appcontext, XtIMAll); return (mot_exitmainloop)? IUP_CLOSE : IUP_DEFAULT; @@ -79,7 +79,7 @@ int IupMainLoop(void) while (!mot_exitmainloop) { - if (motLoopStep() == IUP_CLOSE) + if (motLoopProcessEvent() == IUP_CLOSE) break; } @@ -88,19 +88,26 @@ int IupMainLoop(void) return IUP_NOERROR; } +int IupLoopStepWait(void) +{ + while(!XtAppPending(iupmot_appcontext)); + + return motLoopProcessEvent(); +} + int IupLoopStep(void) { if (!XtAppPending(iupmot_appcontext)) return IUP_DEFAULT; - return motLoopStep(); + return motLoopProcessEvent(); } void IupFlush(void) { while (XPending(iupmot_display) != 0) { - if (motLoopStep() == IUP_CLOSE) + if (motLoopProcessEvent() == IUP_CLOSE) break; } |