I am trying to delete a child widget from a Flex container on a click event, but I can't find any methods to do so. The child widget is also a Flex container.
I have tried searching Druid examples and docs and can't seem to find anything relevant for this use case.
I have managed to find a way although a bit hacky but still works, answer is based on this post from [email protected] where he explains how to escape Rust privacy rules: https://users.rust-lang.org/t/is-private-really-private/7826/15
Note this is all done on Rust 1.56.1 and Druid 0.7.0.
First you declare a struct same as Flex but with exposed children Vector:
And then in one of your event or command methods where you have mutable reference to container you use Rust unsafe operations(transmute):