在小牛隊中,使用了不推薦使用的NSStatusItem
實現。
這是接口:
@interface NSStatusItem (NSStatusItemDeprecated)
/*
These are softly deprecated methods of NSStatusItem.
Their past and current behavior is to forward their calls onto the button property.
They will be formally deprecated in a later release.
*/
@property (nullable) SEL action;
@property (nullable) SEL doubleAction;
@property (nullable, weak) id target;
@property (nullable, copy) NSString *title;
@property (nullable, copy) NSAttributedString *attributedTitle;
@property (nullable, strong) NSImage *image;
@property (nullable, strong) NSImage *alternateImage;
@property (getter=isEnabled) BOOL enabled;
@property BOOL highlightMode;
@property (nullable, copy) NSString *toolTip;
- (NSInteger)sendActionOn:(NSInteger)mask;
/*
Custom views should not be set on a status item.
The button property with a template image will allow proper styling of the status item in various states and contexts and should be used instead.
*/
@property (nullable, strong) NSView *view;
- (void)drawStatusBarBackgroundInRect:(NSRect)rect withHighlight:(BOOL)highlight;
- (void)popUpStatusItemMenu:(NSMenu*)menu;
@end
我能問爲什麼我越來越下降投票? – jQwierdy