Fixed the OS X build, including warnings. It works. I'm still a bit unhappy about the way these backends are turning out...
This commit is contained in:
parent
946b3ea342
commit
6b08a2b18f
|
@ -82,5 +82,5 @@ uiButton *uiNewButton(const char *text)
|
||||||
|
|
||||||
bb.uiB = b;
|
bb.uiB = b;
|
||||||
|
|
||||||
return b.uiB;
|
return bb.uiB;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ static void checkboxOnToggled(uiCheckbox *c, void (*f)(uiCheckbox *, void *), vo
|
||||||
{
|
{
|
||||||
uiCheckboxNSButton *cc;
|
uiCheckboxNSButton *cc;
|
||||||
|
|
||||||
cc = (uiCheckboxNSButton *) uiControlHandle(uiCheckbox(c));
|
cc = (uiCheckboxNSButton *) uiControlHandle(uiControl(c));
|
||||||
cc.uiOnToggled = f;
|
cc.uiOnToggled = f;
|
||||||
cc.uiOnToggledData = data;
|
cc.uiOnToggledData = data;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ uiCheckbox *uiNewCheckbox(const char *text)
|
||||||
c = uiNew(uiCheckbox);
|
c = uiNew(uiCheckbox);
|
||||||
|
|
||||||
uiDarwinNewControl(uiControl(c), [uiCheckboxNSButton class], NO, NO);
|
uiDarwinNewControl(uiControl(c), [uiCheckboxNSButton class], NO, NO);
|
||||||
cc = (uiCheckboxNSButton *) uiControlHandle(c);
|
cc = (uiCheckboxNSButton *) uiControlHandle(uiControl(c));
|
||||||
|
|
||||||
[cc setTitle:toNSString(text)];
|
[cc setTitle:toNSString(text)];
|
||||||
[cc setButtonType:NSSwitchButton];
|
[cc setButtonType:NSSwitchButton];
|
||||||
|
|
|
@ -59,7 +59,7 @@ uiEntry *uiNewEntry(void)
|
||||||
e = uiNew(uiEntry);
|
e = uiNew(uiEntry);
|
||||||
|
|
||||||
uiDarwinNewControl(uiControl(e), [uiNSTextField class], NO, NO);
|
uiDarwinNewControl(uiControl(e), [uiNSTextField class], NO, NO);
|
||||||
t = (uiNSTextField *) uiControlHandle(c);
|
t = (uiNSTextField *) uiControlHandle(uiControl(e));
|
||||||
|
|
||||||
[t setSelectable:YES]; // otherwise the setting is masked by the editable default of YES
|
[t setSelectable:YES]; // otherwise the setting is masked by the editable default of YES
|
||||||
finishNewTextField((NSTextField *) t, YES);
|
finishNewTextField((NSTextField *) t, YES);
|
||||||
|
|
|
@ -34,7 +34,7 @@ static void labelSetText(uiLabel *l, const char *text)
|
||||||
[t setStringValue:toNSString(text)];
|
[t setStringValue:toNSString(text)];
|
||||||
}
|
}
|
||||||
|
|
||||||
uiControl *uiNewLabel(const char *text)
|
uiLabel *uiNewLabel(const char *text)
|
||||||
{
|
{
|
||||||
uiLabel *l;
|
uiLabel *l;
|
||||||
uiLabelNSTextField *t;
|
uiLabelNSTextField *t;
|
||||||
|
@ -42,7 +42,7 @@ uiControl *uiNewLabel(const char *text)
|
||||||
l = uiNew(uiLabel);
|
l = uiNew(uiLabel);
|
||||||
|
|
||||||
uiDarwinNewControl(uiControl(l), [uiLabelNSTextField class], NO, NO);
|
uiDarwinNewControl(uiControl(l), [uiLabelNSTextField class], NO, NO);
|
||||||
t = (uiLabelNSTextField *) uiControlHandle(c);
|
t = (uiLabelNSTextField *) uiControlHandle(uiControl(l));
|
||||||
|
|
||||||
[t setStringValue:toNSString(text)];
|
[t setStringValue:toNSString(text)];
|
||||||
[t setEditable:NO];
|
[t setEditable:NO];
|
||||||
|
@ -53,7 +53,7 @@ uiControl *uiNewLabel(const char *text)
|
||||||
uiLabel(l)->Text = labelText;
|
uiLabel(l)->Text = labelText;
|
||||||
uiLabel(l)->SetText = labelSetText;
|
uiLabel(l)->SetText = labelSetText;
|
||||||
|
|
||||||
t.uiC = l;
|
t.uiL = l;
|
||||||
|
|
||||||
return t.uiC;
|
return t.uiL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{
|
{
|
||||||
// TODO free all tabs explicitly
|
// TODO free all tabs explicitly
|
||||||
if (uiDarwinControlFreeWhenAppropriate(uiControl(self.uiT), [self superview]))
|
if (uiDarwinControlFreeWhenAppropriate(uiControl(self.uiT), [self superview]))
|
||||||
self.uiC = NULL;
|
self.uiT = NULL;
|
||||||
[super viewDidMoveToSuperview];
|
[super viewDidMoveToSuperview];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,8 +55,10 @@ uiTab *uiNewTab(void)
|
||||||
uiTab *t;
|
uiTab *t;
|
||||||
uiNSTabView *tv;
|
uiNSTabView *tv;
|
||||||
|
|
||||||
|
t = uiNew(uiTab);
|
||||||
|
|
||||||
uiDarwinNewControl(uiControl(t), [uiNSTabView class], NO, NO);
|
uiDarwinNewControl(uiControl(t), [uiNSTabView class], NO, NO);
|
||||||
tv = (uiNSTabView *) uiControlHandle(c);
|
tv = (uiNSTabView *) uiControlHandle(uiControl(t));
|
||||||
|
|
||||||
// also good for NSTabView (same selector and everything)
|
// also good for NSTabView (same selector and everything)
|
||||||
setStandardControlFont((NSControl *) tv);
|
setStandardControlFont((NSControl *) tv);
|
||||||
|
|
|
@ -19,7 +19,7 @@ uiLogObjCClassAllocations
|
||||||
- (BOOL)windowShouldClose:(id)win
|
- (BOOL)windowShouldClose:(id)win
|
||||||
{
|
{
|
||||||
// return exact constants to be safe
|
// return exact constants to be safe
|
||||||
if ((*(self.onClosing))(self.uiw, self.onClosingData))
|
if ((*(self.onClosing))(uiWindow(self.uiw), self.onClosingData))
|
||||||
return YES;
|
return YES;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@ -153,10 +153,10 @@ uiWindow *uiNewWindow(const char *title, int width, int height)
|
||||||
uiWindow(d.uiw)->SetTitle = windowSetTitle;
|
uiWindow(d.uiw)->SetTitle = windowSetTitle;
|
||||||
uiWindow(d.uiw)->Show = windowShow;
|
uiWindow(d.uiw)->Show = windowShow;
|
||||||
uiWindow(d.uiw)->Hide = windowHide;
|
uiWindow(d.uiw)->Hide = windowHide;
|
||||||
uiWindow(d.uiw)->OnClosing = windowSetOnClosing;
|
uiWindow(d.uiw)->OnClosing = windowOnClosing;
|
||||||
uiWindow(d.uiw)->SetChild = windowSetChild;
|
uiWindow(d.uiw)->SetChild = windowSetChild;
|
||||||
uiWindow(d.uiw)->Margined = windowMargined;
|
uiWindow(d.uiw)->Margined = windowMargined;
|
||||||
uiWindow(d.uiw)->SetMargined = windowSetMargined;
|
uiWindow(d.uiw)->SetMargined = windowSetMargined;
|
||||||
|
|
||||||
return d.uiw;
|
return uiWindow(d.uiw);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue