#10 scrollok() doesn't work with PAD

closed-fixed
Mark Hessling
None
5
2007-05-14
2002-04-29
Alberto Ornaghi
No

the scrollok() function has no effect on a pad declared as WINDOW *
and created with newpad(). i.e. the windows wont scroll when the
last line is reached.

Furthermore if I create a pad with 30 lines
after 30 wprintw("try\n"); it crashes the
application.

please check it. it is vital for my
application.

I've made a simple program demonstrating it. if
you want I can send you.

Discussion

  • Mark Hessling
    Mark Hessling
    2002-05-11

    • assigned_to: nobody --> rexx
     
  • Mark Hessling
    Mark Hessling
    2002-05-11

    Logged In: YES
    user_id=86185

    I'm looking at all outstanding bugs this weekend. Please
    forward your test program, or upload it here. Thanks.

     
  • Logged In: NO

    this is the faulty program:

    -------------------------------------------

    #include <curses.h>

    int W_MAINX1 = 0;
    int W_MAINX2 = 80 - 1;
    int W_MAINY2 = 20 - 1;
    int W_MAINY1 = 4 + 1;
    int PAD_BUFFER = 35;

    int main()
    {
    WINDOW *b_main_window, *main_window;
    int i;

    initscr();
    cbreak();
    noecho();

    b_main_window = newwin(W_MAINY2 - W_MAINY1 + 1,
    W_MAINX2 - W_MAINX1 + 1, W_MAINY1, W_MAINX1);
    main_window = newpad(PAD_BUFFER, W_MAINX2);

    box(b_main_window,ACS_VLINE,ACS_HLINE);

    scrollok(main_window, TRUE);

    wmove(main_window, PAD_BUFFER - W_MAINY2 -10, 0);

    wnoutrefresh(stdscr);
    wnoutrefresh(b_main_window);
    pnoutrefresh(main_window, PAD_BUFFER - W_MAINY2 -
    10, 0, W_MAINY1 + 1, 1, W_MAINY2 - 2 , W_MAINX2 - 2);

    doupdate();

    for (i=0; i<40; i++) {
    wprintw(main_window, "PROVA ---------------
    --------------------- %d\n", i);
    pnoutrefresh(main_window, PAD_BUFFER -
    W_MAINY2 -10, 0, W_MAINY1 + 1, 1, W_MAINY2 - 2 , W_MAINX2 -
    2);
    doupdate();
    usleep(50000);
    }

    }

    =============================

    I'm compiling it with cygwin under windows XP.

    bye

     
  • Mark Hessling
    Mark Hessling
    2003-01-08

    • status: open --> closed
     
  • Mark Hessling
    Mark Hessling
    2003-01-08

    Logged In: YES
    user_id=86185

    Fixed in 2.6 (source) released today.

     
    • status: closed --> closed-fixed