• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dragging, IB style.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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] initWithData:[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.


  • Prev by Date: Re: NSOpenPanel and special files
  • Next by Date: Re: CORBA with Mac OS X
  • Previous by thread: Re: NSOpenPanel and special files
  • Next by thread: Varying row heights in NSTableView
  • Index(es):
    • Date
    • Thread