]> Pileus Git - ~andy/gtk/blobdiff - tests/testaccel.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / tests / testaccel.c
index d92d5d69d0bc3e5fcb68c418567f5985ab52caa1..cf27823fd03175c953b5ec7362beed034a129c27 100644 (file)
@@ -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
@@ -12,9 +12,7 @@
  * 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.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <gtk/gtk.h>
@@ -39,6 +37,7 @@ accel_edited_callback (GtkCellRendererText *cell,
   gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                      0, (gint)mask,
                      1, keyval,
+                     2, hardware_keycode,
                      -1);
   gtk_tree_path_free (path);
 }
@@ -59,13 +58,13 @@ key_test (void)
        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);
+       store = gtk_list_store_new (3, G_TYPE_INT, G_TYPE_UINT, 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 ();
+       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),
@@ -78,6 +77,7 @@ key_test (void)
        gtk_tree_view_column_set_attributes (column, rend,
                                             "accel-mods", 0,
                                             "accel-key", 1,
+                                            "keycode", 2,
                                             NULL);
        gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);