]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed AppendCommon (called by all Append methods) so it doesn't
authorHarco de Hilster <harcoh@caos.kun.nl>
Tue, 14 Sep 1999 19:32:20 +0000 (19:32 +0000)
committerHarco de Hilster <harcoh@caos.kun.nl>
Tue, 14 Sep 1999 19:32:20 +0000 (19:32 +0000)
call ApplyWidgetStyle (which applies the current style to all list_items,
which should already have the right style), but instead only applies
the style to the new list_item. This results in a *great* speedup for large
listboxes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/listbox.cpp
src/gtk1/listbox.cpp

index fe31b2e16d2b2610dada85197fdaea425737373f..f5f8c7a65e5b21cce99ddabc1632c8cf61756e08 100644 (file)
@@ -518,7 +518,14 @@ void wxListBox::AppendCommon( const wxString &item )
         gtk_widget_realize( list_item );
         gtk_widget_realize( GTK_BIN(list_item)->child );
        
-        if (m_widgetStyle) ApplyWidgetStyle();
+        //if (m_widgetStyle) ApplyWidgetStyle();
+        if (m_widgetStyle) {
+            // Apply current widget style to the new list_item
+            gtk_widget_set_style( GTK_WIDGET( list_item ), m_widgetStyle );
+            GtkBin *bin = GTK_BIN( list_item );
+            GtkWidget *label = GTK_WIDGET( bin->child );
+            gtk_widget_set_style( label, m_widgetStyle );
+        }
 
 #if wxUSE_DRAG_AND_DROP
 #ifndef NEW_GTK_DND_CODE
@@ -994,4 +1001,4 @@ void wxListBox::ApplyWidgetStyle()
     }
 }
 
-#endif
\ No newline at end of file
+#endif
index fe31b2e16d2b2610dada85197fdaea425737373f..f5f8c7a65e5b21cce99ddabc1632c8cf61756e08 100644 (file)
@@ -518,7 +518,14 @@ void wxListBox::AppendCommon( const wxString &item )
         gtk_widget_realize( list_item );
         gtk_widget_realize( GTK_BIN(list_item)->child );
        
-        if (m_widgetStyle) ApplyWidgetStyle();
+        //if (m_widgetStyle) ApplyWidgetStyle();
+        if (m_widgetStyle) {
+            // Apply current widget style to the new list_item
+            gtk_widget_set_style( GTK_WIDGET( list_item ), m_widgetStyle );
+            GtkBin *bin = GTK_BIN( list_item );
+            GtkWidget *label = GTK_WIDGET( bin->child );
+            gtk_widget_set_style( label, m_widgetStyle );
+        }
 
 #if wxUSE_DRAG_AND_DROP
 #ifndef NEW_GTK_DND_CODE
@@ -994,4 +1001,4 @@ void wxListBox::ApplyWidgetStyle()
     }
 }
 
-#endif
\ No newline at end of file
+#endif