aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/color_edit_dlg.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2011-02-07 18:41:38 +0000
committerStephen Fisher <steve@stephen-fisher.com>2011-02-07 18:41:38 +0000
commit9d3586b4f5de8f9a9e4fd5f4ec0e5a4fa97518ac (patch)
treebe04b6fa1ad15df0c1c28fc7a185f9fe6224f83f /gtk/color_edit_dlg.c
parent88ea7649d528a506be29c4196f390f0f1a873b96 (diff)
And even more -DGSEAL_ENABLE cleanup for GTK+ 3.0 preparation...
svn path=/trunk/; revision=35849
Diffstat (limited to 'gtk/color_edit_dlg.c')
-rw-r--r--gtk/color_edit_dlg.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/gtk/color_edit_dlg.c b/gtk/color_edit_dlg.c
index 49f106ba89..31edd67c33 100644
--- a/gtk/color_edit_dlg.c
+++ b/gtk/color_edit_dlg.c
@@ -475,23 +475,33 @@ color_sel_win_new(color_filter_t *colorf, gboolean is_bg)
#endif
}
- color_sel_ok = GTK_COLOR_SELECTION_DIALOG (color_sel_win)->ok_button;
+ g_object_get(color_sel_win, "ok-button", color_sel_ok, NULL);
g_object_set_data(G_OBJECT(color_sel_win), "color_sel_ok", color_sel_ok);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_can_default(color_sel_ok, TRUE);
+#else
GTK_WIDGET_SET_FLAGS (color_sel_ok, GTK_CAN_DEFAULT);
+#endif
- color_sel_cancel = GTK_COLOR_SELECTION_DIALOG (color_sel_win)->cancel_button;
+ g_object_get(color_sel_win, "cancel-button", color_sel_cancel, NULL);
g_object_set_data(G_OBJECT(color_sel_win), "color_sel_cancel", color_sel_cancel);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_can_default(color_sel_cancel, TRUE);
+#else
GTK_WIDGET_SET_FLAGS (color_sel_cancel, GTK_CAN_DEFAULT);
+#endif
window_set_cancel_button(color_sel_win, color_sel_cancel, NULL); /* ensure esc does req'd local cxl action. */
/* esc as handled by the */
/* gtk_color_selection_dialog widget */
/* doesn't result in this happening. */
- color_sel_help = GTK_COLOR_SELECTION_DIALOG (color_sel_win)->help_button;
+ g_object_get(color_sel_win, "help-button", color_sel_help, NULL);
g_object_set_data(G_OBJECT(color_sel_win), "color_sel_help", color_sel_help);
-
-
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_can_default(color_sel_help, TRUE);
+#else
GTK_WIDGET_SET_FLAGS (color_sel_help, GTK_CAN_DEFAULT);
+#endif
g_signal_connect(color_sel_ok, "clicked", G_CALLBACK(color_sel_ok_cb), color_sel_win);
g_signal_connect(color_sel_cancel, "clicked", G_CALLBACK(color_sel_cancel_cb), color_sel_win);
@@ -540,8 +550,11 @@ color_sel_ok_cb (GtkButton *button _U_,
color_dialog = (GtkWidget *)user_data;
- gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(
- GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &new_color);
+#if GTK_CHECK_VERSION(2,14,0)
+ gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))), &new_color);
+#else
+ gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &new_color);
+#endif
if ( ! get_color(&new_color) ){
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,