forked from osmocom/wireshark
Revert 49166: It breaks compilation:
[ 82%] Building C object ui/gtk/CMakeFiles/gtkui.dir/filter_dlg.c.o /home/jmayer/work/wireshark/svn/trunk/ui/gtk/filter_dlg.c: In function ‘color_filter_te’: /home/jmayer/work/wireshark/svn/trunk/ui/gtk/filter_dlg.c:1258:5: error: enum conversion when passing argument 2 of ‘gtk_widget_modify_bg’ is invalid in C++ [-Werror=c++-compat] gtk_widget_modify_bg(w, GTK_STATE_FLAG_NORMAL, &bg); ^ In file included from /usr/include/gtk-3.0/gtk/gtkaction.h:38:0, from /usr/include/gtk-3.0/gtk/gtkactiongroup.h:38, from /usr/include/gtk-3.0/gtk/gtkapplication.h:29, from /usr/include/gtk-3.0/gtk/gtkwindow.h:35, from /usr/include/gtk-3.0/gtk/gtkdialog.h:35, from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:33, from /home/jmayer/work/wireshark/svn/trunk/ui/gtk/filter_dlg.c:29: /usr/include/gtk-3.0/gtk/gtkwidget.h:813:13: note: expected ‘GtkStateType’ but argument is of type ‘int’ void gtk_widget_modify_bg (GtkWidget *widget, ^ /home/jmayer/work/wireshark/svn/trunk/ui/gtk/filter_dlg.c:1258:5: error: passing argument 3 of ‘gtk_widget_modify_bg’ from incompatible pointer type [-Werror] gtk_widget_modify_bg(w, GTK_STATE_FLAG_NORMAL, &bg); ^ In file included from /usr/include/gtk-3.0/gtk/gtkaction.h:38:0, from /usr/include/gtk-3.0/gtk/gtkactiongroup.h:38, from /usr/include/gtk-3.0/gtk/gtkapplication.h:29, from /usr/include/gtk-3.0/gtk/gtkwindow.h:35, from /usr/include/gtk-3.0/gtk/gtkdialog.h:35, from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:33, from /home/jmayer/work/wireshark/svn/trunk/ui/gtk/filter_dlg.c:29: /usr/include/gtk-3.0/gtk/gtkwidget.h:813:13: note: expected ‘const struct GdkColor *’ but argument is of type ‘struct GdkRGBA *’ void gtk_widget_modify_bg (GtkWidget *widget, ^ cc1: all warnings being treated as errors make[2]: *** [ui/gtk/CMakeFiles/gtkui.dir/filter_dlg.c.o] Error 1 Also note that https://developer.gnome.org/gtk3/3.6/GtkWidget.html#gtk-widget-modify-bg states: gtk_widget_modify_bg has been deprecated since version 3.0 and should not be used in newly-written code. Use gtk_widget_override_background_color() instead Of course we are not the only ones who have problems with that replacement: http://gtk.10911.n7.nabble.com/button-background-color-in-gtk3-td14268.html which ends with a sort of ugly solution without the deprecated function. svn path=/trunk/; revision=49169
This commit is contained in:
parent
e73e5f2d05
commit
e13a0996ee
|
@ -1255,7 +1255,7 @@ color_filter_te(GtkWidget *w, guint16 red, guint16 green, guint16 blue)
|
|||
bg.alpha = 1;
|
||||
|
||||
gtk_widget_override_color(w, GTK_STATE_FLAG_NORMAL, &black);
|
||||
gtk_widget_modify_bg(w, GTK_STATE_FLAG_NORMAL, &bg);
|
||||
gtk_widget_override_background_color(w, GTK_STATE_FLAG_NORMAL, &bg);
|
||||
gtk_widget_override_cursor(w, &black, &black);
|
||||
#else
|
||||
static GdkColor black = { 0, 0, 0, 0 };
|
||||
|
|
Loading…
Reference in New Issue