Bindable
Experimental library to implement data binding with @:bindable metadata and events
Install / Use
/learn @mxhx-dev/BindableREADME
Bindable
A data binding library for Haxe and MXHX.
Minimum Requirements
- Haxe 4.0
Installation
This library is not yet available on Haxelib, so you'll need to install it from Github.
haxelib git bindable https://github.com/mxhx-dev/bindable.git
Project Configuration
After installing the library above, add it to your Haxe .hxml file.
--library bindable
OpenFL or Lime
For Lime and OpenFL, add it to your project.xml file instead.
<haxelib name="bindable" />
Usage
The first argument is the source of the data. The second is the destination. The final argument is a display object where the binding should be activated when it is added to the stage, and deactivated when it is removed.
DataBinding.bind(Std.string(slider.value), label.text, this);
C++
When Haxe creates a release build for the cpp target, it omits certain null checks by default. This configuration can lead to segmentation faults when accessing fields on null objects, instead of an exception that can be caught, like other targets.
There are a couple of different ways to workaround this quirk.
-
Adding the
HXCPP_CHECK_POINTERdefine to your project's configuration to enable the missingnullchecks. -
If using Haxe 4.3 or newer, using the safe navigation operator to manually handle
nullobjects.DataBinding.bind(obj?.prop, dest, this);
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
