Crate kiss_ui [] [src]

A UI framework for Rust based on the KISS principle: "Keep It Simple, Stupid!"

Built on top of the IUP GUI library for C.

Note: "valid KISS-UI context"

All KISS-UI static widget methods will panic if called before kiss_ui::show_gui() is invoked or after it returns.

This is because the underlying IUP library has been either, respectively, not initialized yet or already deinitialized, and attempting to interact with it in either situation will likely cause undefined behavior.

Note: This is a (technically) leaky abstraction.

Because IUP only frees all its allocations when it is deinitialized, all widgets created by KISS-UI will remain in-memory until kiss_ui::show_gui() returns. While unbounded memory growth can happen with complex applications, this should not be an issue for most use-cases.

However, some types do allocate large chunks of memory, or other valuable system resources, and should be manually freed when they are no longer being used. This is most evident with the Image struct, which can allocate large backing buffers for image data.

All types that should be manually freed expose a .destroy() method which should be called when they are no longer being used. This can safely be called multiple times on clones of the widget types[citation needed].

Modules

base

A general widget type that can be specialized at runtime.

button

Buttons that can receive user input.

callback

Traits for notifying client code when the state of a KISS-UI widget is updated.

container

Assorted types that can contain multiple widgets.

dialog

KISS-UI top-level dialogs (windows)

image

Renderable image buffers.

prelude

A module that KISS-UI users can glob-import to get the most common types.

progress

Progress bars and dialogs.

text

Widgets that can render and process text (labels, text boxes).

timer

Timers that can invoke a callback on an interval.

utils

Utility types and functions that might be useful for KISS-UI users.

widget

Operations common to all widget types.

Macros

children!

Convert a heterogeneous list of widgets into a Vec<BaseWidget>, suitable for passing to any function that takes AsRef<[BaseWidget]>, such as a constructor for one of the container types.

Functions

show_gui

The entry point for KISS-UI. The closure argument should initialize and call .show().