samborn@sunrise.com (Kevin Samborn) (01/19/91)
Alright, this has been bothering me for a while. How do you determine if a Shell Widget (or any of its subclasses) has already been popped up? According to the documentation distributed on the R4 tape, this is what a XtPopup does: (This is from page 67) The XtPopup function performs the following: o Calls XtCheckSubclass to ensure popup_shell is a sub- class of Shell. o Returns if the shell's popped_up field is already True. o Calls the callback procedures on the shell's popup_callback list. o Sets the shell popped_up field to True, the shell spring_loaded field to False, and the shell grab_kind field from grab_kind. o If the shell's create_popup_child field is non-NULL, XtPopup calls it with popup_shell as the parameter. o If grab_kind is either XtGrabNonexclusive or XtGrabEx- clusive, it calls: XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False) o Calls XtRealizeWidget with popup_shell specified. o Calls XMapRaised with the window of popup_shell. I understand all this. However, checking the shell's popped_up field is not an acceptable method of determining the shell's state from within an application. Also, in the new Digital Press book by Swick, in the specification section, under the exact same section, headings, etc., the specs are different. For this step, it says that XtPopup (from page 723) o Raises the window and returns if the shell's popped_up field is ^^^^^^^^^^^^^^^^^^^^^ already True. This is what I wanted to do, so I was psyched. But, I checked the source. Guess what- XtPopup does not raise the window unless popped_up is false. So, alas, I am still lost. Sun SPARCstation 1, SunOS 4.0.3, X11r4, Mit patches 1-18. -- kevin samborn samborn@sunrise.com ...!uunet!ezx!samborn