From: SourceForge.net <no...@so...> - 2004-12-17 15:04:51
|
Bugs item #842945, was opened at 2003-11-15 18:53 Message generated for change (Settings changed) made by chengyemao You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=842945&group_id=12997 Category: 48. Geometry Management Group: obsolete: 8.4.4 >Status: Closed Resolution: None Priority: 5 Submitted By: David Gravereaux (davygrvy) Assigned to: Chengye Mao (chengyemao) Summary: out-of-process embedding support doesn't work (win32) Initial Comment: After some research to find out how, thanks to the tclplugin, these special windows messages need to be handled by a window that will act as a container: // --------- Begin Tk container specials ---------- #define TK_CLAIMFOCUS (WM_USER) #define TK_GEOMETRYREQ (WM_USER+1) #define TK_ATTACHWINDOW (WM_USER+2) #define TK_DETACHWINDOW (WM_USER+3) case TK_CLAIMFOCUS: if (wParam || (GetFocus() != NULL)) { ::SetFocus(pBlank->hAttach); } return 0; case TK_GEOMETRYREQ: ::SetWindowPos(hwnd, NULL, 0, 0, wParam, lParam, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); return 0; case TK_ATTACHWINDOW: pBlank->hAttach = (HWND)wParam; ::SetParent(pBlank->hAttach, hwnd); return 0; case TK_DETACHWINDOW: pBlank->hAttach = NULL; ::PostMessage(hwnd, WM_CLOSE, 0, 0); return 0; // --------- End Tk container specials ---------- And this is working fine for me with: package require Tk toplevel .mdi -use [IRC::makeblank] text .mdi.t pack .mdi.t Yet, I can't resize the window. For each size change change sent, an equal TK_GEOMETRYREQ sent back to return it to where it was. There is no message interface for me to tell it to resize. case WM_SIZE: if (wParam != SIZE_MINIMIZED && pBlank- >hAttach) { goes bang-> //::SendMessage(pBlank->hAttach, TK_GEOMETRYREQ, // LOWORD(lParam), HIWORD (lParam)); forced back-> //::SetWindowPos(pBlank->hAttach, NULL, 0, 0, // LOWORD(lParam), HIWORD (lParam), // SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); NO!!!-> //Tk_GeometryRequest (Tk_HWNDToWindow(pBlank->hAttach), // LOWORD(lParam), HIWORD (lParam)); } // must fall to DefMDIChildProc(), or bad things happen. // break; I can't call any Tk functions or my app becomes dependant on it. I am in the same process and could call Tk functions, but if this window was out-of-process, this would not work and is useless. The ability to send a message to the attached window to tell the geometry manager to resize is required. ---------------------------------------------------------------------- Comment By: Chengye Mao (chengyemao) Date: 2004-12-17 08:26 Message: Logged In: YES user_id=191079 The bug has been fixed for a Tk container. The following files have been changed: tkWinX.c, tkWinEmbed.c, tkWinWm.c and tkWindow.c to process the TK_GEOMETRYREQ message and cleanup container list properly. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-11-18 00:51 Message: Logged In: YES user_id=7549 Played with the example and got it to work. By selectively turning off TK_GEOMETRYREQ when the user is changing the size, the application now works. But.. Here's where it gets strange.. in-process embedding doesn't behave the same way. Although the example is now working, the same logic doesn't work in-process (??). I'd upload an example, but would too large. I'm at a loss for how to solve this. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-11-17 19:08 Message: Logged In: YES user_id=7549 To use the test app, 1) start it up and the messagebox will display the "window id" 2) from a wish process do: toplevel .a -use <window id> text .a.t pack .a.t 3) click the ok on the messagebox, then manipulate the container's size. Resizing is very bouncy and unclean. What's happening is Tk is trying to force it back to where it wants it instead of accepting the size change. 4) now do: destroy .a Notice the container is not told of the unattach. If it was told, the app would close. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-11-16 20:28 Message: Logged In: YES user_id=7549 uploaded isolated test case. Resizing is very unfriendly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=842945&group_id=12997 |