cmd

Function cmd 

Source
pub fn cmd(wgt: &mut WidgetBuilding, cmd: impl IntoVar<Command>)
Expand description

B Sets the Command the button represents.

When this is set the button widget sets these properties if they are not set:

  • child: Set to a widget produced by cmd_child_fn, by default is Text!(cmd.name()).
  • tooltip_fn: Set to a widget function provided by cmd_tooltip_fn, by default it shows the command info and first shortcut.
  • enabled: Set to cmd.is_enabled().
  • visibility: Set to cmd.has_handlers().into().
  • on_click: Set to a handler that notifies the command if cmd.is_enabled().
  • on_disabled_click: Set to a handler that notifies the command if !cmd.is_enabled().

ยงMixin Property

This property is a mixin, it modifies the widget builder during build, it does not produce a standalone UI node.