summaryrefslogtreecommitdiff
path: root/new/entry_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-09 11:54:02 -0400
committerPietro Gagliardi <[email protected]>2015-04-09 11:54:02 -0400
commit67bfe61c933de7c241bc646008b757e3871be906 (patch)
treeefeef141e6adc3f75e1587bb2f11c4b18e240ba6 /new/entry_darwin.m
parentb5eea413c496d40838af258e533e514212081909 (diff)
Implemented the text functions on OS X.
Diffstat (limited to 'new/entry_darwin.m')
-rw-r--r--new/entry_darwin.m21
1 files changed, 19 insertions, 2 deletions
diff --git a/new/entry_darwin.m b/new/entry_darwin.m
index b08d53b..4a4047a 100644
--- a/new/entry_darwin.m
+++ b/new/entry_darwin.m
@@ -20,14 +20,14 @@
// TOOD move elsewhere
// these are based on interface builder defaults; my comments in the old code weren't very good so I don't really know what talked about what, sorry :/
-void finishNewTextField(NSTextField *t, BOOL isLabel)
+void finishNewTextField(NSTextField *t, BOOL isEntry)
{
setStandardControlFont((id) t);
// THE ORDER OF THESE CALLS IS IMPORTANT; CHANGE IT AND THE BORDERS WILL DISAPPEAR
[t setBordered:NO];
[t setBezelStyle:NSTextFieldSquareBezel];
- [t setBezeled:isLabel];
+ [t setBezeled:isEntry];
// TODO autocorrect comment
@@ -49,3 +49,20 @@ uiControl *uiNewEntry(void)
return t.uiC;
}
+
+char *uiEntryText(uiControl *c)
+{
+ uiNSTextField *t;
+
+ t = (uiNSTextField *) uiControlHandle(c);
+ // TODO wrap all strdup calls
+ return strdup(fromNSString([t stringValue]));
+}
+
+void uiEntrySetText(uiControl *c, const char *text)
+{
+ uiNSTextField *t;
+
+ t = (uiNSTextField *) uiControlHandle(c);
+ [t setStringValue:toNSString(text)];
+}