You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/egui/src/lib.rs
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,20 @@
315
315
//!
316
316
//! See [`Context::request_discard`] and [`Options::max_passes`] for more.
317
317
//!
318
+
//! ## FAQ
319
+
//!
320
+
//! **How do I store state between frames?**
321
+
//! Keep your own `struct` with the values you mutate (e.g. selected enum variants, slider numbers) and update it inside `App::update`. egui only borrows your data temporarily each frame - it never stores it for you.
322
+
//!
323
+
//! **Why does my layout jitter the first frame?**
324
+
//! Some widgets (e.g. [`Grid`]) need a frame of measurements before they can allocate perfectly. Call [`Context::request_discard`] or keep the widget alive so the second frame reuses the cached layout.
325
+
//!
326
+
//! **How do I make widgets span the full width?**
327
+
//! Use helpers like [`Ui::vertical_centered_justified`] or wrap content with [`Ui::with_layout`] and [`Layout::top_down`]/[`Layout::left_to_right`] to control justification explicitly.
328
+
//!
329
+
//! **Where can I see more complete examples?**
330
+
//! The live demo at <https://www.egui.rs/#demo> mirrors the code in `crates/egui_demo_app` and `crates/egui_demo_lib`. Each window links back to the relevant source so you can inspect a working reference implementation.
0 commit comments