Skip to main content
gamedev.net
🔒 Locked

ncurses

Started by guywithknife 2 replies 550+ views
Original Post
guywithknife
guywithknife
How do i determine the size of a window using ncurses?
guywithknife
guywithknife
Someone must know how i can get the size of a window/terminal using curses/ncurses.
I was told that its stored in an environment variable, so you would use getenv() or whatever to retrieve it. Does anyone know which environment variables this nis stored in or should I ask this in the Unix forum?
markr
markr
You have to set curses up first, otherwise it won't know.

You definitely have to have called initscr(), and you probably have to have called refresh() at least once.

The function you're looking for is getmaxyx(stdscr, x, y)

Look it up in the doc for more info.

I hate curses; it sucks :)

Mark
guywithknife
guywithknife
Thanks! Thats exactly what i needed.


Im using curses because I need to write a program which i can run from a text terminal and need a little more output power than standard printf/cout provide.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.