diff options
Diffstat (limited to 'new/window_darwin.m')
| -rw-r--r-- | new/window_darwin.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/new/window_darwin.m b/new/window_darwin.m index 30c3a1a..b74714a 100644 --- a/new/window_darwin.m +++ b/new/window_darwin.m @@ -22,6 +22,8 @@ struct uiWindow { NSWindow *w; + uiContainer *container; + uiControl *child; uiWindowDelegate *d; }; @@ -43,6 +45,9 @@ uiWindow *uiNewWindow(char *title, int width, int height) [w->w setTitle:toNSString(title)]; // TODO substitutions + w->container = [[uiContainer alloc] initWithFrame:NSZeroRect]; + [w->w setContentView:((NSView *) w->container)]; + w->d = [uiWindowDelegate new]; w->d.w = w; w->d.onClosing = defaultOnClosing; @@ -79,3 +84,9 @@ void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *data) w->d.onClosing = f; w->d.onClosingData = data; } + +void uiWindowSetChild(uiWindow *w, uiControl *c) +{ + w->child = c; + (*(w->child->setParent))(w->child, (uintptr_t) (w->container)); +} |
