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
1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(any(feature = "desktop", feature = "tablet", feature = "mobile"))]
use rust_widgets::core::Rect;

fn main() {
    #[cfg(any(feature = "desktop", feature = "tablet", feature = "mobile"))]
    {
        use rust_widgets::widget::special_widgets::code_editor::CodeEditor;
        let mut editor = CodeEditor::new(Rect::new(0, 0, 640, 400));
        editor.set_text("fn main() {\n    println!(\"hello\");\n}");
        let svg = rust_widgets::widget::svg::render_to_svg(&mut editor);
        println!("demo_code_editor: rendered svg bytes={}", svg.len());
    }
}