https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    04/23/2020, 9:12 PM
    depends on the framework... haxeui-heaps runs on hl, for me haxeui-openfl does too - but @User has had issues, and i have no idea if kha can run on hl... probably?
  • a

    ambitious-knife-25690

    04/23/2020, 9:23 PM
    kha is weird
  • a

    ambitious-knife-25690

    04/23/2020, 9:23 PM
    It has intergration for hashlink/c
  • a

    ambitious-knife-25690

    04/23/2020, 9:23 PM
    but not for the vm
  • m

    most-caravan-45834

    04/23/2020, 9:31 PM
    @User Strangely, I just tried to run it on windows (I was previously on mac) and got the exact same error. Well, anyway HL is not stopping me from developing, so I'll leave it quiet, for the moment. In the future I'll investigate further.
  • u

    user

    04/24/2020, 1:00 AM
    All good, thanks for the feedback
  • m

    most-caravan-45834

    04/24/2020, 5:37 AM
    This snippet works fine for me. (this one has id="test" in a Button item in main.xml)
    Copy code
    haxe
    var main: VBox = ComponentMacros.buildComponent("assets/ui/xml/main.xml");
    Screen.instance.addComponent(main);
    var button: Button = main.findComponent("test", Button, true);
    trace(button);
    This one traces: null (this one has id="test" in a MenuItem item in main.xml)
    Copy code
    haxe
    var main: VBox = ComponentMacros.buildComponent("assets/ui/xml/main.xml");
    Screen.instance.addComponent(main);
    var button: MenuItem = main.findComponent("test", MenuItem, true);
    trace(button);
    Is this expected?
  • b

    bright-gpu-74537

    04/24/2020, 6:53 AM
    The problem here is the menu items are created dynamically, on demand as they parent menu are shown
  • b

    bright-gpu-74537

    04/24/2020, 6:54 AM
    i think there is a way around it though, ill have to have a look, is there any chance you could open an issue on haxeui-core repo on GH? Just so it doesnt get lost
  • m

    most-caravan-45834

    04/24/2020, 4:01 PM
    @User https://github.com/haxeui/haxeui-core/issues/348
  • b

    bright-gpu-74537

    04/24/2020, 4:15 PM
    cool - thanks
  • b

    bright-gpu-74537

    04/24/2020, 4:16 PM
    what are you actually trying to do with the menu item? I mean, why do you want to "find" it?
  • b

    bright-gpu-74537

    04/24/2020, 4:16 PM
    > I can't find another another way of adding actions to MenuItens by code.
  • b

    bright-gpu-74537

    04/24/2020, 4:16 PM
    what does that mean?
  • m

    most-caravan-45834

    04/24/2020, 4:32 PM
    I just wanted to add an action for when it's clicked, and since the only "documentation" I found was this https://github.com/haxeui/haxeui-templates/blob/master/flash-develop/%24(BaseDir)/Projects/550%20HaxeUI%20-%20OpenFL%20Project/src/%24(PackagePath)/Main.hx.template
  • b

    bright-gpu-74537

    04/24/2020, 4:33 PM
    gotcha... so menu behave a little differently in the sense that you dont add listeners to individual items, but rather add a listener to the menu
  • b

    bright-gpu-74537

    04/24/2020, 4:34 PM
    let me see if i can find an example
  • b

    bright-gpu-74537

    04/24/2020, 4:36 PM
    http://haxeui.org/builder/?tluste
  • b

    bright-gpu-74537

    04/24/2020, 4:36 PM
    you dont have to use xml ofc, just use
    .onMenuSelected
  • m

    most-caravan-45834

    04/24/2020, 4:43 PM
    Got it, thanks a lot Ian!
  • m

    most-caravan-45834

    04/24/2020, 4:44 PM
    I know there's a lot of documentation to come forth, this ended up not even being an issue. Thanks for the help
  • b

    bright-gpu-74537

    04/24/2020, 4:45 PM
    no probs... leave the ticket open though as it would be nice to be able to use findComponent with menus, like if you wanted to change the text of a menu item or something like that
  • m

    most-caravan-45834

    04/24/2020, 4:47 PM
    sure
  • m

    most-caravan-45834

    04/24/2020, 9:05 PM
    @User Seems like I can't find Menus as well, even though they are visible all the time. Do you think it's possible do populate a Menu with MenuItems in runtime?
  • b

    bright-gpu-74537

    04/24/2020, 9:07 PM
    hmmmm... yeah, thats a pretty good point... you mean a sub-menu i guess? I think the same "restrictions" apply (for now)
  • b

    bright-gpu-74537

    04/24/2020, 9:07 PM
    (they arent really restrictions, im sure something can be done about it, as the menu, in essence, does exist, its just not initialised, etc)
  • m

    most-caravan-45834

    04/24/2020, 9:07 PM
    Copy code
    xml
    <vbox width="100%">
        <menubar id="menu-bar" width="100%">
            <menu text="File">
                <menuitem id="new" text="New" />
                <menuitem id="export-png" text="Export PNG" />
                <menuitem id="config-scripts-path" text="Configure Scripts Path" />
                <menuitem id="quit" text="Quit" />
            </menu>
            <menu id="tools" text="Tools"></menu>
        </menubar>
    </vbox>
    Like inserting menuItems in tools
  • m

    most-caravan-45834

    04/24/2020, 9:08 PM
    I see... Well no problem, I'll work around that for now
  • b

    bright-gpu-74537

    04/24/2020, 9:08 PM
    hmmmpppff... yeah, same issue.... those menus wont exist until you "show" them...
  • b

    bright-gpu-74537

    04/24/2020, 9:08 PM
    menu items i could live with, menus is a little more importat
1...201202203...1687Latest