Nofew icon

CursesWmove()Bug

Nofew | PRO | 05/24/16 02:35:25 AM UTC | 0 ⭐ | 394 👁️ | Never ⏰ | []
C |

910 B

|

None

|

0 👍

/

0 👎

// The code below doesn't move the cursor.
 
#include <curses.h>
 
int main(void) {
    initscr();
    resize_term(50, 100);
    raw();
    nonl();
    noecho();
    keypad(stdscr, TRUE);
    curs_set(2);
 
    WINDOW *Wind;
 
    Wind = newwin(30, 30, 5, 5);
    box(Wind, 0, 0);
    wmove(Wind, 1, 1);
    wrefresh(Wind);
    refresh();
 
    getch();
 
    return 0;
}
 
 
 
 
 
// The code below does move the cursor, so we definitely have control over the cursor, but I'd really rather not do "move(1+getbegy(Wind), 1+getbegy(Wind));" every time I do something like this.
 
#include <curses.h>
 
int main(void) {
    initscr();
    resize_term(50, 100);
    raw();
    nonl();
    noecho();
    keypad(stdscr, TRUE);
    curs_set(2);
 
    WINDOW *Wind;
 
    Wind = newwin(30, 30, 5, 5);
    box(Wind, 0, 0);
    move(1, 1);
    wrefresh(Wind);
    refresh();
 
    getch();
 
    return 0;
}

Comments