Skip to content
Snippets Groups Projects
Commit 021ec866 authored by Danny Auble's avatar Danny Auble
Browse files

Resize works again with new window parameters

parent 6caf4bac
No related branches found
No related tags found
No related merge requests found
......@@ -173,18 +173,18 @@ int print_text_job(job_info_t * job_ptr)
mvwprintw(smap_info_ptr->text_win, smap_info_ptr->ycord,
smap_info_ptr->xcord, "%5d", job_ptr->num_nodes);
smap_info_ptr->xcord += 6;
smap_info_ptr->xcord += 6;
tempxcord = smap_info_ptr->xcord;
width = smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
//width = smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
while (job_ptr->nodes[i] != '\0') {
if ((printed =
mvwaddch(smap_info_ptr->text_win,
smap_info_ptr->ycord, smap_info_ptr->xcord,
job_ptr->nodes[i])) < 0)
if ((printed = mvwaddch(smap_info_ptr->text_win,
smap_info_ptr->ycord, smap_info_ptr->xcord,
job_ptr->nodes[i])) < 0)
return printed;
smap_info_ptr->xcord++;
width =
smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
width = smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
if (job_ptr->nodes[i] == '[')
prefixlen = i + 1;
else if (job_ptr->nodes[i] == ',' && (width - 9) <= 0) {
......
......@@ -207,15 +207,14 @@ int print_text_part(partition_info_t * part_ptr)
smap_info_ptr->xcord += 7;
tempxcord = smap_info_ptr->xcord;
width = smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
//width = smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
if (params.display == BGLPART)
nodes = part_ptr->allow_groups;
else
nodes = part_ptr->nodes;
prefixlen = i;
while (nodes[i] != '\0') {
width =
smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
width = smap_info_ptr->text_win->_maxx - smap_info_ptr->xcord;
if (!prefixlen && nodes[i] == '[' && nodes[i - 1] == ',')
prefixlen = i + 1;
......
......@@ -147,7 +147,6 @@ int main(int argc, char *argv[])
_get_option();
redraw:
init_grid(node_info_ptr);
wclear(smap_info_ptr->text_win);
//wclear(smap_info_ptr->grid_win);
......@@ -271,23 +270,26 @@ void *_resize_handler(int sig)
{
int height = smap_info_ptr->Y * smap_info_ptr->Z + smap_info_ptr->Y + 3;
int width = smap_info_ptr->X + smap_info_ptr->Z + 3;
int tempwidth = width;
smap_info_ptr->ycord = 1;
wclear(smap_info_ptr->grid_win);
wclear(smap_info_ptr->text_win);
delwin(smap_info_ptr->grid_win);
delwin(smap_info_ptr->text_win);
endwin();
initscr();
getmaxyx(stdscr, LINES, COLS);
delwin(smap_info_ptr->grid_win);
if (COLS < (75 + width) || LINES < height) {
endwin();
printf
("Screen is too small make sure the screen is at least %dx%d\nRight now it is %dx%d\n",
75 + width, height, COLS, LINES);
exit(0);
}
smap_info_ptr->grid_win = newwin(height, width, 0, 0);
width = COLS - width;
delwin(smap_info_ptr->text_win);
smap_info_ptr->text_win =
newwin(LINES, width, 0, smap_info_ptr->X * 2);
smap_info_ptr->text_win = newwin(LINES, width, 0, tempwidth);
print_date();
switch (params.display) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment