]> git.saurik.com Git - wxWidgets.git/commitdiff
If compiling with WXGTK20, set wxConvCurrent to wxConvUTF8, as all
authorOve Kaaven <ovek@arcticnet.no>
Wed, 19 Jul 2000 08:47:46 +0000 (08:47 +0000)
committerOve Kaaven <ovek@arcticnet.no>
Wed, 19 Jul 2000 08:47:46 +0000 (08:47 +0000)
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
src/gtk1/app.cpp

index 7505f40b8a74ddbf718e25e24dba821fdf49d2b1..65460281f18150a07d1ce617d9dce494e3e7abc8 100644 (file)
@@ -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;
index 7505f40b8a74ddbf718e25e24dba821fdf49d2b1..65460281f18150a07d1ce617d9dce494e3e7abc8 100644 (file)
@@ -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;