Example #1
0
/*
 * File redraw routine. Draws current list on screen.
 */
int
credraw(CELL * c)
{
    register int row = c->srow;
    dlistptr p = c->list_start;
    int i = 0;
    char buff[200];

    if (c->ecol - c->scol)
        sprintf(buff, "%*s", c->ecol - c->scol + 1, " ");

    while (i <= c->erow - c->srow && p != NULL) {
        if (p == c->current)
            wattron(c->window, A_REVERSE);
        mvaddstr(row, c->scol, cDisplay(&p));
        if (p == c->current)
            wattroff(c->window, A_REVERSE);
        row++;
        i++;
        p = p->nextlistptr;
    }
    if (row <= c->erow)
        for (; row <= c->erow; row++)
            mvaddstr(row, c->scol, buff);
    wrefresh(c->window);
    c->redraw = FALSE;
    return TRUE;
}
int main()
{
  Storage cStorage(5, 6.7);
  Display cDisplay(false);
 
  cDisplay.DisplayItem(cStorage);

  return 0;
}