dernier commit avant travaux...
This commit is contained in:
13
ui/ncfuncs.c
13
ui/ncfuncs.c
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <curses.h>
|
||||
#include "ncfuncs.h"
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
int init_ecran(char *txt)
|
||||
@@ -11,7 +11,7 @@ int init_ecran(char *txt)
|
||||
initscr();
|
||||
|
||||
standout();
|
||||
border('o', 'o', 'o', 'o', 'X', 'X', 'X', 'X');
|
||||
// border('o', 'o', 'o', 'o', 'X', 'X', 'X', 'X');
|
||||
standend();
|
||||
mvaddstr(1, 5, txt);
|
||||
refresh();
|
||||
@@ -27,3 +27,12 @@ endwin();
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
int idx2position(int idx, int *prow, int *pcol)
|
||||
{
|
||||
|
||||
*prow = 6 + (idx % 13);
|
||||
*pcol = 4 + (40*(idx/13));
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
* NcLooper--- interface curses, fonctions de base
|
||||
*/
|
||||
|
||||
#include <curses.h>
|
||||
|
||||
int init_ecran(char *txt);
|
||||
int fin_ecran(void);
|
||||
|
||||
int idx2position(int idx, int *prow, int *pcol);
|
||||
|
||||
|
||||
20
ui/t.c
20
ui/t.c
@@ -6,24 +6,26 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../nclooper.h"
|
||||
#include "ncfuncs.h"
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
void help(int k)
|
||||
{
|
||||
puts("plop...");
|
||||
puts("test des fonctions de l'interface utilisateur");
|
||||
exit(0);
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int foo;
|
||||
int foo, idx;
|
||||
int opt;
|
||||
|
||||
int row, col;
|
||||
|
||||
while ((opt = getopt(argc, argv, "hv")) != -1) {
|
||||
switch(opt) {
|
||||
@@ -37,9 +39,19 @@ fprintf(stderr, "argc = %d, optind = %d\n", argc, optind);
|
||||
#endif
|
||||
|
||||
foo = init_ecran("* NcLooper *");
|
||||
sleep(2);
|
||||
|
||||
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();
|
||||
|
||||
sleep(3);
|
||||
|
||||
fin_ecran();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user