Trouble with multiple top-level shells

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Trouble with multiple top-level shells

Submitted by Anonymous on Thu, 02/28/2002 - 13:45. Developers
Hi, I am having trouble with an application that does not have a main window but needs to display zero, one, or more windows now and then. These windows can be deleted by the user in an arbitrary sequence. The windows may not be popups but must be managed by the window manager.

I forgot to say that I am programming on CDE / Solaris 2.6 and 8.

The X and Motif docs tell me that I need to have only one main shell of class applicationShellWidgetClass, and that all further shells "should" be of class topLevelShellWidgetClass. However, this does not apply to my case, so all I can do is either have one invisible applicationShell and all windows of topLevelShell, or create all windows with applicationShells. Neither of those approaches work. I am getting into trouble after the first window is deleted. Purify reports memory violations deep inside the X libraries.

How should I create my shells and windows correctly?

Thanks for any hint.

ICS_support

The first approach should work. You do your normal XtOpenApplication() or Xt*AppInitialize() call to get an application shell. There should be one of these, at most, per application. Then, for subsequent windows, use XtCreatePopupShell() (http//www.motifzone.com/resources/man/XtCreatePopupShell.html), naming the topLevelShellWidgetClass as the widget to create. You make them appear via XtPopup().

And it should work. Now, occasionally Purify reports errors within Xlib which are not true errors. For example, it can report a UMR for the sorts of structure-copies that Xlib often does. If you post the trace, we can help figure out whether it is a real problem or not.

Anonymous

Thanks for the clarification. I will try and eventually come back if I don`t succeed. Oh well, I should also come back if I succeed -)