[comp.windows.x] Which shell type should I use?

jik@PIT-MANAGER.MIT.EDU (Jonathan I. Kamens) (10/25/89)

  Problem: I want to pop up an error message shell containing a form
which contains a label an an "OK" button.  The shell should have the
following characteristics:

1. It should not move independent of the application window.  That is,
   if I move the shell, the application moves the same amount in the
   same direction, and vice versa.
2. It should iconify when the application is iconified, and not
   otherwise.
3. Its geometry should be relative to the application window, not to
   the screen.
4. It should be constrained by the application window.

(These first four items suggest that the window created by the shell
should be a sub-window of the application's main window.)

5. I should be able to change the keyboard focus on it
   (XtSetKeyboardFocus).
6. I should be able to use XtMoveWidget on it, or change its location
   in some other way after it is realized but before it is popped up,
   without an ICCCM-compliant window-manager ignoring my movements.

  Thus far, I have tried using overrideShellWidgetClass and
transientShellWidgetClass.  Neither of them meets criteria 1, 3, or 4.
The transient shell meets 2 and 5, but not 6.  The override shell
meets 6, but not 2 or 5.

  So, neither of these shell classes is going to do what I want,
unless I'm missing something.  *IS* there a shell that has the
qualities I'm looking for?

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-4261			      Home: 617-782-0710

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (10/27/89)

>   Problem: I want to pop up an error message shell containing a form
> which contains a label an an "OK" button.  The shell should have the
> following characteristics:

[ Specifics deleted. ]

>  So, neither of these shell classes is going to do what I want,
> unless I'm missing something.  *IS* there a shell that has the
> qualities I'm looking for?

It seems to me that you don't want a shell at all, that what you really want is
an unmanaged child of the application shell that contains your application.  If
you do not mananage a child widget it will be ingored by its parent, and you
will be able to move it around all you want with XtSetValues() on XtNx and
XtNy.

This solution should meet all of your criteria, and you don't have to deal with
the window manager at all.


						Good Luck,

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213

jik@PIT-MANAGER.MIT.EDU (Jonathan I. Kamens) (10/27/89)

   From: kit@expo.lcs.mit.edu (Chris D. Peterson)
   Date: Thu, 26 Oct 89 14:08:39 -0400

   It seems to me that you don't want a shell at all, that what you
   really want is an unmanaged child of the application shell that
   contains your application.  If you do not mananage a child widget
   it will be ingored by its parent, and you will be able to move it
   around all you want with XtSetValues() on XtNx and XtNy.

   This solution should meet all of your criteria, and you don't have
   to deal with the window manager at all.

  Sigh.  There's one criterion I forgot about.  It's a wish, but not
a requirement; namely, I want to be able to use XtPopup and XtPopdown
on the widget, as well, as being able to use the MenuPopup and
MenuPopdown action procedures.  It is my understanding that you can
only use these functions with shells?

  If I have to, I'll write my own routines to pop up and pop down the
box (it's for an error message) and direct all keyboard input to it,
but doing an XtPopup is just so much easier :-).

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-4261			      Home: 617-782-0710

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (10/27/89)

> I want to be able to use XtPopup and XtPopdown
> on the widget, as well, as being able to use the MenuPopup and
> MenuPopdown action procedures.  It is my understanding that you can
> only use these functions with shells?

You understand correctly.  Looks like you had better start writing your own
functions and action routines :-)

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213

swick@ATHENA.MIT.EDU (Ralph R. Swick) (11/09/89)

>> (jik)
>> I want to be able to use XtPopup and XtPopdown
>> on the widget, as well, as being able to use the MenuPopup and
>> MenuPopdown action procedures.  It is my understanding that you can
>> only use these functions with shells?

> (kit)
> You understand correctly.  Looks like you had better start writing your own
> functions and action routines :-)

You could also subclass a shell (probably OverrideShell would be
your best bet) and make the realize proc create a subwindow of
the parent rather than a top-level window.  Best of both worlds :-)