Closed Selenium39 closed 1 year ago
use druid::{AppLauncher, Data, Lens, Widget, WidgetExt, WindowDesc}; use druid::widget::Button; #[derive(Clone, Data, Lens)] struct AppState { } fn ui_builder() -> impl Widget<AppState> { Button::new("开始截图") .on_click(|_ctx, _data: &mut AppState, _env| { start_screenshot(); }) .center() } fn main() { let main_window = WindowDesc::new(ui_builder()).title("RustShot"); let state = AppState {}; AppLauncher::with_window(main_window) .launch(state) .expect("Failed to launch application"); } fn start_screenshot() { }
druid = "0.8.3"