Dock
This page describes how to configure the application’s icon in the macOS Dock.
Overview
The Dock is a convenient way to launch and switch between applications on macOS. When you run Molybden application, its icon will appear in the Dock.
Molybden provides APIs you can use to configure the application icon in the Dock. You can show a badge with a custom text on the icon or show/hide the app’s icon in the Dock.
Badge text
You can show a badge with a custom text on the app’s icon in the Dock. To do this, use the following code:
app->dock()->setBadgeText("42");
Note: To display the badge text on the app’s icon in the Dock, the Badge application icon setting must be enabled in System Preferences → Notifications → MyApp.
To remove the badge text from the icon, just set an empty string:
app->dock()->setBadgeText("");
Hiding app icon
You can hide the app’s icon in the Dock. To do this, use the following code:
app->dock()->hide();
When you hide the application icon in the Dock, the application menu bar will be hidden automatically.
Tip: You can use this approach to hide the application from the user, but still keep it running in the background.