<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,16 @@
 @echo off
-python setup.py
+
+if &quot;d&quot;==&quot;%1&quot; goto debug
+
+:release
+echo building wxpy RELEASE
+echo ---------------------
+python setup.py %1 %2 %3 %4 %5 %6 %7 %8 %9
+goto done
+
+:debug
+echo building wxpy DEBUG
+echo -------------------
+python_d setup.py %1 %2 %3 %4 %5 %6 %7 %8 %9
+
+:done</diff>
      <filename>b.bat</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-import os
+import os.path
 import shutil
+import sys
 
 import genlisttypes
 from wxpybuild.wxpyext import build_extension, WXWIN
@@ -8,23 +9,48 @@ wxpy_modules = [
     ('_wxcore',  ['src/wx.sip']),
     ('_wxhtml',  ['src/html.sip']),
     ('_wxstc',   ['contrib/stc/stc.sip']),
-    #('_webview', ['src/webview.sip']),
 ]
 
+if not '--nowk' in sys.argv:
+    wxpy_modules.append(('_webview', ['src/webview.sip']))
+    BUILDING_WK = True
+else:
+    sys.argv.remove('--nowk')
+    BUILDING_WK = False
+
+
+from path import path
+WEBKITDIR   = path(r'c:\dev\digsby\build\msw\webkit')
+WEBKITBUILD = WEBKITDIR / 'WebKitBuild'
+
+DEBUG = os.path.splitext(sys.executable)[0].endswith('_d')
+
 def main():
     genlisttypes.generate()
-    build_extension('wxpy', wxpy_modules)
+
+    opts = {}
+
+    if BUILDING_WK:
+        opts.update(includes = [WEBKITDIR / 'WebKit'],
+                    libs     = ['wxwebkit'],
+                    libdirs  = [WEBKITBUILD / 'Release'])
+
+    build_extension('wxpy', wxpy_modules, **opts)
 
     import os
     if os.name == 'nt':
         windows_install_pyds()
 
 def windows_install_pyds():
-    srcdir  = 'build/obj-msvs2005prj/'
+    srcdir  = 'build/obj-msvs2005prj'
+    srcdir += '_d/' if DEBUG else '/'
+
     destdir = 'wx/'
 
     print 'copying binaries from %s to %s:' % (srcdir, destdir)
     for name, sources in wxpy_modules:
+        if DEBUG:
+            name = name + '_d'
         for ext in ('.pyd', '.pdb'):
             print '  %s%s' % (name, ext)
             copy_with_prompt('%s%s%s' % (srcdir,  name, ext),
@@ -56,4 +82,4 @@ if __name__ == '__main__':
 
     try: main()
     except SystemExit: raise
-    except: print_exc(); sys.exit(1)
\ No newline at end of file
+    except: print_exc(); sys.exit(1)</diff>
      <filename>setup.py</filename>
    </modified>
    <modified>
      <diff>@@ -52,7 +52,7 @@ def matchhelp(pattern, string, repl='_._'):
             elif m_start == m_end:   # zero-width match;
                 m_end += 1           #    keep things moving along
 
-            m = r.search(string, m_end)                
+            m = r.search(string, m_end)
 
         print( ('global replace (%s):\n%s') %
                (repl, re.sub(pattern, repl, string)) )</diff>
      <filename>sipclean.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,27 +4,6 @@
 #endif
 %End
 
-int EntryStart();
-%MethodCode
-    int argc = 0;
-    char** argv = 0;
-    wxApp* app = wxTheApp;
-
-    /* Ensure the wxApp was created already. */
-    if (app == NULL)
-    {
-        PyErr_SetString(PyExc_AssertionError, &quot;wxEntryStart called without a wxApp created yet&quot;);
-        sipIsErr = 1;
-    }
-
-    /* Call wxEntryStart for wx initialization */
-    sipRes = wxEntryStart(argc, argv);
-
-    /* Connect the CallAfter mechanism. */
-    initializeCallAfter();
-%End
-
-
 %ModuleHeaderCode
 
 class wxPyApp : public wxApp
@@ -33,15 +12,22 @@ public:
     wxPyApp();
     ~wxPyApp();
 
-    void OnAssertFailure(const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg);
-
+    virtual void OnAssertFailure(const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg);
     PyObject* callAfterCbs;
+    wxString executable;
 };
 
-%End // ModuleHeaderCode
+%End // TypeHeaderCode
 
 %ModuleCode
 
+
+#ifndef WXPY_PREC
+#ifdef __WXMSW__
+#include &lt;wx/msw/crashrpt.h&gt;
+#endif
+#endif
+
 wxPyApp::wxPyApp()
 {
     SIP_BLOCK_THREADS
@@ -56,7 +42,7 @@ wxPyApp::~wxPyApp()
     SIP_UNBLOCK_THREADS
 }
 
-void wxPyApp::OnAssertFailure(const wxChar *file, int line, const wxChar *szFunc, const wxChar *cond, const wxChar *szMsg)
+static void traceback_print_stack()
 {
     SIP_BLOCK_THREADS
     PyObject* traceback = PyImport_ImportModule(&quot;traceback&quot;);
@@ -72,6 +58,101 @@ void wxPyApp::OnAssertFailure(const wxChar *file, int line, const wxChar *szFunc
         Py_DECREF(traceback);
     }
     SIP_UNBLOCK_THREADS
+}
+
+#ifdef __WXMSW__
+
+extern EXCEPTION_POINTERS *wxGlobalSEInformation = NULL;
+
+#include &lt;wx/msw/seh.h&gt;
+
+unsigned long wxGlobalSEHandler(EXCEPTION_POINTERS *pExcPtrs)
+{
+    // store the pointer to exception info
+    wxGlobalSEInformation = pExcPtrs;
+
+    wxSEH_TRY
+    {
+        wxTheApp-&gt;OnFatalException();
+    }
+    wxSEH_IGNORE
+
+    wxSEH_TRY
+    {
+        wxPyApp* app = (wxPyApp*)wxTheApp;
+        wxString cmd(app-&gt;executable);
+
+        wxCrashReport::Generate(wxCRASH_REPORT_DEFAULT, pExcPtrs);
+
+        cmd &lt;&lt; wxT(&quot; --crashreport &quot;) &lt;&lt; wxCrashReport::GetFileName();
+        wxExecute(cmd);
+    }
+    wxSEH_IGNORE
+
+    wxGlobalSEInformation = NULL;
+
+    // this will execute our handler and terminate the process
+    return EXCEPTION_EXECUTE_HANDLER;
+}
+/*
+void wxPyApp::OnFatalException()
+{
+    traceback_print_stack();
+    fprintf(stderr, &quot;OnFatalException, generating minidump...\n&quot;);
+
+    wxString msg;
+
+    SIP_BLOCK_THREADS
+    fprintf(stderr, &quot;Inside SIP_BLOCK_THREADS\n&quot;);
+
+    // grab sys.executable
+    PyObject *mod;
+    mod = PyImport_ImportModule(&quot;sys&quot;);
+    fprintf(stderr, &quot;mod is %p\n&quot;, mod);
+
+    if (mod)
+    {
+        PyObject* sys_dict = PyModule_GetDict(mod);
+        fprintf(stderr, &quot;sys_dict is %p\n&quot;, sys_dict);
+        if (sys_dict)
+        {
+            PyObject* pyExecutable = PyDict_GetItemString(sys_dict, &quot;executable&quot;);
+            fprintf(stderr, &quot;pyExecutable is %p\n&quot;, pyExecutable);
+            if (pyExecutable)
+            {
+                wxString pythonExc;
+                char* pyexechar = PyString_AsString(pyExecutable);
+
+                fprintf(stderr, &quot;pexechar is %s\n&quot;, pyexechar);
+
+                pythonExc.FromAscii(pyexechar);
+                msg &lt;&lt; wxT(&quot;Python excutable is &quot;) &lt;&lt; pythonExc &lt;&lt; wxT(&quot;\n&quot;);
+            }
+            else
+                fprintf(stderr, &quot;Coult not get sys.__dict__['executable']\n&quot;);
+        }
+        else
+            fprintf(stderr, &quot;Could not get sys.__dict__\n&quot;);
+        Py_DECREF(mod);
+    }
+    else
+        fprintf(stderr, &quot;Could not import 'sys'\n&quot;);
+    SIP_UNBLOCK_THREADS
+
+    msg &lt;&lt; wxT(&quot;A crash dump was generated at &quot;);
+    msg &lt;&lt; wxCrashReport::GetFileName();
+    wxCrashReport::Generate(wxCRASH_REPORT_DEFAULT);
+
+    wxMessageBox(msg);
+}
+*/
+#else
+#error &quot;No fatal exception handling.&quot;
+#endif
+
+void wxPyApp::OnAssertFailure(const wxChar *file, int line, const wxChar *szFunc, const wxChar *cond, const wxChar *szMsg)
+{
+    traceback_print_stack();
 
     wxString msg;
     msg.reserve(2048);
@@ -95,27 +176,73 @@ void wxPyApp::OnAssertFailure(const wxChar *file, int line, const wxChar *szFunc
     msg &lt;&lt; &quot;\n&quot; &lt;&lt; GetAssertStackTrace();
 #endif
 
-
     fprintf(stderr, &quot;%s&quot;, msg.ToAscii());
 }
 
 %End // ModuleCode
 
+
+int EntryStart();
+%MethodCode
+    int argc = 0;
+    char** argv = 0;
+    wxApp* app = wxTheApp;
+
+    /* Ensure the wxApp was created already. */
+    if (app == NULL)
+    {
+        PyErr_SetString(PyExc_AssertionError, &quot;wxEntryStart called without a wxApp created yet&quot;);
+        sipIsErr = 1;
+    }
+
+    /* Call wxEntryStart for wx initialization */
+    sipRes = wxEntryStart(argc, argv);
+
+    /* Connect the CallAfter mechanism. */
+    initializeCallAfter();
+%End
+
 class wxApp : wxEvtHandler
 {
-public:
     wxApp();
     ~wxApp();
 };
 
 class wxPyApp : wxApp
 {
+
+%TypeHeaderCode
+#include &lt;wx/msw/seh.h&gt;
+%End
+
+
 public:
     wxPyApp() /Transfer/;
     ~wxPyApp();
     virtual bool OnInit();
     virtual bool OnInitGui();
-    virtual int MainLoop() /ReleaseGIL/;
+
+    void SetExecutable(const wxString&amp; exc);
+%MethodCode
+    sipCpp-&gt;executable = *a0;
+%End
+
+    int MainLoop();
+%MethodCode
+    Py_BEGIN_ALLOW_THREADS
+#if __WXMSW__
+    wxSEH_TRY
+    {
+#endif
+        sipRes = sipCpp-&gt;MainLoop();
+#if __WXMSW__
+    }
+    wxSEH_HANDLE(-1)
+#endif
+    Py_END_ALLOW_THREADS
+%End
+
+    virtual void OnFatalException();
 
     void ReleaseGIL();
 %MethodCode
@@ -123,6 +250,15 @@ public:
     Py_END_ALLOW_THREADS
 %End
 
+    int Crash();
+%MethodCode
+    int a = 1;
+    int b = 1;
+    b--;
+    int c = a/b;
+    sipRes = c;
+%End
+
     wxString GetAppName() const;
     void SetAppName(const wxString&amp; name);
 </diff>
      <filename>src/app.sip</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,10 @@ typedef int wxBitmapType;
 
 class wxMask : wxObject
 {
+private:
+    wxMask(const wxMask&amp;);
+    wxMask();
+
 public:
     wxMask(const wxBitmap&amp; bitmap, const wxColour&amp; colour = wxNullColour);
     virtual ~wxMask();
@@ -30,8 +34,11 @@ wxBitmap wxEmptyBitmap(int width, int height);
 
 class wxBitmap : wxGDIObject
 {
-public:
+private:
     wxBitmap();
+    wxBitmap(const wxBitmap&amp;);
+
+public:
     wxBitmap(const wxString&amp; filename, long type = wxBITMAP_TYPE_ANY);
 
     virtual ~wxBitmap();</diff>
      <filename>src/bitmap.sip</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ private:
 
 
 %PostInitialisationCode
-PyDict_SetItemString(sipModuleDict, &quot;wxTheClipboard&quot;,
+PyDict_SetItemString(sipModuleDict, &quot;TheClipboard&quot;,
                      sipConvertFromInstance((void*)wxTheClipboard, sipClass_wxClipboard, NULL));
 %End
 </diff>
      <filename>src/clipboard.sip</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,11 @@ wxCursor wxStockCursor(int id);
     sipRes = new wxCursor(a0);
 %End
 
-class wxCursor : wxGDIObject {
+
+class wxCursor : wxGDIObject
+{
+public:
+    wxCursor();
     wxCursor(const wxString&amp; cursorName, long type, int hotSpotX = 0, int hotSpotY = 0);
     virtual ~wxCursor();
 };
\ No newline at end of file</diff>
      <filename>src/cursor.sip</filename>
    </modified>
    <modified>
      <diff>@@ -452,8 +452,9 @@ public:
         // sets the date to the given day of the given week in the year,
         // returns True on success and False if given date doesn't exist (e.g.
         // numWeek is &gt; 53)
-    bool SetToTheWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First);
-    wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First);
+    // deprecated
+    //bool SetToTheWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First);
+    //wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First);
 
         // returns the date corresponding to the given week day of the given
         // week (in ISO notation) of the specified year</diff>
      <filename>src/datetime.sip</filename>
    </modified>
    <modified>
      <diff>@@ -196,3 +196,5 @@ unsigned long wxGetProcessId();
 wxString wxGetOsDescription();
 bool wxIsPlatformLittleEndian();
 bool wxIsPlatform64Bit();
+
+bool wxHandleFatalExceptions();
\ No newline at end of file</diff>
      <filename>src/functions.sip</filename>
    </modified>
    <modified>
      <diff>@@ -11,8 +11,8 @@ public:
 
 %ConvertToTypeCode
     if (sipIsErr == NULL)
-        return sequence_2_ints_check(sipPy)
-            || sipCanConvertToInstance(sipPy, sipClass_wxGBPosition, SIP_NO_CONVERTORS);
+        return sipCanConvertToInstance(sipPy, sipClass_wxGBPosition, SIP_NO_CONVERTORS)
+            || sequence_2_ints_check(sipPy);
 
     int _x, _y;
     if (sequence_2_ints(sipPy, &amp;_x, &amp;_y))
@@ -47,8 +47,8 @@ public:
 
 %ConvertToTypeCode
     if (sipIsErr == NULL)
-        return sequence_2_ints_check(sipPy)
-            || sipCanConvertToInstance(sipPy, sipClass_wxGBSpan, SIP_NO_CONVERTORS);
+        return sipCanConvertToInstance(sipPy, sipClass_wxGBSpan, SIP_NO_CONVERTORS)
+            || sequence_2_ints_check(sipPy);
 
     int _x, _y;
     if (sequence_2_ints(sipPy, &amp;_x, &amp;_y))</diff>
      <filename>src/gbsizer.sip</filename>
    </modified>
    <modified>
      <diff>@@ -11,14 +11,16 @@ class wxPoint
 #endif
 %End
 
+
+
 public:
     wxPoint(int x = 0, int y = 0);
     ~wxPoint();
 
 %ConvertToTypeCode
     if (sipIsErr == NULL)
-        return sequence_2_ints_check(sipPy)
-            || sipCanConvertToInstance(sipPy, sipClass_wxPoint, SIP_NO_CONVERTORS);
+        return sipCanConvertToInstance(sipPy, sipClass_wxPoint, SIP_NO_CONVERTORS)
+            || sequence_2_ints_check(sipPy);
 
     int _x, _y;
     if (sequence_2_ints(sipPy, &amp;_x, &amp;_y)) {
@@ -72,6 +74,7 @@ public:
 
     int x;
     int y;
+
 };
 
 class wxSize
@@ -102,8 +105,8 @@ public:
 // Convert from tuples of two integers
 %ConvertToTypeCode
     if (sipIsErr == NULL)
-        return sequence_2_ints_check(sipPy) ||
-            sipCanConvertToInstance(sipPy, sipClass_wxSize, SIP_NO_CONVERTORS);
+        return sipCanConvertToInstance(sipPy, sipClass_wxSize, SIP_NO_CONVERTORS)
+            || sequence_2_ints_check(sipPy);
 
     int _x, _y;
     if (sequence_2_ints(sipPy, &amp;_x, &amp;_y)) {
@@ -151,7 +154,6 @@ wxRect RectPS(const wxPoint&amp; topLeft, const wxSize&amp; bottomRight);
     sipRes = new wxRect(*a0);
 %End
 
-
 class wxRect
 {
 
@@ -162,10 +164,11 @@ class wxRect
 %End
 
 public:
+
 %ConvertToTypeCode
     if (sipIsErr == NULL)
-        return sequence_4_ints_check(sipPy)
-            || sipCanConvertToInstance(sipPy, sipClass_wxRect, SIP_NO_CONVERTORS);
+        return sipCanConvertToInstance(sipPy, sipClass_wxRect, SIP_NO_CONVERTORS)
+            || sequence_4_ints_check(sipPy);
 
     int _x, _y, _w, _h;
     if (sequence_4_ints(sipPy, &amp;_x, &amp;_y, &amp;_w, &amp;_h)) {
@@ -255,37 +258,6 @@ public:
     sipRes = 4;
 %End
 
-    SIP_PYTUPLE __getitem__(SIP_PYSLICE);
-%MethodCode
-//    int PySlice_GetIndicesEx(	PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
-
-    Py_ssize_t start, stop, step, length;
-    PySlice_GetIndicesEx((PySliceObject*)a0, 4, &amp;start, &amp;stop, &amp;step, &amp;length);
-
-    sipRes = PyTuple_New(length);
-    int c = 0;
-    int val = -1;
-    int i;
-
-    for (i = start; (step &gt; 0 ? i &lt; stop : i &gt; stop); i += step) {
-        switch (i) {
-            case 0: val = sipCpp-&gt;x; break;
-            case 1: val = sipCpp-&gt;y; break;
-            case 2: val = sipCpp-&gt;width; break;
-            case 3: val = sipCpp-&gt;height; break;
-            default:
-                PyErr_SetString(PyExc_IndexError, &quot;index out of range&quot;);
-                sipIsErr = 1;
-        }
-
-        if (sipIsErr) break;
-        PyTuple_SET_ITEM(sipRes, c++, PyInt_FromLong(val));
-    }
-
-    if (sipIsErr)
-        Py_DECREF(sipRes);
-%End
-
     int __getitem__(size_t i);
 %MethodCode
     switch (a0)
@@ -308,12 +280,44 @@ public:
     }
 %End
 
+SIP_PYTUPLE __getitem__(SIP_PYSLICE);
+%MethodCode
+//    int PySlice_GetIndicesEx(	PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
+
+Py_ssize_t start, stop, step, length;
+PySlice_GetIndicesEx((PySliceObject*)a0, 4, &amp;start, &amp;stop, &amp;step, &amp;length);
+
+sipRes = PyTuple_New(length);
+int c = 0;
+int val = -1;
+int i;
+
+for (i = start; (step &gt; 0 ? i &lt; stop : i &gt; stop); i += step) {
+    switch (i) {
+        case 0: val = sipCpp-&gt;x; break;
+        case 1: val = sipCpp-&gt;y; break;
+        case 2: val = sipCpp-&gt;width; break;
+        case 3: val = sipCpp-&gt;height; break;
+        default:
+            PyErr_SetString(PyExc_IndexError, &quot;index out of range&quot;);
+            sipIsErr = 1;
+    }
+
+    if (sipIsErr) break;
+    PyTuple_SET_ITEM(sipRes, c++, PyInt_FromLong(val));
+}
+
+if (sipIsErr)
+    Py_DECREF(sipRes);
+%End
+
     bool operator==(const wxRect&amp;);
 
     int x;
     int y;
     int width;
     int height;
+
 };
 
 </diff>
      <filename>src/gdicmn.sip</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
 
-class wxGDIObject : wxObject {
-public:
+class wxGDIObject : wxObject
+{
+private:
+    wxGDIObject();
+    wxGDIObject(const wxGDIObject&amp;);
 
+public:
     virtual ~wxGDIObject();
-
     bool IsNull();
-private:
-    wxGDIObject();
-    
 };</diff>
      <filename>src/gdiobj.sip</filename>
    </modified>
    <modified>
      <diff>@@ -57,39 +57,46 @@ public:
 
 class wxGraphicsObject : wxObject
 {
-public :
+private:
     wxGraphicsObject(wxGraphicsRenderer* renderer = NULL);
+    wxGraphicsObject(const wxGraphicsObject&amp;);
     virtual ~wxGraphicsObject();
-
+public:
     bool IsNull() const;
     wxGraphicsRenderer* GetRenderer() const;
 };
 
 class wxGraphicsPen : wxGraphicsObject
 {
-public :
+private:
     wxGraphicsPen();
+    wxGraphicsPen(const wxGraphicsPen&amp;);
     virtual ~wxGraphicsPen();
 };
 
 class wxGraphicsBrush : wxGraphicsObject
 {
-public :
+private:
     wxGraphicsBrush();
+    wxGraphicsBrush(const wxGraphicsBrush&amp;);
     virtual ~wxGraphicsBrush();
 };
 
 class wxGraphicsFont : wxGraphicsObject
 {
-public :
+private:
     wxGraphicsFont();
+    wxGraphicsFont(const wxGraphicsFont&amp;);
     virtual ~wxGraphicsFont();
 };
 
 class wxGraphicsMatrix : wxGraphicsObject
 {
-public :
-//    wxGraphicsMatrix();
+private:
+    wxGraphicsMatrix();
+    wxGraphicsMatrix(const wxGraphicsMatrix&amp;);
+
+public:
     virtual ~wxGraphicsMatrix();
     void Concat(const wxGraphicsMatrix&amp; t);
     void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
@@ -109,8 +116,11 @@ public :
 
 class wxGraphicsPath : wxGraphicsObject
 {
-public :
-//    wxGraphicsPath();
+private:
+    wxGraphicsPath();
+    wxGraphicsPath(const wxGraphicsPath&amp;);
+
+public:
     virtual ~wxGraphicsPath();
 
     void  MoveToPoint(wxDouble x, wxDouble y);
@@ -148,15 +158,18 @@ public :
 
 class wxGraphicsContext : wxGraphicsObject
 {
+private:
+    wxGraphicsContext();
+    wxGraphicsContext(const wxGraphicsContext&amp;);
+
 public:
-    //wxGraphicsContext();         This is an ABC, use Create to make an instance...
     virtual ~wxGraphicsContext();
 
-    static wxGraphicsContext* Create(const wxWindowDC&amp; dc);
-    static wxGraphicsContext* Create(wxWindow* window);
-    static wxGraphicsContext* Create();
-    static wxGraphicsContext* CreateFromNative(void * context);
-    static wxGraphicsContext* CreateFromNativeWindow(void * window);
+    static wxGraphicsContext* Create(const wxWindowDC&amp; dc) /Factory/;
+    static wxGraphicsContext* Create(wxWindow* window) /Factory/;
+    static wxGraphicsContext* Create() /Factory/;
+    static wxGraphicsContext* CreateFromNative(void * context) /Factory/;
+    static wxGraphicsContext* CreateFromNativeWindow(void * window) /Factory/;
 
     wxGraphicsPath CreatePath();
     wxGraphicsPen CreatePen(const wxPen&amp; pen);
@@ -207,44 +220,31 @@ public:
 
 SIP_PYOBJECT GetTextExtent(const wxString &amp;text);
 %MethodCode
-            wxDouble width = 0.0,
-                     height = 0.0;
-            sipCpp-&gt;GetTextExtent(*a0, &amp;width, &amp;height, NULL, NULL);
-
-            PyObject* rv = PyTuple_New(2);
-            PyTuple_SET_ITEM(rv, 0, PyFloat_FromDouble(width));
-            PyTuple_SET_ITEM(rv, 1, PyFloat_FromDouble(height));
-            sipRes = rv;
+    wxDouble width = 0.0, height = 0.0;
+    sipCpp-&gt;GetTextExtent(*a0, &amp;width, &amp;height, NULL, NULL);
+
+    PyObject* rv = PyTuple_New(2);
+    PyTuple_SET_ITEM(rv, 0, PyFloat_FromDouble(width));
+    PyTuple_SET_ITEM(rv, 1, PyFloat_FromDouble(height));
+    sipRes = rv;
 %End
-/*
-    %extend {
-        DocAStr(GetPartialTextExtents,
-                &quot;GetPartialTextExtents(self, text) -&gt; [widths]&quot;;
-                &quot;Returns a list of widths from the beginning of ``text`` to the
-coresponding character in ``text``.&quot;, &quot;&quot;);
-        wxArrayDouble GetPartialTextExtents(const wxString&amp; text) {
-            wxArrayDouble widths;
-            self-&gt;GetPartialTextExtents(text, widths);
-            return widths;
-        }
-    }
-
-*/
-         void DrawBitmap(const wxBitmap &amp;bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h);
-         void DrawIcon(const wxIcon &amp;icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h);
-         void StrokeLine(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2);
-//         void StrokeLines(size_t points, const wxPoint2DDouble *points_array);
-         void DrawRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
-         void DrawEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
-         void DrawRoundedRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius);
-         bool ShouldOffset() const;
-    private:
-        wxGraphicsContext();
+
+    void DrawBitmap(const wxBitmap &amp;bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h);
+    void DrawIcon(const wxIcon &amp;icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h);
+    void StrokeLine(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2);
+    void DrawRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
+    void DrawEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
+    void DrawRoundedRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius);
+    bool ShouldOffset() const;
 };
 
 class wxGraphicsRenderer : wxObject
 {
-public :
+private:
+    wxGraphicsRenderer();
+    wxGraphicsRenderer(const wxGraphicsRenderer&amp;);
+
+public:
     // wxGraphicsRenderer();  This is an ABC, use GetDefaultRenderer
 
      ~wxGraphicsRenderer();
@@ -278,8 +278,7 @@ public :
                                                         const wxColour &amp;oColor, const wxColour &amp;cColor);
 
      wxGraphicsFont CreateFont(const wxFont &amp;font, const wxColour &amp;col);
-private:
-    wxGraphicsRenderer();
+
 };
 
 </diff>
      <filename>src/graphics.sip</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,12 @@
 
 %ModuleHeaderCode
-bool sequence_2_ints_check(PyObject* obj);
-bool sequence_2_ints(PyObject* source, int* i1, int* i2);
+//inline bool sequence_2_ints_check(PyObject* obj);
+//inline bool sequence_2_ints(PyObject* source, int* i1, int* i2);
+//
+//inline bool sequence_4_ints_check(PyObject* obj);
+//inline bool sequence_4_ints(PyObject* source, int* i1, int* i2, int* i3, int* i4);
 
-bool sequence_4_ints_check(PyObject* obj);
-bool sequence_4_ints(PyObject* source, int* i1, int* i2, int* i3, int* i4);
-%End
-
-%ModuleCode
-bool sequence_2_ints_check(PyObject* obj)
+inline bool sequence_2_ints_check(PyObject* obj)
 {
     bool is_ints = false;
 
@@ -29,7 +27,7 @@ bool sequence_2_ints_check(PyObject* obj)
     return is_ints;
 }
 
-bool sequence_2_ints(PyObject* source, int* i1, int* i2) {
+inline bool sequence_2_ints(PyObject* source, int* i1, int* i2) {
     PyObject *o1, *o2;
 
     if (!(PySequence_Check(source) &amp;&amp; PySequence_Length(source) == 2))
@@ -58,7 +56,7 @@ bool sequence_2_ints(PyObject* source, int* i1, int* i2) {
 }
 
 
-bool sequence_4_ints_check(PyObject* obj)
+inline bool sequence_4_ints_check(PyObject* obj)
 {
     bool is_ints = false;
 
@@ -86,7 +84,7 @@ bool sequence_4_ints_check(PyObject* obj)
     return is_ints;
 }
 
-bool sequence_4_ints(PyObject* source, int* i1, int* i2, int* i3, int* i4) {
+inline bool sequence_4_ints(PyObject* source, int* i1, int* i2, int* i3, int* i4) {
     PyObject *o1, *o2, *o3, *o4;
 
     if (!(PySequence_Check(source) &amp;&amp; PySequence_Length(source) == 4))</diff>
      <filename>src/helpers.sip</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 %End
 
 %PostInitialisationCode
-typedef void (*add_event_type)(PyObject* module_dict, const char* name, ...);
+typedef void (*add_event_type)(PyObject* moduple_dict, const char* name, ...);
 
 add_event_type add_event = (add_event_type)sipImportSymbol(&quot;wxpy_add_event&quot;);
 
@@ -98,6 +98,9 @@ public:
 
 class wxHtmlWindow : wxWindow
 {
+private:
+    wxHtmlWindow(const wxHtmlWindow&amp;);
+    wxHtmlWindow();
 public:
     wxHtmlWindow(wxWindow *parent, int id = -1,
                  const wxPoint&amp; pos = wxDefaultPosition,
@@ -372,34 +375,23 @@ public:
         PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg);
         Py_DECREF(arg);
 
-        printf(&quot;FillHandlersTable for parser %p\n&quot;, parser);
-        printf(&quot;tag handler is &quot;);
-        PyObject_Print(obj, stdout, 0);
-        printf(&quot;\n&quot;);
-
         // now figure out where it's C++ object is...
         wxHtmlWinTagHandler* thPtr = 0;
         int sipIsErr = 0;
 
         if (sipCanConvertToInstance(obj, sipClass_wxHtmlWinTagHandler, SIP_NOT_NONE))
         {
-            thPtr = (wxHtmlWinTagHandler*)sipConvertToInstance(obj, sipClass_wxHtmlWinTagHandler, NULL, SIP_NOT_NONE, NULL, &amp;sipIsErr);
-            printf(&quot;sipConvertToInstance returned %p, sipIsErr is %d\n&quot;, thPtr, sipIsErr);
-        }
-        else
-        {
-            printf(&quot;ERROR: sipCanConvertToInstance returned false\n&quot;);
-            sipIsErr = 1;
-        }
-
-        if (!sipIsErr)
-        {
             // add it,
+            thPtr = (wxHtmlWinTagHandler*)sipConvertToInstance(obj, sipClass_wxHtmlWinTagHandler,
+                                                               NULL, SIP_NOT_NONE, NULL, &amp;sipIsErr);
             parser-&gt;AddTagHandler(thPtr);
 
             // and track it.
             m_objArray.Add(obj);
+
         }
+        else
+            sipIsErr = 1;
 
         SIP_UNBLOCK_THREADS
     }</diff>
      <filename>src/html.sip</filename>
    </modified>
    <modified>
      <diff>@@ -104,6 +104,9 @@ done:
 
 class wxImage: wxObject
 {
+private:
+    wxImage(const wxImage&amp; image);
+
 public:
 
     SIP_PYOBJECT GetData();</diff>
      <filename>src/image.sip</filename>
    </modified>
    <modified>
      <diff>@@ -133,7 +133,7 @@ public:
     //
 
     wxSizerItem* Insert(int index, wxWindow* item, int proportion = 0, int flag = 0, int border = 0) /Transfer/;
-    wxSizerItem* Insert(int index, wxSizer* item,  int proportion = 0, int flag = 0, int border = 0) /Transfer/;
+    wxSizerItem* Insert(int index, wxSizer* item /Transfer/,  int proportion = 0, int flag = 0, int border = 0) /Transfer/;
 
     wxSizerItem* AddSpacer(SIP_PYTUPLE) /Transfer/;
 %MethodCode
@@ -166,6 +166,22 @@ public:
     // TODO: fix the object ownership issues here!
     bool Detach(wxWindow* window);
     bool Detach(wxSizer* sizer);
+%MethodCode
+    wxSizerItem* item = sipCpp-&gt;GetItem(a0);
+    if (item)
+    {
+
+        // if successfully removed, move ownership of the wxSizer object
+        // back to Python
+        PyObject* pySizer = sipGetWrapper(a0, sipClass_wxSizer);
+        if (pySizer)
+            sipTransferBack(pySizer);
+        PyObject* pySizerItem = sipGetWrapper(item, sipClass_wxSizerItem);
+        if (pySizerItem)
+            sipTransferBack(pySizerItem);
+    }
+%End
+
     bool Detach(size_t index);
 
     bool Show(wxWindow* item, bool show = true, bool recursive = false);
@@ -242,27 +258,6 @@ public:
     int GetRows();
     int GetVGap();
     int GetHGap();
-/*
-    %pythoncode {
-        def CalcRowsCols(self):
-            &quot;&quot;&quot;
-            CalcRowsCols() -&gt; (rows, cols)
-
-            Calculates how many rows and columns will be in the sizer based
-            on the current number of items and also the rows, cols specified
-            in the constructor.
-            &quot;&quot;&quot;
-            nitems = len(self.GetChildren())
-            rows = self.GetRows()
-            cols = self.GetCols()
-            assert rows != 0 or cols != 0, &quot;Grid sizer must have either rows or columns fixed&quot;
-            if cols != 0:
-                rows = (nitems + cols - 1) / cols
-            elif rows != 0:
-                cols = (nitems + rows - 1) / rows
-            return (rows, cols)
-    }
-    */
 };
 
 </diff>
      <filename>src/sizer.sip</filename>
    </modified>
    <modified>
      <diff>@@ -62,8 +62,12 @@
 #include &lt;wx/dcgraph.h&gt;
 #ifdef __WXMSW__
 #include &lt;wx/msw/regconf.h&gt;
+#include &lt;wx/msw/crashrpt.h&gt;
 #endif
 
 #include &lt;vector&gt;
 #include &lt;list&gt;
+#include &lt;Python.h&gt;
+#include &lt;sip.h&gt;
+
 #endif // WXPY_PREC
\ No newline at end of file</diff>
      <filename>src/stdwxpy.h</filename>
    </modified>
    <modified>
      <diff>@@ -8,17 +8,17 @@ class wxTimer : wxEvtHandler
 public:
     wxTimer(wxEvtHandler* owner = NULL, int id = wxID_ANY);
     virtual ~wxTimer();
-    
+
     void SetOwner(wxEvtHandler* ownder, int id = wxID_ANY);
     wxEvtHandler* GetOwner() const;
-    
+
     bool Start(int milliseconds = -1, bool oneShot = false);
     void Stop();
-    
-    virtual void Notify();
-    
+
+    virtual void Notify() /ReleaseGIL/;
+
     bool IsRunning() const;
-    
+
     int GetInterval() const;
     int GetId() const;
     bool IsOneShot() const;</diff>
      <filename>src/timer.sip</filename>
    </modified>
    <modified>
      <diff>@@ -453,34 +453,14 @@ public:
     wxTextCtrl* GetEditControl() const;
 
 %If (WXMSW)
-    // end editing and accept or discard the changes to item label
     void EndEditLabel(const wxTreeItemId&amp; item, bool discardChanges = false);
 %End
 
     void SortChildren(const wxTreeItemId&amp; item);
 
     wxTreeItemId HitTest(const wxPoint&amp; point, int&amp; where /Out/);
-/*
-
-    %extend {
-        // get the bounding rectangle of the item (or of its label only)
-        PyObject* GetBoundingRect(const wxTreeItemId&amp; item,  bool textOnly = false) {
-             wxRect rect;
-            if (self-&gt;GetBoundingRect(item, rect, textOnly)) {
-                wxPyBlock_t blocked = wxPyBeginBlockThreads();
-                wxRect* r = new wxRect(rect);
-                PyObject* val = wxPyConstructObject((void*)r, wxT(&quot;wxRect&quot;), true);
-                wxPyEndBlockThreads(blocked);
-                return val;
-            }
-            else
-                RETURN_NONE();
-        }
-    }
-*/
 
 %If (WXMSW)
-    // set/get the item state.image (state == -1 means cycle to the next one)
     void SetState(const wxTreeItemId&amp; node, int state);
     int GetState(const wxTreeItemId&amp; node);
 %End</diff>
      <filename>src/treectrl.sip</filename>
    </modified>
    <modified>
      <diff>@@ -10,13 +10,13 @@
 #include &quot;wx/webview.h&quot;
 %End
 
-
+/*
 class WebViewFrameData
 {
     private:
     WebViewFrameData();
 };
-
+*/
 class wxWebView : wxWindow
 {
 
@@ -25,8 +25,8 @@ public:
               const wxPoint&amp; point = wxDefaultPosition,
               const wxSize&amp; size = wxDefaultSize,
               long style = 0,
-              const wxString&amp; name = wxWebViewNameStr,
-              WebViewFrameData* data = NULL);
+              const wxString&amp; name = wxWebViewNameStr);
+              //WebViewFrameData* data = NULL);
 
     virtual ~wxWebView();
 </diff>
      <filename>src/webview.sip</filename>
    </modified>
    <modified>
      <diff>@@ -356,6 +356,23 @@ public:
     bool Layout();
 
     void SetSizer(wxSizer *sizer /Transfer/, bool deleteOld = true);
+%MethodCode
+    if (!a1) // deleteOld = False
+    {
+        wxSizer* oldSizer = sipCpp-&gt;GetSizer();
+        if (oldSizer)
+        {
+            SIP_BLOCK_THREADS
+            PyObject* pySizer = sipGetWrapper(oldSizer, sipClass_wxSizer);
+            if (pySizer)
+                sipTransferBack(pySizer);
+            SIP_UNBLOCK_THREADS
+        }
+    }
+    sipCpp-&gt;SetSizer(a0, a1);
+%End
+
+
     void SetSizerAndFit(wxSizer *sizer /Transfer/, bool deleteOld = true);
 
     wxSizer *GetSizer() const;</diff>
      <filename>src/window.sip</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ released under the wxWidgets License
 
 // Enable stripping of &quot;wx&quot; from Python names, and auto generation of
 // properties from GetXXX() and SetXXX() methods.
-%SIPOptions (RenameWx, AutoProperties)
+%SIPOptions (RenameWx, AutoProperties, ThreadChecking)
 
 %UnitCode
 #include &quot;stdwxpy.h&quot;
@@ -52,7 +52,7 @@ void add_event(PyObject* module_dict, const char* name, ...)
     PyDict_SetItemString(module_dict, name, tuple);
     Py_DECREF(list);
 }
-%End
+%End // ModuleCode
 
 %PostInitialisationCode
 
@@ -82,6 +82,7 @@ AddItem(&quot;DefaultPosition&quot;,  &amp;wxDefaultPosition,  sipClass_wxPoint);
 AddItem(&quot;DefaultValidator&quot;, &amp;wxDefaultValidator, sipClass_wxValidator);
 PyDict_SetItemString(sipModuleDict, &quot;TextEntryDialogStyle&quot;, PyInt_FromLong(wxTextEntryDialogStyle));
 
+AddItem(&quot;NORMAL_FONT&quot;, wxNORMAL_FONT, sipClass_wxFont);
 
 AddItem(&quot;BLACK&quot;, wxBLACK, sipClass_wxColour);
 AddItem(&quot;WHITE&quot;, wxWHITE, sipClass_wxColour);</diff>
      <filename>src/wx.sip</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
 import wx
+import sip
+from random import randint
 
 def test_gc():
-    f = wx.Frame(None)
+    f = wx.Frame(None, style = wx.DEFAULT_FRAME_STYLE | wx.FULL_REPAINT_ON_RESIZE)
+    f.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
     f.pen = wx.Pen(wx.Colour(213,213,213))
 
     def paint(e):
@@ -16,11 +19,23 @@ def test_gc():
         dc.DrawRectangleRect(rect)
 
         gc = wx.GraphicsContext.Create(dc)
-        print gc.GetNativeContext()
-        gc.SetBrush(wx.RED_BRUSH)
-        gc.SetPen(wx.BLACK_PEN)
-        gc.DrawRoundedRectangle(0, 0, 100, 100, 5)
 
+        for x in xrange(50):
+            x1, y1, x2, y2 = (randint(0, rect.width-1), randint(0, rect.height-1),
+                              randint(0, rect.width-1), randint(0, rect.height-1))
+
+            gc.SetBrush(wx.RED_BRUSH)
+            gc.SetPen(wx.BLACK_PEN)
+            gc.DrawRoundedRectangle(x1, y1, x2, y2, randint(1, 15))
+
+            gc.SetFont(wx.NORMAL_FONT, wx.BLACK)
+            gc.DrawText('gctest', randint(0, rect.width-1), randint(0, rect.height-1))
+
+    def onclose(e):
+        f.Destroy()
+        wx.CallAfter(test_gc)
+
+    f.Bind(wx.EVT_CLOSE, onclose)
     f.Bind(wx.EVT_PAINT, paint)
     f.Show()
 
@@ -31,4 +46,4 @@ def main():
     a.MainLoop()
 
 if __name__ == '__main__':
-    main()
\ No newline at end of file
+    main()</diff>
      <filename>tests/test_gc.py</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,6 @@ def test_imageformats():
     for filename in images:
         imgfile = os.path.join(image_folder, filename)
         assert os.path.isfile(imgfile)
-
         assert wx.Image(imgfile).IsOk()
 
 </diff>
      <filename>tests/test_image.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,48 @@
+import gc
+from weakref import ref
 import sip
 import wx
 from testutil import assert_ownership
 
 def test_FlexGridSizer():
     f = wx.Frame(None)
-    s = wx.FlexGridSizer(2, 2)
 
-    assert s.FlexibleDirection == s.GetFlexibleDirection() == wx.BOTH
-    s.AddGrowableCol(1, 1)
+    buttons = []
+    labels = ['SetSizer', 'Collect Garbage', 'test', 'test']
+    for label in labels:
+        b = wx.Button(f, -1, label)
+        buttons.append(b)
 
-    for x in xrange(4):
-        b = wx.Button(f, -1, 'button %d' % x)
-        s.Add(b)
+    weakrefs = []
+
+    def on_sizer(e=None):
+        print 'on_sizer'
+
+        oldSizer = f.Sizer
+        if oldSizer is not None:
+            weakrefs.append(ref(oldSizer))
+
+        s = wx.FlexGridSizer(2, 2)
+
+        assert s.FlexibleDirection == s.GetFlexibleDirection() == wx.BOTH
+        s.AddGrowableCol(1, 1)
+
+        for b in buttons:
+            s.Add(b)
+
+        f.SetSizer(s, False)
+        gc.collect()
+        print weakrefs
+
+    def on_gc(e=None):
+        print 'gc.collect()'
+        gc.collect()
+
+    buttons[0].Bind(wx.EVT_BUTTON, on_sizer)
+    buttons[1].Bind(wx.EVT_BUTTON, on_gc)
+
+    on_sizer()
 
-    f.Sizer = s
     return f
 
 </diff>
      <filename>tests/test_sizer.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,22 @@
-/*
- * hworld.cpp
- * Hello world sample by Robert Roebling
- */
-
 #include &lt;wx/wx.h&gt;
+#include &lt;wx/log.h&gt;
 #include &lt;wx/dcbuffer.h&gt;
+#include &lt;wx/html/htmlwin.h&gt;
+#include &lt;wx/msw/crashrpt.h&gt;
+
+#if !wxUSE_CRASHREPORT
+#error &quot;no crash report&quot;
+#endif
+
+#if !wxUSE_ON_FATAL_EXCEPTION
+#error &quot;no fatal exception&quot;
+#endif
 
 class MyApp: public wxApp
 {
     virtual bool OnInit();
+    virtual void OnFatalException();
+
 };
 
 class MyFrame: public wxFrame
@@ -17,9 +25,12 @@ public:
 
     MyFrame(const wxString&amp; title, const wxPoint&amp; pos, const wxSize&amp; size);
 
-    void OnQuit(wxCommandEvent&amp; event);
-    void OnAbout(wxCommandEvent&amp; event);
-    void OnPaint(wxPaintEvent&amp; event);
+    void OnQuit(wxCommandEvent&amp;);
+    void OnAbout(wxCommandEvent&amp;);
+    void OnCrash(wxCommandEvent&amp;);
+    void OnGenerateCrashReport(wxCommandEvent&amp;);
+
+    void OnPaint(wxPaintEvent&amp;);
 
     DECLARE_EVENT_TABLE()
 };
@@ -28,12 +39,16 @@ enum
 {
     ID_Quit = 1,
     ID_About,
+    ID_Crash,
+    ID_GenerateCrashReport,
 };
 
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_PAINT(MyFrame::OnPaint)
     EVT_MENU(ID_Quit, MyFrame::OnQuit)
     EVT_MENU(ID_About, MyFrame::OnAbout)
+    EVT_MENU(ID_Crash, MyFrame::OnCrash)
+    EVT_MENU(ID_GenerateCrashReport, MyFrame::OnGenerateCrashReport)
 END_EVENT_TABLE()
 
 IMPLEMENT_APP(MyApp)
@@ -57,14 +72,32 @@ bool MyApp::OnInit()
     MyFrame *frame = new MyFrame(title, wxPoint(50,50), wxSize(450,340) );
     frame-&gt;Show(TRUE);
     SetTopWindow(frame);
+
+    FILE* fp = fopen(&quot;c:\\output.txt&quot;, &quot;w&quot;);
+    wxLog::SetActiveTarget(new wxLogStderr(fp));
+    wxLogMessage(wxT(&quot;test log message&quot;));
+    wxLogError(wxT(&quot;this is an error&quot;));
+
     return TRUE;
 }
 
+void MyApp::OnFatalException()
+{
+    wxCrashReport::Generate(wxCRASH_REPORT_DEFAULT);
+
+    wxString msg(wxT(&quot;A crash dump was generated at &quot;));
+    msg &lt;&lt; wxCrashReport::GetFileName();
+
+    wxMessageBox(msg);
+}
+
 MyFrame::MyFrame(const wxString&amp; title, const wxPoint&amp; pos, const wxSize&amp; size)
 : wxFrame((wxFrame *)NULL, -1, title, pos, size)
 {
     wxMenu *menuFile = new wxMenu;
 
+    menuFile-&gt;Append(ID_Crash, _T(&quot;&amp;Crash!&quot;));
+    menuFile-&gt;Append(ID_GenerateCrashReport, _T(&quot;&amp;Generate Crash Report&quot;));
     menuFile-&gt;Append(ID_About, _T(&quot;&amp;About...&quot;));
     menuFile-&gt;AppendSeparator();
     menuFile-&gt;Append(ID_Quit, _T(&quot;E&amp;xit&quot;));
@@ -76,6 +109,18 @@ MyFrame::MyFrame(const wxString&amp; title, const wxPoint&amp; pos, const wxSize&amp; size)
 
     CreateStatusBar();
     SetStatusText(_T(&quot;Welcome to wxWindows!&quot;));
+
+    wxHtmlWindow* html = new wxHtmlWindow(this, -1);
+
+    wxString msg;
+    msg &lt;&lt; wxT(&quot;wxHandleFatalExceptions: &quot;) &lt;&lt; wxHandleFatalExceptions() &lt;&lt; wxT(&quot;&lt;br&gt;&quot;);
+    msg &lt;&lt; wxT(&quot;wxCrashReport::GetFileName(): &quot;) &lt;&lt; wxCrashReport::GetFileName() &lt;&lt; wxT(&quot;&lt;br&gt;&quot;);
+
+    html-&gt;SetPage(msg);
+
+    wxSizer* boxSizer = new wxBoxSizer(wxHORIZONTAL);
+    boxSizer-&gt;Add(html, 1, wxEXPAND);
+    SetSizer(boxSizer);
 }
 
 void MyFrame::OnPaint(wxPaintEvent&amp; event)
@@ -91,7 +136,6 @@ void MyFrame::OnPaint(wxPaintEvent&amp; event)
     gc-&gt;SetBrush(*wxBLUE_BRUSH);
     gc-&gt;DrawRoundedRectangle(50, 50, 150, 150, 5);
     delete gc;
-
 }
 
 void MyFrame::OnQuit(wxCommandEvent&amp; WXUNUSED(event))
@@ -105,3 +149,17 @@ void MyFrame::OnAbout(wxCommandEvent&amp; WXUNUSED(event))
         _T(&quot;About Hello World&quot;), wxOK | wxICON_INFORMATION, this);
 }
 
+void MyFrame::OnCrash(wxCommandEvent&amp;)
+{
+    int c = 1;
+    int d = 1;
+
+    --d;
+
+    int infinity = c/d;
+}
+
+void MyFrame::OnGenerateCrashReport(wxCommandEvent&amp;)
+{
+    wxCrashReport::GenerateNow();
+}</diff>
      <filename>tests/wxtest/wxtest.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,6 @@ python additions
 
 VERSION = (1, 0, 0, 0)
 USE_UNICODE = True
-
 import sip, new
 from functools import wraps
 
@@ -22,7 +21,7 @@ class SipTrace(object):
 SipTrace.ALL = (SipTrace.VIRTUAL | SipTrace.CONSTRUCTOR | SipTrace.DESTRUCTOR
                 | SipTrace.PY_INIT | SipTrace.PY_DEL | SipTrace.PY_METHOD)
 
-sip.settracemask(SipTrace.ALL)
+#sip.settracemask(SipTrace.ALL)
 
 def autorepr(s = None):
     if s is not None:
@@ -67,7 +66,7 @@ class Frame(wxFrame):
 wxDialog = wx.Dialog
 class Dialog(wxDialog):
     def __init__(self, parent, id = -1, title = '', pos = DefaultPosition, size = DefaultSize, style = DEFAULT_DIALOG_STYLE, name = wx.DialogNameStr):
-        wxDialog.__init__(self, parent, id, title, pos, size, style, name)
+        wxDialog.__init__(self, parent, id, title, Point(*pos), Size(*size), style, name)
 
 wxTextCtrl = wx.TextCtrl
 class TextCtrl(wxTextCtrl):
@@ -97,7 +96,7 @@ PyControl = Control
 _Window = wx.Window
 class Window(wx.Window):
     def __init__(self, parent, id = -1, pos = DefaultPosition, size = DefaultSize, style = 0, name = 'Window'):
-        _Window.__init__(self, parent, id, pos, size, style, name)
+        _Window.__init__(self, parent, id, Point(*pos), Size(*size), style, name)
 
 _HyperlinkCtrl = wx.HyperlinkCtrl
 class HyperlinkCtrl(wx.HyperlinkCtrl):
@@ -107,7 +106,7 @@ class HyperlinkCtrl(wx.HyperlinkCtrl):
 _Panel = wx.Panel
 class Panel(wx.Panel):
     def __init__(self, parent, id = -1, pos = DefaultPosition, size = DefaultSize, style = TAB_TRAVERSAL | NO_BORDER, name = 'Panel'):
-        _Panel.__init__(self, parent, id, pos, size, style, name)
+        _Panel.__init__(self, parent, id, Point(*pos), Size(*size), style, name)
 
 _MenuItem = wx.MenuItem
 class MenuItem(wx.MenuItem):
@@ -188,6 +187,12 @@ class FlexGridSizer(_FlexGridSizer):
     def __init__(self, rows = 1, cols = 0, vgap = 0, hgap = 0):
         _FlexGridSizer.__init__(self, rows, cols, vgap, hgap)
 
+_Gauge = Gauge
+class Gauge(_Gauge):
+    def __init__(self, parent, id = -1, range = 100, pos = DefaultPosition, size = DefaultSize, style = GA_HORIZONTAL,
+                 validator = DefaultValidator, name = &quot;gauge&quot;):
+        _Gauge.__init__(self, parent, id, range, pos, size, style, validator, name)
+
 _ListCtrl = ListCtrl
 class ListCtrl(_ListCtrl):
     def __init__(self, parent, id = -1, pos = DefaultPosition, size = DefaultSize,
@@ -549,6 +554,14 @@ def _wxpy_init():
     except Exception:
         pass
 
+    try:
+        # make sure HTML tag modules get loaded
+        import lib.wxpTag
+    except Exception:
+        from traceback import print_exc; print_exc()
+
+    assert True == HandleFatalExceptions()
+
     _entrystart()
     _initallimagehandlers()
 
@@ -567,11 +580,8 @@ class App(_app):
             _wxpy_init()
             _did_wxpy_init = True
 
-        self.OnInit()
 
-    def MainLoop(self):
-        if len(GetTopLevelWindows()) &gt; 0:
-            return _app.MainLoop(self)
+        self.OnInit()
 
 PySimpleApp = App
 </diff>
      <filename>wx/__init__.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,26 +3,40 @@
 &lt;makefile&gt;
     &lt;set var=&quot;WX_UNICODE&quot;&gt;1&lt;/set&gt;
     &lt;set var=&quot;WX_PYTHON&quot;&gt;0&lt;/set&gt;
-    &lt;set var=&quot;WX_DEBUG&quot;&gt;0&lt;/set&gt;
     &lt;set var=&quot;WX_SHARED&quot;&gt;1&lt;/set&gt;
     &lt;include file=&quot;presets/wx.bkl&quot;/&gt;
-    &lt;set var=&quot;DEBUG&quot;&gt;0&lt;/set&gt;
 
-    &lt;set var=&quot;BUILDDIR&quot;&gt;obj-$(FORMAT)&lt;/set&gt;
+    &lt;set var=&quot;DEBUG&quot;&gt;$(WX_DEBUG)&lt;/set&gt;
+
+    &lt;!-- add _d to the build directory with DEBUG=='1' --&gt;
+
+    &lt;set var=&quot;WXPY_DEBUG_POSTFIX&quot;&gt;
+        $(substituteFromDict(DEBUG, {'1':'_d','0':''}))
+    &lt;/set&gt;
+
+    &lt;set var=&quot;BUILDDIR&quot;&gt;obj-$(FORMAT)$(WXPY_DEBUG_POSTFIX)&lt;/set&gt;
 
     &lt;template id=&quot;wxpy_build_settings&quot;&gt;
+        &lt;set var=&quot;DEBUG_DEFINE&quot;&gt;$(substituteFromDict(DEBUG, {'1':'DEBUG','0':''}))&lt;/set&gt;
+        &lt;set var=&quot;PY_LIB&quot;&gt;$(substituteFromDict(DEBUG, {'1':'python26_d','0':'python26'}))&lt;/set&gt;
+
+        &lt;define&gt;$(DEBUG_DEFINE)&lt;/define&gt;
+        &lt;sys-lib&gt;$(PY_LIB)&lt;/sys-lib&gt;
+
         &lt;warnings&gt;max&lt;/warnings&gt;
-        &lt;cxx-rtti&gt;off&lt;/cxx-rtti&gt;
+
+        &lt;cxx-rtti&gt;on&lt;/cxx-rtti&gt;
         &lt;cxx-exceptions&gt;off&lt;/cxx-exceptions&gt;
-        &lt;define&gt;$(substituteFromDict(DEBUG, {'1':'','0':'NDEBUG'}))&lt;/define&gt;
-        &lt;optimize&gt;
-            $(substituteFromDict(DEBUG, {'1':'off','0':'speed'}))
-        &lt;/optimize&gt;
-        &lt;debug-info&gt;
-            $(substituteFromDict(DEBUG, {'1':'on','0':'off'}))
-        &lt;/debug-info&gt;
+
+        &lt;define&gt;$(substituteFromDict(DEBUG, {'1':'_DEBUG','0':'NDEBUG'}))&lt;/define&gt;
+
+        &lt;optimize&gt;$(substituteFromDict(DEBUG, {'1':'off','0':'speed'}))&lt;/optimize&gt;
+        &lt;debug-info&gt;$(substituteFromDict(DEBUG, {'1':'on','0':'off'}))&lt;/debug-info&gt;
+
         &lt;if cond=&quot;FORMAT in ('msvc', 'msvs2005prj')&quot;&gt;
-            &lt;debug-runtime-libs&gt;off&lt;/debug-runtime-libs&gt;
+            &lt;debug-runtime-libs&gt;
+            $(substituteFromDict(DEBUG, {'1':'on','0':'off'}))
+            &lt;/debug-runtime-libs&gt;
         &lt;/if&gt;
     &lt;/template&gt;
 
@@ -35,6 +49,7 @@
         &lt;include&gt;../src&lt;/include&gt;
         &lt;include&gt;c:\dev\wxWebKitBranch-2.8\contrib\include&lt;/include&gt;
         &lt;define&gt;WXPY=1&lt;/define&gt;
+        &lt;define&gt;WXUSINGDLL_WEBKIT&lt;/define&gt;
 
         &lt;runtime-libs&gt;dynamic&lt;/runtime-libs&gt;
 
@@ -57,10 +72,10 @@
 
         &lt;runtime-libs&gt;dynamic&lt;/runtime-libs&gt;
 
-        &lt;optimize&gt;speed&lt;/optimize&gt;
         &lt;if cond=&quot;FORMAT in ('msvc', 'msvs2005prj')&quot;&gt;
             &lt;cxxflags&gt;/GL /Zi&lt;/cxxflags&gt;
-            &lt;ldflags&gt;/DEBUG /LTCG&lt;/ldflags&gt;
+            &lt;ldflags&gt;/LTCG&lt;/ldflags&gt;
+            &lt;ldflags&gt;/DEBUG&lt;/ldflags&gt;
         &lt;/if&gt;
     &lt;/template&gt;
 
@@ -81,7 +96,7 @@ der was created, recreate the precompiled header.
         &lt;define&gt;WXPY_PREC&lt;/define&gt;
         &lt;precomp-headers&gt;on&lt;/precomp-headers&gt;
         &lt;precomp-headers-header&gt;stdwxpy.h&lt;/precomp-headers-header&gt;
-        &lt;precomp-headers-file&gt;../src/stdwxpy.cpp&lt;/precomp-headers-file&gt;
+        &lt;precomp-headers-file&gt;stdwxpy.cpp&lt;/precomp-headers-file&gt;
     &lt;/template&gt;
 
 &lt;/makefile&gt;</diff>
      <filename>wxpybuild/wxpy-settings.bkl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 from __future__ import with_statement
-import os
+import os.path
 import shutil
 import sipconfig
 import sys
@@ -19,6 +19,9 @@ GENERATED_SRC_DIR = SRC_DIR / 'generated'
 VERBOSE = True
 sip_cfg = sipconfig.Configuration()
 
+
+DEBUG = os.path.splitext(sys.executable)[0].endswith('_d')
+
 def wx_path():
     opts = {}
 
@@ -37,8 +40,18 @@ def wx_path():
 
 WXWIN = wx_path()
 
-
-def build_extension(project_name, modules, includes = None):
+class wxpyext(object):
+    def __init__(name, sources, includes = None, libs = None, libdirs = None):
+        self.name = name
+        self.sources = sources
+        self.includes = includes if includes is not None else []
+        self.libs = libs if libs is not None else []
+        self.libdirs = libdirs if libdirs is not None else []
+
+def build_extension(project_name, modules,
+                    includes = None,
+                    libs = None,
+                    libdirs = None):
     features = emit_features_file(WXWIN, 'src/generated/features.sip')
     feature_args = list(chain(*(('-x', feature)
                         for feature, enabled in features.iteritems() if not enabled)))
@@ -49,7 +62,7 @@ def build_extension(project_name, modules, includes = None):
 
         includes = [path(i).abspath() for i in includes]
 
-    sources = runsip(modules, feature_args, includes)
+    sources = runsip(modules, feature_args, includes, libs, libdirs)
     manage_cache(GENERATED_SRC_DIR)
 
     # The files we create below go in OUTPUT_DIR
@@ -63,7 +76,6 @@ def build_extension(project_name, modules, includes = None):
 def build_nt(solution_name):
     vcbuild_opts = [
         solution_name,
-        '/htmllog:build.html',
         '/nologo',    # leave out the MS copyright message
         '/showenv',
         '/time',
@@ -73,11 +85,11 @@ def build_nt(solution_name):
     if 'rebuild' in sys.argv:
         vcbuild_opts.append('/rebuild')
 
-    run('vcbuild %s Multilib|Win32' % ' '.join(vcbuild_opts))
+    config = '&quot;%s Multilib|Win32&quot;' % ('Debug' if DEBUG else 'Release')
 
-    output_dir = OUTPUT_DIR / 'obj-msvs2005prj'
+    run('vcbuild %s %s' % (' '.join(vcbuild_opts), config))
 
-def runsip(modules, features, includes = None):
+def runsip(modules, features, includes = None, libs = None, libdirs = None):
     sipgen = SIPGenerator(GENERATED_SRC_DIR, 'WXMSW', features)
     makefile = Element('makefile')
 
@@ -92,7 +104,7 @@ def runsip(modules, features, includes = None):
         else:
             template = 'wxpy_extension'
 
-        add_wxpy_module(makefile, module_name, sip_sources, includes, template)
+        add_wxpy_module(makefile, module_name, sip_sources, includes, template, libs, libdirs)
 
     return makefile
 
@@ -149,11 +161,18 @@ def build_path(p):
 def add_includes(module, inc_paths):
     return [xmlnode(module, 'include', p) for p in inc_paths]
 
-def add_wxpy_module(makefile, module_name, sources, include_paths = None, template = None):
+def add_wxpy_module(makefile, module_name, sources,
+                    include_paths = None,
+                    template = None,
+                    libs = None,
+                    libdirs = None):
+
     module = xmlnode(makefile, 'module',
                      id = module_name,
                      template = 'wxpy_extension' if template is None else template)
 
+    if DEBUG: module_name += '_d'
+
     dllname = xmlnode(module, 'dllname', '%s' % module_name)
 
     includes = [sip_cfg.sip_inc_dir,    # for sip.h
@@ -165,7 +184,26 @@ def add_wxpy_module(makefile, module_name, sources, include_paths = None, templa
 
     add_includes(module, includes)
 
-    xmlnode(module, 'lib-path', sip_cfg.py_lib_dir)
+    if libs is not None:
+        for lib in libs:
+            xmlnode(module, 'sys-lib', lib)
+
+    if libdirs is None:
+        libdirs = []
+
+    # TODO: Where is PythonXX.lib
+    from distutils import sysconfig
+
+    if os.name == 'nt':
+        if DEBUG:
+            pylibdir = path(sysconfig.project_base) / 'PCBuild'
+        else:
+            pylibdir = path(sysconfig.project_base)
+    else:
+        assert False
+
+    for libdir in libdirs + [pylibdir]:
+        xmlnode(module, 'lib-path', libdir)
 
     source_elem = xmlnode(module, 'sources', '\n'.join(build_path(s) for s in sources))
 
@@ -246,4 +284,4 @@ def cd(*path):
         os.chdir(original_cwd)
 
 def diff(new, old):
-    run(r'c:\cygwin\bin\diff -d -u &quot;%s&quot; &quot;%s&quot;' % (str(new), str(old)))
\ No newline at end of file
+    run(r'c:\cygwin\bin\diff -d -u &quot;%s&quot; &quot;%s&quot;' % (str(new), str(old)))</diff>
      <filename>wxpybuild/wxpyext.py</filename>
    </modified>
    <modified>
      <diff>@@ -76,8 +76,6 @@ elif platform_name == 'msw':
                      '/GR',
                      ])
 
-
-
     lflags = ['/LIBPATH:' + str(wxdir / 'lib/vc_dll')]
 
     if WHOLE_PROGRAM_OPTIMIZATION:
@@ -85,9 +83,11 @@ elif platform_name == 'msw':
         lflags.append('/LTCG')
 
     if WXDEBUG:
-        cxxflags.extend(['/D__WXDEBUG__'])
+        cxxflags.append('/D__WXDEBUG__')
         if not DEBUG_RUNTIME:
-            cxxflags.extend(['/D__NO_VC_CRTDBG__'])
+            cxxflags.append('/D__NO_VC_CRTDBG__')
+    else:
+        cxxflags.append('/DNDEBUG')
 
     if DEBUG_SYMBOLS: # debug
         if '/Zi' not in cxxflags:</diff>
      <filename>wxpyconfig.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>tests/test_dc.py</filename>
    </removed>
    <removed>
      <filename>tests/test_memory.py</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>44cdc9ff18eacd21ba1de68e32d9eae1c9073c3c</id>
    </parent>
  </parents>
  <author>
    <name>Kevin Watters</name>
    <email>kevinwatters@gmail.com</email>
  </author>
  <url>http://github.com/kevinw/wxpy/commit/68c7352ce91dea7383b920f69ea436f74d0ae453</url>
  <id>68c7352ce91dea7383b920f69ea436f74d0ae453</id>
  <committed-date>2008-06-06T16:59:21-07:00</committed-date>
  <authored-date>2008-06-06T16:59:21-07:00</authored-date>
  <message>support for sending crash dumps~</message>
  <tree>21e3514aa0e89e0f084b9f070de9e495dbe669b4</tree>
  <committer>
    <name>Kevin Watters</name>
    <email>kevinwatters@gmail.com</email>
  </committer>
</commit>
