#include <string.h>
-extern char *wxBuffer;
extern wxList wxPendingDelete;
wxApp *wxTheApp = NULL;
bool wxApp::Initialize()
{
- wxBuffer = new char[BUFSIZ + 512];
-
wxClassInfo::InitializeClasses();
// GL: I'm annoyed ... I don't know where to put this and I don't want to
// Destroy all GDI lists, etc.
- delete wxTheBrushList;
- wxTheBrushList = NULL;
-
- delete wxThePenList;
- wxThePenList = NULL;
-
- delete wxTheFontList;
- wxTheFontList = NULL;
-
- delete wxTheBitmapList;
- wxTheBitmapList = NULL;
+ wxDeleteStockLists();
delete wxTheColourDatabase;
wxTheColourDatabase = NULL;
wxBitmap::CleanUpHandlers();
- delete[] wxBuffer;
- wxBuffer = NULL;
-
wxClassInfo::CleanUpClasses();
delete wxTheApp;
wxApp::wxApp()
{
- m_topWindow = NULL;
- wxTheApp = this;
- m_className = "";
- m_wantDebugOutput = TRUE ;
- m_appName = "";
argc = 0;
argv = NULL;
- m_exitOnFrameDelete = TRUE;
m_mainColormap = (WXColormap) NULL;
m_appContext = (WXAppContext) NULL;
}
}
+static char *fallbackResources[] = {
+ "*menuBar.marginHeight: 0",
+ "*menuBar.shadowThickness: 1",
+ "*background: #c0c0c0",
+ "*foreground: black",
+ NULL
+};
+
// Create an application context
bool wxApp::OnInitGui()
{
XtToolkitInitialize() ;
- wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext() ;
+ wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
+ XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
+
Display *dpy = XtOpenDisplay((XtAppContext) wxTheApp->m_appContext,(String)NULL,NULL,
(const char*) wxTheApp->GetClassName(), NULL, 0,
# if XtSpecificationRelease < 5
argv);
if (!dpy) {
+ // if you don't log to stderr, nothing will be shown...
+ delete wxLog::SetActiveTarget(new wxLogStderr);
wxString className(wxTheApp->GetClassName());
wxLogError(_("wxWindows could not open display for '%s': exiting."),
(const char*) className);
return TRUE;
}
-// TODO use XmGetPixmap (?) to get the really standard icons!
-
-#include "wx/generic/info.xpm"
-#include "wx/generic/error.xpm"
-#include "wx/generic/question.xpm"
-#include "wx/generic/warning.xpm"
-
-wxIcon
-wxApp::GetStdIcon(int which) const
-{
- switch(which)
- {
- case wxICON_INFORMATION:
- return wxIcon(info_xpm);
-
- case wxICON_QUESTION:
- return wxIcon(question_xpm);
-
- case wxICON_EXCLAMATION:
- return wxIcon(warning_xpm);
-
- default:
- wxFAIL_MSG("requested non existent standard icon");
- // still fall through
-
- case wxICON_HAND:
- return wxIcon(error_xpm);
- }
-}
-
// ----------------------------------------------------------------------------
// accessors for C modules
// ----------------------------------------------------------------------------