3.7 Switch

  • “1” Read switch status; Click “Choose UI Objects” to choose the corresponding widget id to bind the widget.

  • “2” Toggle switch; Click “Choose UI Objects” to choose the corresponding widget id to bind the widget.

Example:

  • Create two switch widgets and a label widget.

  • Click the content drop-down box on the right to set properties.

  • Blockly implementation

  • Click Process/Event, select “When Boot”.

  • Click UI controls-Label, select “Set label content”, and set content to “disable”.

  • Click Process/Event-UI, select “When switch value change”.

  • Click UI controls-Switch, select “Toggle switch”.

  • Click Base-Logic, select “If do”, “=” and “True”.

  • Click UI controls-Switch, select “Read switch status”.

文档更新时间: 2021-06-18 16:49   作者:Win