- printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
- return 0;
- };
-
- wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
-
- wxObject *test_app = app_ini();
-
- wxTheApp = (wxApp*) test_app;
-
-// wxTheApp = (wxApp*)( app_ini() );
- };
-
- if (!wxTheApp)
- {
- printf( "wxWindows error: wxTheApp == NULL\n" );
- return 0;
- };
-
-// printf( "Programmstart.\n" );
-
- wxTheApp->argc = argc;
- wxTheApp->argv = argv;
-
- gtk_init( &argc, &argv );
-
-#ifdef USE_GDK_IMLIB
-
- gdk_imlib_init();
-
- gtk_widget_push_visual(gdk_imlib_get_visual());
-
- gtk_widget_push_colormap(gdk_imlib_get_colormap());
-
-#endif
-
- wxApp::CommonInit();
-
- wxTheApp->OnInitGui();
-
- // Here frames insert themselves automatically
- // into wxTopLevelWindows by getting created
- // in OnInit().
-
- if (!wxTheApp->OnInit()) return 0;
-
- wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
-
- int retValue = 0;
-
- if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
-
- wxTheApp->DeletePendingObjects();
-
- wxTheApp->OnExit();
-
- wxApp::CommonCleanUp();
-
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
- if (wxDebugContext::CountObjectsLeft() > 0)
- {
- wxTrace("There were memory leaks.\n");
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- }
- wxDebugContext::SetStream(NULL, NULL);
-#endif
-
- return retValue;
-};