Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!oliveb!orc!decwrl!bacchus.pa.dec.com!asente From: asente@wrl.dec.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: Adding event handlers to windows Message-ID: <1990Jun13.051102.16512@wrl.dec.com> Date: 13 Jun 90 05:11:02 GMT References: <1445.9006120916@kheops.cmi.no> <9006121416.AA07750@expo.lcs.mit.edu> Sender: news@wrl.dec.com (News) Organization: DEC Western Software Lab Lines: 20 To expound a bit upon Chris's solution (and to offer one that *is* fully within the bounds of what is supported in the toolkit)... The best way to take an arbitrary window and "widgetize" it is to write a new widget class. This class can be quite simple; the important thing in it is its realize procedure. Rather than creating a window, the realize procedure assigns an existing window to the widget's window field. When this widget gets realized, its window gets entered into the window-to-widget table directly. This widget should never be managed, but it must be realized. Disclaimer: I haven't tried this with the root window, but it should work. The context I used it in was in a widget for a reparenting window manager; it takes the client window and reparents it to the window of an existing widget. -paul asente asente@decwrl.dec.com ...!decwrl!asente