gpointer data);
static void gtk_sheet_deactivate_cell (GtkSheet *sheet);
static void gtk_sheet_hide_active_cell (GtkSheet *sheet);
-static gboolean gtk_sheet_activate_cell (GtkSheet *sheet,
+static void gtk_sheet_activate_cell (GtkSheet *sheet,
gint row, gint col);
static void gtk_sheet_draw_active_cell (GtkSheet *sheet);
static void gtk_sheet_show_active_cell (GtkSheet *sheet);
G_SIGNAL_RUN_LAST,
offsetof (GtkSheetClass, activate),
NULL, NULL,
- gtkextra_BOOLEAN__INT_INT,
- G_TYPE_BOOLEAN, 2, G_TYPE_INT, G_TYPE_INT);
+ gtkextra_VOID__INT_INT,
+ G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
sheet_signals[CHANGED] =
g_signal_new ("changed",
return TRUE;
}
-gboolean
+void
gtk_sheet_set_active_cell (GtkSheet *sheet, gint row, gint col)
{
- g_return_val_if_fail (sheet != NULL, 0);
- g_return_val_if_fail (GTK_IS_SHEET (sheet), 0);
+ g_return_if_fail (sheet != NULL);
+ g_return_if_fail (GTK_IS_SHEET (sheet));
+
+ if (row < -1 || col < -1)
+ return;
- if (row < -1 || col < -1) return FALSE;
if (row >= g_sheet_row_get_row_count (sheet->row_geometry)
||
col >= g_sheet_column_get_column_count (sheet->column_geometry))
- return FALSE;
+ return;
sheet->active_cell.row = row;
sheet->active_cell.col = col;
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)))
- return TRUE;
+ return;
gtk_sheet_deactivate_cell (sheet);
if ( row == -1 || col == -1)
{
gtk_sheet_hide_active_cell (sheet);
- return TRUE;
+ return;
}
- return gtk_sheet_activate_cell (sheet, row, col);
+ gtk_sheet_activate_cell (sheet, row, col);
}
void
GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (sheet->entry_widget), GTK_VISIBLE);
}
-static gboolean
+static void
gtk_sheet_activate_cell (GtkSheet *sheet, gint row, gint col)
{
- gboolean veto = TRUE;
-
- g_return_val_if_fail (sheet != NULL, FALSE);
- g_return_val_if_fail (GTK_IS_SHEET (sheet), FALSE);
+ g_return_if_fail (sheet != NULL);
+ g_return_if_fail (GTK_IS_SHEET (sheet));
- if (row < 0 || col < 0) return FALSE;
+ if (row < 0 || col < 0)
+ return;
if ( row > g_sheet_row_get_row_count (sheet->row_geometry)
|| col > g_sheet_column_get_column_count (sheet->column_geometry))
- return FALSE;
+ return;
- if (!veto) return FALSE;
if (sheet->state != GTK_SHEET_NORMAL)
{
sheet->state = GTK_SHEET_NORMAL;
G_CALLBACK (gtk_sheet_entry_changed),
sheet);
- g_signal_emit (sheet, sheet_signals [ACTIVATE], 0, row, col, &veto);
-
- return TRUE;
+ g_signal_emit (sheet, sheet_signals [ACTIVATE], 0, row, col);
}
static void
/* obvious */
void gtk_sheet_unselect_range (GtkSheet *sheet);
-/* set active cell where the entry will be displayed
- * returns FALSE if current cell can't be deactivated or
- * requested cell can't be activated */
-gboolean gtk_sheet_set_active_cell (GtkSheet *sheet,
- gint row, gint column);
+/* set active cell where the entry will be displayed */
+void gtk_sheet_set_active_cell (GtkSheet *sheet,
+ gint row, gint column);
/* Sets *ROW and *COLUMN to be the coordinates of the active cell.
ROW and/or COLUMN may be null if the caller is not interested in their