bright-gpu-74537
02/07/2022, 9:36 PMbrave-kangaroo-30399
02/08/2022, 12:04 AMbrave-kangaroo-30399
02/08/2022, 12:04 AMflaky-flag-48397
02/09/2022, 1:57 PMDataSource<T> and the IItemTransformer<T> - I was thinking that the DataSource<T> is the underlying container of some T s - an Array<T> for example and that the IItemTransformer<T> transforms a T to something that TableView can display. At least it worked for me that way when I used typed my underlying data as Array<Dynamic> and provided an IItemTransformer<T> which converted the Dynamic to a display type T . Now I wanted to get rid of Dynamic and constructed the DataSource<T> as a specific ArrayDataSource<T> (same underlying Data as before) with a IItemTransformer<D> which converts the T to a displayable type D (I used the same transformer as before) - now I get errors from the compiler that D should be T which seems to be correct because I just replaced the less specific Dynamic with a T . Shouldn't the definition for for DataSource be DataSource<T,D> with an IItemTransformer<D> ? - I am confusedbright-gpu-74537
02/09/2022, 7:57 PMbright-gpu-74537
02/09/2022, 7:58 PMvar myDS = new ArrayDataSource<MyClass>() and never touch the transform stuffbright-gpu-74537
02/09/2022, 8:05 PMbright-gpu-74537
02/09/2022, 8:06 PMxml
<listview id="myList" width="200" height="200">
<item-renderer width="100%" layoutName="horizontal">
<checkbox id="someBool" verticalAlign="center" />
<label id="someString" width="100%" verticalAlign="center" />
<number-stepper id="someInt" />
</item-renderer>
</listview>bright-gpu-74537
02/09/2022, 8:06 PMbright-gpu-74537
02/09/2022, 8:06 PMhaxe
class SomeDataItem {
public var someString:String;
public var someBool:Bool;
public var someInt:Int;
public function new(s:String, b:Bool, i:Int) {
someString = s;
someBool = b;
someInt = i;
}
}bright-gpu-74537
02/09/2022, 8:06 PMbright-gpu-74537
02/09/2022, 8:06 PMhaxe
var ds = new ArrayDataSource<SomeDataItem>();
ds.add(new SomeDataItem("Item 1", true, 101));
ds.add(new SomeDataItem("Item 2", false, 202));
ds.add(new SomeDataItem("Item 3", true, 303));
ds.add(new SomeDataItem("Item 4", true, 404));
ds.add(new SomeDataItem("Item 5", false, 505));
ds.add(new SomeDataItem("Item 6", true, 606));
ds.add(new SomeDataItem("Item 7", true, 707));
ds.add(new SomeDataItem("Item 8", false, 808));
ds.add(new SomeDataItem("Item 9", true, 909));
myList.dataSource = ds;bright-gpu-74537
02/09/2022, 8:07 PMbright-gpu-74537
02/09/2022, 8:09 PMSomeDataItem implements IDataItem then you can access properties in the SomeDataItem and it will automatically update the data source (and any associated view)bright-gpu-74537
02/09/2022, 8:10 PMds.get(3).someString = "bob";gray-van-91657
02/09/2022, 11:15 PMld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: Build failed
I'm on a MacBook Air M1.
Thanks!bright-gpu-74537
02/10/2022, 7:07 AMgray-van-91657
02/10/2022, 1:46 PMgray-van-91657
02/11/2022, 12:01 AMbright-gpu-74537
02/11/2022, 7:20 AMhaxelib git haxeui-core https://github.com/haxeui/haxeui-core
haxelib git haxeui-hxwidgets https://github.com/haxeui/haxeui-hxwidgets
haxelib git hxWidgets https://github.com/haxeui/hxWidgets
Then build wxWidgets (wx, not hx) from source on your mac, instructions can be found here: https://github.com/haxeui/hxWidgets#building-wxwidgets-from-source-linux--osx (I would consider using the git version of wxWidgets from https://github.com/wxWidgets/wxWidgets)
I would also try updating hxcpp (haxelib update hxcpp), or, like the other deps install git version (note if you do install hxcpp git you will need to rebuild the hxcpp tools - instructions can be found here https://github.com/HaxeFoundation/hxcpp#building-the-tools)bright-gpu-74537
02/11/2022, 7:21 AMhxwidgets.hxmlbright-gpu-74537
02/11/2022, 7:21 AMbright-gpu-74537
02/11/2022, 7:23 AM-DHXCPP_M64 do anything?gray-van-91657
02/11/2022, 9:24 AMflaky-flag-48397
02/11/2022, 10:38 AMflaky-flag-48397
02/11/2022, 10:38 AMclass SomeDataItem implements IDataItem {
public var someString(get, never):String;
function get_someString() {
return "calculated: " + Std.string(_someFloat);
}
public var someBool:Bool;
public var someInt:Int;
var _someFloat: Float;
public function new(d:Float, b:Bool, i:Int) {
_someFloat = d;
someBool = b;
someInt = i;
}
}bright-gpu-74537
02/11/2022, 10:39 AMflaky-flag-48397
02/11/2022, 10:39 AMbright-gpu-74537
02/11/2022, 10:39 AMbright-gpu-74537
02/11/2022, 10:39 AM