bug-ncurses
[Top][All Lists]
Advanced

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

hide_panel/show_panel not woking with pad.


From: Giorgos Xou
Subject: hide_panel/show_panel not woking with pad.
Date: Sat, 23 Oct 2021 12:18:39 +0300

referenced-at: https://github.com/wmcbrine/PDCurses/issues/124

        #include <curses.h>
        #include <panel.h>


        int main( void)
        {
            int ch = -1;
            WINDOW *pad1;
            PANEL  *panel1;

            initscr    ();
            noecho     ();
            start_color();
           
            init_pair(1, COLOR_BLUE, COLOR_RED);
            keypad(stdscr, TRUE);

            refresh();

            pad1 = newpad(10,10);
           
            wbkgd   (pad1, COLOR_PAIR(1));
            waddstr (pad1,"Test.");
            prefresh(pad1, 0, 0, 1, 2, 4 , 9);

            panel1 = new_panel(pad1);

            while(ch != 'q' && ch != 'Q')
            {
                ch = getch();
               
                if      (ch == KEY_UP  ) show_panel(panel1);
                else if (ch == KEY_DOWN) hide_panel(panel1);

                update_panels();
                doupdate();
            }
            endwin( );
            return(0);
        }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]