winio 0.1.8

Single-threaded async GUI runtime based on compio.
docs.rs failed to build winio-0.1.8
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: winio-0.10.0

Winio

Winio is a single-threaded asynchronous GUI runtime. It is based on compio, and the GUI part is powered by Win32, GTK and Cocoa. All IO requests could be issued in the same thread as GUI, without blocking the user interface!

Quick start

winio::block_on(async {
    let window = Window::new().unwrap();
    window.set_text("Basic example").unwrap();
    window.set_size(Size::new(800.0, 600.0)).unwrap();

    // Wait for the close request.
    window.wait_close().await;
})

The asynchronous style of winio enables you writing simple code to handle the requests:

loop {
    // Wait for the close request.
    window.wait_close().await;
    // If the close button clicked, show a message box.
    if MessageBox::new()
        .title("Basic example")
        .message("Close window?")
        .style(MessageBoxStyle::Info)
        .buttons(MessageBoxButton::Yes | MessageBoxButton::No)
        .show(Some(&window))
        .await
        .unwrap()
        == MessageBoxResponse::Yes
    {
        // The user clicked "Yes", break the loop.
        break;
    }
}
// When `window` is dropped, it is closed immediately.