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

Discussion in 'C++' started by Water Lin, Jun 12, 2009.

  1. Water Lin

    Water Lin Guest

    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?
     
    Water Lin, Jun 12, 2009
    #1
    1. Advertisements

  2. Water Lin

    Vicky Guest

    Your problem is not so clear. TUI programming will be quit OS
    dependent. For Unix/Linux there is curse library. You can use it.
     
    Vicky, Jun 12, 2009
    #2
    1. Advertisements

  3. Water Lin

    rabbits77 Guest

    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
     
    rabbits77, Jun 12, 2009
    #3
  4. Water Lin

    Tony Guest

    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
     
    Tony, Jun 12, 2009
    #4
  5. Water Lin

    Jorgen Grahn Guest

    Not if he does a prompting interface, like this:

    Enter a foo value: d898hhd
    Enter a bar value: djkjhjc8
    ...

    But both Unix and Windows users hate such interfaces.

    For an overview of Unix interface styles, see

    http://www.catb.org/~esr/writings/taoup/html/ch11s06.html

    One of those will probably be a best fit on Windows, too.

    /Jorgen
     
    Jorgen Grahn, Jun 14, 2009
    #5
  6. Water Lin

    Water Lin Guest

    Thanks for this instructions.

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

    http://tvision.sourceforge.net/
     
    Water Lin, Jun 15, 2009
    #6
  7. Water Lin

    Water Lin Guest


    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
     
    Water Lin, Jun 16, 2009
    #7
  8. Water Lin

    Tony Guest

    The only way to find out is to dive in and research the framework and see if
    it will meet your requirements. Only you can decide that.
     
    Tony, Jun 19, 2009
    #8
  9. Water Lin

    rabbits77 Guest

    Thanks for this instructions.
    Most definitely this is a good place to start!
    Note: I am the one that recommended it in the first
    place. ;)
     
    rabbits77, Jun 19, 2009
    #9
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.