diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-08 20:01:33 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-08 20:01:33 -0400 |
| commit | 7d349d6a2843c6e0825403448ac28683e688f338 (patch) | |
| tree | 20998202a05e4b74d4e5ff4534fba6d69f3e043d /new/button_windows.c | |
| parent | 317217de5a75eca736a8f7c4adcc17250975bd37 (diff) | |
More TODO resolution.
Diffstat (limited to 'new/button_windows.c')
| -rw-r--r-- | new/button_windows.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/new/button_windows.c b/new/button_windows.c index a257e15..9d3ae65 100644 --- a/new/button_windows.c +++ b/new/button_windows.c @@ -72,6 +72,8 @@ uiControl *uiNewButton(const char *text) p.dwExStyle = 0; p.lpClassName = L"button"; + wtext = toUTF16(text); + p.lpWindowName = wtext; p.dwStyle = BS_PUSHBUTTON | WS_TABSTOP; p.hInstance = hInstance; p.onWM_COMMAND = onWM_COMMAND; @@ -81,12 +83,9 @@ uiControl *uiNewButton(const char *text) p.preferredSize = preferredSize; p.data = b; b->c = uiWindowsNewControl(&p); + uiFree(wtext); hwnd = (HWND) uiControlHandle(b->c); - wtext = toUTF16(text); - if (SetWindowTextW(hwnd, wtext) == 0) - logLastError("error setting button text in uiNewButton()"); - uiFree(wtext); SendMessageW(hwnd, WM_SETFONT, (WPARAM) hMessageFont, (LPARAM) TRUE); b->onClicked = defaultOnClicked; |
