X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d2d8da1d89c195cb44f95f267989118e205c7bf..8916d00747c8e7b704ad549afcd8d0f88b6d861e:/samples/printing/printing.cpp?ds=sidebyside

diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp
index bdc779878e..45703a7f3d 100644
--- a/samples/printing/printing.cpp
+++ b/samples/printing/printing.cpp
@@ -192,7 +192,12 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
     wxPrinter printer(& printDialogData);
     MyPrintout printout("My printout");
     if (!printer.Print(this, &printout, TRUE))
-        wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK);
+    {
+        if (wxPrinter::GetLastError() == wxPRINTER_ERROR)
+            wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK);
+        else
+            wxMessageBox("You canceled printing", "Printing", wxOK);
+    }
     else
     {
         (*g_printData) = printer.GetPrintDialogData().GetPrintData();