summaryrefslogtreecommitdiff
path: root/new/window_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-10 17:06:59 -0400
committerPietro Gagliardi <[email protected]>2015-04-10 17:06:59 -0400
commit3069f38a9c0e91d13fe8a9274d1faa79107c87f4 (patch)
tree82dcf26ab9cf0c4792ecef66e39ce88c0d03b620 /new/window_darwin.m
parentd326407f05cadec6422fe3ccbcfcaf41a869dfde (diff)
Removed autocorrect from Mac OS X uiEntries. Also moved uiFreeText() to text_darwin.m.
Diffstat (limited to 'new/window_darwin.m')
-rw-r--r--new/window_darwin.m9
1 files changed, 8 insertions, 1 deletions
diff --git a/new/window_darwin.m b/new/window_darwin.m
index 690c73a..9b6949f 100644
--- a/new/window_darwin.m
+++ b/new/window_darwin.m
@@ -51,7 +51,14 @@ uiWindow *uiNewWindow(char *title, int width, int height)
backing:NSBackingStoreBuffered
defer:YES];
[d.w setTitle:toNSString(title)];
- // TODO substitutions
+
+ // we do not want substitutions
+ // text fields, labels, etc. take their smart quotes and other autocorrect settings from their parent window, which provides a shared "field editor"
+ // so we have to turn them off here
+ // thanks akempgen in irc.freenode.net/#macdev
+ // for some reason, this selector returns NSText but is documented to return NSTextView...
+ // NOTE: if you disagree with me about disabling substitutions, start a github issue with why and I'll be happy to consider it
+ disableAutocorrect((NSTextView *) [d.w fieldEditor:YES forObject:nil]);
// this is what will destroy the window on close
[d.w setReleasedWhenClosed:YES];