Fix wxColourButton with GTK+4
gtk_color_button_get_rgba()/gtk_color_button_set_rgba() are gone
This commit is contained in:
@@ -36,9 +36,14 @@ static void gtk_clrbutton_setcolor_callback(GtkColorButton *widget,
|
||||
{
|
||||
// update the m_colour member of the wxColourButton
|
||||
wxASSERT(p);
|
||||
#ifdef __WXGTK3__
|
||||
#ifdef __WXGTK4__
|
||||
GdkRGBA gdkColor;
|
||||
gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &gdkColor);
|
||||
#elif defined(__WXGTK3__)
|
||||
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
|
||||
GdkRGBA gdkColor;
|
||||
gtk_color_button_get_rgba(widget, &gdkColor);
|
||||
wxGCC_WARNING_RESTORE()
|
||||
#else
|
||||
GdkColor gdkColor;
|
||||
gtk_color_button_get_color(widget, &gdkColor);
|
||||
@@ -100,8 +105,12 @@ wxColourButton::~wxColourButton()
|
||||
|
||||
void wxColourButton::UpdateColour()
|
||||
{
|
||||
#ifdef __WXGTK3__
|
||||
#ifdef __WXGTK4__
|
||||
gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(m_widget), m_colour);
|
||||
#elif defined(__WXGTK3__)
|
||||
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
|
||||
gtk_color_button_set_rgba(GTK_COLOR_BUTTON(m_widget), m_colour);
|
||||
wxGCC_WARNING_RESTORE()
|
||||
#else
|
||||
gtk_color_button_set_color(GTK_COLOR_BUTTON(m_widget), m_colour.GetColor());
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user