rust_widgets 1.0.0

Pure Rust cross-platform native GUI library with hardware-adaptive rendering, 60+ widgets, touch/gesture support, i18n, and SVG-pipeline-accurate output
#[cfg(any(feature = "desktop", feature = "tablet", feature = "mobile"))]
use rust_widgets::core::Rect;
#[cfg(any(feature = "desktop", feature = "tablet", feature = "mobile"))]
use rust_widgets::widget::base_widgets::button::Button;
#[cfg(any(feature = "desktop", feature = "tablet", feature = "mobile"))]
use rust_widgets::widget::window::Window;

fn main() {
    #[cfg(any(feature = "desktop", feature = "tablet", feature = "mobile"))]
    {
        let mut window = Window::new("Rust Widgets Demo".to_string(), Rect::new(0, 0, 800, 480));
        let mut button = Button::new("Start".to_string(), Rect::new(20, 60, 120, 36));
        button.set_text("Start demo".to_string());

        let window_svg = rust_widgets::widget::svg::render_to_svg(&mut window);
        let button_svg = rust_widgets::widget::svg::render_to_svg(&mut button);

        println!("demo_main: window_svg={} button_svg={}", window_svg.len(), button_svg.len());
    }
}