From Wiki96
Revision as of 14:48, 23 January 2022 by Ctrl (talk | contribs) (Created page with "Windows 96 includes a flexible API for developing your own applications. All applications are ran under WRT, which is a partial sandbox and runtime provided by Windows 96 for applications. Applications may be referred to as "bins", "WRT bins", or "sysbins" depending on the context. == Structure of an application == Windows 96 applications are simply JavaScript files without the .JS extension that include a WRT shebang. Here is an example of a very basic Windows 96 GUI...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Windows 96 includes a flexible API for developing your own applications. All applications are ran under WRT, which is a partial sandbox and runtime provided by Windows 96 for applications.

Applications may be referred to as "bins", "WRT bins", or "sysbins" depending on the context.

Structure of an application

Windows 96 applications are simply JavaScript files without the .JS extension that include a WRT shebang.

Here is an example of a very basic Windows 96 GUI program:

//!wrt
const { Theme } = w96.ui;

class MyApplication extends WApplication {
    /**
     * Application constructor.
     * */
    constructor() {
        super();
    }
    
    /**
     * Main entry point.
     * @param {String[]} argv The program arguments.
     * */
    async main(argv) {
        // Create the window
        const mainwnd = this.createWindow({
            title: "Sample Application",
            body: "Sample text",
            bodyClass: "sample-app",
            taskbar: true,
            resizable: true,
            initialHeight: 480,
            initialWidth: 640,
            icon: await Theme.getIconUrl("mime/executable", '16x16')
        }, true);
        
        // Show the window
        mainwnd.show();
    }
}

return await WApplication.execAsync(new MyApplication(), this.boxedEnv.args);