]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/app.cpp
Make wxBase compiled for wxMotif compatible with wxbase compiled
[wxWidgets.git] / src / motif / app.cpp
index ef63f6206ebc740d6db803bb8b919e7fe70508cb..fa41cfebee8c0ce2d33f6d60cb7c34ba779081cb 100644 (file)
@@ -38,7 +38,6 @@
 #pragma message disable nosimpint
 #endif
 #include <Xm/Xm.h>
-#include <Xm/Label.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
@@ -103,10 +102,23 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
 
 void wxApp::CleanUp()
 {
+    wxAppBase::CleanUp();
+
     delete wxWidgetHashTable;
     wxWidgetHashTable = NULL;
 
-    wxAppBase::CleanUp();
+    delete m_mainLoop;
+
+    for( wxPerDisplayDataMap::iterator it  = m_perDisplayData->begin(),
+                                       end = m_perDisplayData->end();
+         it != end; ++it )
+    {
+        delete it->second->m_visualInfo;
+        XtDestroyWidget( it->second->m_topLevelWidget );
+        delete it->second;
+    }
+
+    delete m_perDisplayData;
 }
 
 void wxApp::Exit()
@@ -134,19 +146,6 @@ wxApp::wxApp()
 
 wxApp::~wxApp()
 {
-    delete m_mainLoop;
-
-    for( wxPerDisplayDataMap::iterator it  = m_perDisplayData->begin(),
-                                       end = m_perDisplayData->end();
-         it != end; ++it )
-    {
-        delete it->second->m_visualInfo;
-        XtDestroyWidget( it->second->m_topLevelWidget );
-        delete it->second;
-    }
-
-    delete m_perDisplayData;
-
     wxApp::SetInstance(NULL);
 }
 
@@ -307,9 +306,9 @@ WXWidget wxCreateTopLevelWidget( WXDisplay* display )
 
 WXWidget wxCreateTopLevelRealizedWidget( WXDisplay* display )
 {
-    Widget rTlw = XtVaCreateWidget( "dummy_widget", xmLabelWidgetClass,
+    Widget rTlw = XtVaCreateWidget( "dummy_widget", topLevelShellWidgetClass,
                                     (Widget)wxTheApp->GetTopLevelWidget(),
-                                    NULL);
+                                     NULL, 0 );
     XtSetMappedWhenManaged( rTlw, False );
     XtRealizeWidget( rTlw );