1. A very basic app
An example app which demonstrates the creation of a window with simple contents inside
Creating the file
Defining the goal
The source code
// Import the necessary functions from their namespaces.
const { register } = w96.app;
const { Theme } = w96.ui;
// Define the application class
class ExampleApplication extends WApplication {
constructor() {
super();
}
async main(argv) {
super.main(argv);
// Create the main window object and assign it to a variable
const mainwnd = this.createWindow({
title: "My Application",
icon: Theme.getIconUrl("exec", "small"), // The icon for this window.
initialHeight: 400,
initialWidth: 640,
body: "very cool text", // Specify the HTML body of your application here.
bodyClass: "example1-app", // The class to use to style the body and its contents of this window.
taskbar: true // Show this window in the taskbar
}, true); // true specifies that this is an app window (main window)
mainwnd.show();
}
}
// Register the app
register({
command: "example-app",
type: "gui",
cls: ExampleApplication,
meta: {
icon: Theme.getIconUrl("exec"), // You may specify a custom icon URL here.
friendlyName: "Example Application"
}
});The final result

Important notes
Last updated