Hey Everybody, I’d like to understand the fundamental impossibility of a subclassed NSView to read its own properties, like frame or bounds.
The NSView’s description says that: <MYView @0x60000015a6d0: OSAID(4) ComponentInstance(0x810002)>
All I wanted is to read frame size of my view inside its implementation. I tried several approaches: declare a property, write a method. I’m clearly missing something of how AppleScript works. When I expect the frame message I get nothing but the error:
script MYView property parent : class "NSView" property NSColor : class "NSColor" on initWithFrame:frame continue initWithFrame:frame return me end initWithFrame: on drawRect:dirtyRect continue drawRect:dirtyRect NSColor's brownColor()'s setFill() current application's NSRectFill(dirtyRect) end drawRect: on mouseUp:theEvent display dialog my frame's |description|() as text end mouseUp: end script