Re: Draggable buttons
Re: Draggable buttons
- Subject: Re: Draggable buttons
- From: John Timmer <email@hidden>
- Date: Sun, 18 Sep 2005 12:10:54 -0400
Is there a reason this is preferable to tracking mouse dragging events in a
view and moving the view along with it? I realize that the snap back
animation is informative to a user, but I would have also thought that the
object stopping at the edge of its container view was also informative. Is
this less processor intensive?
Thanks,
JT
> The RoundTransparentWindow example isn't really applicable to this.
>
> To get an image of your button for dragging, use -
> cacheDisplayInRect:toBitmapImageRep:, and to do the dragging
> operation itself, use
> dragImage:at:offset:event:pasteboard:source:slideBack:, and implement
> the NSDraggingDestination protocol in the view where you want to drop
> the buttons.
>
> -jcr
>
>
> On Sep 18, 2005, at 8:36 AM, John Timmer wrote:
>
>> Apple's got example code somewhere on how to create an irregular
>> shaped
>> borderless window (a quick try at searching failed). The window
>> allows you
>> to drag it around the screen on mouse down events. It's pretty
>> easy to
>> translate the basic principles to dragging a view.
>>
>> The only other thing you need is for your view to check its
>> superview's
>> frame at the start of the drag, and use these as limits to keep it on
>> screen.
>>
>> If you can't find the code, I've got a similar thing done for a
>> text view,
>> and I can send it by email off list.
>>
_______________________________________________
This mind intentionally left blank
_______________________________________________
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