views:

308

answers:

2

I'm looking to add an element to my wxWidgets GUI that behaves like a terminal emulator. Not in terms of a shell which executes commands, but just the input-output setup of an application running in a terminal.

Basically, the requirements are:

Streaming input/output: When you enter a character, it is added to an input stream, and when something is piped to the terminal, it prints out immediately.

No editing: Once you type in a character, it's permanently there, since it's probably been consumed by the application running in the terminal.

Some sort of scrolling (even if it just shows a few lines or something).

It would be nice if there is something that already does this, but suggestions on how to implement this with already existing controls such as wxTextCtrl would also be welcome.

+1  A: 

wxWidgets supports redirecting STDOUT to a wxTextCtrl via wxStreamToTextRedirector. As for input, you could override the OnChar event in a wxTextCtrl-derived class to handle this.

George Edison
Alright, looks like I'm doing something like this.
Jeremybub
+1  A: 

I know this is a couple weeks late, but hopefully it's still useful. I've got a project called Chameleon that uses a wxWidgets-based VT100 terminal widget, which was itself based off of a project called taTelnet. The Chameleon source is available from my website (download page here). Not sure if it's exactly what you're looking for, but it might give you some ideas. Feel free to let me know if you have any questions about it.

markerikson
Thanks, this is *exactly* what I am looking for! I will look into it, and will ask you any questions I might have.
Jeremybub
Note: the source code is in a flat directory structure, but the project expects it to be in folders.
Jeremybub
Hmm. May have made a mistake when I was zipping it. Thanks for the notice.
markerikson