Reputation: 608
I am looking for a way to organize the interface following the rougelike pattern (term borrowed from The Art of Unix Programming by Eric S. Raymond), which is basically similar to that of vim, links etc. I opt for C++ with ncurses and cdk.
I have already peeked at the source of wicd-curses (rougelike interface for wicd). There is a main window object which processes keystrokes and invokes actions. If a new screen was opened (say, options screen), the main window delegates the keystrokes to an appropriate OptionsWindow object. The view part was kind of mixed with a controller part of the application.
I would really like to know the proper, oo design of a rougelike app interface. How to organize my screens (windows)? In which component should I process the keystrokes? What about things common to all the windows (moving focus, etc.)?
Upvotes: 1
Views: 130
Reputation: 19504
A good book for this is Using C With Curses, Lex, and Yacc: Building a Window Shell for Unix System V by Axel-Tobias Schreiner (also the author of Object-Oriented Programming in C, link).
Upvotes: 1