diff dw.hpp @ 2916:fe43f8667d3d

C++: Implement Notification class, and enable dwtestoo code that relied on it.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 28 Dec 2022 03:28:31 +0000
parents 8af64b6d75a9
children 77e5d6743013
line wrap: on
line diff
--- a/dw.hpp	Wed Dec 28 02:46:58 2022 +0000
+++ b/dw.hpp	Wed Dec 28 03:28:31 2022 +0000
@@ -1579,6 +1579,18 @@
     }
 };
 
+class Notification final : public Clickable
+{
+public:
+    // Constructors
+    Notification(const char *title, const char *imagepath, const char *description) { SetHWND(dw_notification_new(title, imagepath, description)); }
+    Notification(const char *title, const char *imagepath) { SetHWND(dw_notification_new(title, imagepath, NULL)); }
+    Notification(const char *title) { SetHWND(dw_notification_new(title, NULL, NULL)); }
+
+    // User functions
+    int Send() { int retval = dw_notification_send(hwnd); delete this; return retval; }
+};
+
 class App
 {
 protected: