英文:
How to create linux tui like this one on the picture
问题
请问有人可以分享如何创建像这样带有输入框和搜索功能的 tui 吗?我需要什么?
英文:
Could someone share how can i create tui like this one with input boxex and search ?
What do i need?
答案1
得分: 1
通常程序员会使用类似于ncurses的现成库。
如果你真的有太多时间,你也可以手动完成。例如,要获取对话框窗口的边框线,你需要查看终端正在模拟的当前代码页,例如:代码页 850。如你所见,你会找到单线和双线边框,还有交叉等。现在你需要将光标移动到给定位置,打印代码页中的字符,然后... 还有很多工作。移动光标本身也可以通过使用转义代码从你模拟的终端中使用简单的字符来完成。
正如所说的:与其手动完成所有工作,不如简单地使用像ncurses这样的库。
英文:
Normally programmers use a ready to use library like ncurses.
You can also do it by hand if you really have to much time. To get for example the border lines of a dialog window you have to take a look at the current code page your terminal is emulating, for example: Code Page 850. As you can see, you will find single and double line boarders and also crossings and so on. Now you have to move your cursor to a given position, print that char from the code page and ... lots of work. Moving cursors itself can also be done by simple chars from your emulated terminal by using escape codes.
As said: Instead of doing it all by hand, simply use a lib like ncurses.
答案2
得分: 0
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论