Trait IntoAtoms
Source pub trait IntoAtoms<'a> {
// Required method
fn collect(self, atoms: &mut Atoms<'a>);
// Provided method
fn into_atoms(self) -> Atoms<'a>
where Self: Sized { ... }
}
Expand description
Trait for turning a tuple of Atoms into Atoms.
Many widgets take an impl IntoAtoms parameter,
which allows you to easily create atoms from tuples of text, images, and other atoms:
let image = egui::include_image!("../../../eframe/data/icon.png");
ui.button((image, "Click me!"));
use egui::{Atoms, Image, IntoAtoms, RichText};
let atoms: Atoms = (
"Some text",
RichText::new("Some RichText"),
Image::new("some_image_url"),
).into_atoms();