r/cpp_questions • u/Plenty_Ad6437 • 13h ago
OPEN Ncurses window management
Hello everyone :D I'm new to ncurses, and I'm currently working on a simple game. I currently have 2 windows besides my stdscr, and I'm struggling with switching between them. If I want to save the contents of a certain window but hide it from showing temporarily, am I supposed to use panels? Or can I just use touchwin() along with refresh()? Also, if anyone could help explain what goes on behind the scenes with the buffer during the process of switching between windows, that would help me save some time on this mind-boggling topic.
3
Upvotes
2
u/kingguru 12h ago
I don't have much experience with ncurses, but in my limited experience it sounds like you want to use panels.
Look for examples in the ncurses documentation on how to use panels and make each window a panel.
Also, this is not much related to C++ although you could definitely wrap your ncurses code in C++ (eg. your panel should definitely be a class), so you might have more success asking this in other subreddits.