gpt4 book ai didi

c++ - 以编程方式告诉 PDCurses 使窗口与物理屏幕大小相同的方法?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:02:15 38 4
gpt4 key购买 nike

目前我有一个在 Win7/AIX/Linux 上运行的 C++ 控制台应用程序。在应用程序中,我使用 getmaxyx 获取窗口的尺寸。

getmaxyx(_window, _rows, _cols);

在 Windows 平台上,我需要尝试使用正在运行的应用程序的(属性)(布局)选项,以使屏幕最大化。这有点痛苦。

翻阅文档没有任何值(value)。

lines:  Specifies the number of lines the "screen" will have.
Directly equates to LINES.
There is no theoretical maximum.
The minimum value must be 2.
Default: 24
cols: Specifies the number of columns the "screen" will have.
Directly equates to COLS.
There is no theoretical maximum.
The minimum value must be 2.
Default: 80

有什么技术可以让我将窗口调整为屏幕的物理尺寸吗?是否有使用 PDCurses 和 curses 的可移植方式?如果没有,是否有任何特定于平台的方法来实现此行为?

Possibly Related SO Question

Here perl does it with signals

最佳答案

        /* Resize the terminal to something larger than the physical screen */
resize_term(2000, 2000);

/* Get the largest physical screen dimensions */
getmaxyx(_window, _rows, _cols);

/* Resize so it fits */
resize_term(_rows - 1, _cols - 1);

/* Get the screen dimensions that fit */
getmaxyx(_window, _rows, _cols);

关于c++ - 以编程方式告诉 PDCurses 使窗口与物理屏幕大小相同的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18818600/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com