Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

User Interface(UI)

v1

#![allow(unused)]
fn main() {
use std::net::SocketAddr;
use std::time::Duration;
use algosul::ui::*;
use algosul::derive::*;

#[derive(UI, DataSync)]
#[ui(key = "time-sync", widget = "Taps::new()")]
enum TimeSync {
  #[ui(title_key = "unknown")]
  #[ui_cfg(class = "show", widget = "Text::new()")]
  #[ui_cfg(class = "input", ignore)]
  Unknown,
  #[ui(title_key = "no-sync")]
  No,
  #[ui(title_key = "auto-sync")]
  Auto {
    url: String,
    refresh_duration: Duration,
  }
}
}

v2

  1. async + Rc<RefCell<T>>
  2. Sender and Receiver
#![allow(unused)]
fn main() {
use algosul::{ui::*, derive::*};
#[derive(DataSync)]
enum TimeSync {
  Unknown,
  No,
  Auto {
    url: String,
    refresh_duration: Duration,
  }
}

impl Widget for TimeSync {
  fn build(&self) -> Box<dyn Widget> {}
}

}