views:

25

answers:

1

I am making a desktop application and I want to show the NSToolbar of an NSPanel only if the mouse pointer is positioned over that NSPanel. Also, when the mouse pointer is not positioned over that NSPanel, the NSToolbar should be hidden.

Can anyone help me with detecting the hovering over the NSPanel, and showing and hiding the NSToolbar (I can only find how to toggle the NSToolbar)?


This should also happen when the application is not active.

+1  A: 

You should setup NSTrackingArea to see when the mouse enters/leaves the area you're interested in hovering over.

Eimantas