On Jul 29, 2009, at 4:16 PM, Alexander Bokovikov wrote:

Maybe it's a stupid question, but I can't find a solution... I'm dragging files from my app to desktop. All goes OK, but file icons are located one exactly above another if I'm dragging many items. As a result, few extra clicks on desktop are required to be able to split these icons.

The question is, how could I assign icons location for dropped items? I believe, though didn't yet tested it, that similar problem will be with Finder window, when it is in icons mode. The only point where I could get such information (as I believe) could be tableView::namesOfPromisedFilesDroppedAtDestination: method, but it doesn't contain any information about icons location.


I don't believe there is a (public API) way to set (or get) the location of an icon. If I read the first part of your message correctly, though, this isn't necessarily what you want. You only want them to tile / snap to a grid, right?

Are you saying that, even with the snap-to-grid setting enabled for the desktop (this is not the default), the icons don't snap to the grid when dropped from a promised drag? I'd file that as a bug.

In any case, you might be able to ask AppleScript to "clean up" the Desktop folder. I don't know if this is scriptable but it's worth a look. You'd want to first select those icons then "Clean Up Selection" (as the View menu item is called when there is a selection). I caution against "cleaning up" the entire desktop as those with OCD may not appreciate their pixel-perfect toils to align to a grid.

Then again, if they're truly OCD, I think they wouldn't mind a perfectly-aligned grid so much ... :-)

--
I.S.




_______________________________________________

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

This email sent to [email protected]

Reply via email to