X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/926bb76c2a79fcb83406552e9ca9324fc249ed31..bf44306ebca5d26e204ef17851516d844bc2f0a7:/wxPython/src/printfw.i diff --git a/wxPython/src/printfw.i b/wxPython/src/printfw.i index 2ca9a23f41..4ab596d72e 100644 --- a/wxPython/src/printfw.i +++ b/wxPython/src/printfw.i @@ -41,7 +41,7 @@ -class wxPrintData { +class wxPrintData : public wxObject { public: wxPrintData(); ~wxPrintData(); @@ -112,7 +112,7 @@ public: //--------------------------------------------------------------------------- -class wxPageSetupDialogData { +class wxPageSetupDialogData : public wxObject { public: wxPageSetupDialogData(); ~wxPageSetupDialogData(); @@ -165,7 +165,7 @@ public: //---------------------------------------------------------------------- -class wxPrintDialogData { +class wxPrintDialogData : public wxObject { public: wxPrintDialogData(); ~wxPrintDialogData(); @@ -219,9 +219,10 @@ public: // Since this one would be tough and ugly to do with the Macros... void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { bool hadErr = FALSE; + bool found; - bool doSave = wxPyRestoreThread(); - if (m_myInst.findCallback("GetPageInfo")) { + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = m_myInst.findCallback("GetPageInfo"))) { PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()")); if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) { PyObject* val; @@ -251,10 +252,9 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p } Py_DECREF(result); } - else + wxPyEndBlockThreads(state); + if (! found) wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo); - - wxPySaveThread(doSave); } void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { @@ -275,7 +275,7 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage); // Now define the custom class for SWIGging -%name(wxPrintout) class wxPyPrintout { +%name(wxPrintout) class wxPyPrintout : public wxObject { public: wxPyPrintout(const char* title = "Printout"); @@ -304,7 +304,7 @@ public: //---------------------------------------------------------------------- -class wxPrinter { +class wxPrinter : public wxObject { public: wxPrinter(wxPrintDialogData* data = NULL); ~wxPrinter(); @@ -320,7 +320,7 @@ public: //---------------------------------------------------------------------- -class wxPrintPreview { +class wxPrintPreview : public wxObject { public: wxPrintPreview(wxPyPrintout* printout, wxPyPrintout* printoutForPrinting, wxPrintData* data=NULL); // ~wxPrintPreview(); **** ???? @@ -364,6 +364,11 @@ public: }; //---------------------------------------------------------------------- + +%init %{ + wxPyPtrTypeMap_Add("wxPrintout", "wxPyPrintout"); +%} + //---------------------------------------------------------------------- //----------------------------------------------------------------------