SRadio

SRadio let people select a single item

example

#![allow(unused)]
fn main() {
import {SRadio} from "../../index.slint";
import {Themes} from "../../use/index.slint";
import { SText } from "../../src/text/index.slint";

component TestCollection inherits Window {
  height: 560px;
  width: 600px;
  background: #515c74;
  VerticalLayout {
    spacing: 20px;
    padding: 20px;
    SRadio{
      actived: true;
    }
    SRadio{theme: Light;}
    SRadio{theme: Primary;}
    SRadio {theme: Error;}
    SRadio {
      theme: Warning;
      font-weight: 700;
      text : "Chinese";
      font-color: #ff5e00;
      font-italic: true;
      font-family: "Verdana";
    }
    SRadio {
      theme: Info;
      clicked(text,value,actived) => {
        debug(text);
        debug(value);
        debug(actived);
      }
    }
    SRadio{
      active-color : #4affae;
      theme:Primary;
      actived : true;
    }
  }
}
}

properties inherits Rectangle

  • in property font-weight : display text font weight
  • in property font-size: display text font size
  • in property font-color : display text font color
  • in property font-italic : display text font italic
  • in property font-family : display text font family
  • in property theme : SurrealismUI theme
  • in property card-height: radio height (contain padding)
  • in property card-width: radio width (contain padding)
  • in property text : display text
  • in-out property value : radio value
  • in-out property actived : is actived or not
  • in-out property active-color: active radio color
  • in property padding-type : radio padding type
  • in property shadow-type : radio shadow type
  • in property border-type : radio border type

functions

callbacks

  • callback clicked(string,string,bool) : run if you click the radio