Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How exit from XtAppMainLoop()?

3 views
Skip to first unread message

Victor V. Ploshikhin

unread,
Dec 2, 1999, 3:00:00 AM12/2/99
to
Hi!

The problem in the subject. In my programm it nedds to do some things
after graphic part ends. But when I destroy top level shell programm
stops at MainLoop... So how exit from main loop?

Thanks in advance.

Victor

Chuck Dillon

unread,
Dec 2, 1999, 3:00:00 AM12/2/99
to

You can't but it's a trivial function so roll your own.
Or consider using destroy callbacks.
Or use atexit.
Or use XmAddWMProtocolCallback to watch for WM_DELETE_WINDOW messages.

RTFM

-- ced

--
Chuck Dillon
Senior Software Engineer
Genetics Computer Group, a subsidiary of Oxford Molecular

David B. Lewis

unread,
Dec 3, 1999, 3:00:00 AM12/3/99
to Victor V. Ploshikhin
|> stops at MainLoop... So how exit from main loop?

Use your own main loop, or use XtAppSetExitFlag().

--
David B. Lewis Editor, The Motif Developer: http://www.motifzone.com/tmd/
d...@motifzone.com WebWrangler, The Motif Zone: http://www.motifzone.com/

Owen Lawrence

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to
>Use your own main loop, or use XtAppSetExitFlag().


My man page says only this:

"To indicate that an application context should exit, use XtAppSetExitFlag."

How should I interpret this? If I call XtAppSetExitFlag()
will my application actually exit (i.e. will exit() be called?)
or will it only exit the main loop? I'd prefer the latter
since I need to do some cleanup and output some status
messages when exitting the program.

- Owen -

Dan Mercer

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to
In article <0k934.38555$m4.125...@news.magma.ca>,

If you had tested instead of posting you would have discovered that
control goes to the statement following the XtAppMainLoop() call.

--
Dan Mercer
dame...@uswest.net

Opinions expressed herein are my own and may not represent those of my employer.


ken...@nojunk.rahul.net

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to
In article <0k934.38555$m4.125...@news.magma.ca>,

Owen Lawrence <ow...@davis-eng.on.ca> wrote:
>My man page says only this:
>
>"To indicate that an application context should exit, use XtAppSetExitFlag."
>
>How should I interpret this? If I call XtAppSetExitFlag()
>will my application actually exit (i.e. will exit() be called?)
>or will it only exit the main loop? I'd prefer the latter
>since I need to do some cleanup and output some status
>messages when exitting the program.

Remember that the Xt source code is publically available, so you can
easily figure this out. If you want to exit immediately, just call exit().
XtAppSetExitFlag just ends the main loop.
--
Ken Lee, http://www.rahul.net/kenton/

David B. Lewis

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to Owen Lawrence
|> My man page says only this:
|>
|> "To indicate that an application context should exit, use XtAppSetExitFlag."

It would be better as:

"To indicate that an application context should exit THE MAIN LOOP, use
XtAppSetExitFlag."

|> How should I interpret this? If I call XtAppSetExitFlag()

Doing so flips a flag that is checked in XtAppMainLoop(), which continues
until that flag is flipped.

|> or will it only exit the main loop? I'd prefer the latter

Yes.

The typical use of this function is in an Xt signal handler.

Owen Lawrence

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to
>|> How should I interpret this? If I call XtAppSetExitFlag()
>
>Doing so flips a flag that is checked in XtAppMainLoop(), which continues
>until that flag is flipped.
>
>|> or will it only exit the main loop? I'd prefer the latter
>
>Yes.


Thanks.

- Owen -

0 new messages