Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!bloom-beacon!EXPO.LCS.MIT.EDU!converse From: converse@EXPO.LCS.MIT.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: Popup Dialog box: Some Questions!! Message-ID: <8908141830.AA09913@expo.lcs.mit.edu> Date: 14 Aug 89 18:30:52 GMT References:Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 66 > Donna Converse posted a sample code in this newsgroup about a week ago > which shows how a popup dialog box can be implemented. I have some questions > about the code and anyone on the net who saw the same code, please help me out. > 1. Where are XtNinput and XtNallowShellResize described? Intrinsics Section 4.1.3 "ShellPart Default Values" > The reason for using these resources in this code is not clear to me. Setting the input resource of the shell widget to true lets the window manager know that your application expects to receive user keyboard and/or mouse events. Some window managers will not pass on events to the application unless the application has indicated that it takes input. Setting XtNallowShellResize to true will allow the shell to make resize requests of the window manager in response to a resize request from the the child of the shell. Suppose the user, in the example code, types in a color name that is really long. The popup window expands as the input area expands, because XtNallowShellResize is true. In the example code, I set resizable on the value, but I forgot to set it on the label. If you set resizable on the label you'll see the shell resize as the prompt grows and shrinks. > 2. Why do you have to execute BOTH of the following in PopupPrompt() > routine? What is the exact difference between these 2 calls with respect to > a popup shell? > XtRealizeWidget (popup); > XtPopup (popup, ...); Good, you got me! You don't have to execute both. See section 5.3 "Creating Popup Children". XtPopup will call XtRealizeWidget. > Can you not just XtPopup(popup, ...)? I read somewhere that a popup > shell need not be "realized" if you execute 'XtPopup()' on it. I removed > XtRealizeWidget() call, and the program works! You are right on all points: there is no particular reason to call XtRealizeWidget in this example. Section 5.3 gives a reason why some implementations would want to realize before calling XtPopup. > > 3. Can anyone send me the description of "XtDialogAddButton()" routine? > It is not described in the Instrisics manpages. It is not documented in R3, but if it were, it would be with the Athena widgets. void XtDialogAddButton(dialog, name, function, param) Widget dialog; /* dialog widget */ char *name; /* name of the command button to add to dialog */ void (*function)(); /* button press callback function */ caddr_t param; /* button press callback client data */ > 4. I ran this program, opened the main "popup" window and positioned > it on the screen. Then I MOVED it interactively BEFORE clicking on the > button named "Press to see Simple Demo". The Dialog window appeared at a > place where the main "popup" window had FIRST appeared. > Is the Window Manager causing this problem? This exactly describes a problem in R3 with XtTranslateCoords. Until R4, use XTranslateCoordinates instead. It is not your window manager. Sorry I didn't warn you about this in the example code. Donna Converse converse@expo.lcs.mit.edu