mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
![]() Delay the conversion of percentage to the float to code generation type by inserting the multiplication into the syntax tree. That way we will be able to detect plain uses of percetages and interpret them differently. |
||
---|---|---|
.. | ||
lib | ||
native | ||
loader.mjs | ||
package.json | ||
README.md |
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:
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();