HeartWare
HeartWare

Reputation: 8243

TTrayIcon for MacOS?

In Windows VCL, I have the TTrayIcon to be able to (partially) hide my application. Is there a similar method to have an application being outside the normal task list on MacOS and only accessible in an alternate location normally reserved for background applications?

The specifics is a TCP/IP server listening on a port for incoming traffic, but one that doesn't need a UI interface (except for setup purposes). On Windows, I manage this with TTrayIcon and a TPopupMenu, but I am at a loss on how to implement similar functionality on MacOS.

Upvotes: 1

Views: 221

Answers (1)

Olaf Hess
Olaf Hess

Reputation: 1483

What you are looking for is called Menu Bar app for Mac OSX. A search for "macos menu bar app source code" will yield lots of examples, but I have only found one (partial?) example written in Delphi. The main API to use is NSStatusItem.

EDIT: There is an example statusitem.pas for Lazarus / Free Pascal which might be useful for your purposes.

Upvotes: 3

Related Questions