2015-04-28 12:49:20 -05:00
|
|
|
// 7 april 2015
|
|
|
|
#import "uipriv_darwin.h"
|
|
|
|
|
|
|
|
// also fine for NSCells and NSTexts (NSTextViews)
|
|
|
|
void setStandardControlFont(NSControl *control)
|
|
|
|
{
|
|
|
|
[control setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
|
|
|
|
}
|
|
|
|
|
|
|
|
void disableAutocorrect(NSTextView *tv)
|
|
|
|
{
|
|
|
|
[tv setEnabledTextCheckingTypes:0];
|
|
|
|
[tv setAutomaticDashSubstitutionEnabled:NO];
|
|
|
|
// don't worry about automatic data detection; it won't change stringValue (thanks pretty_function in irc.freenode.net/#macdev)
|
|
|
|
[tv setAutomaticSpellingCorrectionEnabled:NO];
|
|
|
|
[tv setAutomaticTextReplacementEnabled:NO];
|
|
|
|
[tv setAutomaticQuoteSubstitutionEnabled:NO];
|
|
|
|
[tv setAutomaticLinkDetectionEnabled:NO];
|
|
|
|
[tv setSmartInsertDeleteEnabled:NO];
|
|
|
|
}
|
|
|
|
|
|
|
|
void complain(const char *fmt, ...)
|
|
|
|
{
|
2015-04-30 22:28:02 -05:00
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start(ap, fmt);
|
2015-05-07 18:34:45 -05:00
|
|
|
fprintf(stderr, "[libui] ");
|
2015-04-30 22:28:02 -05:00
|
|
|
vfprintf(stderr, fmt, ap);
|
2015-05-07 18:34:45 -05:00
|
|
|
fprintf(stderr, "\n");
|
2015-04-30 22:28:02 -05:00
|
|
|
va_end(ap);
|
|
|
|
abort();
|
2015-04-28 12:49:20 -05:00
|
|
|
}
|