summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--new/darwin/button.m2
-rw-r--r--new/darwin/checkbox.m4
-rw-r--r--new/darwin/entry.m2
-rw-r--r--new/darwin/label.m8
-rw-r--r--new/darwin/tab.m6
-rw-r--r--new/darwin/window.m6
6 files changed, 15 insertions, 13 deletions
diff --git a/new/darwin/button.m b/new/darwin/button.m
index fd73675..3ec8a54 100644
--- a/new/darwin/button.m
+++ b/new/darwin/button.m
@@ -82,5 +82,5 @@ uiButton *uiNewButton(const char *text)
bb.uiB = b;
- return b.uiB;
+ return bb.uiB;
}
diff --git a/new/darwin/checkbox.m b/new/darwin/checkbox.m
index 5ad6961..a7ccfb3 100644
--- a/new/darwin/checkbox.m
+++ b/new/darwin/checkbox.m
@@ -50,7 +50,7 @@ static void checkboxOnToggled(uiCheckbox *c, void (*f)(uiCheckbox *, void *), vo
{
uiCheckboxNSButton *cc;
- cc = (uiCheckboxNSButton *) uiControlHandle(uiCheckbox(c));
+ cc = (uiCheckboxNSButton *) uiControlHandle(uiControl(c));
cc.uiOnToggled = f;
cc.uiOnToggledData = data;
}
@@ -83,7 +83,7 @@ uiCheckbox *uiNewCheckbox(const char *text)
c = uiNew(uiCheckbox);
uiDarwinNewControl(uiControl(c), [uiCheckboxNSButton class], NO, NO);
- cc = (uiCheckboxNSButton *) uiControlHandle(c);
+ cc = (uiCheckboxNSButton *) uiControlHandle(uiControl(c));
[cc setTitle:toNSString(text)];
[cc setButtonType:NSSwitchButton];
diff --git a/new/darwin/entry.m b/new/darwin/entry.m
index 84835f3..7189156 100644
--- a/new/darwin/entry.m
+++ b/new/darwin/entry.m
@@ -59,7 +59,7 @@ uiEntry *uiNewEntry(void)
e = uiNew(uiEntry);
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
finishNewTextField((NSTextField *) t, YES);
diff --git a/new/darwin/label.m b/new/darwin/label.m
index 4f20e98..56780d0 100644
--- a/new/darwin/label.m
+++ b/new/darwin/label.m
@@ -34,7 +34,7 @@ static void labelSetText(uiLabel *l, const char *text)
[t setStringValue:toNSString(text)];
}
-uiControl *uiNewLabel(const char *text)
+uiLabel *uiNewLabel(const char *text)
{
uiLabel *l;
uiLabelNSTextField *t;
@@ -42,7 +42,7 @@ uiControl *uiNewLabel(const char *text)
l = uiNew(uiLabel);
uiDarwinNewControl(uiControl(l), [uiLabelNSTextField class], NO, NO);
- t = (uiLabelNSTextField *) uiControlHandle(c);
+ t = (uiLabelNSTextField *) uiControlHandle(uiControl(l));
[t setStringValue:toNSString(text)];
[t setEditable:NO];
@@ -53,7 +53,7 @@ uiControl *uiNewLabel(const char *text)
uiLabel(l)->Text = labelText;
uiLabel(l)->SetText = labelSetText;
- t.uiC = l;
+ t.uiL = l;
- return t.uiC;
+ return t.uiL;
}
diff --git a/new/darwin/tab.m b/new/darwin/tab.m
index 98dd733..b84ee9a 100644
--- a/new/darwin/tab.m
+++ b/new/darwin/tab.m
@@ -15,7 +15,7 @@
{
// TODO free all tabs explicitly
if (uiDarwinControlFreeWhenAppropriate(uiControl(self.uiT), [self superview]))
- self.uiC = NULL;
+ self.uiT = NULL;
[super viewDidMoveToSuperview];
}
@@ -55,8 +55,10 @@ uiTab *uiNewTab(void)
uiTab *t;
uiNSTabView *tv;
+ t = uiNew(uiTab);
+
uiDarwinNewControl(uiControl(t), [uiNSTabView class], NO, NO);
- tv = (uiNSTabView *) uiControlHandle(c);
+ tv = (uiNSTabView *) uiControlHandle(uiControl(t));
// also good for NSTabView (same selector and everything)
setStandardControlFont((NSControl *) tv);
diff --git a/new/darwin/window.m b/new/darwin/window.m
index af644c0..c243374 100644
--- a/new/darwin/window.m
+++ b/new/darwin/window.m
@@ -19,7 +19,7 @@ uiLogObjCClassAllocations
- (BOOL)windowShouldClose:(id)win
{
// return exact constants to be safe
- if ((*(self.onClosing))(self.uiw, self.onClosingData))
+ if ((*(self.onClosing))(uiWindow(self.uiw), self.onClosingData))
return YES;
return NO;
}
@@ -153,10 +153,10 @@ uiWindow *uiNewWindow(const char *title, int width, int height)
uiWindow(d.uiw)->SetTitle = windowSetTitle;
uiWindow(d.uiw)->Show = windowShow;
uiWindow(d.uiw)->Hide = windowHide;
- uiWindow(d.uiw)->OnClosing = windowSetOnClosing;
+ uiWindow(d.uiw)->OnClosing = windowOnClosing;
uiWindow(d.uiw)->SetChild = windowSetChild;
uiWindow(d.uiw)->Margined = windowMargined;
uiWindow(d.uiw)->SetMargined = windowSetMargined;
- return d.uiw;
+ return uiWindow(d.uiw);
}