Re: Cursor rects, cursors and dragging
Re: Cursor rects, cursors and dragging
- Subject: Re: Cursor rects, cursors and dragging
- From: Henry McGilton <email@hidden>
- Date: Thu, 18 Nov 2004 22:22:14 -0800
On Nov 18, 2004, at 9:09 PM, Sean McBride wrote:
Julian Pellico (email@hidden) on Wed, Nov 10, 2004 13:03 said:
I have an application where the user can drag some images between
windows. I decided that on 10.3 I'd like to change the cursor to open
hand when the mouse is over these images, and to close hand while the
user is dragging. I set up cursor rects with the open hand for the
images. On a mouseDown over the images, I do [[NSCursor
closedHandCursor] push]. On a mouseUp I do [NSCursor pop]. This seems
to work well enough in that, if the mouse is released in the origin
view after dragging, the cursor goes back to open hand or arrow
depending on where it is.
I'd like the cursor to remain closed hand throughout the duration of
the drag. However, as soon as the drag leaves the source window, the
cursor changes to arrow. It stays this way regardless of whether the
cursor goes back into the window again. So I must be missing something
here. Is there something else I need to take care of? Is there some
more automatic method of changing the cursor for a drag?
Did you ever figure this out? I am curious....
My understanding of this stuff is that, while you set up all
your tracking rects in your NSView, those rects are actually
managed by the view's *window*. And from that, I infer that
tracking rects are valid only within the window that contains
the view.
Try this to fine-tune the experiment.
o Pick up the image.
o Drag it out of the Window.
o Drag it back over the image again.
Is the cursor still the arrow cursor or is it the close hand
cursor?
Not to question your programming skills, are you accounting
correctly for the case when the drag exits the tracking rect?
And then re-enters the tracking rect?
In a couple of my applications, I determined that the only
way I could do cursor management across windows was to have
a backing window the size of the screen. Then you would use
the backing window/view to do the tracking rect managament for
for the entire application . . .
I am sure that the way I am going about the job is bogus,
but, nobody has stepped forward so far with a better solution.
Cheers,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
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