Alex Rivera | Logout

A terminal-like window for wxWidgets?

Asked 2010-01-20T00:38:54.627
9

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.

Edit
Report

1 Answer

3

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.

answered 2010-01-20T00:47:55.230

Your Answer