If one has a frame (or really any container widget) that contains a bunch of button widgets, and one ones to enable or disable those button features, with real Tcl/Tk one can do something like
foreach b [winfo children .frameofbuttons] {
$b configure -state $someState
}
In rust the obvious code would be comething like
for b in frame.winfo_children()?.iter() {
b.configure(-state(somestate))?;
}
But this does not work, because b is a tk::Widget, not something like TtkButton (or any of the other possible button widgets). There also does not seem to be any way to go from a generic tk::Widget to a specific widget type. There is a hole here. (Yes, rust does not do polymorphism -- which also sucks).
If one has a frame (or really any container widget) that contains a bunch of button widgets, and one ones to enable or disable those button features, with real Tcl/Tk one can do something like
In rust the obvious code would be comething like
But this does not work, because b is a tk::Widget, not something like TtkButton (or any of the other possible button widgets). There also does not seem to be any way to go from a generic tk::Widget to a specific widget type. There is a hole here. (Yes, rust does not do polymorphism -- which also sucks).