Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!brl.mil!moss From: moss@brl.mil (Gary S. Moss (VLD/VMB) ) Newsgroups: comp.windows.x Subject: Re: Help needed mixing Xlib & Athena widgets. Message-ID: <14221@smoke.BRL.MIL> Date: 23 Oct 90 14:18:18 GMT References: <2436@dover.sps.mot.com> <1990Oct22.151528@wsl.dec.com> Sender: news@smoke.BRL.MIL Reply-To: moss@brl.mil Distribution: na Organization: Ballistic Research Laboratory Lines: 19 In article <1990Oct22.151528@wsl.dec.com>, klee@wsl.dec.com (Ken Lee) writes: |> 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. I'm sure Ken is right, but you don't really need to write a special purpose widget to do Xlib graphics. I use a core widget "widgetClass" and it works just fine. Initially, I made it a child of a viewport widget, but found that dealing with scroll bars to be less desirable than dragging the image around with the mouse. Now I just use a core widget as a direct child of a form widget and use Xlib calls to draw in a Pixmap and XCopyArea to keep my poor man's graphics widget up to date. No problems so far... Good luck, -Gary