summaryrefslogtreecommitdiff
path: root/new/button_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-07 04:12:03 -0400
committerPietro Gagliardi <[email protected]>2015-04-07 04:12:03 -0400
commit3b52095ab08fdb749d454698721300351eb49ffa (patch)
tree22c7999591fca116055d16d0fd3ad1bac59709da /new/button_windows.c
parenta7293951f75d92a80d4d986ec7dda3fa25ab640b (diff)
Added uiControlHandle() and fixed other uiButton issues.
Diffstat (limited to 'new/button_windows.c')
-rw-r--r--new/button_windows.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/new/button_windows.c b/new/button_windows.c
index a66490d..d7921ad 100644
--- a/new/button_windows.c
+++ b/new/button_windows.c
@@ -38,6 +38,7 @@ uiControl *uiNewButton(const char *text)
struct button *b;
uiWindowsNewControlParams p;
WCHAR *wtext;
+ HWND hwnd;
b = uiNew(struct button);
@@ -52,9 +53,12 @@ uiControl *uiNewButton(const char *text)
p.data = b;
b->c = uiWindowsNewControl(&p);
+ hwnd = (HWND) uiControlHandle(b->c);
wtext = toUTF16(text);
- // TODO set 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;