diff options
author | David Robillard <d@drobilla.net> | 2019-08-04 20:44:54 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-09-03 08:34:39 +0200 |
commit | 4c07a013d0943985f156101f1123c518da5fc590 (patch) | |
tree | 5e0a767e70b9921f713ce2142c4cdd3a1dd9a693 /pugl/detail/win.c | |
parent | 89af2b1e3910196c4cad47c3748c1a2920b3faf9 (diff) | |
download | pugl-4c07a013d0943985f156101f1123c518da5fc590.tar.gz pugl-4c07a013d0943985f156101f1123c518da5fc590.tar.bz2 pugl-4c07a013d0943985f156101f1123c518da5fc590.zip |
Add puglSetWindowTitle()
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r-- | pugl/detail/win.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c index efd6070..e761654 100644 --- a/pugl/detail/win.c +++ b/pugl/detail/win.c @@ -161,10 +161,8 @@ puglCreateWindow(PuglView* view, const char* title) return 3; } - wchar_t* wtitle = puglUtf8ToWideChar(title); - if (wtitle) { - SetWindowTextW(impl->hwnd, wtitle); - free(wtitle); + if (title) { + puglSetWindowTitle(view, title); } SetWindowLongPtr(impl->hwnd, GWLP_USERDATA, (LONG_PTR)view); @@ -776,6 +774,20 @@ puglGetNativeWindow(PuglView* view) } PuglStatus +puglSetWindowTitle(PuglView* view, const char* title) +{ + puglSetString(&view->title, title); + + wchar_t* wtitle = puglUtf8ToWideChar(title); + if (wtitle) { + SetWindowTextW(view->impl->hwnd, wtitle); + free(wtitle); + } + + return PUGL_SUCCESS; +} + +PuglStatus puglSetFrame(PuglView* view, const PuglRect frame) { view->frame = frame; |