diff options
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; |