]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/radiobox.cpp
wxFoldBar now also horizontal (with API methods renamed to mean length rather than...
[wxWidgets.git] / src / gtk / radiobox.cpp
index ea1eee523009f2267e4b1d760e14cecc3b71a6bd..f5779a893668759ee37b2631232e7a4f0a216098 100644 (file)
@@ -286,6 +286,7 @@ wxSize wxRadioBox::DoGetBestSize() const
     if (req.width > size.x)
         size.x = req.width;
 
+    CacheBestSize(size);
     return size;
 }
 
@@ -685,6 +686,10 @@ void wxRadioBox::DoApplyWidgetStyle(GtkRcStyle *style)
 {
     gtk_widget_modify_style( m_widget, style );
 
+#ifdef __WXGTK20__
+    gtk_widget_modify_style(GTK_FRAME(m_widget)->label_widget, style);
+#endif
+
     wxList::compatibility_iterator node = m_boxes.GetFirst();
     while (node)
     {
@@ -755,9 +760,12 @@ wxVisualAttributes
 wxRadioBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
 {
     wxVisualAttributes attr;
+    // NB: we need toplevel window so that GTK+ can find the right style
+    GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     GtkWidget* widget = gtk_radio_button_new_with_label(NULL, "");
+    gtk_container_add(GTK_CONTAINER(wnd), widget);
     attr = GetDefaultAttributesFromGTKWidget(widget);
-    gtk_widget_destroy(widget);
+    gtk_widget_destroy(wnd);
     return attr;
 }