Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Chicken or Egg Xtk Problem Message-ID: <8808021817.AA00759@LYRE.MIT.EDU> Date: 2 Aug 88 18:17:45 GMT References: <2926@nicmad.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 34 Date: 26 Jul 88 14:56:19 GMT From: astroatc!nicmad!hill@speedy.cs.wisc.edu (Ray Hill) 1. Is there anyway to find the size the Athena "form" widget will become before it is realized? No, not in the general case. XtQueryGeometry will tell you what geometry a widget would prefer to have (not implemented in R2/Xaw/Form), but the parent has the final say. This propagates all the way up the widget tree until you reach a Shell, which attempts to conform to the child's preferred geometry. You could XtSetMappedWhenManaged(,False) on the shell, realize the sub-tree, examine the geometry and map later. If you are simply attempting to position a dialog box, this would be the best approach. However, the final authority is the window manager (under the user's direction) which doesn't assume control until the window is mapped, so you really can't be sure of your geometry until then. 2. Is there anyway to move a "transient shell" widget after it has been realized? (or popped up once?) Yes, use XtSetValues. You have to have allowShellResize==True or the shell will discard the request. [Note: XtMoveWidget is not the proper procedure, as suggested in another message. It is reserved to the parent of the widget being moved.] It seems impossible to center a "transient shell" widget on the screen with the existing widgets. My "transient shell" widget has a "form" widget as a child. I can't get the size of a "form" widget until after its realized and I can't position the "transient shell" widget after its realized. So how can an arbitrary "transient shell" widget be centered on the screen or over a particular widget? Given a moderately co-operative window manager, changing set_mapped_when_ managed as suggested above is the most convenient method.