I am creating an application (without an interface builder!) That "lives" in the NSStatusBar; when you click on the icon in the StatusBar, an NSWindow with NSScrollView appears. A window will appear, but it seems that something is interfering with the user’s interaction with ScrollView
To find out where the problem came from, I also added my view to the main contentView window in AppDelegate, it is strange that scrollview is interactive in MainWindow ... Does anyone know why it doesn't work in my new window?
This is the code I'm using to create a new TTDropDownWindow:
- (void)openWindow {
This is the implementation of TTDropDownWindow:
#import "TTDropDownWindow.h" #import "WFConstants.h" @implementation TTDropDownWindow - (id) init { self = [super initWithContentRect:NSMakeRect(0, 0, DROP_DOWN_WIDTH, DROP_DOWN_HEIGHT) styleMask:NSBorderlessWindowMask backing:NSBackingStoreRetained defer:NO]; return self; } - (BOOL)canBecomeMainWindow { return YES; } - (BOOL)canBecomeKeyWindow { return YES; } @end
And this is the code that creates the View and ScrollView
#import "TTStatusBarDropDownView.h" #import "TTTestView.h" @implementation TTStatusBarDropDownView @synthesize dropDownTableViewData = dropDownTableViewData_; - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { NSImageView *imageView = [[NSImageView alloc] initWithFrame:frameRect]; imageView.image = [NSImage imageNamed:@"background-dropdown"]; [self addSubview:imageView];
source share