eww
eww copied to clipboard
[WIP] AttrValue / Update
Description
The PR
Checklist
Please make sure you can check all the boxes that apply to this PR.
- [ ] All widgets I've added are correctly documented.
- [ ] I added my changes to CHANGELOG.md, if appropriate.
- [ ] The documentation in the
docs/content/main
directory has been adjusted to reflect my changes. - [ ] I used
cargo fmt
to automatically format all code before committing
Still TODO:
- [x] implement placeholders for update (and figure out how they should look) (curlies are pain because they actually could be empty json objects,... maybe remove unnumbered
{}
now?) - [x] allow for multiple children
- [ ] ~~Possibly implement a
const
or sth that keeps state references linked~~ (not for now) - [ ] update documentation
- [ ] update widget attribute documentation !!!!
- [x] handle defaults for actions in def_widget
Update: To properly implement actions as part of the data structure system here, we need to completely restructure the project. Because actions would need to be represented as simplexpr/dynvals, the simplexpr crate would need to not only know about the datastructure, but also know how to parse the s-expression based update syntax.
The alternative would be to turn this into some sort of actual lambda syntax in simplexpr, and then having a side-effecty simplexpr.... but that's also horrible, and would look significantly worse.
I'm not sure how best to do this.
The other alternative is to, for now, not allow passing actions around through custom widgets, storing them in state, etc. That's a big limitation, but the only way I can currently see how to do this without massive changes to the underlying architecture.