├── _template
├── assets
│ └── empty.txt
├── src
│ ├── haxeui-pdcurses.properties
│ ├── haxeui-heaps.properties
│ ├── haxeui-hxwidgets.properties
│ ├── haxeui-flixel.properties
│ ├── MainView.hx
│ └── Main.hx
├── nme-windows.hxml
├── flixel-hl.hxml
├── openfl-hl.hxml
├── flixel-html5.hxml
├── flixel-windows.hxml
├── openfl-html5.hxml
├── openfl-windows.hxml
├── .haxeui
├── html5.hxml
├── pdcurses.hxml
├── raylib.hxml
├── heaps-js.hxml
├── hxwidgets.hxml
├── heaps-hl.hxml
├── .vscode
│ ├── tasks.json
│ └── launch.json
├── project.nmml
├── khafile.js
├── application.xml
├── build
│ └── html5
│ │ └── index.html
└── project.xml
├── .gitignore
├── buttons
├── colorful-buttons
│ ├── .gitignore
│ ├── html.png
│ ├── wxwidgets.png
│ ├── html5.hxml
│ ├── .haxeui
│ ├── src
│ │ ├── haxeui-hxwidgets.properties
│ │ └── Main.hx
│ ├── hxwidgets.hxml
│ └── README.md
└── basic-buttons
│ ├── src
│ ├── haxeui-pdcurses.properties
│ ├── haxeui-heaps.properties
│ ├── haxeui-hxwidgets.properties
│ ├── haxeui-flixel.properties
│ ├── Main.hx
│ └── MainView.hx
│ ├── nme-windows.hxml
│ ├── flixel-hl.hxml
│ ├── flixel-html5.hxml
│ ├── openfl-hl.hxml
│ ├── flixel-windows.hxml
│ ├── openfl-html5.hxml
│ ├── openfl-windows.hxml
│ ├── .haxeui
│ ├── html5.hxml
│ ├── pdcurses.hxml
│ ├── raylib.hxml
│ ├── heaps-js.hxml
│ ├── hxwidgets.hxml
│ ├── heaps-hl.hxml
│ ├── .vscode
│ ├── tasks.json
│ └── launch.json
│ ├── project.nmml
│ ├── khafile.js
│ ├── application.xml
│ └── project.xml
└── README.md
/_template/assets/empty.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Kha/
2 | build/
3 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/.gitignore:
--------------------------------------------------------------------------------
1 | build
--------------------------------------------------------------------------------
/_template/src/haxeui-pdcurses.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.pdcurses.title=Main
2 |
--------------------------------------------------------------------------------
/_template/src/haxeui-heaps.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.heaps.engine.background.color=#ffffff
2 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/src/haxeui-pdcurses.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.pdcurses.title=Main
2 |
--------------------------------------------------------------------------------
/_template/nme-windows.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-nme
3 | --cmd nme test windows
--------------------------------------------------------------------------------
/_template/flixel-hl.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-flixel
3 | --cmd lime test project.xml hl
--------------------------------------------------------------------------------
/_template/openfl-hl.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-openfl
3 | --cmd lime test application.xml hl
--------------------------------------------------------------------------------
/buttons/basic-buttons/nme-windows.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-nme
3 | --cmd nme test windows
--------------------------------------------------------------------------------
/buttons/basic-buttons/src/haxeui-heaps.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.heaps.engine.background.color=#ffffff
2 |
--------------------------------------------------------------------------------
/_template/flixel-html5.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-flixel
3 | --cmd lime build project.xml html5
--------------------------------------------------------------------------------
/_template/flixel-windows.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-flixel
3 | --cmd lime test project.xml windows
--------------------------------------------------------------------------------
/_template/openfl-html5.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-openfl
3 | --cmd lime build application.xml html5
--------------------------------------------------------------------------------
/_template/openfl-windows.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-openfl
3 | --cmd lime test application.xml windows
--------------------------------------------------------------------------------
/buttons/basic-buttons/flixel-hl.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-flixel
3 | --cmd lime test project.xml hl
--------------------------------------------------------------------------------
/_template/src/haxeui-hxwidgets.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.hxwidgets.frame.fit=true
2 | haxe.ui.hxwidgets.frame.title=Main
3 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/flixel-html5.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-flixel
3 | --cmd lime build project.xml html5
--------------------------------------------------------------------------------
/buttons/basic-buttons/openfl-hl.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-openfl
3 | --cmd lime test application.xml hl
--------------------------------------------------------------------------------
/_template/.haxeui:
--------------------------------------------------------------------------------
1 | # generated file simply to hold info about projects created with "haxeui create ..."
2 | name=Main
3 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/flixel-windows.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-flixel
3 | --cmd lime test project.xml windows
--------------------------------------------------------------------------------
/buttons/basic-buttons/openfl-html5.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-openfl
3 | --cmd lime build application.xml html5
--------------------------------------------------------------------------------
/_template/html5.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-html5
6 |
7 | -js build/html5/Main.js
8 |
--------------------------------------------------------------------------------
/_template/src/haxeui-flixel.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.flixel.background.color=#FFFFFF
2 | haxe.ui.flixel.mouse.useSystemCursor=true
3 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/openfl-windows.hxml:
--------------------------------------------------------------------------------
1 | -lib haxeui-core
2 | -lib haxeui-openfl
3 | --cmd lime test application.xml windows
--------------------------------------------------------------------------------
/buttons/colorful-buttons/html.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haxeui/component-examples/HEAD/buttons/colorful-buttons/html.png
--------------------------------------------------------------------------------
/_template/pdcurses.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-pdcurses
6 |
7 | -cpp build/pdcurses
8 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/.haxeui:
--------------------------------------------------------------------------------
1 | # generated file simply to hold info about projects created with "haxeui create ..."
2 | name=Main
3 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/src/haxeui-hxwidgets.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.hxwidgets.frame.fit=true
2 | haxe.ui.hxwidgets.frame.title=Main
3 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/wxwidgets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haxeui/component-examples/HEAD/buttons/colorful-buttons/wxwidgets.png
--------------------------------------------------------------------------------
/buttons/basic-buttons/html5.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-html5
6 |
7 | -js build/html5/Main.js
8 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/pdcurses.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-pdcurses
6 |
7 | -cpp build/pdcurses
8 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/src/haxeui-flixel.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.flixel.background.color=#FFFFFF
2 | haxe.ui.flixel.mouse.useSystemCursor=true
3 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/html5.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-html5
6 |
7 | -js build/html5/Main.js
8 |
--------------------------------------------------------------------------------
/_template/raylib.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-raylib
6 | -lib raylib-haxe
7 |
8 | -cpp build/raylib
9 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/.haxeui:
--------------------------------------------------------------------------------
1 | # generated file simply to hold info about projects created with "haxeui create ..."
2 | name=Colorful Buttons
3 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/src/haxeui-hxwidgets.properties:
--------------------------------------------------------------------------------
1 | haxe.ui.hxwidgets.frame.fit=true
2 | haxe.ui.hxwidgets.frame.title=Colorful Buttons
3 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/raylib.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-raylib
6 | -lib raylib-haxe
7 |
8 | -cpp build/raylib
9 |
--------------------------------------------------------------------------------
/_template/heaps-js.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib heaps
5 | -lib haxeui-core
6 | -lib haxeui-heaps
7 |
8 | -D resourcesPath=assets
9 |
10 | -js build/heaps/js/Main.js
11 |
--------------------------------------------------------------------------------
/_template/src/MainView.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import haxe.ui.containers.VBox;
4 |
5 | @:xml('
6 |
7 |
8 | ')
9 | class MainView extends VBox {
10 | }
--------------------------------------------------------------------------------
/_template/hxwidgets.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-hxwidgets
6 | -lib hxWidgets
7 |
8 | -D ABI=-MD
9 | -D WXSTATIC
10 |
11 | -cpp build/hxwidgets
12 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/heaps-js.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib heaps
5 | -lib haxeui-core
6 | -lib haxeui-heaps
7 |
8 | -D resourcesPath=assets
9 |
10 | -js build/heaps/js/Main.js
11 |
--------------------------------------------------------------------------------
/_template/heaps-hl.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib heaps
5 | -lib hlsdl
6 | -lib haxeui-core
7 | -lib haxeui-heaps
8 |
9 | -D resourcesPath=assets
10 |
11 | -hl build/heaps/hl/Main.hl
12 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/hxwidgets.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-hxwidgets
6 | -lib hxWidgets
7 |
8 | -D ABI=-MD
9 | -D WXSTATIC
10 |
11 | -cpp build/hxwidgets
12 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/hxwidgets.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib haxeui-core
5 | -lib haxeui-hxwidgets
6 | -lib hxWidgets
7 |
8 | -D ABI=-MD
9 | -D WXSTATIC
10 |
11 | -cpp build/hxwidgets
12 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/heaps-hl.hxml:
--------------------------------------------------------------------------------
1 | -cp src
2 | -main Main
3 |
4 | -lib heaps
5 | -lib hlsdl
6 | -lib haxeui-core
7 | -lib haxeui-heaps
8 |
9 | -D resourcesPath=assets
10 |
11 | -hl build/heaps/hl/Main.hl
12 |
--------------------------------------------------------------------------------
/_template/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "haxe",
6 | "args": "active configuration",
7 | "group": {
8 | "kind": "build",
9 | "isDefault": true
10 | },
11 | "problemMatcher": [],
12 | "label": "haxe: active configuration"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/_template/src/Main.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import haxe.ui.HaxeUIApp;
4 |
5 | class Main {
6 | public static function main() {
7 | var app = new HaxeUIApp();
8 | app.ready(function() {
9 | app.addComponent(new MainView());
10 |
11 | app.start();
12 | });
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "haxe",
6 | "args": "active configuration",
7 | "group": {
8 | "kind": "build",
9 | "isDefault": true
10 | },
11 | "problemMatcher": [],
12 | "label": "haxe: active configuration"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/buttons/basic-buttons/src/Main.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import haxe.ui.HaxeUIApp;
4 |
5 | class Main {
6 | public static function main() {
7 | var app = new HaxeUIApp();
8 | app.ready(function() {
9 | app.addComponent(new MainView());
10 |
11 | app.start();
12 | });
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/src/MainView.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import haxe.ui.events.MouseEvent;
4 | import haxe.ui.containers.VBox;
5 |
6 | @:xml('
7 |
8 |
9 |
10 | ')
11 | class MainView extends VBox {
12 | @:bind(theButton, MouseEvent.CLICK)
13 | private function onButton(_) {
14 | theButton.text = "Thanks!";
15 | }
16 | }
--------------------------------------------------------------------------------
/_template/project.nmml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/project.nmml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/_template/khafile.js:
--------------------------------------------------------------------------------
1 | let project = new Project('Main');
2 |
3 |
4 | const haxeui_kha_dir = await new Promise((resolve, reject) => {
5 | require('child_process').execFile('haxelib', ['path', 'haxeui-kha'], {}, (err, data) => {
6 | if (err) reject(err);
7 | else resolve(data.split("\n")[0].trim());
8 | });
9 | });
10 |
11 | console.log("Using haxeui-kha from: " + haxeui_kha_dir);
12 |
13 | //project.addAssets('./assets/**');
14 | project.addSources('./src');
15 |
16 | project.addLibrary('haxeui-core');
17 | await project.addProject(haxeui_kha_dir);
18 |
19 | resolve(project);
20 |
--------------------------------------------------------------------------------
/_template/application.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/khafile.js:
--------------------------------------------------------------------------------
1 | let project = new Project('Main');
2 |
3 |
4 | const haxeui_kha_dir = await new Promise((resolve, reject) => {
5 | require('child_process').execFile('haxelib', ['path', 'haxeui-kha'], {}, (err, data) => {
6 | if (err) reject(err);
7 | else resolve(data.split("\n")[0].trim());
8 | });
9 | });
10 |
11 | console.log("Using haxeui-kha from: " + haxeui_kha_dir);
12 |
13 | //project.addAssets('./assets/**');
14 | project.addSources('./src');
15 |
16 | project.addLibrary('haxeui-core');
17 | await project.addProject(haxeui_kha_dir);
18 |
19 | resolve(project);
20 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/application.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # component-examples
2 |
3 | This project contains example code using many of the UI components supported by HaxeUI.
4 | Each directory contains a standalone Haxe project that you can build and run locally
5 | using the included build hxml files for a variety of targets.
6 |
7 | ## A Note About Kha
8 |
9 | In order to run these examples with Kha simply use the following: `node path/to/Kha/make --compile --run`.
10 |
11 | ## Additional Resources
12 |
13 | For more examples, see [the HaxeUI Component Explorer](http://haxeui.org/explorer/).
14 |
15 | ## License
16 |
17 | This software is distributed under the terms of the Apache 2.0 license. See the included
18 | LICENSE.txt file for details.
19 |
--------------------------------------------------------------------------------
/_template/build/html5/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Main
6 |
7 |
8 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/buttons/colorful-buttons/src/Main.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import haxe.ui.util.ColorUtil;
4 | import haxe.ui.components.Button;
5 | import haxe.ui.containers.HBox;
6 | import haxe.ui.HaxeUIApp;
7 |
8 | class Main {
9 | public static function main() {
10 | var app = new HaxeUIApp();
11 | app.ready(function() {
12 | var hbox:HBox = new HBox();
13 | hbox.percentWidth = 100;
14 | hbox.percentHeight = 100;
15 |
16 | for (i in 1...8) {
17 | var button:Button = new Button();
18 | button.text = 'Button $i';
19 | button.onClick = (e) -> {
20 | trace('Button $i clicked');
21 | hbox.backgroundColor = button.backgroundColor;
22 | }
23 | button.backgroundColor = ColorUtil.fromHSL(200 + (i * 50), 100, 75.0);
24 | hbox.addComponent(button);
25 | }
26 |
27 | app.addComponent(hbox);
28 | app.title = 'HaxeUI Demo';
29 |
30 | app.start();
31 | });
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/_template/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Kha: HTML5",
5 | "request": "launch",
6 | "type": "chrome",
7 | "cwd": "${workspaceFolder}/build/debug-html5",
8 | "runtimeExecutable": "${command:kha.findKhaElectron}",
9 | "runtimeArgs": [
10 | "--no-sandbox",
11 | "--force-device-scale-factor=1",
12 | "."
13 | ],
14 | "outFiles": [
15 | "${workspaceFolder}/build/debug-html5/*.js"
16 | ],
17 | "preLaunchTask": "Kha: Build for Debug HTML5",
18 | "internalConsoleOptions": "openOnSessionStart",
19 | "skipFiles": [
20 | "/**"
21 | ]
22 | },
23 | {
24 | "type": "krom",
25 | "request": "launch",
26 | "name": "Kha: Krom",
27 | "preLaunchTask": "Kha: Build for Krom",
28 | "internalConsoleOptions": "openOnSessionStart"
29 | }
30 | ],
31 | "compounds": []
32 | }
--------------------------------------------------------------------------------
/buttons/basic-buttons/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Kha: HTML5",
5 | "request": "launch",
6 | "type": "chrome",
7 | "cwd": "${workspaceFolder}/build/debug-html5",
8 | "runtimeExecutable": "${command:kha.findKhaElectron}",
9 | "runtimeArgs": [
10 | "--no-sandbox",
11 | "--force-device-scale-factor=1",
12 | "."
13 | ],
14 | "outFiles": [
15 | "${workspaceFolder}/build/debug-html5/*.js"
16 | ],
17 | "preLaunchTask": "Kha: Build for Debug HTML5",
18 | "internalConsoleOptions": "openOnSessionStart",
19 | "skipFiles": [
20 | "/**"
21 | ]
22 | },
23 | {
24 | "type": "krom",
25 | "request": "launch",
26 | "name": "Kha: Krom",
27 | "preLaunchTask": "Kha: Build for Krom",
28 | "internalConsoleOptions": "openOnSessionStart"
29 | }
30 | ],
31 | "compounds": []
32 | }
--------------------------------------------------------------------------------
/buttons/colorful-buttons/README.md:
--------------------------------------------------------------------------------
1 | # Colorful Buttons
2 | This example shows 7 buttons, each with a different color.
3 | Clicking a button turns the background of the app the same color as the button.
4 |
5 | This example includes project files for a composite and a native backend.
6 |
7 | # Composite (HTML)
8 | There are various composite backends targeting mobile, desktop and even consoles.
9 | This example includes the HTML backend because it doesn't require installing a toolkit.
10 |
11 | 
12 |
13 | # Native (wxwidgets)
14 | The native target uses the native components of each platform (Windows, Mac, Linux).
15 | The Linux version uses the GTK toolkit.
16 | 
17 |
18 | **NOTE**: Compiling to this target requires [installing an additional toolkit](https://www.haxeui.org/getting-started/haxeui-hxwidgets/)!
19 |
20 | # Code
21 | This code can be found in `src/Main.hx`.
22 |
23 | ```haxe
24 | var app = new HaxeUIApp();
25 | app.ready(function() {
26 | var hbox:HBox = new HBox();
27 | hbox.percentWidth = 100;
28 | hbox.percentHeight = 100;
29 |
30 | for (i in 1...8) {
31 | var button:Button = new Button();
32 | button.text = 'Button $i';
33 | button.onClick = (e) -> {
34 | trace('Button $i clicked');
35 | hbox.backgroundColor = button.backgroundColor;
36 | }
37 | button.backgroundColor = ColorUtil.fromHSL(200 + (i * 50), 100, 75.0);
38 | hbox.addComponent(button);
39 | }
40 |
41 | app.addComponent(hbox);
42 |
43 | app.start();
44 | });
45 | ```
--------------------------------------------------------------------------------
/_template/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/buttons/basic-buttons/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------