From 02b4eb9f754543dc52fb68a925851cebd7de74b9 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Wed, 6 Jul 2022 20:36:36 +0200 Subject: [PATCH] Update otherEvents.md --- docs/events/otherEvents.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/events/otherEvents.md b/docs/events/otherEvents.md index ebe2917..8ed8f3e 100644 --- a/docs/events/otherEvents.md +++ b/docs/events/otherEvents.md @@ -7,7 +7,7 @@ This is a custom event which gets triggered as soon as the function :setValue() Here is a example on how to add a onChange event to your input, and also another example for your checkbox: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local aInput = mainFrame:addInput("specialInput"):setPosition(3,3):show() @@ -36,7 +36,7 @@ This is a custom event which gets triggered as soon as the parent frame gets res Here is a example on how to add a onResize event to your button: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local aButton = mainFrame:addButton("myButton"):setPosition(3,3):show() @@ -53,6 +53,8 @@ aButton:onResize(onButtonResize) This event gets triggered as soon as the object loses its focus. ```lua +local basalt = require("Basalt") + local mainFrame = basalt.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onLoseFocus( function(self) @@ -66,6 +68,8 @@ local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onLoseFocu This event gets triggered as soon as the object is the currently focused object. ```lua +local basalt = require("Basalt") + local mainFrame = basalt.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onGetFocus( function(self)