0

I have a simple question. I have my NSView which is detecting drops (drag and drop). When user drops a link with image from browser, I detect that action, create NSImageView, initialize it on a place where user dropped it with some default frameSize and put the image from the link into it.

I would now like to highlight that NSImageView when user clicks on it. I also want to implement moving around that NSImageView in NSView but I'm pretty sure I will manage that. How do I highlight that exact NSImageView which was clicked? I haven't created earlier that NSImageView in interfacebuilder and assigned a special class for it so I can use drawRect, I have just created it dynamically... Any help would be appreciated.

jovanjovanovic
  • 4,158
  • 3
  • 22
  • 32
  • is your image contained in a NSTableView or something? are you using viewbased table view? cell based table view? Not sure what youre NSImageView is contained in – Just a coder Aug 13 '13 at 11:44
  • I'm just spawning NSImageView on my NSView (Custom View). – jovanjovanovic Aug 13 '13 at 12:25
  • hmm.. if you just have the NSImageView sitting there on a NSView, you cant exactly "highlight" the image like you would do to a NSTableView row. NSImage doesnt have methods to highlight like that. You only option would be to create a subclass of NSView, and override the drawing methods. I'm not familiar with the Drawing methods so maybe someone else can help you. You will also need to know what do you want you highlighting code to look like since you are doing the highlight your self. – Just a coder Aug 13 '13 at 12:35
  • Thanks Jai, if I could only draw a rectangle around that image, or imageView in which that image is - that would be great. – jovanjovanovic Aug 14 '13 at 01:42

1 Answers1

-1

You can use NSImageView's setImageFrameStyle for highlighting.

D-side
  • 9,150
  • 3
  • 28
  • 44
Sheen Vempeny
  • 818
  • 1
  • 5
  • 8