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

    fast-rain-20339

    07/30/2020, 7:40 AM
    Soz 😬
  • b

    bright-gpu-74537

    07/30/2020, 7:41 AM
    ok, then no, you probably dont need to use ready event, still strange that the behviour is different between hxcpp and neko, so ill still check it out
  • k

    kind-policeman-40412

    07/30/2020, 7:42 AM
    I'm still curious what exactly onReady is supposed to be used for? what it tells us?
  • b

    bright-gpu-74537

    07/30/2020, 7:43 AM
    honestly, its mainly used internally, it essentially means "component is done initialising, its added to "stage" (for openfl), and its had at least one invalidation"
  • k

    kind-policeman-40412

    07/30/2020, 7:44 AM
    oh I see. that was the first thing I assumed )
  • b

    bright-gpu-74537

    07/30/2020, 7:44 AM
    yeah, your assumption was correct, but generally you dont need to use it
  • b

    bright-gpu-74537

    07/30/2020, 7:44 AM
    there are special cases
  • k

    kind-policeman-40412

    07/30/2020, 7:45 AM
    ok thanks
  • b

    bright-gpu-74537

    07/30/2020, 7:45 AM
    np 👍
  • k

    kind-policeman-40412

    07/30/2020, 7:51 AM
    oh I think I found the problem though still not sure why it happens... I used a local var for storing result of buildComponent and everything start working even the onClick event, even for neko target.
  • k

    kind-policeman-40412

    07/30/2020, 7:51 AM
    at first I used class property ui:Dynamic to store the built component
  • b

    bright-gpu-74537

    07/30/2020, 7:52 AM
    what if you used a class prop ui:Component ?
  • k

    kind-policeman-40412

    07/30/2020, 7:52 AM
    hmm I haven't tried. letme check
  • k

    kind-policeman-40412

    07/30/2020, 7:53 AM
    it works
  • k

    kind-policeman-40412

    07/30/2020, 7:54 AM
    I was not sure what type to use to store because docs does not mention ))
  • b

    bright-gpu-74537

    07/30/2020, 7:54 AM
    out of interest, does "ui:Any" also work?
  • k

    kind-policeman-40412

    07/30/2020, 7:54 AM
    no, tried it first. does not compile
  • b

    bright-gpu-74537

    07/30/2020, 7:55 AM
    ok, interesting...
  • b

    bright-gpu-74537

    07/30/2020, 7:55 AM
    ill have to try it
  • k

    kind-policeman-40412

    07/30/2020, 7:55 AM
    i mean did not compiled when i tried to access ui.joinButton
  • k

    kind-policeman-40412

    07/30/2020, 7:55 AM
    might work now when i use findComponent
  • k

    kind-policeman-40412

    07/30/2020, 7:56 AM
    actually all my code is working now as I wanted in my first question here.
  • k

    kind-policeman-40412

    07/30/2020, 7:57 AM
    this just works as I like to
  • b

    bright-gpu-74537

    07/30/2020, 7:57 AM
    ok, great... so, note to self: dont use Dynamic for the UI as a result of buildComponent
  • k

    kind-policeman-40412

    07/30/2020, 7:58 AM
    looks like Dynamic is driving your macros crazy )
  • b

    bright-gpu-74537

    07/30/2020, 7:58 AM
    i think its because the macro returns
    Expr
  • b

    bright-gpu-74537

    07/30/2020, 7:58 AM
    and that "works" with Dynamic
  • k

    kind-policeman-40412

    07/30/2020, 7:59 AM
    yeah I read the code of buildComponent so I was not sure what to do with Expr ))
  • b

    brainy-machine-50829

    07/30/2020, 7:59 AM
    What's the issue?
  • b

    bright-gpu-74537

    07/30/2020, 7:59 AM
    Copy code
    haxe
        macro public static function buildComponent(filePath:String, params:Expr = null):Expr {
            var builder = new CodeBuilder();
            buildComponentFromFile(builder, filePath, null, MacroHelpers.exprToMap(params), "rootComponent");
            builder.add(macro rootComponent);
            return builder.expr;
        }
1...328329330...1687Latest