NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/47402: wresize(3) loses window colour attributes



>Number:         47402
>Category:       lib
>Synopsis:       wresize(3) loses window colour attributes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 04 01:25:00 +0000 2013
>Originator:     Julian Fagir
>Release:        6.0-RELEASE
>Organization:
>Environment:
>Description:
When you set a colour with wattron and wbkgd and then resize the window with 
wresize, it loses its colour, you have to re-set it.
This behaviour is different in nbcurses to ncurses, which holds the colour. If 
this is meant by the sentence "The application must redraw the window after it 
has been resized.", it should be clarified more.
Anyway, it is an incompatibility with ncurses.
So fixing or documenting this, which is the way to go?
>How-To-Repeat:
Compile the following code with `-lcurses`. Run it on ncurses and see a shiny 
white-on-blue screen. Run it with nbcurses and see a not-so-shiny blue screen 
with a large black window in it.



#include <curses.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

int
main(int arg, char *argv[])
{
        int ch, j, i = 0;
        WINDOW *mainwin;

        initscr();
        keypad(stdscr, TRUE);
        noecho();
        cbreak();

        mainwin = newwin(20, 70, 2, 2);
        keypad(mainwin, TRUE);
        box(mainwin, 0, 0);
        mvwprintw(mainwin, 1, 1, "Creating window...");
        wrefresh(mainwin);

        start_color();
        init_pair(1, COLOR_WHITE, COLOR_BLUE);
        attron(COLOR_PAIR(1));
        bkgd(COLOR_PAIR(1));
        wattron(mainwin, COLOR_PAIR(1));
        wbkgd(mainwin, COLOR_PAIR(1));
        wborder(mainwin, 0, 0, 0, 0, 0, 0, 0, 0);
        mvwin(mainwin, 2, 2);
        wresize(mainwin, 20, 70);

        refresh();
        wrefresh(mainwin);
        endwin();

        return 0;
}
>Fix:



Home | Main Index | Thread Index | Old Index