summaryrefslogtreecommitdiff
path: root/new/window_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-09 11:12:01 -0400
committerPietro Gagliardi <[email protected]>2015-04-09 11:12:01 -0400
commit79a7e18b8da55b4bcec72cc66f9b4e07878e7eee (patch)
tree1c3b3873576e80ee73cc8a6281cef5e0ef03b1be /new/window_windows.c
parent1f18d88f565844436fb4487b596175ba48138c05 (diff)
Implemented the text functions on Windows.
Diffstat (limited to 'new/window_windows.c')
-rw-r--r--new/window_windows.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/new/window_windows.c b/new/window_windows.c
index 88e7aae..2a5603f 100644
--- a/new/window_windows.c
+++ b/new/window_windows.c
@@ -116,7 +116,26 @@ uintptr_t uiWindowHandle(uiWindow *w)
return (uintptr_t) (w->hwnd);
}
-// TODO titles
+char *uiWindowTitle(uiWindow *w)
+{
+ WCHAR *wtext;
+ char *text;
+
+ wtext = windowText(w->hwnd);
+ text = toUTF8(wtext);
+ uiFree(wtext);
+ return text;
+}
+
+void uiWindowSetTitle(uiWindow *w, const char *text)
+{
+ WCHAR *wtext;
+
+ wtext = toUTF16(text);
+ if (SetWindowTextW(w->hwnd, wtext) == 0)
+ logLastError("error setting window title in uiWindowSetTitle()");
+ uiFree(wtext);
+}
void uiWindowShow(uiWindow *w)
{