From a553d3257002238ac07a2a7d4a3df5bc68db5bcc Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Sat, 25 Jun 2022 07:40:09 -0400 Subject: [PATCH] Corrected class example --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14ee28c..0e438b7 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,9 @@ Alternativly you may use the extended callback funtion which provides three para

The below example creates a button and defines a lambda function to implicitly create an `ExtendedCallback` which then invokes a more specialized button callback handler. The example uses the `UserParameter` to hold the `this` pointer to an object instance, providing a mechanism for sending the event to a specific object without the need for a switch / map / lookup translation of the Sender Id to an object reference. ``` -ButtonElementId = ESPUI.addControl( +void YourClassName::setup() +{ + ButtonElementId = ESPUI.addControl( ControlType::Button, ButtonLabel.c_str(), " Button Face Text ", @@ -168,6 +170,7 @@ ButtonElementId = ESPUI.addControl( } }, this); // <-Third parameter for the extended callback +} ``` ``` void YourClassName::myButtonCallback(Control* sender, int eventname)