Updated Program (markdown)
13
Program.md
13
Program.md
@@ -1,12 +1,9 @@
|
|||||||
This is one of my favorite part<br>
|
This is one of my favorite part<br>
|
||||||
With that object you are able to open programs like shell or worm or any custom program you've made. There is only 1 thing you have to make
|
With the program object you are able to open programs like shell or worm or any custom program you've made. There is only 1 thing you have to do: the program needs at least one os.sleep() or coroutine.yield() somewhere.
|
||||||
sure: the program needs at least one os.sleep() or coroutine.yield() somewhere
|
|
||||||
<br><br>
|
<br><br>
|
||||||
One important note: this is currently in developement, if something doesn't work correctly feel free to tell me thx<br>
|
|
||||||
Here is a example of how to create a default program:
|
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aProgram = mainFrame:addProgram("myFirstProgram"):show()
|
local aProgram = mainFrame:addProgram("myFirstProgram"):show()
|
||||||
````
|
````
|
||||||
|
|
||||||
@@ -17,7 +14,7 @@ Here are all possible functions available for programs. Remember program inherit
|
|||||||
## getStatus
|
## getStatus
|
||||||
Sets the displayed button text
|
Sets the displayed button text
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aProgram = mainFrame:addProgram("myFirstProgram"):show()
|
local aProgram = mainFrame:addProgram("myFirstProgram"):show()
|
||||||
NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or "dead"
|
NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or "dead"
|
||||||
````
|
````
|
||||||
@@ -27,7 +24,7 @@ NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or
|
|||||||
## execute
|
## execute
|
||||||
executes the given path (-program)
|
executes the given path (-program)
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aProgram = mainFrame:addProgram("myFirstProgram"):show()
|
local aProgram = mainFrame:addProgram("myFirstProgram"):show()
|
||||||
aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuuuuuuun - only hard difficulty ok?
|
aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuuuuuuun - only hard difficulty ok?
|
||||||
````
|
````
|
||||||
@@ -37,7 +34,7 @@ aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuu
|
|||||||
## stop
|
## 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
|
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
|
````lua
|
||||||
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aProgram = mainFrame:addProgram("myFirstProgram"):execute("rom/programs/shell.lua"):show()
|
local aProgram = mainFrame:addProgram("myFirstProgram"):execute("rom/programs/shell.lua"):show()
|
||||||
mainFrame:addButton("myFirstButton"):setText("close"):onClick(function() aProgram:stop() end):show()
|
mainFrame:addButton("myFirstButton"):setText("close"):onClick(function() aProgram:stop() end):show()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user