haxeui-hxwidgets
haxeui-hxwidgets copied to clipboard
TableView virtual throws an invalid cast
I am playing around with the hxWidgets target and wanted to try out the TableView in virtual mode, but without success.
The component creation throws an exception: invalid cast.
my xml
<vbox style="padding: 5px;" width="100%" height="100%">
<tableview width="100%" height="200" virtual="true">
<header width="100%">
<column id="colA" text="Column A" />
<column id="colB" text="Column B" width="200" />
<column id="colC" text="Column C" width="100%" />
</header>
<data>
<item colA="Item 1A" colB="Item 1B" colC="Item 1C" />
</data>
</tableview>
</vbox>
and I use it like that:
class Main {
public static function main() {
Toolkit.init();
var app = new HaxeUIApp();
app.ready(function() {
var main = ComponentMacros.buildComponent("assets/main-view.xml"); // throws here with invalid cast
app.addComponent(main);
app.start();
});
}
}
as soon as I remove the virtual, it works.
Cheers, Adrian.
Hi Adrian, sorry for the delay - been on holiday, so i think the virtual flag wont make a difference on hxWidgets, but it still shouldnt hard crash - pretty sure i know what it is - and should be a simple fix. Will look shortly.
Cheers, Ian
Hi Ian, thanks for looking at it, but as I said I am just playing around with the hxWidgets target. So virtual won't have any effect with hxWidgets ?
Essentially no, the wxWidgets counter part for tableview will already be virtual - this still shouldnt error if you set it though, it should just have no effect.
I'm getting a similar error when trying to compile an app to native (C++).
Error: ./src/hx/widgets/DataViewListCtrl.cpp:232:28: error: conversion from 'long' to 'const Dynamic' is ambiguous
HXLINE( 69) r = v->ptr->GetLong();
EDIT: Ooops, my bad, thought it was TableView as well...