[comp.windows.x.motif] the "message window" in a MainWindow

bruner@sp15.csrd.uiuc.edu (John Bruner) (02/07/91)

I don't read this group regularly, so this may well have been reported
before.  In case it hasn't, however....

I want to define a "message window" as part of my XmMainWindow
widgets.  There seems to be little information about this in my
(version 1.1) manual.  I created a widget (in this case an XmForm
widget) and set the XmNmessageWindow resource with XtSetValues().
Things worked fine until I tried to destroy the parent XmMainWindow,
at which time I was rewarded with a bus error.

I went digging through the source code and discovered the reason for
this.  My message widget was reparented to the clip window, and a
destroy callback was added to invoke XmScrolledWindow's KidKilled()
routine.  (The work window was similarly reparented.)  Finally, when
the clip window's (XmDrawingArea) ChangeManaged procedure was called,
it reparented my message window back to the XmMainWindow.  The destroy
callback assumes that the widget is a child of the clip window, an
assumption which was now invalid.

I kludged around it with XtRemoveAllCallbacks(w, XmNdestroyCallback).
--
John Bruner	Center for Supercomputing R&D, University of Illinois
	bruner@csrd.uiuc.edu		(217) 244-4476