Hi, Is there way to disable all widget in tk window with single proc? argument can be just initial toplevel path.
Given a widget, you can get all of the children of that widget with [winfo children]. With a tiny recursive procedure you can act upon every widget in a tree of widgets. If you want to be lazy, you can usually also get a list of all widgets by doing [info commands .*]. That is often Good Enough, unless your application creates procedures or images that begin with ".".
Most tk widgets accept a "-state" option, and those that don't can usually be ignored since state doesn't matter (for example, a frame widget). So, you can iterate over all the widgets and do something like [catch {$widget configure -state disabled}]. This won't work if you have unusual widgets that need to be enabled or disabled by some other means (such as the ttk button which has a "state" subcommand).
If you have a simple application using standard widgets, something like this may be Good Enough:
proc disable_all {path} {
catch {$path configure -state disabled}
foreach child [winfo children $path] {
disable_all $child
}
}
For precise control you can use "[winfo class $widget]" to get the class of the widget, and do different commands depending on the class.