[gtk+/native-layout] Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout] Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
- Date: Sun, 4 Apr 2010 02:34:55 +0000 (UTC)
commit ec20658b51299f651cfa0f84d016dcc5ad2c40d1
Author: Javier Jardón <jjardon gnome org>
Date: Tue Mar 2 07:58:05 2010 +0100
Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)
Use new API instead: gtk_widget_set_can_default ()
demos/gtk-demo/menus.c | 2 +-
demos/gtk-demo/ui_manager.c | 2 +-
docs/tutorial/gtk-tut.sgml | 12 +++---
examples/calendar/calendar.c | 2 +-
examples/entry/entry.c | 2 +-
examples/progressbar/progressbar.c | 2 +-
examples/radiobuttons/radiobuttons.c | 2 +-
examples/rangewidgets/rangewidgets.c | 2 +-
examples/scrolledwin/scrolledwin.c | 2 +-
examples/text/text.c | 2 +-
gtk/gtkaboutdialog.c | 4 +-
gtk/gtkassistant.c | 6 +-
gtk/gtkdialog.c | 2 +-
gtk/gtkfilechooserdefault.c | 2 +-
gtk/gtkfilesel.c | 4 +-
gtk/gtkgamma.c | 2 +-
gtk/gtkinfobar.c | 2 +-
gtk/gtkinputdialog.c | 4 +-
gtk/gtkmain.c | 2 +-
gtk/gtkoptionmenu.c | 8 ++-
gtk/gtkprintunixdialog.c | 2 +-
gtk/gtkwidget.c | 4 +-
tests/testcalendar.c | 2 +-
tests/testgtk.c | 72 +++++++++++++++++-----------------
tests/testmenubars.c | 2 +-
tests/testmenus.c | 2 +-
tests/testrecentchoosermenu.c | 2 +-
tests/testtext.c | 6 +-
28 files changed, 80 insertions(+), 78 deletions(-)
---
diff --git a/demos/gtk-demo/menus.c b/demos/gtk-demo/menus.c
index 6e546f3..78f63bf 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 5bbdf5c..735bf7f 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 9a7c9f1..cc85082 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)->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 2be27c3..1f9a3a5 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 ab06ec5..2d06f71 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 fb219d0..525cbba 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 05fd1e3..ad66c42 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 17bfcce..ba36b67 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 b0aaf81..7d09e64 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 c3439cb..2b05c47 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 cdba728..affb946 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 0f112e6..011334c 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 d14e8ac..04f2539 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 2ced490..ecdcc01 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 78938a3..465b722 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 5485ded..79e4d1c 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 b25df2c..f49155b 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 a023e19..c91467b 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 4b1ae90..497a99f 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 e56290e..5d75ed3 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 bee8631..2442ab7 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 f94b9a6..5c1d841 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5568,9 +5568,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 3af41b3..c926be3 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 2bde6bc..7cd4660 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 7626431..416a939 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 541ee19..4163ffd 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 94166c6..73cfafb 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 1224f75..0bbd789 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]