Path: utzoo!attcan!uunet!lll-winken!ames!hc!pprg.unm.edu!unmvax!tut.cis.ohio-state.edu!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: probs with popup windows Message-ID: <8905051611.AA10212@expo.lcs.mit.edu> Date: 5 May 89 16:11:35 GMT References: <2461@lll-lcc.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 58 > My latest idea is to have a dialog widget within a popup shell... Who's latest idea? :-) :-) > I'm having great difficulty getting things to work as stated above. It sounds like you are having problems with your program flow. What you need to do is: 1) When this user selects display popup the dialog widget, and then return from the routine. This will return you to XtMainLoop() which will process events and popup the dialog widget. 2) If cancel is selected then just popdown the dialog, and then exit. This will cause no other action (the desired behavior. 3) If "okay" was selected then check the barcode. a) If it is okay then call your computation routine right here in the okay proc. b) If is it not okay then print an error message and force the user to try again (or whatever. It is important to remember that no event processing will happen when the program is actually in a callback or action routine, all event processing and window operations take place when the program is in the XtMainLoop() fuinction. It is important to spend as little time away from this routine as possible, as no events will be processed while you are off doing something else. This includes both user interactions and window refreshes. > A few other minor questions: Is there a way to set the font for the > text entered by the user in the dialog widget (XtNvalue)? The name of the dialog widgets value entry widget is documented as: "value" Thus you can use a resource specification of the following: **value.Font: If you really want to hard code the font name into the program (very bad practice IMHO) you can use XtNameToWidget() to get the widget id of the the value widget and then do a XtSetValues(). > Am I correct to be using XtGrabExclusive as an argument to XtPopup? It depends upon the behavior that you desire, XtGrabExclusive will lock out event processing in the rest of your application while the grab is active (as long as the menu is up). > If I use XtNvalue with the dialog widget, then I don't need > XtGetValueDialogString, correct? Nope, you should use XtGetValueDialogString(), as the dialog value is copied internally. It is not clear that this is the right behavior, but it seems too late to break things.