I am trying to make a simple application in which there is a empty red rectangle and whenever the mouse is moved over the upper half border of the rectangle the cursor will become closed hand.
I started with selecting the foundation command line project.Made a transparent NSWindow
and embedded a NSView
in it with the rectangle, made window to accept mouse moved events(by method: -setAcceptsMouseMovedEvents
). I have overridden -canBecomeKeyWindow
and -canBecomeMainWindow
window to return YES. But somehow none of the -mouseMoved
events are being received by NSView
.
When I put the same code by making a cocoa application project and creating my window in -applicationDidFinishLaunching
method , my view was able to receive -mouseMoved
events.
why is it not receiving mouse moved events when I use foundation command line utility project ?
I have also observed that whenever I make a window(carbon or cocoa) through foundation cmd line utility project , the window doesn't become key even on clicking the title bar.On clicking the title bar color remains light grey instead of becoming dark grey. Why is this happening?
I have overridden -canBecomeKeyWindow
and -canBecomeMainWindow
of NSwindow
to return YES.