NSNativeButton as Default

Hi,


Is it possible to set a Native Button as default, i.e. it is coloured Blue 'before' clicking?

Many thanks

Andy

Hi, 


You can try the following code to accomplish this:

uses
  FMX.Platform.Mac, Macapi.AppKit;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFMXNativeNSButton1.BezelStyle := bbsRoundedBezelStyle;
end;

procedure TForm1.FormShow(Sender: TObject);
var
  h: TMacWindowHandle;
begin
  h := WindowHandleToPlatform(Self.Handle);
  h.Wnd.setDefaultButtonCell(TNSButtonCell.Wrap(TMSFMXNativeNSButton1.Button.cell));
end;

Works perfect, many thanks for your prompt response.


Andy