This commit is contained in:
NoryiE
2025-02-24 22:54:38 +00:00
parent c3f9dfa735
commit 47fef51a0c
21 changed files with 188 additions and 1114 deletions

View File

@@ -13,35 +13,18 @@ This is the program class. It provides a program that runs in a window.
|Method|Returns|Description|
|---|---|---|
|[Program.new](#Program.new)|Program|Creates a new Program instance
|[Program:dispatchEvent](#Program:dispatchEvent)|any|Handles all incomming events
|[Program:execute](#Program:execute)|Program|Executes a program
## Protected Functions
|Method|Returns|Description|
|---|---|---|
|[Program:dispatchEvent](#Program:dispatchEvent)|any|Handles all incomming events
|[Program:focus](#Program:focus)|-|Gets called when the element gets focused
|[Program:init](#Program:init)|Program|Initializes the Program instance
|[Program:render](#Program:render)|-|Renders the program
## Program.new()
Creates a new Program instance
### Returns
* `Program` `object` The newly created Program instance
### Usage
```lua
local element = Program.new("myId", basalt)
```
## Program:dispatchEvent(event, ...)
Handles all incomming events
### Parameters
* `event` `string` The event to handle
* `...` `any` The event arguments
### Returns
* `any` `result` The event result
## Program:execute(path)
Executes a program
@@ -51,20 +34,4 @@ Executes a program
### Returns
* `Program` `self` The Program instance
## Program:focus()
Gets called when the element gets focused
## Program:init(props, basalt)
Initializes the Program instanceProperty
### Parameters
* `props` `table` The properties to initialize the element with
* `basalt` `table` The basalt instance
### Returns
* `Program` `self` The initialized instance
## Program:render()
Renders the program