Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!apple!sun-barr!decwrl!gilroy.pa.dec.com!klee From: klee@gilroy.pa.dec.com (Ken Lee) Newsgroups: comp.windows.x Subject: Re: Xlib graphics within widgets Message-ID: <1915@bacchus.dec.com> Date: 10 Oct 89 22:23:35 GMT References: <46739@bbn.COM> Sender: news@decwrl.dec.com Reply-To: klee@decwrl.dec.com Distribution: na Organization: DEC Western Software Laboratory Lines: 25 In article <46739@bbn.COM>, haines@bbn.com (Ted Haines) writes: > The widget graphics I have seen always create their own > special purpose widget. Is this necessary? Isn't it possible > to use Xlib calls within a widget environment? Drawing on arbitrary widgets is usually not a good idea because 1. many widgets have multiple windows, so you don't know which window you're drawing on 2. event handling is somewhat complicated, and you do need to handle Expose events A better solution is to use a widget that supports arbitrary Xlib drawing. The major widget sets (DECwindows, HP, Motif) have widgets like this. They have straightforward callback interfaces for Expose event handling. The Athena widget set does not have such a widget built in, but the design for one is outlined in the manual. If you won't or can't use one of these widgets, at least try to draw on a core widget so you can be reasonably sure there's only one window there. That's probably the problem you're having now. Ken Lee DEC Western Software Laboratory, Palo Alto, Calif. Internet: klee@decwrl.dec.com uucp: uunet!decwrl!klee