views:

262

answers:

1

Hi, I'm writing a wxWidgets GUI application, but it also uses some console objects.

I need a way of displaying stdout and accessing stdin; the best way to do this, would be displaying the console as well as the GUI. This can be done if a user runs the program from the command prompt/shell etc, but the command prompt does not automatically open to view stdout when the application is ran.

I know this has to be possible, because when you run a console application, the console runs automatically. I found one or two solutions that require the Windows API, but sadly my code needs to be cross platform (I'm developing this on Linux).

+1  A: 

The solution is very simple: use wxStreamToTextRedirector. This allows console output to be redirected to a text control. You could create a separate window for this and color it to look like a console. The link above provides an example.

George Edison
Does this work for you?
George Edison