File: ncgui.c

package info (click to toggle)
pfqueue 0.5.6-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,392 kB
  • ctags: 627
  • sloc: sh: 8,904; ansic: 3,877; makefile: 79
file content (34 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (5)
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

/*
 * Funzioni di interfaccia ncurses
 */

#include "ncgui.h"

#include <string.h>
#include <stdlib.h>

void wnd_clear ( WINDOW* wnd, const char* title ) {
	wclear ( wnd );
	wnd_border ( wnd );
	wattron ( wnd, A_BOLD );
	mvwaddstr ( wnd, 0,2, title );
	wattroff ( wnd, A_BOLD );
}

void wnd_border ( WINDOW* wnd ) {
	wborder ( wnd, 0, 0, 0, 0, 0, 0, 0, 0 );
}

void wnd_prompt ( WINDOW* wnd, int y, int x, char* buf, int buflen ) {
	/*
	if ( strlen(regexps) )
		strncpy ( *buf, regexps, strlen(regexps) );
	else
	*/
		memset ( buf, 0, buflen );
	
	mvwaddstr ( wnd, y, x, buf );
	mvwgetnstr ( wnd, y, x, buf, buflen ); 
}