S or /

SourceClass Atom

from egui import Atom
class Atom:

A low-level ui building block.

This can be a piece of text, an image, or even a custom widget. It can be decorated with various layout hints, such as grow, shrink, align, and more.

Atom implements From for String, str, egui.Image and much more for convenience.

Many widgets take an impl egui.IntoAtoms parameter, which allows you to easily create atoms from tuples of text, images, and other atoms:

You can directly call the atom_* methods on anything that implements Into<Atom>.

Methods§

def align(self, /, align: Align2) -> Atom§
Source@staticmethod def custom(id: Id, size: Vec2) -> Atom§

Create an AtomKind.Empty with a specific size.

Source@staticmethod def grow() -> Atom§

Create an empty Atom marked as grow.

This will expand in size, allowing all preceding atoms to be left-aligned, and all following atoms to be right-aligned

def grow_flag(self, /, grow: bool) -> Atom§
def id_value(self, /) -> Id |None§
Sourcedef into_sized(self, /, ui: Ui, available_size: Vec2, wrap_mode: TextWrapMode |None = None) -> SizedAtom§

Turn this into a SizedAtom.

def is_grow(self, /) -> bool§
def kind(self, /) -> AtomKind§
def max_size(self, /, max_size: Vec2) -> Atom§
def shrink(self, /, shrink: bool) -> Atom§
def size(self, /, size: Vec2) -> Atom§
def with_id(self, /, id: Id) -> Atom§