I'm new to cocoa, but pretty comfortable with ruby. I'm trying to draw an image in a custom view in a document based app. Here's my code:
class MapView < OSX::NSView
ns_overrides 'initWithFrame:', 'drawRect:'
def initWithFrame (frame)
@mapbase = NSImage.imageNamed("map_blank")
def drawRect (rect)
@mapbase.compositeToPoint(:drawPoint, :operation, NSCompositeSourceOver)
I can't get it to compile. What is the right way to do this?
thanks in adavance,