summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Natterer <mitch@imendio.com>2005-09-22 16:33:50 +0000
committerMichael Natterer <mitch@src.gnome.org>2005-09-22 16:33:50 +0000
commit080889e0740c8c6991b46052fb66fca08e118a8e (patch)
tree1fe70ffd795f31382a22975f1f9ffd3c86921ab5 /tests
parent155cfe3e9e87971d392feff7fa3f366c5d0e53f5 (diff)
downloadgtk+-080889e0740c8c6991b46052fb66fca08e118a8e.tar.gz
Renamed GtkCellRendererKeys to GtkCellRendererAccel to be consistent with
2005-09-22 Michael Natterer <mitch@imendio.com> Renamed GtkCellRendererKeys to GtkCellRendererAccel to be consistent with GTK+ terminology: * gtk/gtkcellrendererkeys.[ch] * tests/testkeys.c: removed... * gtk/gtkcellrendereraccel.[ch] * tests/testaccel.c: ...and added. * gtk/Makefile.am * gtk/gtk.h * gtk/gtk.symbols * tests/Makefile.am: changed accordingly.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/testaccel.c6
-rw-r--r--tests/testkeys.c109
3 files changed, 6 insertions, 115 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 58fdf41be7..4b04b7e1fa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,6 +29,7 @@ endif
noinst_PROGRAMS = \
autotestfilechooser \
simple \
+ testaccel \
testcairo \
testcalendar \
testcombo \
@@ -43,7 +44,6 @@ noinst_PROGRAMS = \
testicontheme \
testimage \
testinput \
- testkeys \
testmenus \
testmenubars \
testmultidisplay \
@@ -78,6 +78,7 @@ autotestfilechooser_DEPENDENCIES = $(TEST_DEPS)
simple_DEPENDENCIES = $(TEST_DEPS)
testicontheme_DEPENDENCIES = $(TEST_DEPS)
testiconview_DEPENDENCIES = $(TEST_DEPS)
+testaccel_DEPENDENCIES = $(TEST_DEPS)
testcairo_DEPENDENCIES = $(TEST_DEPS)
testcalendar_DEPENDENCIES = $(TEST_DEPS)
testcombo_DEPENDENCIES = $(TEST_DEPS)
@@ -90,7 +91,6 @@ testfilechooserbutton_DEPENDENCIES = $(TEST_DEPS)
testgtk_DEPENDENCIES = $(TEST_DEPS)
testinput_DEPENDENCIES = $(TEST_DEPS)
testimage_DEPENDENCIES = $(TEST_DEPS)
-testkeys_DEPENDENCIES = $(TEST_DEPS)
testmenus_DEPENDENCIES = $(TEST_DEPS)
testmenubars_DEPENDENCIES = $(TEST_DEPS)
testmultidisplay_DEPENDENCIES = $(TEST_DEPS)
@@ -117,6 +117,7 @@ testactions_DEPENDENCIES = $(TEST_DEPS)
autotestfilechooser_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
+testaccel_LDADD = $(LDADDS)
testcairo_LDADD = $(LDADDS)
testcalendar_LDADD = $(LDADDS)
testcombo_LDADD = $(LDADDS)
@@ -131,7 +132,6 @@ testicontheme_LDADD = $(LDADDS)
testiconview_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
testimage_LDADD = $(LDADDS)
-testkeys_LDADD = $(LDADDS)
testmenus_LDADD = $(LDADDS)
testmenubars_LDADD = $(LDADDS)
testmultidisplay_LDADD = $(LDADDS)
diff --git a/tests/testaccel.c b/tests/testaccel.c
index d92d5d69d0..537ef07605 100644
--- a/tests/testaccel.c
+++ b/tests/testaccel.c
@@ -1,4 +1,4 @@
-/* gtkcellrendererkeys.h
+/* gtkcellrendereraccel.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
*
* This library is free software; you can redistribute it and/or
@@ -63,9 +63,9 @@ key_test (void)
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
gtk_container_add (GTK_CONTAINER (sw), tv);
column = gtk_tree_view_column_new ();
- rend = gtk_cell_renderer_keys_new ();
+ rend = gtk_cell_renderer_accel_new ();
g_object_set (G_OBJECT (rend),
- "accel-mode", GTK_CELL_RENDERER_KEYS_MODE_GTK,
+ "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_GTK,
"editable", TRUE,
NULL);
g_signal_connect (G_OBJECT (rend),
diff --git a/tests/testkeys.c b/tests/testkeys.c
deleted file mode 100644
index d92d5d69d0..0000000000
--- a/tests/testkeys.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* gtkcellrendererkeys.h
- * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-static void
-accel_edited_callback (GtkCellRendererText *cell,
- const char *path_string,
- guint keyval,
- GdkModifierType mask,
- guint hardware_keycode,
- gpointer data)
-{
- GtkTreeModel *model = (GtkTreeModel *)data;
- GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
- GtkTreeIter iter;
-
- gtk_tree_model_get_iter (model, &iter, path);
-
- g_print ("%u %d %u\n", keyval, mask, hardware_keycode);
-
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- 0, (gint)mask,
- 1, keyval,
- -1);
- gtk_tree_path_free (path);
-}
-
-static GtkWidget *
-key_test (void)
-{
- GtkWidget *window, *sw, *tv;
- GtkListStore *store;
- GtkTreeViewColumn *column;
- GtkCellRenderer *rend;
- gint i;
-
- /* create window */
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (window), sw);
-
- store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_UINT);
- tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
- gtk_container_add (GTK_CONTAINER (sw), tv);
- column = gtk_tree_view_column_new ();
- rend = gtk_cell_renderer_keys_new ();
- g_object_set (G_OBJECT (rend),
- "accel-mode", GTK_CELL_RENDERER_KEYS_MODE_GTK,
- "editable", TRUE,
- NULL);
- g_signal_connect (G_OBJECT (rend),
- "accel-edited",
- G_CALLBACK (accel_edited_callback),
- store);
-
- gtk_tree_view_column_pack_start (column, rend,
- TRUE);
- gtk_tree_view_column_set_attributes (column, rend,
- "accel-mods", 0,
- "accel-key", 1,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
-
- for (i = 0; i < 10; i++) {
- GtkTreeIter iter;
-
- gtk_list_store_append (store, &iter);
- }
-
- /* done */
-
- return window;
-}
-
-gint
-main (gint argc, gchar **argv)
-{
- GtkWidget *dialog;
-
- gtk_init (&argc, &argv);
-
- dialog = key_test ();
-
- gtk_widget_show_all (dialog);
-
- gtk_main ();
-
- return 0;
-}