Search code examples
objective-cnswindownsimage

how to place some label on some window?


I need to mark some opened window from my application. I can get the windows list, their system id, name, owner... Can I draw some NSImage only on choosen window?


Solution

  • If you have a window, as you say you do, you could add a NSImageView as a subview of that window. This NSImageView should be set to have a frame the same size as the window in question so it fills the window.

    If you need to do custom drawing you could subclass the NSImageView and override its drawRect: method or you could just set its image property to an image that you have already created and added to the apps bundle.

    Hope this is what you mean.