Closed Freyja-moth closed 1 month ago
Good idea! We can even make the param a SystemId
directly, that way OnPress
can be a hidden implementation detail :)
It can be a closure that gets registered internally as well.
@benfrankel that's fancy 👀
@benfrankel just to check, are you talking about passing in a closure to the buttons method or am I thinking of something completely different?
Yeah, exactly that.
Since each usage of the button widget has to add an on press afterwards it might be good to add an OnPress parameter to the method.
This would also allow to take advantage of impl traits to reduce the footprint of spawning buttons if From is implemented for OnPress.