clew-desktop

Crates.ioclew-desktop
lib.rsclew-desktop
version0.0.1
created_at2026-01-03 19:18:24.915033+00
updated_at2026-01-03 19:18:24.915033+00
descriptionDesktop application runner for the clew UI framework.
homepage
repositoryhttps://github.com/sysint64/clew
max_upload_size
id2020690
size103,565
Andrei Kabylin (sysint64)

documentation

README

clew-desktop

Desktop application runner for the clew UI framework.

Provides window management, input handling, and event loop integration using winit.

Usage

use clew_desktop::{Application, ApplicationDelegate, WindowManager, WindowDescriptor};

struct MyApp;

impl ApplicationDelegate<()> for MyApp {
    fn on_start(&mut self, window_manager: &mut WindowManager<Self, ()>) {
        window_manager.spawn_window(
            MainWindow::new(),
            WindowDescriptor {
                title: "My App".to_string(),
                width: 800,
                height: 600,
                resizable: true,
                fill_color: ColorRgb::from_hex(0x121212),
            },
        );
    }

    fn create_renderer(window: Arc<winit::window::Window>) -> Box<dyn Renderer> {
        // Use clew-vello or clew-tiny-skia
        Box::new(
            VelloRenderer::new(
                window.clone(),
                window.inner_size().width,
                window.inner_size().height,
            )
            .block_on(),
        )
    }
}

fn main() -> anyhow::Result<()> {
    Application::run_application(MyApp)
}

Platform Support

Currently tested on macOS only.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Commit count: 0

cargo fmt