Dragging, IB style.
Dragging, IB style.
- Subject: Dragging, IB style.
- From: "John C. Randolph" <email@hidden>
- Date: Sat, 20 Oct 2001 04:06:39 -0700
Hi, all.
I'm implementing a view similar to NSToolBar in some ways, and I'd like
to be able to drag gumdrop buttons around. The dragging works and all,
but I'm having trouble generating an image of a button with the correct
alpha the way that IB does.
I'm generating the dragged image with this method (which is in my
NSMatrix subclass):
- (NSImage *) draggableImageForCellAtRow:(int) row column:(int) column
{
NSRect
cellFrame = [self cellFrameAtRow:row column:column];
return [[[NSImage alloc] initWith
Data:[self
dataWithPDFInsideRect:cellFrame]] autorelease];
}
I've also tried setting up an NSBitmapImageRep with alpha, locking focus
on it, and making the button cell render into it, but that still results
in the white blob around the button. Clearly, since the blob isn't
rectangular, the image does have alpha.
If anyone wants to see exactly what I'm talking about, I'll send you
some image grabs off-list.
Any suggestions?
-jcr
"I fear all we have done is to awaken a sleeping giant and fill him with
a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.