开发者

A terminal-like window for wxWidgets?

开发者 https://www.devze.com 2022-12-17 02:22 出处:网络
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 inpu开发者_运维百科t-output setup of an applicati

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 inpu开发者_运维百科t-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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消