slint/api/sixtyfps-node
2020-08-24 14:44:00 +02:00
..
lib Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
native Commit correct license tags to Cargo.toml 2020-08-18 10:12:59 +02:00
loader.mjs Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
package.json Begin working on a Node API 2020-06-03 17:33:05 +02:00
README.md README changes 2020-08-24 14:44:00 +02:00

SixtyFPS-node

SixtyFPS is a UI toolkit that supports different programming languages. SixtyFPS-node is the integration with node.

Tutorial

require("sixtyfps");
let ui = require("../ui/main.60");
let main = new ui.Main();
main.show();

Example:

See /examples/nodetest

Documentation

By importing the sixtyfps module (or using require), a hook is installed that allows you to import .60 files directly.

let ui = require("../ui/main.60");

Instantiating a component

The exported component is exposed as a type constructor. The type constructor takes as parametter an object which allow to initialize the value of public properties or signals.

// In this example, the main.60 file exports a module which
// has a counter property and a clicked signal
let ui = require("ui/main.60");
let component = new ui.MainWindow({
    counter: 42,
    clicked: function() { console.log("hello"); }
});

Accessing a property

Properties are exposed as properties on the component instance

component.counter = 42;
console.log(component.counter);

Signals

The signals are also exposed as property that can be called

// connect to a signal
component.clicked = function() { console.log("hello"); }
// emit a signal
component.clicked();