From ba5e6fa0c53c7fd4fa83a48baa1940299ce26f80 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sun, 3 Apr 2022 15:24:03 +0200 Subject: [PATCH] Updated Program (markdown) --- Program.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Program.md b/Program.md index 3403615..687072b 100644 --- a/Program.md +++ b/Program.md @@ -6,7 +6,7 @@ One important note: this is currently in developement, if something doesn't work Here is a example of how to create a default program: ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):show() ```` @@ -17,7 +17,7 @@ Here are all possible functions available for programs. Remember program inherit ## getStatus Sets the displayed button text ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):show() NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or "dead" ```` @@ -27,7 +27,7 @@ NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or ## execute executes the given path (-program) ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):show() aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuuuuuuun - only hard difficulty ok? ```` @@ -37,7 +37,7 @@ aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuu ## stop gives a terminate event to the program, which means if you are running a shell, and the shell executes a program by itself you have to call stop 2 times to entirely close the running program ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):execute("rom/programs/shell.lua"):show() mainFrame:addButton("myFirstButton"):setText("close"):onClick(function() aProgram:stop() end):show()