Commit e8e95d4c authored by Javier Jardón's avatar Javier Jardón

Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_DEFAULT)

Use new API instead: gtk_widget_set_can_default ()
parent 483a5a9e
...@@ -191,7 +191,7 @@ do_menus (GtkWidget *do_widget) ...@@ -191,7 +191,7 @@ do_menus (GtkWidget *do_widget)
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), window); G_CALLBACK(gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
} }
......
...@@ -221,7 +221,7 @@ do_ui_manager (GtkWidget *do_widget) ...@@ -221,7 +221,7 @@ do_ui_manager (GtkWidget *do_widget)
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window); G_CALLBACK (gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show_all (window); gtk_widget_show_all (window);
......
...@@ -2520,7 +2520,7 @@ int main( int argc, ...@@ -2520,7 +2520,7 @@ int main( int argc,
G_CALLBACK (close_application), G_CALLBACK (close_application),
G_OBJECT (window)); G_OBJECT (window));
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
gtk_widget_show (window); gtk_widget_show (window);
...@@ -3338,7 +3338,7 @@ static void create_range_controls( void ) ...@@ -3338,7 +3338,7 @@ static void create_range_controls( void )
G_CALLBACK (gtk_main_quit), G_CALLBACK (gtk_main_quit),
NULL); NULL);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
...@@ -4078,7 +4078,7 @@ int main( int argc, ...@@ -4078,7 +4078,7 @@ int main( int argc,
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
/* This makes it so the button is the default. */ /* 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 /* This grabs this button to be the default button. Simply hitting
* the "Enter" key will cause this button to activate. */ * the "Enter" key will cause this button to activate. */
...@@ -4694,7 +4694,7 @@ int main( int argc, ...@@ -4694,7 +4694,7 @@ int main( int argc,
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
G_OBJECT (window)); G_OBJECT (window));
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
...@@ -5913,7 +5913,7 @@ static void create_calendar( void ) ...@@ -5913,7 +5913,7 @@ static void create_calendar( void )
G_CALLBACK (gtk_main_quit), G_CALLBACK (gtk_main_quit),
NULL); NULL);
gtk_container_add (GTK_CONTAINER (bbox), button); 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_grab_default (button);
gtk_widget_show_all (window); gtk_widget_show_all (window);
...@@ -7243,7 +7243,7 @@ int main( int argc, ...@@ -7243,7 +7243,7 @@ int main( int argc,
/* this makes it so the button is the default. */ /* 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); 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 /* This grabs this button to be the default button. Simply hitting
......
...@@ -393,7 +393,7 @@ static void create_calendar( void ) ...@@ -393,7 +393,7 @@ static void create_calendar( void )
G_CALLBACK (gtk_main_quit), G_CALLBACK (gtk_main_quit),
NULL); NULL);
gtk_container_add (GTK_CONTAINER (bbox), button); 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_grab_default (button);
gtk_widget_show_all (window); gtk_widget_show_all (window);
......
...@@ -88,7 +88,7 @@ int main( int argc, ...@@ -88,7 +88,7 @@ int main( int argc,
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
......
...@@ -183,7 +183,7 @@ int main( int argc, ...@@ -183,7 +183,7 @@ int main( int argc,
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
/* This makes it so the button is the default. */ /* 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 /* This grabs this button to be the default button. Simply hitting
* the "Enter" key will cause this button to activate. */ * the "Enter" key will cause this button to activate. */
......
...@@ -69,7 +69,7 @@ int main( int argc, ...@@ -69,7 +69,7 @@ int main( int argc,
G_CALLBACK (close_application), G_CALLBACK (close_application),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
gtk_widget_show (window); gtk_widget_show (window);
......
...@@ -272,7 +272,7 @@ static void create_range_controls( void ) ...@@ -272,7 +272,7 @@ static void create_range_controls( void )
G_CALLBACK (gtk_main_quit), G_CALLBACK (gtk_main_quit),
NULL); NULL);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
......
...@@ -77,7 +77,7 @@ int main( int argc, ...@@ -77,7 +77,7 @@ int main( int argc,
/* this makes it so the button is the default. */ /* 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); 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 /* This grabs this button to be the default button. Simply hitting
......
...@@ -170,7 +170,7 @@ int main( int argc, ...@@ -170,7 +170,7 @@ int main( int argc,
G_CALLBACK (close_application), G_CALLBACK (close_application),
NULL); NULL);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
......
...@@ -623,7 +623,7 @@ gtk_about_dialog_init (GtkAboutDialog *about) ...@@ -623,7 +623,7 @@ gtk_about_dialog_init (GtkAboutDialog *about)
/* Add the credits button */ /* Add the credits button */
button = gtk_button_new_with_mnemonic (_("C_redits")); 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); image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image); gtk_button_set_image (GTK_BUTTON (button), image);
gtk_widget_set_no_show_all (button, TRUE); gtk_widget_set_no_show_all (button, TRUE);
...@@ -637,7 +637,7 @@ gtk_about_dialog_init (GtkAboutDialog *about) ...@@ -637,7 +637,7 @@ gtk_about_dialog_init (GtkAboutDialog *about)
/* Add the license button */ /* Add the license button */
button = gtk_button_new_from_stock (_("_License")); 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_widget_set_no_show_all (button, TRUE);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area), gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area),
button, FALSE, TRUE, 0); button, FALSE, TRUE, 0);
......
...@@ -760,9 +760,9 @@ gtk_assistant_init (GtkAssistant *assistant) ...@@ -760,9 +760,9 @@ gtk_assistant_init (GtkAssistant *assistant)
assistant->back = gtk_button_new_from_stock (GTK_STOCK_GO_BACK); assistant->back = gtk_button_new_from_stock (GTK_STOCK_GO_BACK);
assistant->cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL); assistant->cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
assistant->last = gtk_button_new_from_stock (GTK_STOCK_GOTO_LAST); assistant->last = gtk_button_new_from_stock (GTK_STOCK_GOTO_LAST);
GTK_WIDGET_SET_FLAGS (assistant->close, GTK_CAN_DEFAULT); gtk_widget_set_can_default (assistant->close, TRUE);
GTK_WIDGET_SET_FLAGS (assistant->apply, GTK_CAN_DEFAULT); gtk_widget_set_can_default (assistant->apply, TRUE);
GTK_WIDGET_SET_FLAGS (assistant->forward, GTK_CAN_DEFAULT); gtk_widget_set_can_default (assistant->forward, TRUE);
priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
gtk_size_group_add_widget (priv->size_group, assistant->close); gtk_size_group_add_widget (priv->size_group, assistant->close);
......
...@@ -709,7 +709,7 @@ gtk_dialog_add_button (GtkDialog *dialog, ...@@ -709,7 +709,7 @@ gtk_dialog_add_button (GtkDialog *dialog,
button = gtk_button_new_from_stock (button_text); 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); gtk_widget_show (button);
......
...@@ -8145,7 +8145,7 @@ add_custom_button_to_dialog (GtkDialog *dialog, ...@@ -8145,7 +8145,7 @@ add_custom_button_to_dialog (GtkDialog *dialog,
GtkWidget *button; GtkWidget *button;
button = gtk_button_new_with_mnemonic (mnemonic_label); 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_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON)); gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button); gtk_widget_show (button);
......
...@@ -1416,7 +1416,7 @@ gtk_file_selection_create_dir (GtkWidget *widget, ...@@ -1416,7 +1416,7 @@ gtk_file_selection_create_dir (GtkWidget *widget,
gtk_label_set_mnemonic_widget (GTK_LABEL (label), fs->fileop_entry); gtk_label_set_mnemonic_widget (GTK_LABEL (label), fs->fileop_entry);
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
TRUE, TRUE, 5); 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_entry_set_activates_default (GTK_ENTRY (fs->fileop_entry), TRUE);
gtk_widget_show (fs->fileop_entry); gtk_widget_show (fs->fileop_entry);
...@@ -1681,7 +1681,7 @@ gtk_file_selection_rename_file (GtkWidget *widget, ...@@ -1681,7 +1681,7 @@ gtk_file_selection_rename_file (GtkWidget *widget,
fs->fileop_entry = gtk_entry_new (); fs->fileop_entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
TRUE, TRUE, 5); 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_entry_set_activates_default (GTK_ENTRY (fs->fileop_entry), TRUE);
gtk_widget_show (fs->fileop_entry); gtk_widget_show (fs->fileop_entry);
......
...@@ -438,7 +438,7 @@ button_clicked_callback (GtkWidget *w, gpointer data) ...@@ -438,7 +438,7 @@ button_clicked_callback (GtkWidget *w, gpointer data)
gtk_widget_show (button); gtk_widget_show (button);
button = gtk_button_new_from_stock (GTK_STOCK_OK); 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_signal_connect (button, "clicked",
G_CALLBACK (gamma_ok_callback), c); G_CALLBACK (gamma_ok_callback), c);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
......
...@@ -802,7 +802,7 @@ gtk_info_bar_add_button (GtkInfoBar *info_bar, ...@@ -802,7 +802,7 @@ gtk_info_bar_add_button (GtkInfoBar *info_bar,
button = gtk_button_new_from_stock (button_text); 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); gtk_widget_show (button);
......
...@@ -310,13 +310,13 @@ gtk_input_dialog_init (GtkInputDialog *inputd) ...@@ -310,13 +310,13 @@ gtk_input_dialog_init (GtkInputDialog *inputd)
inputd->keys_list = NULL; inputd->keys_list = NULL;
inputd->save_button = gtk_button_new_from_stock (GTK_STOCK_SAVE); 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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG(inputd)->action_area),
inputd->save_button, TRUE, TRUE, 0); inputd->save_button, TRUE, TRUE, 0);
gtk_widget_show (inputd->save_button); gtk_widget_show (inputd->save_button);
inputd->close_button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); 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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG(inputd)->action_area),
inputd->close_button, TRUE, TRUE, 0); inputd->close_button, TRUE, TRUE, 0);
......
...@@ -2555,7 +2555,7 @@ gtk_print (gchar *str) ...@@ -2555,7 +2555,7 @@ gtk_print (gchar *str)
G_CALLBACK (gtk_widget_hide), G_CALLBACK (gtk_widget_hide),
GTK_OBJECT (window)); GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
} }
......
...@@ -186,9 +186,11 @@ gtk_option_menu_child_type (GtkContainer *container) ...@@ -186,9 +186,11 @@ gtk_option_menu_child_type (GtkContainer *container)
static void static void
gtk_option_menu_init (GtkOptionMenu *option_menu) gtk_option_menu_init (GtkOptionMenu *option_menu)
{ {
gtk_widget_set_can_focus (GTK_WIDGET (option_menu), TRUE); GtkWidget *widget = GTK_WIDGET (option_menu);
GTK_WIDGET_UNSET_FLAGS (option_menu, GTK_CAN_DEFAULT);
gtk_widget_set_receives_default (GTK_WIDGET (option_menu), FALSE); 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 = NULL;
option_menu->menu_item = NULL; option_menu->menu_item = NULL;
......
...@@ -414,7 +414,7 @@ add_custom_button_to_dialog (GtkDialog *dialog, ...@@ -414,7 +414,7 @@ add_custom_button_to_dialog (GtkDialog *dialog,
GtkWidget *button = NULL; GtkWidget *button = NULL;
button = gtk_button_new_with_mnemonic (mnemonic_label); 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_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (stock_id, gtk_image_new_from_stock (stock_id,
GTK_ICON_SIZE_BUTTON)); GTK_ICON_SIZE_BUTTON));
......
...@@ -5553,9 +5553,9 @@ gtk_widget_set_can_default (GtkWidget *widget, ...@@ -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_get_can_default (widget))
{ {
if (can_default) if (can_default)
GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT); GTK_OBJECT_FLAGS (widget) |= GTK_CAN_DEFAULT;
else else
GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_DEFAULT); GTK_OBJECT_FLAGS (widget) &= ~(GTK_CAN_DEFAULT);
gtk_widget_queue_resize (widget); gtk_widget_queue_resize (widget);
g_object_notify (G_OBJECT (widget), "can-default"); g_object_notify (G_OBJECT (widget), "can-default");
......
...@@ -679,7 +679,7 @@ create_calendar(void) ...@@ -679,7 +679,7 @@ create_calendar(void)
gtk_container_add (GTK_CONTAINER (window), vbox); 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_widget_grab_default (button);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 0); gtk_window_set_default_size (GTK_WINDOW (window), 600, 0);
......
...@@ -909,7 +909,7 @@ create_buttons (GtkWidget *widget) ...@@ -909,7 +909,7 @@ create_buttons (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button[9], TRUE, TRUE, 0); 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]); gtk_widget_grab_default (button[9]);
} }
...@@ -977,7 +977,7 @@ create_toggle_buttons (GtkWidget *widget) ...@@ -977,7 +977,7 @@ create_toggle_buttons (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
} }
...@@ -1792,7 +1792,7 @@ create_statusbar (GtkWidget *widget) ...@@ -1792,7 +1792,7 @@ create_statusbar (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
} }
...@@ -3494,7 +3494,7 @@ create_reparent (GtkWidget *widget) ...@@ -3494,7 +3494,7 @@ create_reparent (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window); G_CALLBACK (gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
} }
...@@ -3782,7 +3782,7 @@ create_saved_position (GtkWidget *widget) ...@@ -3782,7 +3782,7 @@ create_saved_position (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); 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_grab_default (button);
gtk_widget_show_all (window); gtk_widget_show_all (window);
...@@ -3867,7 +3867,7 @@ create_pixmap (GtkWidget *widget) ...@@ -3867,7 +3867,7 @@ create_pixmap (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
} }
...@@ -4032,7 +4032,7 @@ create_tooltips (GtkWidget *widget) ...@@ -4032,7 +4032,7 @@ create_tooltips (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_tooltips_set_tip (tooltips, button, "Push this button to close window", "ContextHelp/buttons/Close"); gtk_tooltips_set_tip (tooltips, button, "Push this button to close window", "ContextHelp/buttons/Close");
...@@ -4517,7 +4517,7 @@ create_menus (GtkWidget *widget) ...@@ -4517,7 +4517,7 @@ create_menus (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
} }
...@@ -4788,7 +4788,7 @@ create_item_factory (GtkWidget *widget) ...@@ -4788,7 +4788,7 @@ create_item_factory (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_item_factory_delete_item (item_factory, "/Preferences/ShouldNotAppear"); gtk_item_factory_delete_item (item_factory, "/Preferences/ShouldNotAppear");
...@@ -5197,7 +5197,7 @@ create_scrolled_windows (GtkWidget *widget) ...@@ -5197,7 +5197,7 @@ create_scrolled_windows (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); 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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0); button, TRUE, TRUE, 0);
gtk_widget_grab_default (button); gtk_widget_grab_default (button);
...@@ -5207,7 +5207,7 @@ create_scrolled_windows (GtkWidget *widget) ...@@ -5207,7 +5207,7 @@ create_scrolled_windows (GtkWidget *widget)
g_signal_connect (button, "clicked", g_signal_connect (button, "clicked",
G_CALLBACK (scrolled_windows_remove), G_CALLBACK (scrolled_windows_remove),
scrolled_window); 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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
button, TRUE, TRUE, 0); button, TRUE, TRUE, 0);
gtk_widget_grab_default (button); gtk_widget_grab_default (button);
...@@ -5412,7 +5412,7 @@ create_entry (GtkWidget *widget) ...@@ -5412,7 +5412,7 @@ create_entry (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
} }
...@@ -5580,7 +5580,7 @@ create_event_box (GtkWidget *widget) ...@@ -5580,7 +5580,7 @@ create_event_box (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
} }
...@@ -6623,7 +6623,7 @@ create_list (GtkWidget *widget) ...@@ -6623,7 +6623,7 @@ create_list (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button); gtk_widget_grab_default (button);
} }
...@@ -7174,7 +7174,7 @@ create_clist (GtkWidget *widget) ...@@ -7174,7 +7174,7 @@ create_clist (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button); gtk_widget_grab_default (button);
} }
...@@ -8705,7 +8705,7 @@ create_dialog (GtkWidget *widget) ...@@ -8705,7 +8705,7 @@ create_dialog (GtkWidget *widget)
gtk_container_set_border_width (GTK_CONTAINER (dialog_window), 0); gtk_container_set_border_width (GTK_CONTAINER (dialog_window), 0);
button = gtk_button_new_with_label ("OK"); 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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
button, TRUE, TRUE, 0); button, TRUE, TRUE, 0);
gtk_widget_grab_default (button); gtk_widget_grab_default (button);
...@@ -8715,7 +8715,7 @@ create_dialog (GtkWidget *widget) ...@@ -8715,7 +8715,7 @@ create_dialog (GtkWidget *widget)
g_signal_connect (button, "clicked", g_signal_connect (button, "clicked",
G_CALLBACK (label_toggle), G_CALLBACK (label_toggle),
&label); &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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
button, TRUE, TRUE, 0); button, TRUE, TRUE, 0);
gtk_widget_show (button); gtk_widget_show (button);
...@@ -8724,7 +8724,7 @@ create_dialog (GtkWidget *widget) ...@@ -8724,7 +8724,7 @@ create_dialog (GtkWidget *widget)
button = gtk_button_new_with_label ("Separator"); 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), gtk_dialog_add_action_widget (GTK_DIALOG (dialog_window),
button, button,
...@@ -8986,7 +8986,7 @@ create_event_watcher (GtkWidget *widget) ...@@ -8986,7 +8986,7 @@ create_event_watcher (GtkWidget *widget)
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
dialog_window); 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), gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),
button, TRUE, TRUE, 0); button, TRUE, TRUE, 0);
gtk_widget_grab_default (button); gtk_widget_grab_default (button);
...@@ -9121,7 +9121,7 @@ create_range_controls (GtkWidget *widget) ...@@ -9121,7 +9121,7 @@ create_range_controls (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window); window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); 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_grab_default (button);
gtk_widget_show (button); gtk_widget_show (button);
} }
...@@ -9398,7 +9398,7 @@ create_text (GtkWidget *widget) ...@@ -9398,7 +9398,7 @@ create_text (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),