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

    bright-gpu-74537

    02/20/2020, 7:39 PM
    hahaha... yeah, docs are very thin on the ground... for sure
  • b

    bright-gpu-74537

    02/20/2020, 7:39 PM
    ill get round to it... though im fairly sure ive been saying that since haxeui v1 :/
  • b

    bored-sandwich-20283

    02/20/2020, 7:40 PM
    😆
  • n

    nutritious-boots-87264

    02/21/2020, 1:36 PM
    Are there any tricks for findComponent to work on menu items bellow menubar? Also why is code generated by
    build(haxe.ui.macros.ComponentMacros.build())
    using findComponent when initializing variables based on id from .xml file instead of assigning the variable directly?
  • b

    bright-gpu-74537

    02/21/2020, 1:45 PM
    i think with menu items in sub menu items its problematic because they dont exist until you open the menu
  • b

    bright-gpu-74537

    02/21/2020, 1:46 PM
    as for findComponent, no reason really, could just as easily go "this.myVar = c4;" or whatever the generated var name would be, ill take a look...
  • b

    bright-gpu-74537

    02/21/2020, 1:46 PM
    what are you trying to do with the menu that would mean you would want it to work with findComponent?
  • b

    bright-gpu-74537

    02/21/2020, 1:49 PM
    actually, you can override the findComponent, its just never done for menus (but is for tabviews)... so i guess that would be the place to add that, would be be good to know what you are trying to achieve with menu and findComponent
  • n

    nutritious-boots-87264

    02/21/2020, 2:06 PM
    Most of the menu items are fixed so I define them using .xml, but there are some submenus which I want to generate using code. To add the generated menu items in correct place I need to access the item with correct id.
  • n

    nutritious-boots-87264

    02/21/2020, 2:06 PM
    I don't want to use findComponent directly but that's what the generated code is using.
  • n

    nutritious-boots-87264

    02/21/2020, 2:13 PM
    Ok, will try modifying the macro so that it assigns directly and test if it solves my problem with menu items being inaccessible .
  • b

    bright-gpu-74537

    02/21/2020, 2:33 PM
    hmmm, good use case, so you essentially want to get a sub menu n-levels deep and add some dynamic items to it?
  • n

    nutritious-boots-87264

    02/21/2020, 2:50 PM
    yes
  • b

    bright-gpu-74537

    02/21/2020, 2:56 PM
    right... its a valid use case, and a pretty common one i would think - one that isnt so easy to do with the current way menus work
  • b

    bright-gpu-74537

    02/21/2020, 2:57 PM
    so something will have to change, i think both way are valid too, so the macro not using findComponent may be used, but also, findComponent should also be able to work with menus
  • n

    nutritious-boots-87264

    02/21/2020, 2:59 PM
    Got the variable initialization without findComponent working
  • n

    nutritious-boots-87264

    02/21/2020, 3:00 PM
    There was a bug in temporary variable name assignment and I have no Idea how it avoided breaking completely before
  • b

    bright-gpu-74537

    02/21/2020, 3:00 PM
    oh yeah??
  • n

    nutritious-boots-87264

    02/21/2020, 3:01 PM
    In some cases the generated variables (named c0, c1, c2) could have identical names
  • b

    bright-gpu-74537

    02/21/2020, 3:01 PM
    😮
  • n

    nutritious-boots-87264

    02/21/2020, 3:02 PM
    But something was making them unique by appending by turning c3, c3, c3 into c3, c31, c32
  • b

    bright-gpu-74537

    02/21/2020, 3:02 PM
    jeez...
  • n

    nutritious-boots-87264

    02/21/2020, 3:02 PM
    Could it be the compiler trying to fix things?
  • b

    bright-gpu-74537

    02/21/2020, 3:03 PM
    no idea... sounds doubtful... maybe just lucky accident they didnt clash
  • n

    nutritious-boots-87264

    02/21/2020, 3:03 PM
    Still, I am surprised that it didn't go wrong when setting parent
  • b

    bright-gpu-74537

    02/21/2020, 3:03 PM
    any chance you could PR your changes? They sound interesting / important / better
  • n

    nutritious-boots-87264

    02/21/2020, 3:04 PM
    Definitely
  • b

    bright-gpu-74537

    02/21/2020, 3:04 PM
    thanks man!
  • b

    bright-gpu-74537

    02/21/2020, 4:55 PM
    thanks @User - merged! As i mentioned, im still going to get menu working with findComponent for runtime
  • b

    bright-gpu-74537

    02/21/2020, 4:56 PM
    main.findComponent(MenuBar).findComponent("someSubMenu10LevelsDown").addComponent(new MenuItem())
1...182183184...1687Latest