From 0daace38e73b6c5afbda76ccf04e4a9098ff05f4 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sat, 2 Apr 2022 08:06:25 +0200 Subject: [PATCH] Updated Button (markdown) --- Button.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Button.md b/Button.md index 6d3f665..932f64a 100644 --- a/Button.md +++ b/Button.md @@ -1 +1,22 @@ -WIP \ No newline at end of file +Buttons are a objects, which execute function by clicking on them + +Here is a example of how to create a standard button: + +````lua +local mainFrame = CreateFrame("myFirstFrame"):show() +local aButton = mainFrame:addButton("myFirstButton"):show() +```` + +This will create a default button with the size 5 width and 1 height on position 1 1 (relative to its parent frame), the default background is colors.lightBlue, the default text color is colors.black and the +default zIndex is 5. The default vertical and horizontal text aligns are "center" - but there is no default text. + +Here are all possible functions available for buttons. Remember button inherit from [object](https://github.com/NoryiE/NyoUI/wiki/Object): + +## setText +Sets the displayed button text +````lua +local mainFrame = CreateFrame("myFirstFrame"):show() +local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- you could also use :setValue() instead of :setText() - no difference +```` +**args:** text
+**returns:** the object