From c63996179b73dfa83918d973ccb72a0dfd18d084 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 28 Dec 2021 10:03:56 +0100 Subject: [PATCH] README.md: add link to discussion of begin/end calls vs closures --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13d6ae77..07feea9b 100644 --- a/README.md +++ b/README.md @@ -339,7 +339,7 @@ All colors have premultiplied alpha. egui uses the builder pattern for construction widgets. For instance: `ui.add(Label::new("Hello").text_color(RED));` I am not a big fan of the builder pattern (it is quite verbose both in implementation and in use) but until Rust has named, default arguments it is the best we can do. To alleviate some of the verbosity there are common-case helper functions, like `ui.label("Hello");`. -Instead of using matching `begin/end` style function calls (which can be error prone) egui prefers to use `FnOnce` closures passed to a wrapping function. Lambdas are a bit ugly though, so I'd like to find a nicer solution to this. +Instead of using matching `begin/end` style function calls (which can be error prone) egui prefers to use `FnOnce` closures passed to a wrapping function. Lambdas are a bit ugly though, so I'd like to find a nicer solution to this. More discussion of this at . ### Inspiration