]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/colordlg.cpp
More comments about non-native GTH widgets.
[wxWidgets.git] / src / gtk / colordlg.cpp
index 448f347a386c1bfe7cf79e433b65b7644c6ff590..b264c991ca40c771829732df3237df87655210cc 100644 (file)
@@ -42,8 +42,11 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
     m_widget = gtk_color_selection_dialog_new(wxGTK_CONV(title));
 
     if (parent)
+    {
+        GtkWindow* gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) );
         gtk_window_set_transient_for(GTK_WINDOW(m_widget),
-                                     GTK_WINDOW(parent->m_widget));
+                                     gtk_parent);
+    }
 
     GtkColorSelection *sel =
         GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(m_widget)->colorsel);
@@ -101,12 +104,10 @@ void wxColourDialog::ColourDataToDialog()
         }
     }
 
-    gchar *pal = gtk_color_selection_palette_to_string(colors, n_colors);
+    wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors));
 
     GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel));
-    g_object_set(settings, "gtk-color-palette", pal, NULL);
-
-    g_free(pal);
+    g_object_set(settings, "gtk-color-palette", pal.c_str(), NULL);
 }
 
 void wxColourDialog::DialogToColourData()