Added event handler for the Delete key
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 18 Nov 2008 10:04:22 +0000 (19:04 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 18 Nov 2008 10:04:22 +0000 (19:04 +0900)
lib/gtksheet/gtksheet.c

index 79ba35dc1bf521aa2fb31794e77b1f79a3c7aca6..3152f894095b73753c4deb62257c0ebdf9119326 100644 (file)
@@ -99,8 +99,6 @@ static void gtk_sheet_set_row_height (GtkSheet *sheet,
                                      gint row,
                                      guint height);
 
-static gboolean gtk_sheet_cell_empty (const GtkSheet *, gint, gint);
-
 static void destroy_hover_window (GtkSheetHoverTitle *);
 static GtkSheetHoverTitle *create_hover_window (void);
 
@@ -554,7 +552,6 @@ static void init_attributes                  (const GtkSheet *sheet,
                                                  GtkSheetCellAttr *attributes);
 
 
-/* Memory allocation routines */
 static void gtk_sheet_real_cell_clear           (GtkSheet *sheet,
                                                  gint row,
                                                  gint column);
@@ -2503,21 +2500,6 @@ gtk_sheet_real_cell_clear (GtkSheet *sheet, gint row, gint column)
   dispose_string (sheet, old_text);
 }
 
-
-
-static gboolean
-gtk_sheet_cell_empty (const GtkSheet *sheet, gint row, gint col)
-{
-  gboolean empty;
-  char *text = gtk_sheet_cell_get_text (sheet, row, col);
-  empty = (text == NULL );
-
-  dispose_string (sheet, text);
-
-  return empty;
-}
-
-
 gchar *
 gtk_sheet_cell_get_text (const GtkSheet *sheet, gint row, gint col)
 {
@@ -4578,7 +4560,9 @@ gtk_sheet_key_press (GtkWidget *widget,
        g_sheet_row_get_row_count (sheet->row_geometry) - 1,
        sheet->active_cell.col);
       */
-
+      break;
+    case GDK_Delete:
+      gtk_sheet_real_cell_clear (sheet, sheet->active_cell.row, sheet->active_cell.col);
       break;
     default:
       return FALSE;