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() +```