haxeui-hxwidgets icon indicating copy to clipboard operation
haxeui-hxwidgets copied to clipboard

TableView virtual throws an invalid cast

Open AdrianV opened this issue 3 years ago • 4 comments

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.

AdrianV avatar Mar 19 '21 17:03 AdrianV

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

ianharrigan avatar Apr 02 '21 08:04 ianharrigan

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 ?

AdrianV avatar Apr 06 '21 13:04 AdrianV

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.

ianharrigan avatar Apr 08 '21 09:04 ianharrigan

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...

matronator avatar Jul 29 '21 04:07 matronator