2 ms·
Wasn't really able to follow the bit about traits but: It seems like if you want to have back-references you either would need to use Rc<RefCell<T>> or Arcs, w
by robohamburger 10y ago
Wasn't really able to follow the bit about traits but:
It seems like if you want to have back-references you either would need to use Rc<RefCell<T>> or Arcs, which is not the end of the world.
The best way to do it would be to not have back references at all. Then you could simply have Vec<Box<Widget>> for children.
If I were going to build a GUI system in rust I certainly wouldn't design it to be OO. I think you would repeatedly run into problems. An entity component system or something like react might work better in rust.