Recent

Author Topic: [SOLVED]Hiding icon from a taskbar  (Read 3910 times)

bobix

  • Jr. Member
  • **
  • Posts: 71
    • http://rechnik-bg.com
[SOLVED]Hiding icon from a taskbar
« on: April 28, 2017, 10:07:05 am »
I'm little new to macOS :(
is there any way to hide app icon from a taskbar? This is not working. App's icon is still visible :(
Quote
Form1.visible:=false;
Form1.ShowInTaskBar:=stNever;
« Last Edit: April 28, 2017, 10:57:12 am by bobix »
Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64

bobix

  • Jr. Member
  • **
  • Posts: 71
    • http://rechnik-bg.com
Re: Hiding icon from a taskbar
« Reply #1 on: April 28, 2017, 10:56:17 am »
simply right-click the program in the Finder and choose "Show Package Contents," followed by opening the "Contents" folder in the window that appears. In here, locate the file called "Info.plist" which is a small text file in Apple's Property List XML format. As with all property lists, this file is organized in a key-and-value structure, so to instruct the system to prevent the program from displaying in the Dock, we simply need to add the following key and value to this file:
Quote
<key>LSUIElement</key>
<true/>
Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: Hiding icon from a taskbar
« Reply #2 on: May 01, 2017, 01:55:50 pm »
simply right-click the program in the Finder and choose "Show Package Contents," followed by opening the "Contents" folder in the window that appears. In here, locate the file called "Info.plist" which is a small text file in Apple's Property List XML format. As with all property lists, this file is organized in a key-and-value structure, so to instruct the system to prevent the program from displaying in the Dock, we simply need to add the following key and value to this file:
Quote
<key>LSUIElement</key>
<true/>
This defines your program to be an agent app. In addition to being hidden from the dock it doesn't appear in the Force Quit window. In case of a crash you have to quit your app from the shell with kill -9.

A detailled reference on info.plist files is available from http://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

 

TinyPortal © 2005-2018