Mac Buttons
English · Русский
(macOS only)
By default, the button placed onto a form by Lazarus is 75 width by 25 height, which is not the standard for Mac Applications.
In order for buttons to appear oval, make the button height 22 maximum.
This can be done by setting the button height directly or through code.
CODE FOR A SINGLE BUTTON:
procedure TForm1.FormCreate(Sender: TObject);
begin
Button1.Height := 22;
end;CODE FOR ALL BUTTONS:
procedure TForm1.FormCreate(Sender: TObject);
var
I: Integer;
begin
for I := 0 to Form1.ControlCount - 1 do begin
if (Form1.Controls[I].ClassType = TButton) then Form1.Controls[I].Height := 22;
end;
end;See also
- Introduction to platform-sensitive development
- Mac Show Application Title, Version, and Company
- Add an Apple Help Book to your macOS app
- macOS Programming Tips
From the Free Pascal wiki, page "Mac Buttons", as it stood on 2019-12-18 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
