import{_ as r,a as t,b as a,ag as o}from"./chunks/framework.BcrMLAmg.js";const u=JSON.parse('{"title":"Program","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Program.md","filePath":"references/elements/Program.md","lastUpdated":1757844696000}'),n={name:"references/elements/Program.md"};function d(i,e,s,l,h,c){return a(),t("div",null,e[0]||(e[0]=[o('

Program

This is the program class. It provides a program that runs in a window.

Extends: VisualElement

Properties

PropertyTypeDefaultDescription
programtablenilThe program instance
pathstring""The path to the program
runningbooleanfalseWhether the program is running
errorCallbackfunctionnilThe error callback function
doneCallbackfunctionnilThe done callback function

Functions

MethodReturnsDescription
Program:executeProgramExecutes a program
Program:stopProgramStops the program
Program:sendEventProgramSends an event to the program
Program:onErrorProgramRegisters a callback for the program's error event
Program:onDoneProgramRegisters a callback for the program's done event

Program:execute(path, env?, addEnvironment?)

Executes a program

Parameters

Returns

Program:stop()

Stops the program

Returns

Program:sendEvent(event, any)

Sends an event to the program

Parameters

Returns

Program:onError(fn)

Registers a callback for the program's error event, if the function returns false, the program won't stop

Parameters

Returns

Program:onDone(fn)

Registers a callback for the program's done event

Parameters

Returns

',35)]))}const p=r(n,[["render",d]]);export{u as __pageData,p as default};