-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgui.c
executable file
·79 lines (57 loc) · 2.01 KB
/
gui.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Classe: gui.c
Description: Methodes pour les Windows de curses
Auteurs: Alain Sirois SIRA15068305
Philippe Mercure MERP27078708
Date: 18 juin 2011
Cours: yyyyyyyyyy
Groupe: 30
Travail: TP2
Professeur: xxxxxxxxxx
*/
#include <curses.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "fenetre.h"
// Creer une fenetre avec une bordure
WINDOW * create_newwin_with_border( Fenetre f ) {
WINDOW * local_win;
//local_win = newwin(height, width, starty, startx);
local_win = newwin( donnerHauteur(f), donnerLargeur(f), donnerStarty(f), donnerStartx(f) );
box(local_win, 0 , 0); /* 0, 0 gives default characters
* for the vertical and horizontal
* lines */
wrefresh(local_win); /* Show that box */
return local_win;
}
// Creer une fenetre sans bordure
WINDOW * create_newwin_no_border( Fenetre f ) {
WINDOW * local_win;
//local_win = newwin(height, width, starty, startx);
local_win = newwin( donnerHauteur(f), donnerLargeur(f), donnerStarty(f), donnerStartx(f) );
wrefresh(local_win);
return local_win;
}
// Supprimer une fenetre
void destroy_win( WINDOW *local_win )
{
/* box(local_win, ' ', ' '); : This won't produce the desired
* result of erasing the window. It will leave it's four corners
* and so an ugly remnant of window.
*/
wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
/* The parameters taken are
* 1. win: the window on which to operate
* 2. ls: character to be used for the left side of the window
* 3. rs: character to be used for the right side of the window
* 4. ts: character to be used for the top side of the window
* 5. bs: character to be used for the bottom side of the window
* 6. tl: character to be used for the top left corner of the window
* 7. tr: character to be used for the top right corner of the window
* 8. bl: character to be used for the bottom left corner of the window
* 9. br: character to be used for the bottom right corner of the window
*/
wrefresh(local_win);
delwin(local_win);
}