From: <ti...@ma...> - 2004-01-13 20:55:09
|
new idea: searching for spots where eventStatus.stopProcessing is changed, I find that it only occurs in mouse or keyboard processing, and not in window identification; so, shouldn't it? Could it be that tk is grabbing all window events, checking to see if it owns it or not, then blindly goes ahead and processes the event? Here's the function: int TkMacOSXProcessWindowEvent( TkMacOSXEvent * eventPtr, MacEventStatus * statusPtr) { OSStatus status; WindowRef whichWindow; Window window; int eventFound; switch (eventPtr->eKind) { case kEventWindowActivated: case kEventWindowDeactivated: case kEventWindowUpdate: break; default: return 0; break; } status = GetEventParameter(eventPtr->eventRef, kEventParamDirectObject, typeWindowRef, NULL, sizeof(whichWindow), NULL, &whichWindow); if (status != noErr) { fprintf ( stderr, "TkMacOSXHandleWindowEvent:Failed to retrieve window" ); return 0; } window = TkMacOSXGetXWindow(whichWindow); switch (eventPtr->eKind) { case kEventWindowActivated: eventFound |= GenerateActivateEvents(window, 1); eventFound |= GenerateFocusEvent(window, 1); break; case kEventWindowDeactivated: eventFound |= GenerateActivateEvents(window, 0); eventFound |= GenerateFocusEvent(window, 0); break; case kEventWindowUpdate: if (GenerateUpdateEvent(window)) { eventFound = true; } break; } return 0; } ...so nothing happens if TkMacOSXGetXWindow(whichWindow); doesn't return an XWindow, right? And it shouldn't return an XWindow in my Gem-created window case, right? At the moment, I'm having trouble tracking down the "Window" typedef, but would it just return NULL if the window isn't in the tk window manger list? l8r, jamie |