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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:13:12+00:00 2026-06-01T12:13:12+00:00

In my app delegate I created a window helpWindow and I set its contents

  • 0

In my app delegate I created a window “helpWindow” and I set its contents view to a NSView subclass. In my subclass I drawRect and make sure its the key window. The problem I am having is that on my mouse events the mouse down event works fine with the content view however, the mouse moved is not working and displaying the location. Do i have to add something to the mouseLocation ? I feel that the drawRect is covering up the mouse moved event. Thanks!

//in my appDelegate.m

controlFilterBox = [[MoveFilter alloc] initWithFrame:helpWindow.frame];
[helpWindow setContentView:controlFilterBox];
[controlFilterBox release];

//in my NSView subclass.m

   -(void)drawRect:(NSRect)dirtyRect 
     {
        [[NSColor redColor] set];
        NSRectFill(dirtyRect);

        [[self window] makeKeyWindow]; 
     }

    -(void)mouseDown:(NSEvent *)theEvent 
      {

        NSPoint eventLocation = [theEvent locationInWindow];
        NSPoint location = [self convertPoint:eventLocation fromView:nil];

        NSLog(@"exit %f %f", location.x, location.y); 
      }

    -(void)mouseMoved:(NSEvent *)theEvent 
      {
        NSPoint mouseLoc = [NSEvent mouseLocation];
        NSLog(@"mouseMoved: %f %f", mouseLoc.x, mouseLoc.y);
      }
  • 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-01T12:13:14+00:00Added an answer on June 1, 2026 at 12:13 pm

    I found the answer, it turns out it is best to create an NSTrackingArea to be able to use the mouseMoved event in a NSView.

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

Sidebar

Related Questions

I have this method in App Delegate that makes a window and content view
In my app delegate I create a UISplitViewController. I set the delegate to be
Throughout my app, I'm getting semantic issue warnings when I set ViewController.delegate = self
Am trying to connect the App Delegate to the View Controller in Xcode4, but
I have an App Delegate and a 3 view controllers in my project. I
Here is my code stub for my app-delegate.m -- it never gets called. -
I'm using the following Audio Session in my app delegate: AudioSessionInitialize(NULL, NULL, NULL, self);
I have an array of users in my app delegate, and in one of
I'm writing a Cocoa application where I have an auto generated app delegate:(MyAppDelegate.h/MyAppDelegate.m) So
When my app is run in the iPhone simulator, the delegate method - (void)applicationWillTerminate:(UIApplication

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.