- In future, it would be useful to clarify in the title and post that it's a question relating to my GUI.
- Working for me:
Code:
local lib_path = reaper.GetExtState("Lokasenna_GUI", "lib_path_v2")
if not lib_path or lib_path == "" then
reaper.MB("Couldn't load the Lokasenna_GUI library. Please run 'Script: Set Lokasenna_GUI v2 library path.lua' in your Action List.", "Whoops!", 0)
return
end
loadfile(lib_path .. "Core.lua")()
GUI.req("Classes/Class - Button.lua")()
if missing_lib then return 0 end
local function btn_click()
GUI.Msg("Button was clicked")
end
local endTime2 = reaper.time_precise() + 2
function countDownTimer2 ()
if (reaper.time_precise() <= endTime2) then
reaper.defer(countDownTimer2)
else
GUI.Msg("Timer fired")
GUI.elms.Start_Cont_Button:exec() --Click a button
end
end
GUI.name = "New Window"
GUI.x, GUI.y, GUI.w, GUI.h = 0, 0, 432, 500
GUI.anchor, GUI.corner = "mouse", "C"
GUI.New("Start_Cont_Button", "Button", 1, 168, 28, 96, 20, "Go!", btn_click)
GUI.Msg("Started...")
countDownTimer2()
GUI.Init()
GUI.Main()
-->
Code:
Started...
(...two seconds later...)
Timer fired
Button was clicked