Re: Tear off...
Re: Tear off...
- Subject: Re: Tear off...
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 20 May 2002 12:35:12 -0700
On Monday, May 20, 2002, at 12:21 PM, Albert Atkinson wrote:
Hello!
Is the source of this available so I can learn from how he
implements it? I can see what he did but the problem is I want
to know how he did it :-)
Well, you'd have to ask him. What he did is pretty
straightforward, though. Off the top of my head, in pseudo code:
if (IShouldStartDragging)
{
dragImage = a new NSImage with an appropriate size
lockfocus on the image, send drawRect to the view I want to
drag, unlockfocus
[self startDragging..etc.]
}
...
if (IGotNotifiedOfDraggingEnded)
{
make a new window of the appropriate size
set its content view to the view I wanted to tear off
move the window to where the mouse was when the button went up
order the window to the front
}
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Sftware Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.