使用 C++ 在 GNU/Linux 上编写控制台应用程序的正确方法

发布于 2024-08-13 10:54:48 字数 158 浏览 1 评论 0原文

我真的很喜欢这个控制台,并且最近迷上了使用 nCurses 主要与 C 编程语言结合使用的控制台应用程序。

不幸的是,我认为 ncurses API 完全无聊并且很难使用,并且 C++ 绑定没有文档记录。

所以我的问题是,用于 C++ 控制台应用程序的 API 是什么?

I really like the console and got recently hooked on programming console applications using nCurses mainly in conjunction with the C programming language.

Unfortunately i think the ncurses API is totally borked and very hard to use, and the C++ bindings are undocumented.

So my question is, what is THE API to use for C++ console applications?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

萌逼全场 2024-08-20 10:54:48

简短的回答:取决于您的需求;)

仍然简短的回答:许多工具不是交互式的(cat、sed、wc),因此您不需要像 ncurses 这样的东西。如果您需要基于命令行的东西,那么您可以使用 Readline。
最后,您似乎喜欢的只是带有 2D 布局的基于文本的 GUI。在这种情况下我不知道;)

Short answer: depends on your needs ;)

Still short answer: many tools aren't interactive (cat, sed, wc), so you don't need anything like ncurses. If you need something commandline based, then you have Readline.
At last, what you seem to like, is just a text based GUI with a 2D layout. In this case I don't know ;)

春风十里 2024-08-20 10:54:48

也许您更喜欢 s-lang

maybe you'd like s-lang better?

滴情不沾 2024-08-20 10:54:48

您不会考虑使用转义序列来设置颜色、光标位置等吗?这是我唯一能想到的。查看此链接此处,其中显示了如何打印颜色字符串。转义序列来自 ANSI 标准,也在此处列出

希望这有帮助,
此致,
汤姆.

Would you not consider using escape sequences to set the colours, cursor positions and so on? That is the only thing I can think of. Have a look at this link here which shows how to print a colour string. The escape sequences are from the ANSI standards, also listed here.

Hope this helps,
Best regards,
Tom.

美人迟暮 2024-08-20 10:54:48

它不完全是 API,但在过去 borland Turbovision 库很流行。
Borland 几年前将源代码发布到公共领域,并且有好人移植了它。

这里是:
http://tvision.sourceforge.net/

显然他们在 2007 年就停止发布了。

It isn't exactly THE API, but in the olden times borland turbovision library was popular.
Borland released the source to public domain some years ago, and good people ported it.

Here it is:
http://tvision.sourceforge.net/

Apparently they stopped making releases in 2007.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文