summaryrefslogtreecommitdiff
path: root/new/newcontrol_windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'new/newcontrol_windows.c')
-rw-r--r--new/newcontrol_windows.c21
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);
+}