CBEditableImageView

One of my recent goals is to release more code. Here is a new view I made for the development branch of ProfitTrain. I call it CBEditableImageView.

Sample App using CBEditableImageView

GitHub: https://github.com/zorn/CBEditableImageView

CBEditableImageView is a subclass of NSImageView that resembles the editable image well as seen in System Preferences > Users (where people assign a profile image to their account).

CBEditableImageView adds the following functionality to NSImageView:

  • On mouse hover, adds a tinted black look to the inner well to suggest to the user that this is editable.
  • On click, can present a context menu allowing the user to assign an image or clear it.
  • Can send key events to its delegate to allow for mouse-free interaction.
  • Fixes a bug in the native NSImageView where even when disabled it still accepts new images via drag and drop.

You can see the view in action in this short demo movie.

Please try it out and let me know if you end up using it.

Posted on: October 13, 2011 – 12:56 PM

Post a Comment | Comment RSS feed

(used for gravatar), address not displayed on site)