On Jan 29, 2012, at 6:27 PM, Fritz Anderson wrote:

I want to modify IKImageView so that it erases with the window background color. By default it erases with medium gray which looks awful.

I'm curious — how does the instance property .backgroundColor not suit your purpose?

Me I am curious why a search in the Organizer didn't turn it up - only for UIView.

[self setBackgroundColor:[[self window] backgroundColor]] in - awakeFromNib does the job. (in Carbon the window's backgroundColor didn't do it - I had to use the theme brush color)

Problem solved, except I still have to implement -drawRect or else the empty view is still erased with medium grey when the window opens. Calling -setNeedsDisplay in -awakeFromNib (after -setBackgroundColor) didn't help.

Also I want to register the file url when the user drags an image file on the view. How do I go about that?
Can I make it accept image files but not images in general?

I'd experiment with subclassing, then overriding the setImageWithURL: and setImage:imageProperties: methods. Possibly those aren't on the pipeline for drag-and-drop. In that case, my next experiment would be to override the <NSDraggingDestination> methods.

Neither -setImage:imageProperties: nor -setImageWithURL: is called after a drag.

Jan E.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to