{"id":13534178,"url":"https://github.com/haxeui/haxeui-core","last_synced_at":"2025-04-01T22:31:26.752Z","repository":{"id":38362015,"uuid":"49640812","full_name":"haxeui/haxeui-core","owner":"haxeui","description":"The core library of the HaxeUI framework","archived":false,"fork":false,"pushed_at":"2024-10-29T17:16:53.000Z","size":11690,"stargazers_count":345,"open_issues_count":79,"forks_count":71,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-10-29T18:43:36.582Z","etag":null,"topics":["gui","haxe","haxeui","haxeui-framework"],"latest_commit_sha":null,"homepage":"http://haxeui.org","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haxeui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ianharrigan"],"patreon":"haxeui"}},"created_at":"2016-01-14T10:36:38.000Z","updated_at":"2024-10-29T17:16:58.000Z","dependencies_parsed_at":"2024-03-15T07:46:42.958Z","dependency_job_id":"2976eada-4231-44d6-a536-3e360546db30","html_url":"https://github.com/haxeui/haxeui-core","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxeui%2Fhaxeui-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxeui%2Fhaxeui-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxeui%2Fhaxeui-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxeui%2Fhaxeui-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haxeui","download_url":"https://codeload.github.com/haxeui/haxeui-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222779876,"owners_count":17036542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gui","haxe","haxeui","haxeui-framework"],"created_at":"2024-08-01T07:01:27.432Z","updated_at":"2024-11-02T21:31:07.950Z","avatar_url":"https://github.com/haxeui.png","language":"Haxe","funding_links":["https://github.com/sponsors/ianharrigan","https://patreon.com/haxeui"],"categories":["Haxe","Libraries"],"sub_categories":["Haxe"],"readme":"# haxeui-core\n\n`haxeui-core` is a users universal entry point into the HaxeUI framework and allows for the same user interface code (either with markup or via `haxe` source code) to be used to build a user interface on various platforms using various HaxeUI `backends`. Below is a general overview of how `haxeui-core` and the various HaxeUI `backends` fit together. You can watch a presentation (given at WWX2016) about HaxeUI to get more of an understanding \u003ca href=\"https://www.youtube.com/watch?v=L8J8qrR2VSg\u0026feature=youtu.be\"\u003ehere\u003c/a\u003e.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/system.jpg\"/\u003e\n\u003c/p\u003e\n\n## Installation\nInstallation of the haxeui can be performed by using haxelib, you will need a the haxeui-core haxelib as well as a backend, for example: \n```\nhaxelib install haxeui-core\nhaxelib install haxeui-openfl\n```\n\n\n## Backends\nIn general, using a HaxeUI `backend` is as simple as just including `haxeui-core` and the `backend` library into your application, for example:\n\n```\n-lib haxeui-core\n-lib haxeui-openfl\n```\n\nCurrently, HaxeUI supports the following `backends`. Please refer to each `backend` for specific instructions on how to set-up and initialise the host framework (if required).\n\n\u003cbr\u003e\n\u003ctable align=\"center\"\u003e\n  \u003cthead\u003e\n    \u003cth\u003eBackend Library\u003c/th\u003e\n    \u003cth\u003eDependencies\u003c/th\u003e\n    \u003cth\u003ePlatforms\u003c/th\u003e\n    \u003cth\u003eComponents\u003c/th\u003e\n    \u003cth\u003eBuild Status\u003c/th\u003e\n  \u003c/thead\u003e\n    \n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-html5\"\u003ehaxeui-html5\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ci\u003enone\u003c/i\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/mobile.png\" title=\"Mobile\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/browser.png\" title=\"Browser\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/native-backends/\"\u003eNative\u003c/a\u003e,\u003cbr\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-html5/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-html5/actions/workflows/build.yml/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-kha\"\u003ehaxeui-kha\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/Kode/Kha\"\u003eKha\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/mobile.png\" title=\"Mobile\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/browser.png\" title=\"Browser\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-kha/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-kha/actions/workflows/build.yml/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-openfl\"\u003ehaxeui-openfl\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/openfl/openfl\"\u003eOpenFL\u003c/a\u003e, \u003ca href=\"https://github.com/haxelime/lime\"\u003eLime\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/mobile.png\" title=\"Mobile\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/browser.png\" title=\"Browser\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-openfl/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-openfl/actions/workflows/build.yml/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-flixel\"\u003ehaxeui-flixel\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/HaxeFlixel/flixel\"\u003eFlixel\u003c/a\u003e, \u003ca href=\"https://github.com/openfl/openfl\"\u003eOpenFL\u003c/a\u003e, \u003ca href=\"https://github.com/haxelime/lime\"\u003eLime\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/mobile.png\" title=\"Mobile\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/browser.png\" title=\"Browser\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-flixel/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-flixel/actions/workflows/build.yml/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-heaps\"\u003ehaxeui-heaps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/HeapsIO/heaps\"\u003eHeaps\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/browser.png\" title=\"Browser\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-heaps/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-heaps/actions/workflows/build.yml/badge.svg\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-nme\"\u003ehaxeui-nme\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxenme/nme\"\u003eNME\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/mobile.png\" title=\"Mobile\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-nme/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-nme/actions/workflows/build.yml/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-hxwidgets\"\u003ehaxeui-hxwidgets\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/hxWidgets\"\u003ehxWidgets\u003c/a\u003e, \u003ca href=\"https://github.com/wxWidgets\"\u003ewxWidgets\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/native-backends/\"\u003eNative\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-hxwidgets/actions/workflows/build-linux.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-hxwidgets/actions/workflows/build-linux.yml/badge.svg\"\u003e\u003c/a\u003e\u003cbr\u003e\u003ca href=\"https://github.com/haxeui/haxeui-hxwidgets/actions/workflows/build-windows.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-hxwidgets/actions/workflows/build-windows.yml/badge.svg\"\u003e\u003c/a\u003e\u003cbr\u003e\u003ca href=\"https://github.com/haxeui/haxeui-hxwidgets/actions/workflows/build-osx.yml\"\u003e\u003cimg src=\"https://github.com/haxeui/haxeui-hxwidgets/actions/workflows/build-osx.yml/badge.svg\"\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-winforms\"\u003ehaxeui-winforms\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ci\u003enone\u003c/i\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/native-backends/\"\u003eNative\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e...\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-pixijs\"\u003ehaxeui-pixijs\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/pixijs/pixi-haxe\"\u003ePixiJS\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/browser.png\" title=\"Browser\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e...\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-android\"\u003ehaxeui-android\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ci\u003enone\u003c/i\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/mobile.png\" title=\"Mobile\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/native-backends/\"\u003eNative\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e...\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-pdcurses\"\u003ehaxeui-pdcurses\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/wmcbrine/PDCurses\"\u003ePDCurses\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e...\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/haxeui-raylib\"\u003ehaxeui-raylib\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e\u003ca href=\"https://github.com/haxeui/raylib-haxe\"\u003eraylib-haxe\u003c/a\u003e, \u003ca href=\"https://github.com/raysan5/raylib\"\u003eRayLib\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/haxeui/haxeui-core/master/.github/images/desktop.png\" title=\"Desktop\"\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\" align=\"left\"\u003e\u003ca href=\"http://haxeui.org/getting-started/composite-backends/\"\u003eComposite\u003c/a\u003e\u003c/td\u003e\n    \u003ctd valign=\"top\"\u003e...\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Usage\nAssuming that `haxeui-core` and the `backend` library have been included in your application, initialising the toolkit and using it should be relatively straight forward:\n\n```haxe\nToolkit.init();\n```\n\nThe `init` function can take an optional `Dynamic` argument that allows certain options to be passed to the host framework. Please refer to each specific backend on how to use these. \n\nOnce the toolkit has been initialised components can be added in one of two ways:\n\n### Adding components using Haxe code\nUsing HaxeUI components in haxe code is simple and easy:\n\n```haxe\nimport haxe.ui.components.Button;\nimport haxe.ui.containers.VBox;\nimport haxe.ui.core.Screen;\n\nvar main = new VBox();\n\nvar button1 = new Button();\nbutton1.text = \"Button 1\";\nmain.addComponent(button1);\n\nvar button2 = new Button();\nbutton2.text = \"Button 2\";\nmain.addComponent(button2);\n\nScreen.instance.addComponent(main);\n```\n\n_Note: `Screen` was used here as a universal way to add items to the application, this is not required however, if you are using a single framework and are not interested in the cross-framework capabilities of HaxeUI, then you can use something more specific to the target framework (eg: `Lib.current.stage.addChild(main)`)._\n\n### Adding components from markup\nIt is also possible for HaxeUI to take a user interface definition from a markup language (like XML) and use that to build code similar to above:\n\n```haxe\nvar main = haxe.ui.ComponentBuilder.fromFile(\"assets/ui/demo/main.xml\");\nScreen.instance.addComponent(main);\n```\nIf your xml isn't available at compile time you can use `Toolkit.componentFromString`:\n\n```haxe\nvar main = haxe.ui.RuntimeComponentBuilder.fromString('\u003cvbox\u003e\u003cbutton text=\"Button\" /\u003e\u003c/vbox\u003e', \"xml\");\nScreen.instance.addComponent(main);\n```\n\n## Additional resources\n* \u003ca href=\"http://haxeui.org/explorer/\"\u003ecomponent-explorer\u003c/a\u003e - Browse HaxeUI components\n* \u003ca href=\"http://haxeui.org/builder/\"\u003eplayground\u003c/a\u003e - Write and test HaxeUI layouts in your browser\n* \u003ca href=\"https://github.com/haxeui/component-examples\"\u003ecomponent-examples\u003c/a\u003e - Various componet examples\n* \u003ca href=\"http://haxeui.org/api/haxe/ui/\"\u003ehaxeui-api\u003c/a\u003e - The HaxeUI api docs.\n* \u003ca href=\"https://github.com/haxeui/haxeui-guides\"\u003ehaxeui-guides\u003c/a\u003e - Set of guides to working with HaxeUI and backends.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxeui%2Fhaxeui-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaxeui%2Fhaxeui-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxeui%2Fhaxeui-core/lists"}