]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/control.cpp
disable select root menu command when the root is hidden
[wxWidgets.git] / src / gtk / control.cpp
index 22f7bfcd038227326739e507163c6db9303a4347..7af2a52fc83209698e5f0b1de0342ff9929b0410 100644 (file)
@@ -82,7 +82,7 @@ void wxControl::PostCreation(const wxSize& size)
     gtk_widget_ensure_style(m_widget);
 
     ApplyWidgetStyle();
     gtk_widget_ensure_style(m_widget);
 
     ApplyWidgetStyle();
-    SetInitialBestSize(size);
+    SetInitialSize(size);
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -252,9 +252,6 @@ wxVisualAttributes wxControl::GetDefaultAttributes() const
                                              UseGTKStyleBase());
 }
 
                                              UseGTKStyleBase());
 }
 
-
-#define SHIFT (8*(sizeof(short int)-sizeof(char)))
-
 // static
 wxVisualAttributes
 wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
 // static
 wxVisualAttributes
 wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
@@ -277,17 +274,11 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
         state = GTK_STATE_NORMAL;
 
     // get the style's colours
         state = GTK_STATE_NORMAL;
 
     // get the style's colours
-    attr.colFg = wxColour(style->fg[state].red   >> SHIFT,
-                          style->fg[state].green >> SHIFT,
-                          style->fg[state].blue  >> SHIFT);
+    attr.colFg = wxColour(style->fg[state]);
     if (useBase)
     if (useBase)
-        attr.colBg = wxColour(style->base[state].red   >> SHIFT,
-                              style->base[state].green >> SHIFT,
-                              style->base[state].blue  >> SHIFT);
+        attr.colBg = wxColour(style->base[state]);
     else
     else
-        attr.colBg = wxColour(style->bg[state].red   >> SHIFT,
-                              style->bg[state].green >> SHIFT,
-                              style->bg[state].blue  >> SHIFT);
+        attr.colBg = wxColour(style->bg[state]);
 
     // get the style's font
     if ( !style->font_desc )
 
     // get the style's font
     if ( !style->font_desc )
@@ -375,7 +366,7 @@ void wxControl::OnInternalIdle()
     if ( GtkShowFromOnIdle() )
         return;
 
     if ( GtkShowFromOnIdle() )
         return;
 
-    if ( IsShown() )
+    if ( GTK_WIDGET_REALIZED(m_widget) )
     {
         GTKUpdateCursor();
 
     {
         GTKUpdateCursor();