diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-13 00:44:27 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-13 00:44:27 -0400 |
| commit | 5995af00e6fa544da67b2f3c4e49adaf40bd84c2 (patch) | |
| tree | 040e31d61ec996a90de34957209ad757e4598fc8 /new/window_windows.c | |
| parent | 876971ad41f8b5cb3353eecdd883795ed056d0c5 (diff) | |
Fixed initial content area size on uiWindows.
Diffstat (limited to 'new/window_windows.c')
| -rw-r--r-- | new/window_windows.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/new/window_windows.c b/new/window_windows.c index 0bac04b..fb92c0d 100644 --- a/new/window_windows.c +++ b/new/window_windows.c @@ -31,6 +31,8 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA case WM_WINDOWPOSCHANGED: if ((wp->flags & SWP_NOSIZE) != 0) break; + // fall through + case msgUpdateChild: if (GetClientRect(w->hwnd, &r) == 0) logLastError("error getting window client rect for resize in uiWindowWndProc()"); contenthwnd = uiParentHWND(w->content); @@ -160,7 +162,9 @@ void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *data) void uiWindowSetChild(uiWindow *w, uiControl *c) { uiParentSetChild(w->content, c); - uiParentUpdate(w->content); + // don't call uiParentUpdate(); instead, synthesize a resize + // otherwise, we'll have a 0x0 content area at first + SendMessageW(w->hwnd, msgUpdateChild, 0, 0); } int uiWindowMargined(uiWindow *w) |
