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 8133027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:29:21+00:00 2026-06-06T09:29:21+00:00

I have a window which contains a split view. One of the splits contains

  • 0

I have a window which contains a split view. One of the “splits” contains an outline view. I have a window controller (which is the file owner for the window’s XIB). The window controller is the delegate and data source of the outline view.

When I call the -(void)mouseDown:(NSEvent *)e method in the window controller only the toolbar responds to the method – the outline view does not.

How do I get the mouse events, e.g. the mouseDown, of the outline view?

  • 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-06-06T09:29:23+00:00Added an answer on June 6, 2026 at 9:29 am

    To get the mouse event of the outline view:

    1. Subclass the outline view.
      • In Interface Builder (IB) > Library panel > Classes tab select NSOutlineView
      • Right-click NSOutlineView and select “New Subclass…”
      • Complete the following pop-up windows selecting “Generate Source Files” and add the fils to your project
      • Select the NSOutlineView
      • In Inspector Panel > Identity tab > Class Identity > Class select your new class
    2. Implement your mouse event method

      • In Xcode > your new subclass of your outline view > the implementation (.m) file type your method e.g.

        (void)mouseDown:(NSEvent *)theEvent {
            /* CODE YOU WANT EXECUTED WHEN MOUSE IS CLICKED */
            NSLog(@"Mouse down occurred");
            // call this to get the usual behaviour of your outline
            // view in addition to your custom code
            [super mouseDown:theEvent];
        }
        

    It may be useful to know that one can get mouse events by using [NSEvent modifierFlags]. This is will work not just for the outline view but for views throughout the app. For example, in the window controller (referred to in the question) I could include code like:

    if ([NSEvent modifierFlags] == NSAlternateKeyMask) { // if the option key is being pressed
                /*SOME CODE*/
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winform application which contains a window resizable but one requirement is
I have a text file which contains data I need to preload into a
I have a NIB which contains two windows, one is the app's main window
I have a view controller which contains a table view, and which is wrapped
I have a WPF window, which contains a button called Cancel. Under ordinary circumstances
I have a UserControl which contains a TextBox . When my main window loads
Im using cocoa in xcode 4.4 and I have a window which contains a
I have a scrolled window, which contains a drawing area in pygtk. I would
In my main window, I have a child control(user control) which contains a text
I have a window which contains a QTreeView ( databaseTreeView ) on a subclass

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.