pub fn button(ui: &mut Ui<'_>, text: &str, payload: impl Into<Value>)Expand description
A push button showing text, keyed by it; a click posts payload as
a UiEvent on the button’s key.
widgets::button(&mut ui, "Save", "save");
// The same button with its spec in hand: a tooltip and a stable key.
let (t, m) = (ui.theme(), ui.metrics());
widgets::button_with(&mut ui, "save-2", "Save", widgets::button_spec(&t, &m).on_click("save"), Some("Ctrl+S"));A label that changes re-keys the node (a new node, so it loses keyboard
focus and a screen reader’s cursor); declare such a button with
button_with and a key of its own. The pointer over it is the hand
(CursorShape::Pointer): the core implies no shape from an on_click,
and the stock button is the one place the hand is declared for you.