tcl - TK "grid"和 "grid remove"

标签 tcl tk-toolkit

我有 TK 应用程序,其中包含多个包含不同小部件的框架。 为了隐藏框架(及其内容),我使用grid remove $frame”。 如何将 TK 顶层的大小调整为所需的最小几何形状?

grid [ttk::frame .f ] -sticky nwse
grid [ttk::frame .f.f] -sticky nwse
foreach el {a b c d e f} {
 grid [label .f.f.$el -text "ELEM $el" ] -sticky nwse
}
update
after 2500
grid remove .f.f

“网格删除.f.f”之后需要什么才能获得不带标签的顶层尺寸?

最佳答案

同时grid remove将小部件从网格中取出,它不会忘记有关如何放置该小部件的信息(如果您想将其添加回同一位置,这是一个偶尔有用的操作)。要真正完全忘记它,您应该使用 grid forget它会删除小部件删除其布局信息。

关于tcl - TK "grid"和 "grid remove",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41958771/

相关文章:

c++ - 那里有任何可以便携处理*不*在主线程中的 GUI 库吗?

ruby - 如何在 ruby​​/tk 中使用不确定的进度条?

windows - 当窗口改变位置时如何执行特定代码?

python - 如何确定我的 ActiveState Tk/Tcl 版本是否支持 TkTreetrl 和正确的模块名称?

C++/Tk : can we create an executable that would run with out requiering end user to have any special TcL interpriter installed?

build - 构建 VRip 时缺少 tk.h 和 tcl.h 文件

string - 空 TCL 字符串导致不可打印字符,导致 Project-Open 崩溃

namespaces - 如何在 tcl 命名空间中定义一个 proc

windows - 在 Tcl : Set -eofchar to windows/unix respectively

Python Tkinter 将到达屏幕末尾的小部件包装在框架中