Knowing when a window is being dragged?
Knowing when a window is being dragged?
- Subject: Knowing when a window is being dragged?
- From: Ivan Kourtev <email@hidden>
- Date: Wed, 4 Oct 2006 12:05:59 -0400
I am trying to implement a functionality in a window such that what's
inside of a window changed while the window is been dragged around
the screen by the user. It's actually a little subtler than that --
I need the window to change when the user clicks left mouse down on
the title bar and to change back to normal when left mouse is
released. This should happen regardless of whether the mouse down is
followed by moving the window, or whether the user moves the window
in phases -- move, pause (with mouse down), move, pause, etc.
I first tried doing this by hooking into windowWillMove and
windowDidMove but couldn't quite get it to work. For example, if the
user does a quick left click on the title bar of the window,
windowWillMove is sent but the window is not really moving. There
can be a second (or many more) windowWillMove without a windowDidMove
in between if the user continues to single-click left mouse in the
window titlebar. When the user actually moves the window, there will
be one or more windowDidMove sent.
Speaking of windowdidMove, if the user moves the window a bit, then
stops, then moves, then stops -- all of this while still holding down
the left mouse button on the title bar -- then multiple windowDidMove
are sent.
Perhaps there is some way of implementing some convoluted logic that
will try and figure out wheat exactly is happening with all these
notifications but that doesn't appear to be an elegant enough
solution. And mouseUp and mouseDown don't get to the window when on
the titleBar area.
Has anyone figured out a simple, robust, "strictly-documented-only"
way of doing the above? I read in the archives about the transparent
overlay of the titlebar approach but it still seems quite complicated.
Cheers,
-- ivan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden