Xref: utzoo comp.windows.news:2565 comp.windows.open-look:1157 Newsgroups: comp.windows.news,comp.windows.open-look Path: utzoo!utgpu!watserv1!watcgl!mud.waterloo.edu!bmacinty From: bmacinty@mud.waterloo.edu (Blair MacIntyre) Subject: Getting focus notification in TNT2.0 Beta Message-ID: <1991Apr9.062834.19405@watcgl.waterloo.edu> Sender: news@watcgl.waterloo.edu (USENET News System) Organization: Computer Graphics Laboratory, University of Waterloo, Ontario, Canada Date: Tue, 9 Apr 1991 06:28:34 GMT Lines: 36 I'm writing a window class (subclass of ClassBaseWindow) and I want to be notified when the window gets/loses the focus. I've been trying various things for most of the evening (and night) and cannot seem to get it to work. From poking around in the classes, I came to the conclusion that what I want to do is activate FocusNoticeService (ClassBag) and override HandleFocusNotice in my class. I should then get events of type AcceptFocus, RestoreFocus and LoseFocus. So, I tried setting a Class variable FocusNoticeable? to true. Nothing. I tried calling setfocusnoticeable with a true parameter. Nothing. I know that I'm activating the window (I'm testing things with a simple program based on the manual.colors demo) so active in ClassBag should be being called, which means the Focus should be being activated. The HandleFocusNotice function is just not being called. Period. Questions: am I missing something obvious? I managed to get TrackCrossing events (EnterEvent, ExitEvent) using a similar approach. is this the right way to get focus events? Is there another way? Is there any way? Help! -- Blair MacIntyre, Computer Graphics Lab Dept. of Computer Science, University of Waterloo, Waterloo, ON, Canada, N2L3G1 {bmacintyre@{watcgl|violet|watdragon}}.{waterloo.edu|uwaterloo.ca}