Jump to content
Sign in to follow this  
Nick Blunda

System menu Item on macOS

Recommended Posts

Hi.
It is possible to hide "Window" item of system menu in macOS?

Window Item.png

Edited by Nick Blunda

Share this post


Link to post
24 minutes ago, Nick Blunda said:

It is possible to hide "Window" item of system menu in macOS?

Example code for how to do it:

uses
  Macapi.AppKit, Macapi.Helpers;

procedure TForm1.Button1Click(Sender: TObject);
var
  LMenu: NSMenu;
  LIndex: Integer;
begin
  LMenu := TNSApplication.Wrap(TNSApplication.OCClass.sharedApplication).mainMenu;
  LIndex := LMenu.indexOfItemWithTitle(StrToNSStr('Window'));
  if LIndex > -1 then
    LMenu.itemAtIndex(LIndex).setHidden(True);
end;

 

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×