[Lazarus] Adding Mac specific functionality

Ryan Joseph ryan at thealchemistguild.com
Tue Feb 5 15:24:54 CET 2019


I’m working on a Lazarus program for another person and I’d like to use a feature of the Mac Cocoa framework which doesn’t exist in Lazarus. 

I’m happy to add this myself and submit a patch (because it’s helpful for other users) but what is the protocol for doing this? I could add an accessor function into the control (TMemo) but it would route to a Cocoa control and it wouldn’t have any affect on Windows/Linux.

Here is the code in question which I’ve added via an ifdef for now but Lazarus should expose “setFocusRingType” in the main interface because it’s important on OS X.

     {$ifdef DARWIN}
     NSTextView(Memo1.Handle).setFocusRingType(NSFocusRingTypeNone);
     {$endif}

Regards,
	Ryan Joseph



More information about the lazarus mailing list