我找到了query whether a tk window is maximized的方法:
library(tcltk)
w <- tktoplevel()
tkwm.state(w) # Query the current state; returns "normal" if not maximized
# The possible states for a window include "normal"m "iconic" (for an iconified window), "withdrawn", "icon" or "zoomed".
# For more details about window states see: http://www.tkdocs.com/tutorial/windows.html
如何最大化tk
窗口?
此代码不起作用(使用Ubuntu 14.04):
tkwm.state(w, "zoomed")
结构错误(.External(.C_dotTclObjv,objv),class =“tclObj”): [tcl]坏参数“缩放”:必须是正常的,标志性的或撤回的。
答案 0 :(得分:1)
在Linux上,您必须使用wm attributes
来检查缩放状态。最大化代码与内部系统调用紧密相关,并且不是跨平台兼容的。
set iszoomed [wm attributes $w -zoomed]
wm attributes $w -zoomed 1 ; # set to maximized
抱歉,不知道R代码。