]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
A bit more Unicode compilation.
[wxWidgets.git] / src / gtk / app.cpp
index 97ef298d00a10daef029c1e11dfccb63f482bc65..32d5963bd81e7a376d6eadae0f1fc67982385446 100644 (file)
@@ -213,7 +213,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) )
 
 void wxapp_install_idle_handler()
 {
-    wxASSERT_MSG( wxTheApp->m_idleTag == 0, "attempt to install idle handler twice" );
+    wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") );
 
     /* this routine gets called by all event handlers
        indicating that the idle is over. */
@@ -343,7 +343,7 @@ bool wxApp::OnInitGui()
                 int index = -1;
 
                 GdkColor *colors = cmap->colors;
-                if(colors)
+                if (colors)
                 {
                     int max = 3 * 65536;
 
@@ -359,7 +359,16 @@ bool wxApp::OnInitGui()
                         }
                     }
                 }
-
+               else
+               {
+                   /* assume 8-bit true or static colors. this really
+                      exists. */
+                   GdkVisual* vis = gdk_colormap_get_visual( cmap );
+                   index = (r >> (5 - vis->red_prec)) << vis->red_shift;
+                   index |= (g >> (5 - vis->green_prec)) << vis->green_shift;
+                   index |= (b >> (5 - vis->blue_prec)) << vis->blue_shift;
+               }
+               
                 m_colorCube[ (r*1024) + (g*32) + b ] = index;
             }
         }