Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:52:47+00:00 2026-05-28T16:52:47+00:00

I am building an application (without interface builder!) which ‘lives’ in the NSStatusBar; when

  • 0

I am building an application (without interface builder!) which ‘lives’ in the NSStatusBar; when you click on an icon in the StatusBar a NSWindow with a NSScrollView appears. The window appears but it seems that something is preventing user interaction with the ScrollView

To find out where the problem comes from I also added my view to the main windows contentView in the AppDelegate, strange thing is that the scrollview is interactive in the MainWindow… Anyone knows why it doesn’t work in my new Window?

This is the code I use to create the new TTDropDownWindow:

- (void)openWindow {
    // Dropdown
    if (self.dropDownWindow == nil) {
        self.dropDownWindow = [[TTDropDownWindow alloc] init];
        self.dropDownWindow.releasedWhenClosed = NO;
        self.dropDownWindow.contentView = self.view;
        self.dropDownWindow.backgroundColor = [NSColor clearColor];
        self.dropDownWindow.delegate = self;
        self.dropDownWindow.alphaValue = 1;
        self.dropDownWindow.hasShadow = NO;
        self.dropDownWindow.opaque = NO;
    }

    [[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
    NSRect statusBarContentRect = self.statusBarItemView.window.frame;
    NSPoint statusBarOriginPoint = NSMakePoint(NSMidX(statusBarContentRect), NSMinY(statusBarContentRect));

    NSRect screenFrame = self.dropDownWindow.screen.frame;

    NSRect dropDownContentRect = NSZeroRect;
    dropDownContentRect.size.width = DROP_DOWN_WIDTH;
    dropDownContentRect.size.height = DROP_DOWN_HEIGHT;
    dropDownContentRect.origin.x = statusBarOriginPoint.x - DROP_DOWN_WIDTH / 2;
    dropDownContentRect.origin.y = screenFrame.size.height - DROP_DOWN_HEIGHT - NSStatusBar.systemStatusBar.thickness;

    [self.dropDownWindow setFrame:dropDownContentRect display:YES];
    [self.dropDownWindow makeKeyAndOrderFront:nil];
}

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 the 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];

        // first create a view to put in a ScrollView
        NSView *scrollViewHolder = [[TTTestView alloc] initWithFrame:NSMakeRect(19, 98, 414, 543) andColor:[NSColor yellowColor]];
        [self addSubview:scrollViewHolder];

        // create the scrollView
        NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 414, 543)];
        scrollView.hasVerticalRuler = YES;
        scrollView.hasVerticalScroller = YES;
        [scrollViewHolder addSubview:scrollView];

        // TTTestView is just a NSView with a background drawing
        TTTestView *theViewThatScrolls = [[TTTestView alloc] initWithFrame:NSMakeRect(0, 0, 200, 10000) andColor:[NSColor blueColor]];
        [theViewThatScrolls addSubview:[[TTTestView alloc] initWithFrame:NSMakeRect(10, 10, 100, 8000) andColor:[NSColor grayColor]]];

        [scrollView setDocumentView:theViewThatScrolls];
    }

    return self;
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:52:48+00:00Added an answer on May 28, 2026 at 4:52 pm

    You might change NSBackingStoreRetained to NSBackingStoreBuffered as stated over here:
    NSScrollView in a NSWindow

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in a web application I am building I need to upload photos without using
I'm building an application which uses AutoFac 2 for DI. I've been reading that
I'm building an application which uses ajax calls for form validations and some others,
I'm building an application which will initially use SQLServer 2008 as the DBMS. How
I'm building an application which subscribes to a Javascript event, and sends out a
I'm building a J2EE application in which I want to allows plugins. I'm fairly
I am building application that required some data from iPhone's Call log(read only). The
I'm building application with GWT + GAE on my MAC. In this app i
I'm building application on Google AppEngine with Java (GAE/J) and all my data will
Unlike this question: Linker Error while building application using Boost Asio in Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.