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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:19:03+00:00 2026-06-14T15:19:03+00:00

I have a Mac application that has two NSButtons on each bottom corner of

  • 0

I have a Mac application that has two NSButtons on each bottom corner of the window. I have set their Alpha = .5 in the .xib. I want to know how to detect a mouse hover over the button and change the alpha to lets say .9. How do I do this? I suppose all you need to know from my code is the .h.

@property (unsafe_unretained) IBOutlet NSButton *leftButton;
@property (unsafe_unretained) IBOutlet NSButton *rightButton;

Those are synthesized in my .m. Deployment target is OS X 10.6+. Thanks.

EDIT

I really haven’t tried anything. I have seen something on NSTrackingArea, but am not positive on how to use it, more importantly, I was wondering if there was another way to go about it. Such as an event that is already called or something.

  • 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-14T15:19:06+00:00Added an answer on June 14, 2026 at 3:19 pm

    You need to Subclass the NSButton class (or even better the NSButtonCell class).

    - (void)mouseEntered:(NSEvent *)theEvent;
    - (void)mouseExited:(NSEvent *)theEvent;
    

    They should get called when the mouse enter and exit the area. You may also need to re create the tracking area, look here:

    - (void)updateTrackingAreas
    

    For fade in and fade out effect I played with animator and alpha value for example:

    [[self animator]setAlphaValue:0.9]; 
    

    EDIT: This is just for reference, so that you can take some ideas

    @interface MyButton : NSButton {
    - (void)mouseEntered:(NSEvent *)theEvent;
    - (void)mouseExited:(NSEvent *)theEvent;     
    - (void)updateTrackingAreas;
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Core Data based mac application that is working perfectly well until
I have an iPhone application that send datas via wifi on my mac. I
I have an application for Mac OS X that supports plugins that are intended
I have a Cocoa, Document-based Mac OS X application. One feature that I have
I am developing an ASP.NET MVC application that has two kind of pages: (1)
I am writing a Java Swing application that needs to have a window receive
I am trying to create an mac application in XCode that has some of
I have two application with the same identifier.One is for mac app store and
I am building a Cocoa Mac application that runs in the background but has
I have an application that has a main GUI with a menubar, and another

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.