Hi Kyle,
Yes, definitively, I would like to do something like Safari, which uses drag
manager to drag windows and tabs within the app.

Actually I have coded that in a different way, without using the drag
manager. I create a borderless window containing a small view at the top
looking as a tiny custom window-title. Then I drag "that" view using a loop
within mouseDragged. At any cycle I get the nextEventMatchingMask, I get the
mouse position, I move the title-view's parent window and post a message to
all the other tabs checking whether the mouse point falls within their
frame. It looks like a draconian way to do that. So any better way is
appreciated. Thank you.

Regards
-- Leonardo


> Da: Kyle Sluder <[email protected]>
> Data: Sat, 11 Jan 2014 10:49:08 -0800
> A: Leonardo <[email protected]>
> Cc: "[email protected]" <[email protected]>
> Oggetto: Re: Drag a window and get draggingEntered
> 
>> On Jan 11, 2014, at 8:16 AM, Leonardo <[email protected]> wrote:
>> 
>> I can quite register an NSView to receive a notification (draggingEntered:)
>> when a file is drop over it
>> 
>> NSMutableArray *dragTypes = [NSMutableArray
>> arrayWithObjects:NSFilenamesPboardType, nil];
>> [myView registerForDraggedTypes:dragTypes];
>> 
>> I would like to get the same notification when I drag a NSWindow over that
>> NSView. Which PboardType should I use?
> 
> Window dragging doesn't have anything to do with pasteboards, so there'a no
> pasteboard type you can pass for window dragging.
> 
> 
>> I would like to achieve the following target: when I drag a window over an
>> NSWiew then release the mouse button, I remove the content from the window
>> and I put it within the view, then I delete the window. Photoshop does a
>> similar task.
> 
> It sounds like you're jumping to a specific implementation based on
> assumptions you've made about how Photoshop works.
> 
> But you're going to have to explain your desired behavior in a little more
> detail. What do you mean ³drag a window²? Surely Photoshop doesn't let you
> drag any arbitrary desktop window onto a document to snarf its contents; that
> would make it impossible to drag windows around your desktop, and would
> otherwise be impossible to implement.
> 
> So, do you actually mean dragging your own app¹s _windows_, or are you
> referring to their _file proxies_ (the icons in their title bars that refer to
> the file on disk)?
> 
> Or are you referring to something else entirely? Maybe something like Safari,
> which uses the drag manager to drag tabs between Safari windows, but attaches
> its own window to the mouse pointer so it can do the shrink/grow animation?
> 
> --Kyle Sluder



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to