Is there any good tui library in C++ under Windows?

W

Water Lin

I want to write a text user interface for my program.

That means I will print out something for user, and user will choose which step he wants to run.

Now I am just using cout and cin to output and input. It is really a dirty job.

I need to write a lot of switch statements to judge what I need to do next.

One more thing, I don't know how to output color text under Windows command line, is it possible? How?

so, any suggestion on my task?
 
V

Vicky

I want to write a text user interface for my program.

That means I will print out something for user, and user will choose which step he wants to run.

Now I am just using cout and cin to output and input. It is really a dirty job.

I need to write a lot of switch statements to judge what I need to do next.

One more thing, I don't know how to output color text under Windows command line, is it possible? How?

so, any suggestion on my task?

Your problem is not so clear. TUI programming will be quit OS
dependent. For Unix/Linux there is curse library. You can use it.
 
R

rabbits77

Vicky said:
Your problem is not so clear. TUI programming will be quit OS
dependent. For Unix/Linux there is curse library. You can use it.
Yes, OP could use ncurses under cygwin.
I am not sure if ncurses has a port to plain Win
though. I think that I have heard of such a thing
but cannot currently find it so maybe it
stopped being maintained a long time ago.
If OP is targetting windows only then
it might be a good idea to look at
some old DOS programming guides
Also, see this article on Turbo Vision
and see if you can get the C++ sources somewhere.
They are apparently a little hard to find?
If you find them post a link back here!
http://en.wikipedia.org/wiki/Turbo_Vision
 
T

Tony

Water said:
I want to write a text user interface for my program.

That means I will print out something for user, and user will choose
which step he wants to run.

Now I am just using cout and cin to output and input. It is really a
dirty job.

I need to write a lot of switch statements to judge what I need to do
next.

One more thing, I don't know how to output color text under Windows
command line, is it possible? How?

so, any suggestion on my task?

The Win32 console IO API is quite good and has both UNICODE and codepage
support. You might want to either build some higher level stuff around the
API, use it directly or search for a wrapper online that someone has already
created and made available (CodeProject may be worth searching). Here's a
starting link on MSDN:

http://msdn.microsoft.com/en-us/library/ms682010(VS.85).aspx

More description of the Win32 console and an example of what is possible
with it on this Wikipedia page (click on the GNU Midnight Commander
graphic):

http://en.wikipedia.org/wiki/Win32_console
 
W

Water Lin

Tony said:
The Win32 console IO API is quite good and has both UNICODE and codepage
support. You might want to either build some higher level stuff around the
API, use it directly or search for a wrapper online that someone has already
created and made available (CodeProject may be worth searching). Here's a
starting link on MSDN:

http://msdn.microsoft.com/en-us/library/ms682010(VS.85).aspx

More description of the Win32 console and an example of what is possible
with it on this Wikipedia page (click on the GNU Midnight Commander
graphic):

http://en.wikipedia.org/wiki/Win32_console

Thanks for this instructions.

I think I can study something from Turbo Vision, is it good to start?

http://tvision.sourceforge.net/
 
W

Water Lin

rabbits77 said:
Yes, OP could use ncurses under cygwin.
I am not sure if ncurses has a port to plain Win
though. I think that I have heard of such a thing
but cannot currently find it so maybe it
stopped being maintained a long time ago.
If OP is targetting windows only then
it might be a good idea to look at
some old DOS programming guides
Also, see this article on Turbo Vision
and see if you can get the C++ sources somewhere.
They are apparently a little hard to find?
If you find them post a link back here!
http://en.wikipedia.org/wiki/Turbo_Vision


I think this is the Turbo Vision download link:
-----------
http://tvision.sourceforge.net/

But I can't compile it under Cygwin or MinGW.

Cygwin provide me two errors:
-----------------------------------------
/usr/include/sys/unistd.h:203: error: declaration of C function `int CLY_YieldP
ocessor(useconds_t)' conflicts with
.../include/compatlayer.h:1618: error: previous declaration `void CLY_YieldProce
sor(int)' here
make[1]: *** [obj/calcdisp.o] error1
make[1]: Leaving directory `/home/water/TurboVision/contrib/tvision/makes'
make: *** [static-lib] error 2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top