projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Source cleaning: -1/wxID_ANY/wxDefaultCoord, ::, TRUE/true. FALSE/false, tabs, whites...
[wxWidgets.git]
/
src
/
gtk1
/
app.cpp
diff --git
a/src/gtk1/app.cpp
b/src/gtk1/app.cpp
index 53aa238e66165046506fec4f015e4c5adcb8f348..17b4f900b7c29e4a252c279d49e154488717bf35 100644
(file)
--- a/
src/gtk1/app.cpp
+++ b/
src/gtk1/app.cpp
@@
-35,6
+35,10
@@
#include "wx/module.h"
#include "wx/image.h"
#include "wx/module.h"
#include "wx/image.h"
+#ifdef __WXGPE__
+#include <gpe/init.h>
+#endif
+
#ifdef __WXUNIVERSAL__
#include "wx/univ/theme.h"
#include "wx/univ/renderer.h"
#ifdef __WXUNIVERSAL__
#include "wx/univ/theme.h"
#include "wx/univ/renderer.h"
@@
-539,13
+543,15
@@
GdkVisual *wxApp::GetGdkVisual()
bool wxApp::Initialize(int& argc, wxChar **argv)
{
bool wxApp::Initialize(int& argc, wxChar **argv)
{
+ bool init_result;
+
#if wxUSE_THREADS
// GTK 1.2 up to version 1.2.3 has broken threads
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 4))
{
#if wxUSE_THREADS
// GTK 1.2 up to version 1.2.3 has broken threads
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 4))
{
- printf( "wxWi
ndow
s warning: GUI threading disabled due to outdated GTK version\n" );
+ printf( "wxWi
dget
s warning: GUI threading disabled due to outdated GTK version\n" );
}
else
{
}
else
{
@@
-582,7
+588,13
@@
bool wxApp::Initialize(int& argc, wxChar **argv)
argvGTK[argc] = NULL;
int argcGTK = argc;
argvGTK[argc] = NULL;
int argcGTK = argc;
- gtk_init( &argcGTK, &argvGTK );
+
+#ifdef __WXGPE__
+ init_result = true; // is there a _check() version of this?
+ gpe_application_init( &argcGTK, &argvGTK );
+#else
+ init_result = gtk_init_check( &argcGTK, &argvGTK );
+#endif
if ( argcGTK != argc )
{
if ( argcGTK != argc )
{
@@
-609,9
+621,14
@@
bool wxApp::Initialize(int& argc, wxChar **argv)
#else // !wxUSE_UNICODE
// gtk_init() shouldn't actually change argv itself (just its contents) so
// it's ok to pass pointer to it
#else // !wxUSE_UNICODE
// gtk_init() shouldn't actually change argv itself (just its contents) so
// it's ok to pass pointer to it
-
gtk_init
( &argc, &argv );
+
init_result = gtk_init_check
( &argc, &argv );
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
+ if (!init_result) {
+ wxLogError(wxT("Unable to initialize gtk, is DISPLAY set properly?"));
+ return false;
+ }
+
// we can not enter threads before gtk_init is done
gdk_threads_enter();
// we can not enter threads before gtk_init is done
gdk_threads_enter();
@@
-628,8
+645,6
@@
bool wxApp::Initialize(int& argc, wxChar **argv)
wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
#endif
wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
#endif
- wxGetRootWindow();
-
return true;
}
return true;
}