summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-03-02 07:58:05 +0100
committerJavier Jardón <jjardon@gnome.org>2010-03-02 07:58:05 +0100
commite8e95d4c5ee4c7c78971597c53f0b6e3f0e81b7a (patch)
treee0af9394513f9dcb571e80f39456a1fda1c1533b /gtk
parent483a5a9e1a55f01cbd20b7bbd301ee59efaa4c64 (diff)
downloadgdk-pixbuf-e8e95d4c5ee4c7c78971597c53f0b6e3f0e81b7a.tar.gz
Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
Use new API instead: gtk_widget_set_can_default ()
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkaboutdialog.c4
-rw-r--r--gtk/gtkassistant.c6
-rw-r--r--gtk/gtkdialog.c2
-rw-r--r--gtk/gtkfilechooserdefault.c2
-rw-r--r--gtk/gtkfilesel.c4
-rw-r--r--gtk/gtkgamma.c2
-rw-r--r--gtk/gtkinfobar.c2
-rw-r--r--gtk/gtkinputdialog.c4
-rw-r--r--gtk/gtkmain.c2
-rw-r--r--gtk/gtkoptionmenu.c8
-rw-r--r--gtk/gtkprintunixdialog.c2
-rw-r--r--gtk/gtkwidget.c4
12 files changed, 22 insertions, 20 deletions
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index cdba7287b..affb9466e 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -623,7 +623,7 @@ gtk_about_dialog_init (GtkAboutDialog *about)
/* Add the credits button */
button = gtk_button_new_with_mnemonic (_("C_redits"));
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
gtk_widget_set_no_show_all (button, TRUE);
@@ -637,7 +637,7 @@ gtk_about_dialog_init (GtkAboutDialog *about)
/* Add the license button */
button = gtk_button_new_from_stock (_("_License"));
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_set_no_show_all (button, TRUE);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area),
button, FALSE, TRUE, 0);
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 0f112e6f3..011334c35 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -760,9 +760,9 @@ gtk_assistant_init (GtkAssistant *assistant)
assistant->back = gtk_button_new_from_stock (GTK_STOCK_GO_BACK);
assistant->cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
assistant->last = gtk_button_new_from_stock (GTK_STOCK_GOTO_LAST);
- GTK_WIDGET_SET_FLAGS (assistant->close, GTK_CAN_DEFAULT);
- GTK_WIDGET_SET_FLAGS (assistant->apply, GTK_CAN_DEFAULT);
- GTK_WIDGET_SET_FLAGS (assistant->forward, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (assistant->close, TRUE);
+ gtk_widget_set_can_default (assistant->apply, TRUE);
+ gtk_widget_set_can_default (assistant->forward, TRUE);
priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
gtk_size_group_add_widget (priv->size_group, assistant->close);
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index d14e8ac9a..04f2539ca 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -709,7 +709,7 @@ gtk_dialog_add_button (GtkDialog *dialog,
button = gtk_button_new_from_stock (button_text);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 2ced490d4..ecdcc01b5 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -8145,7 +8145,7 @@ add_custom_button_to_dialog (GtkDialog *dialog,
GtkWidget *button;
button = gtk_button_new_with_mnemonic (mnemonic_label);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button);
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index 78938a340..465b722a5 100644
--- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c
@@ -1416,7 +1416,7 @@ gtk_file_selection_create_dir (GtkWidget *widget,
gtk_label_set_mnemonic_widget (GTK_LABEL (label), fs->fileop_entry);
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
TRUE, TRUE, 5);
- GTK_WIDGET_SET_FLAGS (fs->fileop_entry, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (fs->fileop_entry, TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (fs->fileop_entry), TRUE);
gtk_widget_show (fs->fileop_entry);
@@ -1681,7 +1681,7 @@ gtk_file_selection_rename_file (GtkWidget *widget,
fs->fileop_entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
TRUE, TRUE, 5);
- GTK_WIDGET_SET_FLAGS (fs->fileop_entry, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (fs->fileop_entry, TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (fs->fileop_entry), TRUE);
gtk_widget_show (fs->fileop_entry);
diff --git a/gtk/gtkgamma.c b/gtk/gtkgamma.c
index 5485dede0..79e4d1c06 100644
--- a/gtk/gtkgamma.c
+++ b/gtk/gtkgamma.c
@@ -438,7 +438,7 @@ button_clicked_callback (GtkWidget *w, gpointer data)
gtk_widget_show (button);
button = gtk_button_new_from_stock (GTK_STOCK_OK);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
g_signal_connect (button, "clicked",
G_CALLBACK (gamma_ok_callback), c);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index b25df2c49..f49155b2f 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -802,7 +802,7 @@ gtk_info_bar_add_button (GtkInfoBar *info_bar,
button = gtk_button_new_from_stock (button_text);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);
diff --git a/gtk/gtkinputdialog.c b/gtk/gtkinputdialog.c
index a023e19f2..c91467b6a 100644
--- a/gtk/gtkinputdialog.c
+++ b/gtk/gtkinputdialog.c
@@ -310,13 +310,13 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
inputd->keys_list = NULL;
inputd->save_button = gtk_button_new_from_stock (GTK_STOCK_SAVE);
- GTK_WIDGET_SET_FLAGS (inputd->save_button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (inputd->save_button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(inputd)->action_area),
inputd->save_button, TRUE, TRUE, 0);
gtk_widget_show (inputd->save_button);
inputd->close_button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
- GTK_WIDGET_SET_FLAGS (inputd->close_button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (inputd->close_button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(inputd)->action_area),
inputd->close_button, TRUE, TRUE, 0);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 4b1ae90af..497a99f67 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2555,7 +2555,7 @@ gtk_print (gchar *str)
G_CALLBACK (gtk_widget_hide),
GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);
}
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index e56290ea2..5d75ed362 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -186,9 +186,11 @@ gtk_option_menu_child_type (GtkContainer *container)
static void
gtk_option_menu_init (GtkOptionMenu *option_menu)
{
- gtk_widget_set_can_focus (GTK_WIDGET (option_menu), TRUE);
- GTK_WIDGET_UNSET_FLAGS (option_menu, GTK_CAN_DEFAULT);
- gtk_widget_set_receives_default (GTK_WIDGET (option_menu), FALSE);
+ GtkWidget *widget = GTK_WIDGET (option_menu);
+
+ gtk_widget_set_can_focus (widget, TRUE);
+ gtk_widget_set_can_default (widget, FALSE);
+ gtk_widget_set_receives_default (widget, FALSE);
option_menu->menu = NULL;
option_menu->menu_item = NULL;
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index bee86318e..2442ab76a 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -414,7 +414,7 @@ add_custom_button_to_dialog (GtkDialog *dialog,
GtkWidget *button = NULL;
button = gtk_button_new_with_mnemonic (mnemonic_label);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (stock_id,
GTK_ICON_SIZE_BUTTON));
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 42980191e..9b88994e8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5553,9 +5553,9 @@ gtk_widget_set_can_default (GtkWidget *widget,
if (can_default != gtk_widget_get_can_default (widget))
{
if (can_default)
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT);
+ GTK_OBJECT_FLAGS (widget) |= GTK_CAN_DEFAULT;
else
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_DEFAULT);
+ GTK_OBJECT_FLAGS (widget) &= ~(GTK_CAN_DEFAULT);
gtk_widget_queue_resize (widget);
g_object_notify (G_OBJECT (widget), "can-default");