Path: utzoo!censor!geac!jtsv16!uunet!mcsun!sunic!luth!eru!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Novice question Message-ID: <8909071536.AA00935@LYRE.MIT.EDU> Date: 7 Sep 89 15:36:07 GMT References: <110@euteal.ele.tue.nl> Organization: DEC/MIT Project Athena Lines: 25 > How can I get an ordinary window into the widget > hierarchy? Ordinary means: a window in which I can draw > using the Xlib primitives. You can't insert an existing plain window directly into the widget hierarchy; it needs a "widget wrapper" around it to be understood by the rest of Xt. Any window created by any widget is "ordinary" in the sense that any Xlib primitive works on it; that's how widgets 'do their thing'. There are numerous ways to get a widget set to create a window for you into which you can draw (i.e. without interfering with any drawing that the widget may be trying to do). Some widget sets have a "Canvas" or "Window" widget expressly for this purpose but they typically do much more than you want or leave out something of importance (such as a third pixel value, etc.). At the most basic level, you can simply create an instance of the Core widget. The class name for Core is just widgetClass. You can then register event handlers on this widget to handle such things as Expose. If you want Xt to automatically get resources for you and compress exposure events as it does for other widgets, then you should read the last section of the Athena Widgets manual and modify the Template widget to suit your needs.