Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableView virtual throws an invalid cast #26

Open
AdrianV opened this issue Mar 19, 2021 · 4 comments
Open

TableView virtual throws an invalid cast #26

AdrianV opened this issue Mar 19, 2021 · 4 comments

Comments

@AdrianV
Copy link

AdrianV commented Mar 19, 2021

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
Copy link
Member

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
Copy link
Author

AdrianV commented Apr 6, 2021

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
Copy link
Member

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
Copy link

matronator commented Jul 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants