class DockIcon
package openfl.desktop
extends InteractiveIcon › Icon › EventDispatcher
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The DockIcon class represents the macOS-style dock icon.
You can test for support at run time using the
NativeApplication.supportsDockIcon
property.
OpenFL target support: Not currently supported, except when targeting AIR.
Adobe AIR profile support: This feature is supported on all desktop operating systems, but it is not supported on mobile devices or AIR for TV devices. See AIR Profile Support for more information regarding API support across multiple profiles.
You can use the DockIcon class to change the appearance of the standard icon; for example, to animate the icon or add informational graphics. You can also add items to the dock icon menu. The menu items that you add are displayed above the standard menu items.
An instance of the DockIcon class cannot be created. Get the object
representing the operating system dock icon from NativeApplication.icon
.
Not all operating systems have dock icons. Check
NativeApplication.supportsDockIcon
to determine whether dock icons are
supported on the current system. If dock icons are supported, the
NativeApplication.icon
property is of type DockIcon. Otherwise, the type
of NativeApplication.icon
is another subclass of InteractiveIcon,
typically SystemTrayIcon.
Important: Attempting to call a DockIcon class method on the
NativeApplication.icon
object on an operating system for which OpenFL does
not support dock icons generates a run-time exception.
Methods
bounce(priority:NotificationType = INFORMATIONAL):Void
Notifies the user that an event has occurred that may require attention.
Calling this method bounces the dock icon if, and only if, the
application is in the background. If the priority
is
NotificationType.INFORMATIONAL
then the icon bounces once. If the
priority is NotificationType.CRITICAL
then the icon bounces until the
application is brought to the foreground.