]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
Add an option to use wxTextCtrl as input window in keyboard sample.
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index d4c7b8f6f6beb00daccaf48083ef4b2d8a415b3a..bc8d2601bb177eeb6086c534cd5c596968b97081 100644 (file)
@@ -1747,6 +1747,9 @@ void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnNotifMsgAuto(wxCommandEvent& WXUNUSED(event))
 {
+    // Notice that the notification remains shown even after the
+    // wxNotificationMessage object itself is destroyed so we can show simple
+    // notifications using temporary objects.
     if ( !wxNotificationMessage
           (
             "Automatic Notification",
@@ -1756,6 +1759,11 @@ void MyFrame::OnNotifMsgAuto(wxCommandEvent& WXUNUSED(event))
     {
         wxLogStatus("Failed to show notification message");
     }
+
+    // But it doesn't have to be a temporary, of course.
+    wxNotificationMessage n("Dummy Warning", "Example of a warning notification.");
+    n.SetFlags(wxICON_ERROR);
+    n.Show(5); // Just for testing, use 5 second delay.
 }
 
 void MyFrame::OnNotifMsgShow(wxCommandEvent& WXUNUSED(event))