Commit fc71cbe5 authored by William Jon McCann's avatar William Jon McCann

Remove most of the stock API usage from the tests

With the exception of GtkActions and the tests for stock items.
parent c79a21e1
......@@ -74,7 +74,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \
testkineticscrolling \
testlist \
testlockbutton \
testmenubars \
testmenubutton \
testmountoperation \
testmultidisplay \
......@@ -203,7 +202,6 @@ testimage_DEPENDENCIES = $(TEST_DEPS)
testkineticscrolling_DEPENDENCIES = $(TEST_DEPS)
testlist_DEPENDENCIES = $(TEST_DEPS)
testlockbutton_DEPENDENCIES = $(TEST_DEPS)
testmenubars_DEPENDENCIES = $(TEST_DEPS)
testmenubutton_DEPENDENCIES = $(TEST_DEPS)
testmountoperation_DEPENDENCIES = $(TEST_DEPS)
testmultidisplay_DEPENDENCIES = $(TEST_DEPS)
......
......@@ -154,8 +154,8 @@ do_open (GtkAction *action)
dialog = gtk_file_chooser_dialog_new ("Select file",
GTK_WINDOW (main_window),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
response = gtk_dialog_run (GTK_DIALOG (dialog));
......@@ -216,8 +216,8 @@ do_save_as (GtkAction *action)
dialog = gtk_file_chooser_dialog_new ("Select file",
GTK_WINDOW (main_window),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Save", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
response = gtk_dialog_run (GTK_DIALOG (dialog));
......@@ -572,7 +572,7 @@ preview_cb (GtkPrintOperation *op,
page = gtk_spin_button_new_with_range (1, 100, 1);
gtk_box_pack_start (GTK_BOX (hbox), page, FALSE, FALSE, 0);
close = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
close = gtk_button_new_with_label ("Close");
gtk_box_pack_start (GTK_BOX (hbox), close, FALSE, FALSE, 0);
da = gtk_drawing_area_new ();
......
......@@ -37,8 +37,8 @@ static GtkWidget *test_widgets[TEST_WIDGET_LAST];
static GtkWidget*
create_image (void)
{
return gtk_image_new_from_stock (GTK_STOCK_OPEN,
GTK_ICON_SIZE_BUTTON);
return gtk_image_new_from_icon_name ("document-open",
GTK_ICON_SIZE_BUTTON);
}
static GtkWidget*
......
......@@ -135,8 +135,8 @@ button_clicked (GtkButton *b,
w = gtk_file_chooser_dialog_new ("Select file",
GTK_WINDOW (toplevel),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_run (GTK_DIALOG (w));
......
......@@ -542,7 +542,7 @@ create_full_featured_assistant (GtkWidget *widget)
assistant = gtk_assistant_new ();
gtk_window_set_default_size (GTK_WINDOW (assistant), 400, 300);
button = gtk_button_new_from_stock (GTK_STOCK_STOP);
button = gtk_button_new_with_label ("_Stop");
gtk_widget_show (button);
gtk_assistant_add_action_widget (GTK_ASSISTANT (assistant), button);
g_signal_connect (button, "clicked",
......
......@@ -104,7 +104,7 @@ add_button (GtkBox *box)
char *text;
text = g_strdup_printf ("Remove %d", ++count);
button = (GtkWidget *)gtk_button_new_from_stock (text);
button = (GtkWidget *)gtk_button_new_with_label (text);
g_free (text);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "play");
g_signal_connect_swapped (button,
......
......@@ -104,7 +104,7 @@ int main (int argc, char *argv[])
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), hbox);
button = gtk_button_new_with_label ("_Save");
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_BUTTON));
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_BUTTON));
gtk_container_add (GTK_CONTAINER (hbox), button);
g_object_get (button,
......@@ -121,7 +121,7 @@ int main (int argc, char *argv[])
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (box), hbox);
button = gtk_button_new_with_mnemonic ("_Save");
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_BUTTON));
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_BUTTON));
gtk_container_add (GTK_CONTAINER (hbox), button);
g_object_get (button,
"label", &text,
......
......@@ -25,7 +25,7 @@ simple_list_model (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "Alice in wonderland",
SIMPLE_COLUMN_ICON, "gtk-execute",
SIMPLE_COLUMN_ICON, "system-run",
SIMPLE_COLUMN_DESCRIPTION,
"Twas brillig, and the slithy toves "
"did gyre and gimble in the wabe; "
......@@ -36,14 +36,14 @@ simple_list_model (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "Marry Poppins",
SIMPLE_COLUMN_ICON, "gtk-yes",
SIMPLE_COLUMN_ICON, "dialog-information",
SIMPLE_COLUMN_DESCRIPTION, "Supercalifragilisticexpialidocious",
-1);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "George Bush",
SIMPLE_COLUMN_ICON, "gtk-dialog-warning",
SIMPLE_COLUMN_ICON, "dialog-warning",
SIMPLE_COLUMN_DESCRIPTION, "It's a very good question, very direct, "
"and I'm not going to answer it",
-1);
......@@ -51,7 +51,7 @@ simple_list_model (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "Whinnie the pooh",
SIMPLE_COLUMN_ICON, "gtk-stop",
SIMPLE_COLUMN_ICON, "process-stop",
SIMPLE_COLUMN_DESCRIPTION, "The most wonderful thing about tiggers, "
"is tiggers are wonderful things",
-1);
......@@ -59,7 +59,7 @@ simple_list_model (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "Aleister Crowley",
SIMPLE_COLUMN_ICON, "gtk-about",
SIMPLE_COLUMN_ICON, "help-about",
SIMPLE_COLUMN_DESCRIPTION,
"Thou shalt do what thou wilt shall be the whole of the law",
-1);
......@@ -67,7 +67,7 @@ simple_list_model (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
SIMPLE_COLUMN_NAME, "Mark Twain",
SIMPLE_COLUMN_ICON, "gtk-quit",
SIMPLE_COLUMN_ICON, "application-exit",
SIMPLE_COLUMN_DESCRIPTION,
"Giving up smoking is the easiest thing in the world. "
"I know because I've done it thousands of times.",
......@@ -102,7 +102,7 @@ simple_iconview (void)
cell_2 = renderer = gtk_cell_renderer_pixbuf_new ();
g_object_set (G_OBJECT (renderer), "xalign", 0.0F, NULL);
gtk_cell_area_box_pack_start (GTK_CELL_AREA_BOX (area), renderer, TRUE, FALSE, FALSE);
gtk_cell_area_attribute_connect (area, renderer, "stock-id", SIMPLE_COLUMN_ICON);
gtk_cell_area_attribute_connect (area, renderer, "icon-name", SIMPLE_COLUMN_ICON);
cell_3 = renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer),
......
......@@ -114,7 +114,7 @@ main (int argc, char **argv)
0,
"Copy Large", 0,
"Copy Small", 1,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"_Close", GTK_RESPONSE_CLOSE,
NULL);
image = gtk_image_new ();
......
......@@ -153,48 +153,39 @@ create_combo_box_grid_demo (void)
static GtkTreeModel *
create_tree_blaat (void)
{
GdkPixbuf *pixbuf;
GtkWidget *cellview;
GtkTreeIter iter, iter2;
GtkTreeStore *store;
cellview = gtk_cell_view_new ();
store = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN);
store = gtk_tree_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_BUTTON);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-dialog-warning",
0, "dialog-warning",
1, "dialog-warning",
2, FALSE,
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_STOP,
GTK_ICON_SIZE_BUTTON);
gtk_tree_store_append (store, &iter2, &iter);
gtk_tree_store_set (store, &iter2,
0, pixbuf,
1, "gtk-stock-stop",
0, "process-stop",
1, "process-stop",
2, FALSE,
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_NEW,
GTK_ICON_SIZE_BUTTON);
gtk_tree_store_append (store, &iter2, &iter);
gtk_tree_store_set (store, &iter2,
0, pixbuf,
1, "gtk-stock-new",
0, "document-new",
1, "document-new",
2, FALSE,
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_CLEAR,
GTK_ICON_SIZE_BUTTON);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-clear",
0, "edit-clear",
1, "edit-clear",
2, FALSE,
-1);
......@@ -207,12 +198,10 @@ create_tree_blaat (void)
-1);
#endif
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_OPEN,
GTK_ICON_SIZE_BUTTON);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-open",
0, "document-open",
1, "document-open",
2, FALSE,
-1);
......@@ -224,21 +213,18 @@ create_tree_blaat (void)
static GtkTreeModel *
create_empty_list_blaat (void)
{
GdkPixbuf *pixbuf;
GtkWidget *cellview;
GtkTreeIter iter;
GtkListStore *store;
cellview = gtk_cell_view_new ();
store = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-dialog-warning",
0, "dialog-warning",
1, "dialog-warning",
-1);
gtk_widget_destroy (cellview);
......@@ -251,7 +237,6 @@ populate_list_blaat (gpointer data)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
GtkListStore *store;
GdkPixbuf *pixbuf;
GtkWidget *cellview;
GtkTreeIter iter;
......@@ -264,28 +249,22 @@ populate_list_blaat (gpointer data)
cellview = gtk_cell_view_new ();
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_STOP,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-stop",
0, "process-stop",
1, "process-stop",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_NEW,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-new",
0, "document-new",
1, "document-new",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_CLEAR,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-clear",
0, "edit-clear",
1, "edit-clear",
-1);
gtk_list_store_append (store, &iter);
......@@ -294,12 +273,10 @@ populate_list_blaat (gpointer data)
1, "separator",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_OPEN,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-open",
0, "document-open",
1, "document-open",
-1);
gtk_widget_destroy (cellview);
......@@ -308,45 +285,36 @@ populate_list_blaat (gpointer data)
static GtkTreeModel *
create_list_blaat (void)
{
GdkPixbuf *pixbuf;
GtkWidget *cellview;
GtkTreeIter iter;
GtkListStore *store;
cellview = gtk_cell_view_new ();
store = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-dialog-warning",
0, "dialog-warning",
1, "dialog-warning",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_STOP,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-stop",
0, "process-stop",
1, "process-stop",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_NEW,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-new",
0, "document-new",
1, "document-new",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_CLEAR,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-clear",
0, "edit-clear",
1, "edit-clear",
-1);
gtk_list_store_append (store, &iter);
......@@ -355,12 +323,10 @@ create_list_blaat (void)
1, "separator",
-1);
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_OPEN,
GTK_ICON_SIZE_BUTTON);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, "gtk-stock-open",
0, "document-open",
1, "document-open",
-1);
gtk_widget_destroy (cellview);
......@@ -1086,7 +1052,6 @@ main (int argc, char **argv)
GtkWidget *combobox, *comboboxtext, *comboboxgrid;
GtkWidget *tmp, *boom;
GtkCellRenderer *renderer;
GdkPixbuf *pixbuf;
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
......@@ -1129,13 +1094,10 @@ main (int argc, char **argv)
cellview = gtk_cell_view_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
pixbuf = gtk_widget_render_icon_pixbuf (cellview, GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_BUTTON);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
renderer,
FALSE);
g_object_set (renderer, "pixbuf", pixbuf, NULL);
g_object_set (renderer, "icon-name", "dialog-warning", NULL);
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
......@@ -1163,7 +1125,7 @@ main (int argc, char **argv)
renderer,
FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
"pixbuf", 0,
"icon-name", 0,
NULL);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combobox),
renderer,
......@@ -1208,7 +1170,7 @@ main (int argc, char **argv)
renderer,
FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
"pixbuf", 0,
"icon-name", 0,
NULL);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combobox),
renderer,
......@@ -1251,7 +1213,7 @@ main (int argc, char **argv)
renderer,
FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
"pixbuf", 0,
"icon-name", 0,
NULL);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combobox),
renderer,
......@@ -1312,7 +1274,7 @@ main (int argc, char **argv)
renderer,
FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
"pixbuf", 0,
"icon-name", 0,
NULL);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combobox),
renderer,
......
......@@ -254,7 +254,7 @@ main (int argc, char **argv)
dialog = gtk_dialog_new_with_buttons ("GtkComboBox model changes",
NULL, 0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"_Close", GTK_RESPONSE_CLOSE,
NULL);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
......
......@@ -49,7 +49,7 @@ drag_begin_cb (GtkWidget *widget,
pos = gtk_entry_get_current_icon_drag_source (GTK_ENTRY (widget));
if (pos != -1)
gtk_drag_set_icon_stock (context, GTK_STOCK_INFO, 2, 2);
gtk_drag_set_icon_name (context, "dialog-info", 2, 2);
g_print ("drag begin %d\n", pos);
}
......@@ -121,8 +121,8 @@ main (int argc, char **argv)
gtk_widget_set_hexpand (entry, TRUE);
gtk_grid_attach (GTK_GRID (grid), entry, 1, 0, 1, 1);
icon = g_themed_icon_new ("folder");
g_themed_icon_append_name (G_THEMED_ICON (icon), "folder");
icon = g_themed_icon_new ("folder-symbolic");
g_themed_icon_append_name (G_THEMED_ICON (icon), "folder-symbolic");
gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
......@@ -142,7 +142,7 @@ main (int argc, char **argv)
/*
* Save File - sets the icon using a stock id.
* Save File - sets the icon using an icon name.
*/
label = gtk_label_new ("Save File:");
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
......@@ -154,9 +154,9 @@ main (int argc, char **argv)
gtk_entry_set_text (GTK_ENTRY (entry), "‏Right-to-left");
gtk_widget_set_direction (entry, GTK_TEXT_DIR_RTL);
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
GTK_STOCK_SAVE);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
"document-save-symbolic");
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
"Save a file");
......@@ -187,13 +187,13 @@ main (int argc, char **argv)
gtk_widget_set_hexpand (entry, TRUE);
gtk_grid_attach (GTK_GRID (grid), entry, 1, 2, 1, 1);
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
GTK_STOCK_FIND);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
"edit-find-symbolic");
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY,
GTK_STOCK_CLEAR);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY,
"edit-clear-symbolic");
g_signal_connect (entry, "icon-press", G_CALLBACK (clear_pressed), NULL);
......@@ -203,7 +203,7 @@ main (int argc, char **argv)
G_CALLBACK (properties_cb), entry);
/*
* Password - Sets the icon using a stock id
* Password - Sets the icon using an icon name
*/
label = gtk_label_new ("Password:");
gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
......@@ -214,9 +214,9 @@ main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), entry, 1, 3, 1, 1);
gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
GTK_STOCK_DIALOG_AUTHENTICATION);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
"dialog-password-symbolic");
gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
......
......@@ -586,16 +586,16 @@ main (int argc, char **argv)
case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
gtk_window_set_title (GTK_WINDOW (dialog), "Select a file");
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_OK,
NULL);
break;
case GTK_FILE_CHOOSER_ACTION_SAVE:
case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
gtk_window_set_title (GTK_WINDOW (dialog), "Save a file");
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_OK,
NULL);
break;
}
......
......@@ -285,7 +285,7 @@ main (int argc,
g_free (cwd);
win = gtk_dialog_new_with_buttons ("TestFileChooserButton", NULL, 0,
GTK_STOCK_QUIT, GTK_RESPONSE_CLOSE, NULL);
"_Quit", GTK_RESPONSE_CLOSE, NULL);
g_signal_connect (win, "style-set", G_CALLBACK (win_style_set_cb), NULL);
g_signal_connect (win, "response", G_CALLBACK (gtk_main_quit), NULL);
......@@ -327,7 +327,7 @@ main (int argc,
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), chooser, TRUE, TRUE, 0);
button = gtk_button_new_from_stock (GTK_STOCK_PROPERTIES);
button = gtk_button_new_with_label ("_Properties");
g_signal_connect (button, "clicked", G_CALLBACK (properties_button_clicked_cb), chooser);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
......@@ -357,7 +357,7 @@ main (int argc,
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), chooser, TRUE, TRUE, 0);
button = gtk_button_new_from_stock (GTK_STOCK_PROPERTIES);
button = gtk_button_new_with_label ("_Properties");
g_signal_connect (button, "clicked", G_CALLBACK (properties_button_clicked_cb), chooser);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
......
......@@ -258,7 +258,7 @@ create_alpha_window (GtkWidget *widget)
window = gtk_dialog_new_with_buttons ("Alpha Window",
GTK_WINDOW (gtk_widget_get_toplevel (widget)), 0,
GTK_STOCK_CLOSE, 0,
"_Close", 0,
NULL);
gtk_widget_set_app_paintable (window, TRUE);
......@@ -553,7 +553,7 @@ create_big_windows (GtkWidget *widget)
window = gtk_dialog_new_with_buttons ("Big Windows",
NULL, 0,
GTK_STOCK_CLOSE,
"_Close",
GTK_RESPONSE_NONE,
NULL);
......@@ -845,7 +845,7 @@ create_check_buttons (GtkWidget *widget)
{
window = gtk_dialog_new_with_buttons ("Check Buttons",
NULL, 0,
GTK_STOCK_CLOSE,
"_Close",
GTK_RESPONSE_NONE,
NULL);
......@@ -910,7 +910,7 @@ create_radio_buttons (GtkWidget *widget)
{
window = gtk_dialog_new_with_buttons ("Radio Buttons",
NULL, 0,
GTK_STOCK_CLOSE,
"_Close",
GTK_RESPONSE_NONE,
NULL);
......@@ -1923,7 +1923,7 @@ create_rotated_label (GtkWidget *widget)
{
window = gtk_dialog_new_with_buttons ("Rotated Label",
GTK_WINDOW (gtk_widget_get_toplevel (widget)), 0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"_Close", GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
......@@ -2054,7 +2054,7 @@ create_rotated_text (GtkWidget *widget)
window = gtk_dialog_new_with_buttons ("Rotated Text",
GTK_WINDOW (gtk_widget_get_toplevel (widget)), 0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"_Close", GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
......@@ -2785,8 +2785,8 @@ create_image (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (window), vbox);
pack_image (vbox, "Stock Warning Dialog",
gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
GTK_ICON_SIZE_DIALOG));
gtk_image_new_from_icon_name ("dialog-warning",
GTK_ICON_SIZE_DIALOG));
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) openfile);
......@@ -2993,8 +2993,8 @@ create_menu (GdkScreen *screen, gint depth, gint length)
group = NULL;
image = gtk_image_new_from_stock (GTK_STOCK_OPEN,
GTK_ICON_SIZE_MENU);
image = gtk_image_new_from_icon_name ("document-open",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
menuitem = gtk_image_menu_item_new_with_label ("Image item");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
......@@ -3050,8 +3050,8 @@ create_table_menu (GdkScreen *screen, gint cols, gint rows)
j++;
/* now fill the items submenu */
image = gtk_image_new_from_stock (GTK_STOCK_HELP,
GTK_ICON_SIZE_MENU);
image = gtk_image_new_from_icon_name ("help-broswer",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
menuitem = gtk_image_menu_item_new_with_label ("Image");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
......@@ -3066,8 +3066,8 @@ create_table_menu (GdkScreen *screen, gint cols, gint rows)
gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 1, 2);
gtk_widget_show (menuitem);
image = gtk_image_new_from_stock (GTK_STOCK_HELP,
GTK_ICON_SIZE_MENU);
image = gtk_image_new_from_icon_name ("help-browser",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
menuitem = gtk_image_menu_item_new_with_label ("Image");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
......@@ -3271,8 +3271,8 @@ create_menus (GtkWidget *widget)
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
image = gtk_image_new_from_stock (GTK_STOCK_HELP,
GTK_ICON_SIZE_MENU);
image = gtk_image_new_from_icon_name ("help-browser",
GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
menuitem = gtk_image_menu_item_new_with_label ("Help");
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
......@@ -3506,7 +3506,7 @@ create_key_lookup (GtkWidget *widget)
GtkWidget *content_area;
window = gtk_dialog_new_with_buttons ("Key Lookup", NULL, 0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"_Close", GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_screen (GTK_WINDOW (window),
......@@ -3599,10 +3599,11 @@ cmw_file (GtkWidget *widget, GtkWidget *parent)
GtkWidget *fs;
fs = gtk_file_chooser_dialog_new ("This is a modal file selection dialog",
GTK_WINDOW (parent), GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
GTK_WINDOW (parent),
GTK_FILE_CHOOSER_ACTION_OPEN,
"_Open", GTK_RESPONSE_ACCEPT,
"_Cancel", GTK_RESPONSE_CANCEL,
NULL);
gtk_window_set_screen (GTK_WINDOW (fs), gtk_widget_get_screen (parent));
gtk_window_set_modal (GTK_WINDOW (fs), TRUE);
......@@ -4291,7 +4292,7 @@ create_size_group_window (GdkScreen *screen,
window = gtk_dialog_new_with_buttons ("GtkSizeGroup",
NULL, 0,
GTK_STOCK_CLOSE,
"_Close",
GTK_RESPONSE_NONE,
NULL);
......