Changeset 3481


Ignore:
Timestamp:
May 19, 2009, 10:42:22 PM (11 years ago)
Author:
Sam Hocevar
Message:

Fix the text input example now that the box drawing functions take a size
as argument.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/examples/input.c

    r2821 r3481  
    6060        entries[i].size = 0;
    6161        entries[i].cursor = 0;
     62        caca_printf(cv, 3, 3 * i + 4, "[entry %i]", i + 1);
    6263    }
    6364
     
    7172
    7273            caca_set_color_ansi(cv, CACA_BLACK, CACA_LIGHTGRAY);
    73             caca_fill_box(cv, 2, 3 * i + 4, 2 + BUFFER_SIZE, 3 * i + 4, ' ');
     74            caca_fill_box(cv, 2, 3 * i + 5, BUFFER_SIZE + 1, 1, ' ');
    7475
    7576            start = 0;
     
    7879            for(j = 0; j < size; j++)
    7980            {
    80                 caca_put_char(cv, 2 + j, 3 * i + 4,
     81                caca_put_char(cv, 2 + j, 3 * i + 5,
    8182                              entries[i].buffer[start + j]);
    8283            }
     
    8485
    8586        /* Put the cursor on the active textentry */
    86         caca_gotoxy(cv, 2 + entries[e].cursor, 3 * e + 4);
     87        caca_gotoxy(cv, 2 + entries[e].cursor, 3 * e + 5);
    8788
    8889        caca_refresh_display(dp);
Note: See TracChangeset for help on using the changeset viewer.