告诉PDCurses以编程方式使窗口与物理屏幕大小相同的方法? [英] Method to tell PDCurses to make the window the same size as the physical screen programatically?

查看:25
本文介绍了告诉PDCurses以编程方式使窗口与物理屏幕大小相同的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Currently I have an c++ console application running on Win7/AIX/Linux. In the application I use getmaxyx to get the dimensions of the window.

getmaxyx(_window, _rows, _cols);

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

On the windows platform i need to play around with the (properties)(layout) options of the running app, to get the screen maximized. That is a bit of a pain.

翻阅文档没有任何价值.

Thumbing through the documention yields nothing of 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 的可移植方式?如果没有,是否有任何特定于平台的方法来实现此行为?

可能相关的 SO 问题

这里 perl 用信号

推荐答案

        /* 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);

这篇关于告诉PDCurses以编程方式使窗口与物理屏幕大小相同的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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