Skip to content

Commit

Permalink
mac: implement uiTableGetSelection and uiTableIter
Browse files Browse the repository at this point in the history
  • Loading branch information
bcampbell committed Sep 30, 2017
1 parent f75758e commit 11a98bf
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions darwin/table.m
Original file line number Diff line number Diff line change
Expand Up @@ -547,31 +547,39 @@ void uiTableOnSelectionChanged(uiTable *t, void (*f)(uiTable *, void *), void *d
}

struct uiTableIter {
// TODO
NSIndexSet *set;
int foo;
NSUInteger curr;
};

uiTableIter* uiTableGetSelection(uiTable *t)
{
//TODO
return NULL;
uiTableIter *it = uiAlloc(sizeof(uiTableIter), "uiTableIter");
it->set = [t->tv selectedRowIndexes];
it->foo = 0;

it->curr = [it->set firstIndex];
return it;
}


int uiTableIterAdvance(uiTableIter *it)
{
// TODO
return 0;
if (it->foo>0) {
it->curr = [it->set indexGreaterThanIndex:it->curr];
}
it->foo++;
return (it->curr==NSNotFound) ? 0:1;
}

int uiTableIterCurrent(uiTableIter *it)
{
//TODO
return 0;
return (int)it->curr;
}

void uiTableIterComplete(uiTableIter *it)
{
// TODO
uiFree(it);
}

uiTable *uiNewTable(uiTableModel *model, int styleFlags)
Expand Down

0 comments on commit 11a98bf

Please sign in to comment.