summaryrefslogtreecommitdiff
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
parent483a5a9e1a55f01cbd20b7bbd301ee59efaa4c64 (diff)
downloadgtk+-e8e95d4c5ee4c7c78971597c53f0b6e3f0e81b7a.tar.gz
Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
Use new API instead: gtk_widget_set_can_default ()
-rw-r--r--demos/gtk-demo/menus.c2
-rw-r--r--demos/gtk-demo/ui_manager.c2
-rwxr-xr-xdocs/tutorial/gtk-tut.sgml12
-rw-r--r--examples/calendar/calendar.c2
-rw-r--r--examples/entry/entry.c2
-rw-r--r--examples/progressbar/progressbar.c2
-rw-r--r--examples/radiobuttons/radiobuttons.c2
-rw-r--r--examples/rangewidgets/rangewidgets.c2
-rw-r--r--examples/scrolledwin/scrolledwin.c2
-rw-r--r--examples/text/text.c2
-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
-rw-r--r--tests/testcalendar.c2
-rw-r--r--tests/testgtk.c72
-rw-r--r--tests/testmenubars.c2
-rw-r--r--tests/testmenus.c2
-rw-r--r--tests/testrecentchoosermenu.c2
-rw-r--r--tests/testtext.c6
28 files changed, 80 insertions, 78 deletions
diff --git a/demos/gtk-demo/menus.c b/demos/gtk-demo/menus.c
index 6e546f379c..78f63bfd55 100644
--- a/demos/gtk-demo/menus.c
+++ b/demos/gtk-demo/menus.c
@@ -191,7 +191,7 @@ do_menus (GtkWidget *do_widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), 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/demos/gtk-demo/ui_manager.c b/demos/gtk-demo/ui_manager.c
index 5bbdf5c9e8..735bf7fe7f 100644
--- a/demos/gtk-demo/ui_manager.c
+++ b/demos/gtk-demo/ui_manager.c
@@ -221,7 +221,7 @@ do_ui_manager (GtkWidget *do_widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), 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_all (window);
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index 9a7c9f1c11..cc85082208 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -2520,7 +2520,7 @@ int main( int argc,
G_CALLBACK (close_application),
G_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);
gtk_widget_show (window);
@@ -3338,7 +3338,7 @@ static void create_range_controls( void )
G_CALLBACK (gtk_main_quit),
NULL);
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);
@@ -4078,7 +4078,7 @@ int main( int argc,
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
/* This makes it so the button is the default. */
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
/* This grabs this button to be the default button. Simply hitting
* the "Enter" key will cause this button to activate. */
@@ -4694,7 +4694,7 @@ int main( int argc,
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (window));
gtk_box_pack_start (GTK_BOX (vbox), 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);
@@ -5913,7 +5913,7 @@ static void create_calendar( void )
G_CALLBACK (gtk_main_quit),
NULL);
gtk_container_add (GTK_CONTAINER (bbox), button);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show_all (window);
@@ -7243,7 +7243,7 @@ int main( int argc,
/* this makes it so the button is the default. */
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)-&gt;action_area), button, TRUE, TRUE, 0);
/* This grabs this button to be the default button. Simply hitting
diff --git a/examples/calendar/calendar.c b/examples/calendar/calendar.c
index 2be27c336b..1f9a3a5bbd 100644
--- a/examples/calendar/calendar.c
+++ b/examples/calendar/calendar.c
@@ -393,7 +393,7 @@ static void create_calendar( void )
G_CALLBACK (gtk_main_quit),
NULL);
gtk_container_add (GTK_CONTAINER (bbox), button);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show_all (window);
diff --git a/examples/entry/entry.c b/examples/entry/entry.c
index ab06ec5214..2d06f7192d 100644
--- a/examples/entry/entry.c
+++ b/examples/entry/entry.c
@@ -88,7 +88,7 @@ int main( int argc,
G_CALLBACK (gtk_widget_destroy),
window);
gtk_box_pack_start (GTK_BOX (vbox), 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/examples/progressbar/progressbar.c b/examples/progressbar/progressbar.c
index fb219d0b82..525cbba1bd 100644
--- a/examples/progressbar/progressbar.c
+++ b/examples/progressbar/progressbar.c
@@ -183,7 +183,7 @@ int main( int argc,
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
/* This makes it so the button is the default. */
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
/* This grabs this button to be the default button. Simply hitting
* the "Enter" key will cause this button to activate. */
diff --git a/examples/radiobuttons/radiobuttons.c b/examples/radiobuttons/radiobuttons.c
index 05fd1e38a2..ad66c423bb 100644
--- a/examples/radiobuttons/radiobuttons.c
+++ b/examples/radiobuttons/radiobuttons.c
@@ -69,7 +69,7 @@ int main( int argc,
G_CALLBACK (close_application),
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);
gtk_widget_show (window);
diff --git a/examples/rangewidgets/rangewidgets.c b/examples/rangewidgets/rangewidgets.c
index 17bfcceb94..ba36b67e2d 100644
--- a/examples/rangewidgets/rangewidgets.c
+++ b/examples/rangewidgets/rangewidgets.c
@@ -272,7 +272,7 @@ static void create_range_controls( void )
G_CALLBACK (gtk_main_quit),
NULL);
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/examples/scrolledwin/scrolledwin.c b/examples/scrolledwin/scrolledwin.c
index b0aaf81690..7d09e648a8 100644
--- a/examples/scrolledwin/scrolledwin.c
+++ b/examples/scrolledwin/scrolledwin.c
@@ -77,7 +77,7 @@ int main( int argc,
/* this makes it so the button is the default. */
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area), button, TRUE, TRUE, 0);
/* This grabs this button to be the default button. Simply hitting
diff --git a/examples/text/text.c b/examples/text/text.c
index c3439cbddf..2b05c472b5 100644
--- a/examples/text/text.c
+++ b/examples/text/text.c
@@ -170,7 +170,7 @@ int main( int argc,
G_CALLBACK (close_application),
NULL);
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/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index cdba7287ba..affb9466ee 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 0f112e6f3c..011334c35d 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 d14e8ac9a5..04f2539ca6 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 2ced490d46..ecdcc01b58 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 78938a3406..465b722a51 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 5485dede0f..79e4d1c06b 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 b25df2c493..f49155b2f9 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 a023e19f2a..c91467b6ae 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 4b1ae90af6..497a99f671 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 e56290ea2b..5d75ed3628 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 bee86318ef..2442ab76a1 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 42980191e0..9b88994e81 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");
diff --git a/tests/testcalendar.c b/tests/testcalendar.c
index 3af41b3c46..c926be317a 100644
--- a/tests/testcalendar.c
+++ b/tests/testcalendar.c
@@ -679,7 +679,7 @@ create_calendar(void)
gtk_container_add (GTK_CONTAINER (window), vbox);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 0);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 2bde6bc741..7cd4660858 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -909,7 +909,7 @@ create_buttons (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
gtk_box_pack_start (GTK_BOX (box2), button[9], TRUE, TRUE, 0);
- GTK_WIDGET_SET_FLAGS (button[9], GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button[9], TRUE);
gtk_widget_grab_default (button[9]);
}
@@ -977,7 +977,7 @@ create_toggle_buttons (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -1792,7 +1792,7 @@ create_statusbar (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -3494,7 +3494,7 @@ create_reparent (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), 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);
}
@@ -3782,7 +3782,7 @@ create_saved_position (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show_all (window);
@@ -3867,7 +3867,7 @@ create_pixmap (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -4032,7 +4032,7 @@ create_tooltips (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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_tooltips_set_tip (tooltips, button, "Push this button to close window", "ContextHelp/buttons/Close");
@@ -4517,7 +4517,7 @@ create_menus (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -4788,7 +4788,7 @@ create_item_factory (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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_item_factory_delete_item (item_factory, "/Preferences/ShouldNotAppear");
@@ -5197,7 +5197,7 @@ create_scrolled_windows (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -5207,7 +5207,7 @@ create_scrolled_windows (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK (scrolled_windows_remove),
scrolled_window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -5412,7 +5412,7 @@ create_entry (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -5580,7 +5580,7 @@ create_event_box (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -6623,7 +6623,7 @@ create_list (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
}
@@ -7174,7 +7174,7 @@ create_clist (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
}
@@ -8705,7 +8705,7 @@ create_dialog (GtkWidget *widget)
gtk_container_set_border_width (GTK_CONTAINER (dialog_window), 0);
button = gtk_button_new_with_label ("OK");
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -8715,7 +8715,7 @@ create_dialog (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK (label_toggle),
&label);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -8724,7 +8724,7 @@ create_dialog (GtkWidget *widget)
button = gtk_button_new_with_label ("Separator");
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog_window),
button,
@@ -8986,7 +8986,7 @@ create_event_watcher (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
dialog_window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -9121,7 +9121,7 @@ create_range_controls (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -9398,7 +9398,7 @@ create_text (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
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);
}
@@ -9769,7 +9769,7 @@ create_notebook (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
gtk_box_pack_start (GTK_BOX (box1), button, FALSE, FALSE, 0);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
}
@@ -10638,7 +10638,7 @@ create_wmhints (GtkWidget *widget)
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);
}
@@ -12071,7 +12071,7 @@ create_progress_bar (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
pdata->window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (pdata->window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -13130,7 +13130,7 @@ create_timeout_test (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -13140,7 +13140,7 @@ create_timeout_test (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK(start_timeout_test),
label);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -13149,7 +13149,7 @@ create_timeout_test (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK (stop_timeout_test),
NULL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -13306,7 +13306,7 @@ create_idle_test (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -13316,7 +13316,7 @@ create_idle_test (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK (start_idle_test),
label);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -13325,7 +13325,7 @@ create_idle_test (GtkWidget *widget)
g_signal_connect (button, "clicked",
G_CALLBACK (stop_idle_test),
NULL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -13405,7 +13405,7 @@ create_rc_file (GtkWidget *widget)
button = gtk_button_new_with_label ("Reload");
g_signal_connect (button, "clicked",
G_CALLBACK (gtk_rc_reparse_all), NULL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_grab_default (button);
@@ -13413,7 +13413,7 @@ create_rc_file (GtkWidget *widget)
button = gtk_button_new_with_label ("Reload All");
g_signal_connect (button, "clicked",
G_CALLBACK (reload_all_rc_files), NULL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
@@ -13421,7 +13421,7 @@ create_rc_file (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
}
@@ -13478,7 +13478,7 @@ create_mainloop (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
gtk_widget_show (button);
@@ -13638,7 +13638,7 @@ create_styles (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -13917,7 +13917,7 @@ create_main_window (void)
G_CALLBACK (do_exit),
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_all (window);
diff --git a/tests/testmenubars.c b/tests/testmenubars.c
index 7626431ad3..416a939861 100644
--- a/tests/testmenubars.c
+++ b/tests/testmenubars.c
@@ -160,7 +160,7 @@ main (int argc, char **argv)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), 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/tests/testmenus.c b/tests/testmenus.c
index 541ee19838..4163ffdff1 100644
--- a/tests/testmenus.c
+++ b/tests/testmenus.c
@@ -224,7 +224,7 @@ main (int argc, char **argv)
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), 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/tests/testrecentchoosermenu.c b/tests/testrecentchoosermenu.c
index 94166c6f9b..73cfafbb7d 100644
--- a/tests/testrecentchoosermenu.c
+++ b/tests/testrecentchoosermenu.c
@@ -193,7 +193,7 @@ main (int argc, char *argv[])
G_CALLBACK (gtk_widget_destroy),
window);
gtk_box_pack_end (GTK_BOX (box), 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/tests/testtext.c b/tests/testtext.c
index 1224f75944..0bbd7899b1 100644
--- a/tests/testtext.c
+++ b/tests/testtext.c
@@ -285,7 +285,7 @@ msgbox_run (GtkWindow *parent,
if (yes_button)
{
button = gtk_button_new_with_label (yes_button);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_container_add (GTK_CONTAINER (button_box), button);
if (default_index == 0)
@@ -301,7 +301,7 @@ msgbox_run (GtkWindow *parent,
if (no_button)
{
button = gtk_button_new_with_label (no_button);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_container_add (GTK_CONTAINER (button_box), button);
if (default_index == 0)
@@ -316,7 +316,7 @@ msgbox_run (GtkWindow *parent,
if (cancel_button)
{
button = gtk_button_new_with_label (cancel_button);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default (button, TRUE);
gtk_container_add (GTK_CONTAINER (button_box), button);
if (default_index == 1)