çNCURSES prevent调整大小 [英] C ncurses prevent resize

查看:106
本文介绍了çNCURSES prevent调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习如何使用ncurses的,现在,我做基于行数和列数一些计算在程序启动时。

I am starting to learn how to use ncurses right now, and I do some calculations based on the number of lines and columns when the program starts.

这将是太多的工作,我做动态计算管理显示器,所以我需要找到一种方法执行过程中阻止壳的大小调整,这可能吗?

It would be too much work for me to do dynamic calculation to manage the display, so I would need to find a way to block the resize of the shell during the execution, is this possible ?

推荐答案

当然是有阻塞显示尺寸的变化没有可移植的或通用的方式。具体的终端仿真器可能会提供此功能,但我不知道有什么里面做。它通常可以创建固定大小的一个窗口,但终端仿真器将不得不做;它是无形的终端内部运行控制台code。

There is certainly no portable or general-purpose way of blocking display size changes. Specific terminal emulators might offer this feature, but I don't know of any which do. It is generally possible to create a window of fixed size, but the terminal emulator would have to do that; it is invisible to the console code running inside the terminal.

如果您发现很难动态显示尺寸的变化做出反应,你可能需要调整你的code。否则,你可以忽略的大小变化,这可能会导致您的用户体验混乱,或者可能只是导致他们看到无论是输出的一部分还是很多的空白,这取决于大小调整的性质。 (为了获得后者的效果,你需要避免依赖于自动换行和滚动。在另一方面,自动包装和滚动通常你需要让你的应用程序窗口大小无关什么。)

If you find it difficult to respond to dynamic display size changes, you probably need to restructure your code. Otherwise, you can just ignore the size change, which might result in a confusing experience for your users, or might just result in them seeing either a portion of the output or a lot of blank space, depending on the nature of the resizing. (To get the latter effect, you need to avoid relying on automatic line wrapping and scrolling. On the other hand, automatic wrapping and scrolling are often just what you need to make your application window-size-independent.)

这篇关于çNCURSES prevent调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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