X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdeca1d18cfeb8f47f7ca8339636594b6f1595fc..f0d5fc50ef00f4670e92366ce2da1b37a2fd34e2:/src/motif/window.cpp diff --git a/src/motif/window.cpp b/src/motif/window.cpp index f251d7492e..4ec50c7839 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -408,10 +408,9 @@ wxWindow::~wxWindow() if (w) { XtDestroyWidget(w); + m_drawingArea = (WXWidget) 0; } - m_mainWidget = (WXWidget) 0; - // Only if we're _really_ a canvas (not a dialog box/panel) if (m_scrolledWindow) { @@ -421,14 +420,19 @@ wxWindow::~wxWindow() if (m_hScrollBar) { wxDeleteWindowFromTable((Widget) m_hScrollBar); + XtUnmanageChild((Widget) m_hScrollBar); } if (m_vScrollBar) { wxDeleteWindowFromTable((Widget) m_vScrollBar); + XtUnmanageChild((Widget) m_vScrollBar); } - UnmanageAndDestroy(m_hScrollBar); - UnmanageAndDestroy(m_vScrollBar); + if (m_hScrollBar) + XtDestroyWidget((Widget) m_hScrollBar); + if (m_vScrollBar) + XtDestroyWidget((Widget) m_vScrollBar); + UnmanageAndDestroy(m_scrolledWindow); if (m_borderWidget) @@ -451,7 +455,8 @@ wxWindow::~wxWindow() // wxSCROLL[WIN]_THUMBRELEASE events. Also it was reported // that this call crashed wxMotif under OS/2, so it seems // that leaving it out is the right thing to do. -// XtDestroyWidget((Widget) GetMainWidget()); + // SN, Feb/2000: newgrid/griddemo shows why it is needed :-( + XtDestroyWidget((Widget) GetMainWidget()); SetMainWidget((WXWidget) NULL); } } @@ -572,7 +577,7 @@ void wxWindow::DestroyScrollbar(wxOrientation orientation) XtDestroyWidget((Widget) m_vScrollBar); } m_vScrollBar = (WXWidget) 0; - m_vScroll = TRUE; + m_vScroll = FALSE; XtVaSetValues((Widget) m_scrolledWindow, XmNverticalScrollBar, (Widget) 0,