[comp.windows.x.motif] Popup's cause lock-up of XmText

david@twg.com (David S. Herron) (11/09/90)

Problem: Occasionally, after a popup-dialog, the application will partially
	`lock up'.  Specifically, focusCallback on XmText widgets work but
	the keyboard translations stop working.

Workaround: Off the menu is a popup-dialog .. bring that up and press its
	|ABORT| button.

The difference between the two popups is in the parentage.

The application has a central screen which is a XmMainWindow & which
has very little on this screen.  The real meat of the application is
accessed via menu selections on this central screen.

Each of the `side' applications do an XtCreateApplicationShell() to create
a `top_level' widget, and I am using XmMainWindow inside that.  Each branch
of the application is two screens deep -- that is;

	main screen -> applicationShell -> applicationShell

But this doesn't seem important since the top level widget isn't told
anything about parentage.  I'm just mentioning this for completeness.

Inside each of these the hierarchy is:

	topLevelShellWidgetClass
		XmMainWindow
			...menu bar...
			XmForm
				...stuff...

The XmForm is passed in as the work_region argument to XmMainWindowSetAreas().

The popups I am having trouble with start from somewhere underneath the
XmForm in work_region.  But instead of being told that their parent is
the widget from which they were activated (Example: I have a scrolling
list thing I use.. part of it is a `delete' button.. before actually
doing the deletion I pupup up a XmFormDialog asking "Are you sure?"
with |YES| and |NO| buttons..), the parent (passed in XmCreateFormDialog()
in this example) is the top_level widget at the very top of the hierarchy.

I used to have a dialog like this parented from the |DELETE| button
(for instance) but had some problem which I don't remember right now.

The parent of the popup started from the menu_bar is the button
in the menu_bar which started this dialog.

Since discovering this difference I've changed these popups so that their
parent is the XmForm & I haven't had a problem since.

Questions:  Do I have the right solution?  Is there more which y'all
	need to know?  Is this a known problem?  How the fart is
	somebody to know the correct parentage to use?  (This isn't
	discussed well in any manual I have -- The O'Reilly books,
	OSF's Motif Programmers Guide (which is just as useless as
	always), and Young's Xt+Motif book).

One of the entries in the beta-Frequently-Asked-Questions was somewhat
similar & talked about keyboard grabs.  I barked up that tree for awhile
without gaining any understanding.

-- 
<- David Herron, an MMDF & WIN/MHS guy, <david@twg.com>
<- Formerly: David Herron -- NonResident E-Mail Hack <david@ms.uky.edu>
<-
<- Use the force Wes!