X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/937013e0fd914d4c42f9f5ec98da665986b93dfa..11a23db53128bf244a089123b7fd27deb577a889:/src/gtk/clrpicker.cpp?ds=sidebyside diff --git a/src/gtk/clrpicker.cpp b/src/gtk/clrpicker.cpp index de19aa7c4d..e821a2d16e 100644 --- a/src/gtk/clrpicker.cpp +++ b/src/gtk/clrpicker.cpp @@ -4,7 +4,6 @@ // Author: Francesco Montorsi // Modified By: // Created: 15/04/2006 -// Id: $Id$ // Copyright: (c) Francesco Montorsi // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -37,9 +36,14 @@ static void gtk_clrbutton_setcolor_callback(GtkColorButton *widget, { // update the m_colour member of the wxColourButton wxASSERT(p); +#ifdef __WXGTK3__ + GdkRGBA gdkColor; + gtk_color_button_get_rgba(widget, &gdkColor); +#else GdkColor gdkColor; gtk_color_button_get_color(widget, &gdkColor); - p->SetGdkColor(gdkColor); +#endif + p->GTKSetColour(gdkColor); // fire the colour-changed event wxColourPickerEvent event(p, p->GetId(), p->GetColour()); @@ -67,8 +71,12 @@ bool wxColourButton::Create( wxWindow *parent, wxWindowID id, } m_colour = col; +#ifdef __WXGTK3__ + m_widget = gtk_color_button_new_with_rgba(m_colour); +#else m_widget = gtk_color_button_new_with_color( m_colour.GetColor() ); - gtk_widget_show(m_widget); +#endif + g_object_ref(m_widget); // GtkColourButton signals g_signal_connect(m_widget, "color-set", @@ -89,7 +97,11 @@ wxColourButton::~wxColourButton() void wxColourButton::UpdateColour() { +#ifdef __WXGTK3__ + gtk_color_button_set_rgba(GTK_COLOR_BUTTON(m_widget), m_colour); +#else gtk_color_button_set_color(GTK_COLOR_BUTTON(m_widget), m_colour.GetColor()); +#endif } #endif // wxUSE_COLOURPICKERCTRL