views:

567

answers:

2

I'm writing a quick server app for something so don't really want to write a full GUI. However the problem is that the main part of the server, however the console window will only allow input or output at a time.

Many games ive played that have a console in them (usually needs activating in some way or another) they solved this problem by separating the input and output, such that the bottom line is dedicated to entering input commands, while the rest is used for output like a normal console window.

Is it possible to do something like that with a minimal amount of work (ie without having to write my own console window from scratch), and in a cross platform way? Ideally id like to still use the normal command prompt somehow for the case where the server is running on a system without all the GUI stuff installed, although I guess a simple GUI client that could connect with the server would be fine as well.

By cross platform I mean Windows and Linux support is required. Although if I went the client GUI route id also require Mac on top of that.

+4  A: 

Sounds like you should have a look at curses

ncurses

pdcurses

epatel
Given the large size of those libraries, don't suppose you could point me towards the part that does what I want for allowing both input and output in real time?
Fire Lancer
Here are some short ones. http://www.paulgriffiths.net/program/c/curses.php I'll see if I can find someone with a better "input" example
epatel
Here are a couple more http://static.cray-cyber.org/Documentation/NEC_SX_R10_1/G1AB01E/CHAP9.HTML#9.6
epatel
A: 

GUI builders these days are very easy. You might find that clicking together a gui is easier than solving this the way you want.

I'm a bit uncertain about the cross-platform part. Could you narrow it down a bit and specify which platforms you have in mind?

If you are considering Linux (which in itself is cross-platform, at least to some extent), then I'd take a look at ncurses.

Kees-Jan
Well building the gui isnt hard the hard part, since its just an input box and a bunch of text items with a scroll bar. The problem is I then need all the networking code between the "admin" gui app and the server to send the commands etc.
Fire Lancer
You would need one socket connection, yes. That takes a little bit of plumbing, but still, I bet it beats ncurses :-)
Kees-Jan