From: <no...@so...> - 2002-06-05 15:35:21
|
Bugs item #564897, was opened at 2002-06-05 10:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=564897&group_id=12997 Category: 67. Win Window Operations Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rick Hedin (rhedin) Assigned to: Chengye Mao (chengyemao) Summary: application doesn't activate Initial Comment: If yours is an embedded application, clicking a widget in a Tk window may not activate your application. It will fail to activate it if your main window is a Windows window. Following is some code from the WmProc function in the tkWinWm.c file that I found solves the problem. case WM_MOUSEACTIVATE: { ActivateEvent *eventPtr; winPtr = GetTopLevel((HWND) wParam); /* * If you have Tcl embedded in a C application, * your Windows windows may be above your Tcl windows * in the window hierarchy. In this case, the message * goes to the main application window. Since the application * window is above all the Tk windows, and isn't a Tk window itself, * when we try to "get its toplevel" we get a null pointer. * The result is that the applicate doesn't activate * if we click a widget in the application. The !winPtr || portion * ensures that the message is passed through and * the application activates. */ if (!winPtr || winPtr && (TkGrabState (winPtr) != TK_GRAB_EXCLUDED)) { /* * This allows us to pass the message onto the * native menus [Bug: 2272] */ result = DefWindowProc(hwnd, message, wParam, lParam); goto done; } I hope that correct operation of Tk in an embedded context is a priority for the Tcl community. Regards, Rick ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=564897&group_id=12997 |