Skip to content

Commit f7683c1

Browse files
committed
Replaced deprecated calls to setNeedsDisplay with setting of property needsDisplay. Looks like -needsDisplay is available since macOS 10.0, so this does not increase Deployment Target.
1 parent 07a3114 commit f7683c1

4 files changed

+8
-8
lines changed

SSYAlert.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ - (void)configureForSSYAlertUsage {
147147
// The next two lines are very important. Took me many months to learn that,
148148
// by default, NSTextViews will resize themselves automatically to accomodate
149149
// a changed text size, and what's even more confusing is that they do so
150-
// when you (or a superview) invoke -setNeedsDisplay: or -display on them.
150+
// when you (or a superview) sets their `needsDisplay` property to YES.
151151
// When used in SSYAlert, SSYAlert wants to set their size manually, in its
152152
// -display method. In particular, if SSYAlert's ivar allowsShrinking is set
153153
// to NO, in fact we want them to maintain their height when automatic resizing
@@ -206,7 +206,7 @@ @interface SSYAlert ()
206206
@implementation SSYAlertWindow
207207

208208
- (NSInteger)checkboxState {
209-
NSInteger state = NSMixedState ; // default answer in case we can't find checkbox
209+
NSInteger state = NSControlStateValueMixed ; // default answer in case we can't find checkbox
210210
BOOL didFindCheckbox = NO ;
211211
for (NSView* view in [[self contentView] subviews]) {
212212
if ([view isKindOfClass:[SSYWrappingCheckbox class]]) {
@@ -219,7 +219,7 @@ - (NSInteger)checkboxState {
219219

220220
if (!didFindCheckbox) {
221221
// Until BookMacster 1.22.4, logged Internal Error 624-9382
222-
state = NSOffState ;
222+
state = NSControlStateValueOff ;
223223
}
224224

225225
return state ;
@@ -816,7 +816,7 @@ - (IBAction)clickedButton:(id)sender {
816816
object:self] ;
817817
}
818818

819-
if ([self checkboxState] == NSOnState) {
819+
if ([self checkboxState] == NSControlStateValueOn) {
820820
[[self checkboxInvocation] invoke] ;
821821
}
822822

SSYPopUpTableHeaderCell.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ - (void)performClickWithFrame:(NSRect)frame
112112
to controlView, but decided that, since I don't understand what
113113
Apple is doing or not doing with controlView, it would be safer
114114
to use a private property. */
115-
[self.headerView setNeedsDisplay:YES] ;
115+
self.headerView.needsDisplay=YES;
116116
}
117117
}
118118

SSYProgressView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ - (void)unsafeSizeToFitTextOnly:(BOOL)textOnly {
412412
[[self textField] setToolTip:nil] ;
413413
}
414414

415-
[self setNeedsDisplay:YES] ;
415+
self.needsDisplay = YES;
416416
}
417417

418418
- (void)unsafeSetHasCancelButtonWithTarget:(id)target

SSYSidebarController.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ - (void)regardlesslyExpandSidebar:(BOOL)expand
249249
[self.sidebarView setFrame:sidebarFrame];
250250
}
251251

252-
[self.mainView setNeedsDisplay: YES];
253-
[self.sidebarView setNeedsDisplay:YES];
252+
self.mainView.needsDisplay = YES;
253+
self.sidebarView.needsDisplay = YES;
254254
}
255255

256256

0 commit comments

Comments
 (0)