]> git.saurik.com Git - wxWidgets.git/commitdiff
more GetDefaultAttributesFromGTKWidget fixes
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 15 Aug 2004 20:36:04 +0000 (20:36 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 15 Aug 2004 20:36:04 +0000 (20:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/radiobox.cpp
src/gtk/radiobut.cpp
src/gtk1/radiobox.cpp
src/gtk1/radiobut.cpp

index a2f712302d7c6bd9b1b82a17423db52f151a94f8..11d58c16d180ebd502ffef0e12bda4768b0947eb 100644 (file)
@@ -756,9 +756,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;
 }
 
index 2c3e1c0d107c9d0f53c74df9c2e45fa47f2b63ca..df0ad406d2146f811f5511c186ac57ee20925de2 100644 (file)
@@ -237,9 +237,12 @@ wxVisualAttributes
 wxRadioButton::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;
 }
 
index a2f712302d7c6bd9b1b82a17423db52f151a94f8..11d58c16d180ebd502ffef0e12bda4768b0947eb 100644 (file)
@@ -756,9 +756,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;
 }
 
index 2c3e1c0d107c9d0f53c74df9c2e45fa47f2b63ca..df0ad406d2146f811f5511c186ac57ee20925de2 100644 (file)
@@ -237,9 +237,12 @@ wxVisualAttributes
 wxRadioButton::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;
 }