gpt4 book ai didi

r - 绘制时如何在 R 中隐藏 TclTk 窗口

转载 作者:行者123 更新时间:2023-12-04 10:36:15 25 4
gpt4 key购买 nike

TclTk 在 R 中运行良好,只是我可以在构建窗口时看到小部件被放置在窗口上。有没有办法隐藏窗口,并且只在构建后显示它?将以下内容粘贴到 R 中,您将看到窗口填满。那就是我不希望用户看到的(如果可能的话)。谢谢。

require(tcltk)
dlg = tktoplevel()
# command to hide window ?
for (i in 1:10) {
l = list()
for (i in 1:20) l[[i]]=tkbutton(dlg,text="SO")
do.call(tkgrid,l)
}
# command to show window now it is built ?
tkwait.window(dlg)
tkdestroy(dlg)

最佳答案

我在 gWidgetstcltk 中有以下模式:

library(tcltk)
tclServiceMode(FALSE)
win <- tktoplevel()
tkwm.state(win,"withdrawn")
tclServiceMode(TRUE)

## ... do your thing then:
tkwm.state(win,"normal")

关于r - 绘制时如何在 R 中隐藏 TclTk 窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5330617/

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