haxeui / haxeui-hxwidgets

The hxWidgets backend of the HaxeUI framework -
http://haxeui.org
MIT License
23 stars 7 forks source link

TableView virtual throws an invalid cast #26

Open AdrianV opened 3 years ago

AdrianV commented 3 years ago

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.

ianharrigan commented 3 years ago

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

AdrianV commented 3 years ago

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 ?

ianharrigan commented 3 years ago

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.

matronator commented 2 years ago

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