Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!decuac!bacchus.pa.dec.com!wsl.dec.com!klee From: klee@wsl.dec.com (Ken Lee) Newsgroups: comp.windows.x Subject: Re: Help needed mixing Xlib & Athena widgets. Message-ID: <1990Oct22.151528@wsl.dec.com> Date: 22 Oct 90 22:15:28 GMT References: <2436@dover.sps.mot.com> Sender: news@wrl.dec.com (News) Reply-To: klee@wsl.dec.com Distribution: na Organization: DEC Western Software Laboratory Lines: 26 In article <2436@dover.sps.mot.com>, cowan@dover.sps.mot.com (Andrew H Cowan) writes: |> When I try to create an Xlib "SimpleWindow" with the previously |> create Athena Viewport widget as the parent I get this error: |> |> X Error of failed request: BadWindow (invalid Window parameter) |> Major opcode of failed request: 1 (X_CreateWindow) |> Resource id in failed request: 0x0 If this isn't in the "frequently asked questions" list, it should be. You are trying to access the XtWindow() of a widget that has not yet been realized. You must realize the window before using XtWindow(). A bigger problem you have is that mixing Xlib and X Toolkit windows this way is a messy kludge. You're much, much better off writing your own widget to handle your Xlib graphics. That way, all of the X Toolkit event, resource, and geometry management facilities will be available to help you, rather than get in your way. Writing a widget is no more complex than mixing Xlib with Xt. Asente & Swick's book "X Window System Tookit" contains an excelent tutorial on writing widgets. -- Ken Lee DEC Western Software Laboratory, Palo Alto, Calif. Internet: klee@wsl.dec.com uucp: uunet!decwrl!klee