Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ukma!tut.cis.ohio-state.edu!bloom-beacon!RIACS.EDU!davy From: davy@RIACS.EDU Newsgroups: comp.windows.x Subject: XtMainLoop -vs- XtAppMainLoop Message-ID: <8812151918.AA09798@intrepid.riacs.edu> Date: 15 Dec 88 19:18:49 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 43 Here's a weird one. I have an application which does the following: toplevelwidget = XtInititalize(....) CreateSomeWidgets(); XtRealize(toplevelwidget); XFlush(...); /* generally the user positions the first widget through his wm now, unless he specified a location for it */ CreateSomeMoreWidgets(); XtMainLoop(); All widgets are children of toplevelwidget (or some child of it). If I seem to have to call XFlush to map the toplevelwidget widgets so that the widgets made in CreateSomeMoreWidgets will be mapped. If I leave out the XFlush, then they aren't mapped. I assume this is because the user's window manager hasn't asked him to position the toplevelwidget window yet, and so it isn't mapped, meaning the children don't get mapped either. Anyway, this all works just fine. The problem is when I try to use XtAppMainLoop instead of XtMainLoop, since the manual says XtMainLoop is obsolete. I tried two different ways of calling it: XtAppMainLoop(XtCreateApplicationContext()) - The widgets created in CreateSomeWidgets come up, the ones in CreateSomeMoreWidgets do not. The widgets which do come up don't seem to receive any of the events they're supposed to. XtAppMainLoop(XtWidgetToApplicationContext(toplevelwidget)) - The widgets created in CreateSomeWidgets come up, the ones in CreateSomeMoreWidgets do not. The events seem to work okay now, though. What am I doing wrong? I can't find much of an explanation about what the application context is, or what it is for. There's a little tiny bit about it on page 21 of the Xt manual, but that's all I can find. --Dave