tw19700.pp 496 B

1234567891011121314151617181920212223242526
  1. { %target=darwin }
  2. { %norun }
  3. {$mode objfpc}
  4. {$modeswitch objectivec1}
  5. program Main;
  6. uses
  7. CocoaAll;
  8. type
  9. TSomeView = objcclass (NSView)
  10. function canvasPointFromEvent (theEvent: NSEvent): NSPoint; message 'canvasPointFromEvent:';
  11. end;
  12. function TSomeView.canvasPointFromEvent (theEvent: NSEvent): NSPoint;
  13. begin
  14. result := convertPoint_fromView(theEvent.locationInWindow, nil);
  15. end;
  16. var
  17. argc: LongInt;
  18. argv: PPChar;
  19. begin
  20. NSApplicationMain(argc, argv);
  21. end.