如何创建类似图片中显示的Linux TUI界面

huangapple go评论68阅读模式
英文:

How to create linux tui like this one on the picture

问题

请问有人可以分享如何创建像这样带有输入框和搜索功能的 tui 吗?我需要什么?如何创建类似图片中显示的Linux TUI界面

英文:

Could someone share how can i create tui like this one with input boxex and search ?
What do i need?
如何创建类似图片中显示的Linux TUI界面

答案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

你可以使用一些Python库,比如pyTermTktextual,有很多可供选择的

英文:

You can use some python libraries like pyTermTk or textual, there is wide selection of
libraries to choose from.

huangapple
  • 本文由 发表于 2023年2月16日 16:48:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75469751.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定