NcLooper/ui/t.c

61 lines
1.2 KiB
C
Raw Normal View History

2019-10-27 21:08:27 +11:00
/*
* NcLooper test des fonctions ncurses
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
2019-11-04 04:58:21 +11:00
#include "../nclooper.h"
2019-10-30 15:31:38 +11:00
#include "ncfuncs.h"
2019-10-27 21:08:27 +11:00
/* --------------------------------------------------------------------- */
2019-11-04 04:58:21 +11:00
2019-10-27 21:08:27 +11:00
int verbosity;
/* --------------------------------------------------------------------- */
void help(int k)
{
2019-11-04 04:58:21 +11:00
puts("test des fonctions de l'interface utilisateur");
2019-10-27 21:08:27 +11:00
exit(0);
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
2019-11-04 04:58:21 +11:00
int foo, idx;
2019-10-27 21:08:27 +11:00
int opt;
2019-11-04 04:58:21 +11:00
int row, col;
2019-10-27 21:08:27 +11:00
while ((opt = getopt(argc, argv, "hv")) != -1) {
switch(opt) {
case 'h': help(0); break;
case 'v': verbosity++; break;
}
}
#if DEBUG_LEVEL
fprintf(stderr, "argc = %d, optind = %d\n", argc, optind);
#endif
2019-10-30 15:31:38 +11:00
foo = init_ecran("* NcLooper *");
2019-11-04 04:58:21 +11:00
for (idx=0; idx<26; idx++) {
foo = idx2position(idx, &row, &col);
standout();
mvaddch(row, col, '<');
mvaddch(row, col+1, 'A' + idx);
mvaddch(row, col+2, '>');
standend();
mvaddstr(row, col+5, "bla bla bla...");
}
refresh();
2019-10-30 15:31:38 +11:00
2019-11-04 04:58:21 +11:00
sleep(3);
2019-10-30 15:31:38 +11:00
fin_ecran();
2019-10-27 21:08:27 +11:00
return 0;
}
/* --------------------------------------------------------------------- */