From 2d4dc3a4d0780f9d25804d93b0f1d9da59afa289 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Wed, 19 Jul 2000 08:47:46 +0000 Subject: [PATCH] If compiling with WXGTK20, set wxConvCurrent to wxConvUTF8, as all gtk+ 1.3.1's widgets (except the deprecated/obsoleted ones) work solely with UTF-8. (I knew my forward thinking regarding wxConvCurrent would pay off someday...) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/app.cpp | 10 +++++++++- src/gtk1/app.cpp | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 7505f40b8a..65460281f1 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -284,8 +284,13 @@ bool wxApp::OnInitGui() if ((gdk_visual_get_best() != gdk_visual_get_system()) && (m_useBestVisual)) { +#ifdef __WXGTK20__ + /* seems gtk_widget_set_default_visual no longer exists? */ + GdkVisual* vis = gtk_widget_get_default_visual(); +#else GdkVisual* vis = gdk_visual_get_best(); gtk_widget_set_default_visual( vis ); +#endif GdkColormap *colormap = gdk_colormap_new( vis, FALSE ); gtk_widget_set_default_colormap( colormap ); @@ -590,7 +595,10 @@ int wxEntryStart( int argc, char *argv[] ) gtk_set_locale(); -#if wxUSE_WCHAR_T +#if defined(__WXGTK20__) + // gtk+ 2.0 supports Unicode through UTF-8 strings + wxConvCurrent = &wxConvUTF8; +#elif wxUSE_WCHAR_T if (!wxOKlibc()) wxConvCurrent = &wxConvLocal; #else if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL; diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 7505f40b8a..65460281f1 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -284,8 +284,13 @@ bool wxApp::OnInitGui() if ((gdk_visual_get_best() != gdk_visual_get_system()) && (m_useBestVisual)) { +#ifdef __WXGTK20__ + /* seems gtk_widget_set_default_visual no longer exists? */ + GdkVisual* vis = gtk_widget_get_default_visual(); +#else GdkVisual* vis = gdk_visual_get_best(); gtk_widget_set_default_visual( vis ); +#endif GdkColormap *colormap = gdk_colormap_new( vis, FALSE ); gtk_widget_set_default_colormap( colormap ); @@ -590,7 +595,10 @@ int wxEntryStart( int argc, char *argv[] ) gtk_set_locale(); -#if wxUSE_WCHAR_T +#if defined(__WXGTK20__) + // gtk+ 2.0 supports Unicode through UTF-8 strings + wxConvCurrent = &wxConvUTF8; +#elif wxUSE_WCHAR_T if (!wxOKlibc()) wxConvCurrent = &wxConvLocal; #else if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;