开发者

Embedding simple terminal/console in RealBasic

I have a shell c开发者_运维问答ommand that I am running in a RealBasic App, and until now I've just been reading the output, but it requires user input. Is there something I could use to embed something like a terminal or a console application that could run a command, show the output, and take the input, maybe in a widget looking like a text area, like many IDEs and code editors have?


There is no pre-built control in RealStudio to accomplish this. However it's trivial to implement with a TextArea control and a Shell object set to Mode=2.

An example of this is included in the RealStudio Examples directory in your RealStudio install directory (by default on Windows, C:\Program Files\REAL Software\Real Studio\Examples\Shell\Interactive Shell.rbp.)


Could you separate the output and input, or would this not make sense for your use case?

If you could, then you could simply use a TextArea to display the console app's output, just keep appending to the TextArea's text. Then use a TextField for single line input underneath the TextArea, or whatever else makes sense for entering the params you need to send to the console app.

Then you can use a button (or catch [RETURN] key up in TextField) to grab the input and pass on to the console app.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜