From ac356e2bd87de5b82332def4fdd2e3c5c53c48bf Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 20 Feb 2021 12:43:53 +0100 Subject: [PATCH] Add a link from the crate-level docs to the online egui web demo --- egui/src/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/egui/src/lib.rs b/egui/src/lib.rs index 07d8ed2f..16b63e64 100644 --- a/egui/src/lib.rs +++ b/egui/src/lib.rs @@ -1,4 +1,8 @@ -//! egui core library +//! egui: an easy-to-use GUI in pure Rust +//! +//! Try the live web demo: . +//! +//! Read more about egui at . //! //! To quickly get started with egui, you can take a look at [`egui_template`](https://github.com/emilk/egui_template) //! which uses [`eframe`](https://docs.rs/eframe). @@ -6,7 +10,9 @@ //! To create a GUI using egui you first need a [`CtxRef`] (by convention referred to by `ctx`). //! Then you add a [`Window`] or a [`SidePanel`] to get a [`Ui`], which is what you'll be using to add all the buttons and labels that you need. //! +//! //! ## Integrating with egui +//! //! To write your own integration for egui you need to do this: //! //! ``` no_run @@ -34,6 +40,7 @@ //! } //! ``` //! +//! //! ## Using egui //! //! To see what is possible to build we egui you can check out the online demo at . @@ -63,7 +70,8 @@ //! //! ui.checkbox(&mut some_bool, "Click to toggle"); //! -//! ui.horizontal(|ui|{ +//! ui.horizontal_wrapped(|ui|{ +//! ui.spacing_mut().item_spacing.x = 0.0; // remove spacing between widgets //! // `radio_value` also works for enums, integers, and more. //! ui.radio_value(&mut some_bool, false, "Off"); //! ui.radio_value(&mut some_bool, true, "On");