Moving between records

We have two buttons in our view (namely "Previous" and "Next"), their purpose is evident, the way it is done also (hem hem).

static void previous_clicked(GtkWidget *button, gabywindow *window)
        record *r;
        view *v = window->view;
        int *id = &(window->id);

        r = get_record_no(v->subtable->table, *id);
        r = table_prev(v->subtable->table, r, -1);
        *id = ( r == NULL ) ? 0 : r->id;

The interesting is r = table_prev(v->subtable->table, r, -1);.

FIXME: here is a few notes, they should be moved in a section with table_{first,last,next,prev} and get_record_no.

table_prev takes 3 arguments :

Then we fill again the view and tell gaby about this change so bound windows are updated (with update_bound_windows).

next_clicked is the same with table_next instead of table_prev. Note that you don't need to check if you're on the first (or latest) record, it is handled by Gaby (previous when on first and you'll stay on it, same with next on latest).