diff options
Diffstat (limited to 'pugl/detail/mac.m')
-rw-r--r-- | pugl/detail/mac.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 6d156c6..bf845fc 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -777,6 +777,7 @@ puglCreateWindow(PuglView* view, const char* title) view->minHeight)]; } impl->window = window; + puglSetWindowTitle(view, title); ((NSWindow*)window).delegate = [[PuglWindowDelegate alloc] initWithPuglWindow:window]; @@ -943,6 +944,23 @@ puglGetNativeWindow(PuglView* view) } PuglStatus +puglSetWindowTitle(PuglView* view, const char* title) +{ + puglSetString(&view->title, title); + + NSString* titleString = [[NSString alloc] + initWithBytes:title + length:strlen(title) + encoding:NSUTF8StringEncoding]; + + if (view->impl->window) { + [view->impl->window setTitle:titleString]; + } + + return PUGL_SUCCESS; +} + +PuglStatus puglSetFrame(PuglView* view, const PuglRect frame) { PuglInternals* const impl = view->impl; |