aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-08-04 20:44:54 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:34:39 +0200
commit4c07a013d0943985f156101f1123c518da5fc590 (patch)
tree5e0a767e70b9921f713ce2142c4cdd3a1dd9a693 /pugl/detail/mac.m
parent89af2b1e3910196c4cad47c3748c1a2920b3faf9 (diff)
downloadpugl-4c07a013d0943985f156101f1123c518da5fc590.tar.gz
pugl-4c07a013d0943985f156101f1123c518da5fc590.tar.bz2
pugl-4c07a013d0943985f156101f1123c518da5fc590.zip
Add puglSetWindowTitle()
Diffstat (limited to 'pugl/detail/mac.m')
-rw-r--r--pugl/detail/mac.m18
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;