Fixed other build errors. IT WORKS! but isn't quite clean now...

This commit is contained in:
Pietro Gagliardi 2015-08-17 01:52:06 -04:00
parent a5a9c464bf
commit edd2bf81e1
2 changed files with 14 additions and 1 deletions

View File

@ -197,6 +197,9 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy)
[b->children addObject:[NSValue valueWithPointer:c]];
[b->stretchy addObject:[NSNumber numberWithInt:stretchy]];
uiControlSetParent(c, uiControl(b));
[b->view addSubview:childView];
// TODO save the old hugging priorities
// if a control is stretchy, it should not hug in the primary direction
// otherwise, it should *forcibly* hug
@ -208,7 +211,6 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy)
// make sure controls don't hug their secondary direction so they fill the width of the view
setHuggingPri(childView, NSLayoutPriorityDefaultLow, b->secondaryOrientation);
uiControlSetParent(c, uiControl(b));
relayout(b);
}
@ -216,9 +218,12 @@ void uiBoxDelete(uiBox *b, uintmax_t n)
{
NSValue *v;
uiControl *removed;
NSView *removedView;
v = (NSValue *) [b->children objectAtIndex:n];
removed = (uiControl *) [v pointerValue];
removedView = (NSView *) uiControlHandle(removed);
[removedView removeFromSuperview];
uiControlSetParent(removed, NULL);
[b->children removeObjectAtIndex:n];
[b->stretchy removeObjectAtIndex:n];

View File

@ -15,6 +15,11 @@ void osCommitShow(uiControl *c)
NSView *view;
view = (NSView *) uiControlHandle(c);
// TODO
if ([view isKindOfClass:[NSWindow class]]) {
[view makeKeyAndOrderFront:view];
return;
}
[view setHidden:NO];
}
@ -50,6 +55,9 @@ void uiDarwinFinishControl(uiControl *c)
view = (NSView *) uiControlHandle(c);
[view retain];
// TODO omit this for uiWindow properly
if ([view respondsToSelector:@selector(setTranslatesAutoresizingMaskIntoConstraints:)])
[view setTranslatesAutoresizingMaskIntoConstraints:NO];
}
void uiDarwinSetControlFont(NSControl *c, NSControlSize size)