Re: Conditional mouseDownCanMoveWindow for NSView?
Re: Conditional mouseDownCanMoveWindow for NSView?
- Subject: Re: Conditional mouseDownCanMoveWindow for NSView?
- From: Negm-Awad Amin <email@hidden>
- Date: Wed, 8 Oct 2008 12:12:55 +0200
Am Do,02.10.2008 um 20:15 schrieb Daniel Weber:
I have a single nsview that draws the main content area for my
application
and a bottom statusbar. This was done instead of using two different
views
so the user can move objects from the statusbar to the main content
area,
all with core animation effects. The view is not opaque. The problem
I'm
having, though, is that I want the user to be able to drag the
window when
the mouse is down on the statusbar, but not the main content area.
In other
words, if the mousedown is within the statusbar's rectangle I want
to return
YES for mouseDownCanMoveWindow. But if the mousedown is within the
main
content area rectangle, I want to return NO. I have already tried
setting a
flag in the mouseDown method and then returning that
in mouseDownCanMoveWindow. But it doesn't work. I guess mouseDown is
not
called before mouseDownCanMoveWindow. Anyway, does anyone have any
other
suggestions for this?
The only other thing I can think to do is setting a flag on
mouseEnter and
mouseExit of the statusbar rectangle, but that doesn't seem
particularly
elegant.
Thanks,
Maybe – I've never tried it, so it is just an idea – you can retrieve
the mouse location in -mouseDownCanMoveWindow by using -currentEvent
(NSApplication) and -locationInWindow (NSEvent).
Cheers
Dan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Amin Negm-Awad
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden