mirror of
https://github.com/hmaxnl/netex.git
synced 2025-04-19 11:38:13 +02:00
40 lines
952 B
C
40 lines
952 B
C
#include <ncurses.h>
|
|
|
|
#include "netex.h"
|
|
#include "server.h"
|
|
#include "srv_tui.h"
|
|
|
|
#include "nx_tui.h"
|
|
|
|
|
|
WINDOW *info_win, *log_win, *log_pad;
|
|
|
|
int setup_windows(void)
|
|
{
|
|
// Color pairs
|
|
init_pair(PAIR_BG_WIN_COLOR, COLOR_GREEN, COLOR_BLACK);
|
|
|
|
// Windows
|
|
int ymax,xmax;
|
|
getmaxyx(stdscr, ymax, xmax);
|
|
info_win = create_base_window_box(" Info ",GET_PERC(ymax, 20), xmax-1, 1, 0);
|
|
log_win = create_base_window_box(" Log window ", ymax-16, GET_PERC(xmax, 50), GET_PERC(ymax, 20) + 1, 0);
|
|
log_pad = subpad(log_win, ymax-15, GET_PERC(xmax, 50) - 1, 1, 1);
|
|
refresh();
|
|
|
|
for (int i = 0; i != 15; i++)
|
|
{
|
|
waddstr(log_pad, "Test!");
|
|
}
|
|
wrefresh(info_win);
|
|
wrefresh(log_win);
|
|
touchwin(log_win);
|
|
prefresh(log_pad, 0, 0, 10, 10, 10, 10);
|
|
|
|
return 0;
|
|
}
|
|
void calculate_wind_sizes(void)
|
|
{
|
|
|
|
//TODO: calculate the size of the windows on the screen, called when first start and on screen resize.
|
|
} |