• 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
Re: NSTableView: displaying number of selected rows (error with image)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView: displaying number of selected rows (error with image)


  • Subject: Re: NSTableView: displaying number of selected rows (error with image)
  • From: Chad Weider <email@hidden>
  • Date: Wed, 5 Apr 2006 20:11:50 -0500

I suppose you might need to use this to get the bitmap it wants:

NSImage* image = [[NSImage alloc] initWithSize:size];
[image lockFocus];

// draw draw draw
NSBitmapImageRep* rep = [[NSBitmapImageRep alloc]
                        initWithFocusedViewRect:
                        NSMakeRect(0,0,size.width,size.height)];

[image unlockFocus];

(from http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaDrawingGuide/Images/chapter_7_section_5.html - scroll down to "Creating a Bitmap")


Chad Weider
email@hidden



On Mar 20, 2006, at 10:06 AM, Karim Morsy wrote:

thanks for the hint, chad!
this is exactly what I needed.
however the image doesn't get displayed when I do:
NSImage *im= [ct smallBadgeForValue:8]; // returns an NSImage
return im;
in NSTableView's - (NSImage *)dragImageForRowsWithIndexes: (NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event: (NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset.


I get the following message in the log:
dragging image does not contain bitmap
Could not create CoreDragImageSpec from NSImage

anyone know what might be missing here when creating the image ?



On Mar 19, 2006, at 11:41 PM, Chad Weider wrote:


On Mar 19, 2006, at 1:37 PM, Karim Morsy wrote:

I am using an nstableview as a dragging source. when I drag from the table view I display an nsimage under the mouse coursor. now what I would like to do is display the number of selected rows as well. I know how to retrieve the value but how can I show the number on top of the image (like it's done in the iApps, such as itunes or mail).
any hints would be really appreciated.

Here's some code to get the fancy badge: http://blog.oofn.net/projects/misc#CTBadge


Chad Weider email@hidden


_______________________________________________ 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
  • Prev by Date: Confused about Distributed Objects
  • Next by Date: Re: Confused about Distributed Objects
  • Previous by thread: Re: Confused about Distributed Objects
  • Next by thread: Thread safety issue...
  • Index(es):
    • Date
    • Thread