Tcl/Tk:最大化窗口/确定窗口是否最大化? [英] Tcl/Tk: Maximize window / determine if window is maximized?

查看:69
本文介绍了Tcl/Tk:最大化窗口/确定窗口是否最大化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以知道我的顶级窗口是否已最大化,我是否可以以编程方式将其最大化?我在 Windows XP 上使用 R 的 tcltk 包 8.5.

Can I find out if my toplevel window is maximized, and can I maximize it programmatically? I am using R's tcltk package 8.5 on Windows XP.

问题的原因是:我想通过先调用撤销然后去图标化来强制执行 事件.但是,如果窗口在这两个函数调用之前最大化,则不是在这些调用之后.有没有更简单的方法来强制执行事件?

The reason for the question is: I want to enforce a <Visibility> event by calling first withdraw and then deiconify. However, if the window was maximized before these two function calls, it is not after these calls. Is there an easier way to enforce the event?

推荐答案

您可以通过 wm state $toplevel 来发现窗口是否最大化(查找 zoomed as返回值).但是……

You can discover the whether the window is maximized with wm state $toplevel (look for zoomed as a return value). But…

操作系统不会在 Windows 上为您正确生成 事件;你只能在被映射的窗口上得到它们,这有微妙的不同.(与 X 相比,Windows 告诉您的堆叠顺序及其后果要少得多;Tk 与 X 的模型非常接近.)但是您没有说明为什么想要这个事件;也许还有其他东西可以满足您的真正目的?

The OS doesn't generate <Visibility> events properly for you on Windows; you only get them on the window being mapped, and that's subtly different. (Windows tells you much less about the stacking order and its consequences than X does; Tk's pretty close to X's model.) You don't say why you want this event though; perhaps there's something else that will serve your real purpose?

这篇关于Tcl/Tk:最大化窗口/确定窗口是否最大化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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