Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!dcs.leeds.ac.UK!neilb From: neilb@dcs.leeds.ac.UK (Neil Bowers) Newsgroups: comp.windows.x Subject: Re: Help needed mixing Xlib & Athena widgets. Message-ID: <2046.9010230841@csparc2.dcs.leeds.ac.uk> Date: 23 Oct 90 08:41:53 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 41 You said: > When I try to create an Xlib "SimpleWindow" with the previously > created Athena Viewport widget as the parent I get this error: X Error of failed request: BadWindow (invalid Window parameter) Your code: .. viewport = XtCreateManagedWidget( "viewport", boxWidgetClass, <-- viewportWidgetClass ?? ... ); <-------+ win = XCreateSimpleWindow( .. ); | XMapWindow(XtDisplay(viewport),win); | XtRealizeWidget(Toplevel); --------+ .. A widget's window is created when the widget is realized, rather than when the widget is created. Realizing after you create the viewport will get the thing to compile and run, but there is still a serious flaw. The viewport widget will manage a single child *widget*, but not a window. I would suggest you create your own widget which encapsulates the functionality required for the window (see chapter 7 of the Xaw doc on creating new widgets). Hope this helps! Neil =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= = Neil Bowers, JANET : neilb@leeds.dcs = = School of Computer Studies, UUCP : ukc!leeds.dcs!neilb = = University of Leeds, EARN/BITNET : neilb@dcs.leeds.ac.uk = = Leeds LS2 9JT. PHONE : +44 532 335478 = =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= = ignoring the bad things makes you end up believing that bad = = things never happen Julian Barnes = =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=