Crate popout

Crate popout 

Source
Expand description

§Popout

Small popup library

§Introduction

This is a small library designed to do one thing: create modal popup windows. It was designed to be used for applications that have no persistant UI, but occasionally need to display a popup box to the user.

This crate is powered by egui and uses a custom backend built on wgpu and winit (based on this).

§Examples

Check out the examples folder for more, but for a basic hello world:

use popout::{Dialog, LogicalSize};

fn main() {
    Dialog::new()
        .with_line("Hello, World")
        .with_button("Close")
        .with_size(LogicalSize::new(100, 50))
        .show()
        .unwrap();
}

This will display a dialog box to the user that contains the text “Hello, World” with a “Close” button beneath it. It is modal, so execution of main will stop on show until the window is closed.

§Compatibility

This library is NOT designed to be used when you have another UI library already in use. The winit event loop can only be created ONCE and this library WILL create it on usage of any of its features. It is not intended that this library be used alongside any other UI libraries, if you have a persistant UI already then use that library’s built-in popup support instead.

Re-exports§

pub use dialog::Dialog;
pub use egui;
pub use winit;

Modules§

dialog
Contains utilities for creating dialog boxes

Structs§

Color32
This format is used for space-efficient color representation (32 bits).
Icon
An icon used for the window titlebar, taskbar, etc.
LogicalSize
A size represented in logical pixels.
PhysicalSize
A size represented in physical pixels.
RichText
Text and optional style choices for it.
WindowAttributes
Attributes used when creating a window.

Enums§

Error
An error emitted by popout

Functions§

create_window
Create a window with a provided drawing function

Type Aliases§

Result