Avoid a few more warnings with Gtk+ 3.0

This commit is contained in:
Pierre Pronchery 2015-10-18 23:55:29 +02:00
parent ec01111fac
commit fd7dede316
2 changed files with 14 additions and 0 deletions

View File

@ -115,7 +115,14 @@ static int _compare(char const * string1, char const * string2)
bbox = gtk_hbutton_box_new();
#endif
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
#if GTK_CHECK_VERSION(3, 10, 0)
widget = gtk_button_new_with_label(_("Close"));
gtk_button_set_image(GTK_BUTTON(widget),
gtk_image_new_from_icon_name(GTK_STOCK_CLOSE,
GTK_ICON_SIZE_BUTTON));
#else
widget = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
#endif
g_signal_connect_swapped(widget, "clicked", G_CALLBACK(
_compare_on_close), window);
gtk_container_add(GTK_CONTAINER(bbox), widget);

View File

@ -278,7 +278,14 @@ static int _progress(Prefs * prefs, char * argv[])
#else
hbox = gtk_hbox_new(FALSE, 0);
#endif
#if GTK_CHECK_VERSION(3, 10, 0)
widget = gtk_button_new_with_label(_("Cancel"));
gtk_button_set_image(GTK_BUTTON(widget),
gtk_image_new_from_icon_name(GTK_STOCK_CANCEL,
GTK_ICON_SIZE_BUTTON));
#else
widget = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
#endif
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(
_progress_cancel), NULL);
gtk_box_pack_end(GTK_BOX(hbox), widget, FALSE, TRUE, 0);