mirror of
https://github.com/zoriya/ags.git
synced 2026-05-24 15:28:35 +00:00
11414ffef2
* rework widget subclassing #121 * remove Utils.connect, add Widget.bind, Widget.connectTo * add: types for on_event fields * bump version to 1.5.1 * export service classes and named instance constants * add starter config example
28 lines
680 B
JavaScript
28 lines
680 B
JavaScript
import { Variable } from 'resource:///com/github/Aylur/ags/variable.js';
|
|
import { Widget } from 'resource:///com/github/Aylur/ags/widget.js';
|
|
|
|
const time = new Variable('', {
|
|
poll: [1000, 'date'],
|
|
});
|
|
|
|
const Bar = (/** @type {number} */ monitor) => Widget.Window({
|
|
monitor,
|
|
name: `bar${monitor}`,
|
|
anchor: ['top', 'left', 'right'],
|
|
exclusive: true,
|
|
child: Widget.CenterBox({
|
|
start_widget: Widget.Label({
|
|
hpack: 'center',
|
|
label: 'Welcome to AGS!',
|
|
}),
|
|
end_widget: Widget.Label({
|
|
hpack: 'center',
|
|
binds: [['label', time]],
|
|
}),
|
|
})
|
|
})
|
|
|
|
export default {
|
|
windows: [Bar(0)]
|
|
}
|