Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.33 KB

notify.md

File metadata and controls

40 lines (27 loc) · 1.33 KB

Notification API

Displaying a desktop notification is done using the pfd::notify class. It can be provided a title, a message text, and an icon for the notification style:

pfd::notify::notify(std::string const &title,
                    std::string const &text,
                    pfd::icon icon = pfd::icon::info);

enum class pfd::icon { info, warning, error };

Example

Displaying a notification is straightforward. Emoji are supported:

pfd::notify("System event", "Something might be on fire 🔥",
            pfd::icon::warning);

The pfd::notify object needs not be kept around, letting the object clean up itself is enough.

Screenshots

Windows 10: notify-win32

Mac OS X (dark theme): image

Mac OS X (light theme): image

Linux (GNOME desktop): notify-gnome

Linux (KDE desktop): notify-kde