-
Scroll Bar
Im trying to make a program (in C) to display all the information of the elements of the periodic table. My problem comes when the info is too much and doesnt fit in the screen.
How could i create one? any ideas?? or something that lets the user use ENTER key or up & down arrows to move around the text.
PD: my program is only for the console, im not using any ncurses or X11 libraries
-
Anything other than simple printf (which is just one line after another) is going to involve an awful lot of fiddling about, if you don't use some pre-existing library like ncurses
-
Hi!
You can usually find out about the size of the console by examining the environment variables COLUMNS and LINES (using getenv from stdlib.h) If the environment variables do not exist, you should assume 80 columns and 24 lines. There is no good portable way to get single keystrokes, besides using the curses libraries.
Hope this helps
alex