From 670fab3b92082bb384488812ec247d83e0066927 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sat, 2 Apr 2022 08:22:02 +0200 Subject: [PATCH] Updated Checkbox (markdown) --- Checkbox.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Checkbox.md b/Checkbox.md index 49b8000..4e0a32c 100644 --- a/Checkbox.md +++ b/Checkbox.md @@ -15,9 +15,17 @@ There are currently no unique functions. Everything you need you can see in the # Examples +Get and set the current value: ````lua local mainFrame = CreateFrame("myFirstFrame"):show() local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):setValue(true):show() NyoUI.debug(aCheckbox:getValue()) - returns true ```` +Create a onChange event: +````lua +local mainFrame = CreateFrame("myFirstFrame"):show() +local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):onChange(function(self) NyoUI.debug("The value got changed into "..self:getValue()) end):show() + +```` +