Re: Mouse click inside NSView
Re: Mouse click inside NSView
- Subject: Re: Mouse click inside NSView
- From: "M. Uli Kusterer" <email@hidden>
- Date: Tue, 9 Dec 2003 21:19:08 +0100
At 2:55 Uhr +0800 10.12.2003, Aaron Boothello wrote:
I have a window. on the righthalf is an NSTabView. within the
tabView there is a 'CustomView' (that im drawing OpenGL content
into).
When i click in the customView, i use NSRect, [NSEvent
locationInWindow], and NSPoint to figure outthe coordinates of the
mouse click.
The [NSEvent locationInWindow], gives me the coordinate of the click
within the entire window. the NSRect gives me the values(origin) of
the TabView. i need to either:
1. get the location In NSTabView
or
2. get the NSRect values of the window itself.
cause i need to get the same reference point in order to calculate
the location in the custom view ive clicked on.
Why? What do you want to do? If all you want is get the click
coordinates relative to your custom view, you can do that by using
one of NSView's functions (convertPoint:fromView: or something like
that, look for it in NSView.h). Since you have locationInWindow, you
simply pass "nil" as the fromView: parameter, which means it's in
window coordinates.
If that's not what you're trying to do, I don't get it. It would
help if you told us what you're actually trying to achieve. I.e. what
would a user see in this situation? Are you trying to drag-and-drop
between views? Are you trying to show a small preview of the window
with an indicator of the click location in a view in this window?
MORE INPUT. (as Johnny 5 would say)
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.