解释器,如终端仿真器 [英] Interpreter like Terminal Emulator

查看:94
本文介绍了解释器,如终端仿真器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想在gui中建立一个终端.类似于MATLAB命令窗口.
它应该像解释器一样起作用.请告诉我应该使用哪个gui库或
直接使用Win32 API?
(我使用MinGW gcc)

谢谢.

Hi All,


I want to make a terminal in gui. Same like MATLAB command window.
It should function like an interpreter. Pls tell which gui library should I use or
use Win32 API directly?
(I use MinGW gcc)

Thanks.

推荐答案

这确实有两个很大且完全不同的部分.
0.图形部分.
1.实际的口译员.

...可能不明显,其实质在解释器中.您实质上是在开发脚本语言解释器.如果您想看一下该概念如何更直接地工作(减去所有图形),可以尝试使用Octave. Raw Octave不像Matlab那样具有GUI前端,因此您可以直接在终端窗口中查看其工作方式.也可以将GUI前端软件包安装到Octave上,以使其看起来更像Matlab,但本质上它们两者的工作方式相同.

由于该项目的关键在于后台的解释器,所以您可能应该首先考虑如何实现您的解释器,而不是真正从前端(即GUI)开始.

无论如何,这是我的建议.对于实际的GUI,您可以使用任何可以帮助您直接创建漂亮窗口的工具,例如WinAPI,MFC,Qt,GTK等.祝您编程愉快!
There''s really two big and entirely different portions to this...
0. The graphical portion.
1. The actual interpreter.

...as may or may not be obvious, the meat of it is in the interpreter. You''re essentially developing a scripting language interpreter. If you want to see how the concept works a bit more directly (minus the graphics of it all), play around with Octave a little bit. Raw Octave doesn''t have a GUI front-end like Matlab does, so you can see how it works directly from a terminal window. There are also GUI front-end packages that you can install onto Octave to make it "look" more like Matlab but essentially they both work the same way.

Since the meat of the project lies in the interpreter in the background, perhaps you should probably be thinking about how to implement your interpreter first and not really start from the front-end, which is the GUI.

Anyway, that''s my recommendation. For the actual GUI, you can use anything that helps you make pretty windows like WinAPI directly, MFC, Qt, GTK, whatever you''d like. Happy coding!


您可以创建一个控制台应用程序(这很简单).
如果您确实想要GUI,那么可以,您可以直接使用Win32 API.但是,还有其他选项,例如 QT [
You might create a console application (it would be simple).
If you really want a GUI then, yes, you may use directly the Win32 API. There are other options, however, like, for instance, QT[^].


这篇关于解释器,如终端仿真器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆