Hi
I am trying to load a background image at startup, so I created custom view as a sub-class of NSView. I copied the image file into the project. But, the image does not load. I looked at several posts but this got me confused since they try to accomplish different results.
I went back and read Shane’s chapters on Dealing with Windows and Images, but they deal with different topics as well.
Your help is appreciated.
Thanks,
t.
Here is my code:
script myView
property parent : class “NSView”
on initWithFrame_(frame)
continue initWithFrame_(frame)
set theRect to {{15, 15}, {450, 450}}
set imageView to current application's NSImageView's alloc()'s initWithFrame_(theRect)
imageView's setImageScaling_(current application's NSScateToFit)
set theImage to current application's NSImage's imageNamed_("RedCircle.png")
imageView's setImage_(theImage)
addSubview_(imageView)
return me
end initWithFrame_
on drawRect_(dirtyRect)
-- Drawing cofde here.
end drawRect_
end script