diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-09 11:12:01 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-09 11:12:01 -0400 |
| commit | 79a7e18b8da55b4bcec72cc66f9b4e07878e7eee (patch) | |
| tree | 1c3b3873576e80ee73cc8a6281cef5e0ef03b1be /new/newcontrol_windows.c | |
| parent | 1f18d88f565844436fb4487b596175ba48138c05 (diff) | |
Implemented the text functions on Windows.
Diffstat (limited to 'new/newcontrol_windows.c')
| -rw-r--r-- | new/newcontrol_windows.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/new/newcontrol_windows.c b/new/newcontrol_windows.c index ce7bad4..56719b3 100644 --- a/new/newcontrol_windows.c +++ b/new/newcontrol_windows.c @@ -123,3 +123,24 @@ void *uiWindowsControlData(uiControl *c) { return S(c)->data; } + +char *uiWindowsControlText(uiControl *c) +{ + WCHAR *wtext; + char *text; + + wtext = windowText(S(c)->hwnd); + text = toUTF8(wtext); + uiFree(wtext); + return text; +} + +void uiWindowsControlSetText(uiControl *c, const char *text) +{ + WCHAR *wtext; + + wtext = toUTF16(text); + if (SetWindowTextW(S(c)->hwnd, wtext) == 0) + logLastError("error setting control text in uiWindowsControlSetText()"); + uiFree(wtext); +} |
