From 7336dce8c886a1a0880482a0ebde9c522baab0d3 Mon Sep 17 00:00:00 2001 From: Angelo Haller Date: Sun, 20 Sep 2020 18:21:31 -0500 Subject: [PATCH] Clarify uiTableModelRowDeleted API documentation. * Require the deleted row to have been removed from the model before calling uiTableModelRowDeleted. * Require the row count to be updated before calling uiTableModelRowDeleted. Notes ----- darwin: Does not care about row counts internally. unix: Requires the row to have been deleted prior to calling this function: > This should be called by models after a row has been removed. > The location pointed to by path should be the location that the > row previously was at. It may not be a valid location anymore. windows: Does not state anything in the documentation but does keep track of its own row count internally. --- ui.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ui.h b/ui.h index 95561f38..34a58216 100644 --- a/ui.h +++ b/ui.h @@ -1339,12 +1339,13 @@ _UI_EXTERN void uiTableModelRowInserted(uiTableModel *m, int newIndex); // this if your data changes at some other point. _UI_EXTERN void uiTableModelRowChanged(uiTableModel *m, int index); -// uiTableModelRowDeleted() tells any uiTable associated with m -// that the row at index index has been deleted. You call this -// function when the number of rows in your model has changed; -// after calling it, NumRows() should returm the new row -// count. -// TODO for this and Inserted: make sure the "after" part is right; clarify if it's after returning or after calling +// uiTableModelRowDeleted() tells all uiTables associated with +// the uiTableModel m that the row at index oldIndex has been +// deleted. +// You must delete the row from your model before you call this +// function. +// NumRows() must represent the new row count before you call +// this function. _UI_EXTERN void uiTableModelRowDeleted(uiTableModel *m, int oldIndex); // TODO reordering/moving