From 2919803846823f68301775f2dfd5be500a79ef4d Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Fri, 24 Jun 2022 20:05:13 +0200 Subject: [PATCH] Update otherEvents.md --- docs/events/otherEvents.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/events/otherEvents.md b/docs/events/otherEvents.md index 8d233aa..e345687 100644 --- a/docs/events/otherEvents.md +++ b/docs/events/otherEvents.md @@ -48,3 +48,28 @@ end aButton:onResize(onButtonResize) ``` +## onLoseFocus +`onLoseFocus(self)`
+This event gets triggered as soon as the object loses its focus. + +```lua +local mainFrame = basalt.createFrame("myFirstFrame"):show() +local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onLoseFocus( + function(self) + basalt.debug("Please come back... :(") + end +):show() +``` + +## onGetFocus +`onGetFocus(self)`
+This event gets triggered as soon as the object is the currently focused object. + +```lua +local mainFrame = basalt.createFrame("myFirstFrame"):show() +local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onGetFocus( + function(self) + basalt.debug("Welcome back!") + end +):show() +```