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

    fast-rain-20339

    07/02/2020, 11:35 AM
    I've run into infinite event loops a few times tonight, but this one is particularly strange
  • f

    fast-rain-20339

    07/02/2020, 11:36 AM
    So, hm, hard to explain
  • f

    fast-rain-20339

    07/02/2020, 11:36 AM
    I have a listview and I want to call into some of my systems when it changes
  • f

    fast-rain-20339

    07/02/2020, 11:36 AM
    Just tracing on UIEvent.CHANGE works
  • f

    fast-rain-20339

    07/02/2020, 11:37 AM
    but then calling my other code creates an infinite cycle, apparently, even though as far as I can tell that code is pretty ui independent
  • f

    fast-rain-20339

    07/02/2020, 11:37 AM
    Aha I shouldn't have posted here, you don't know how my systems are arranged lol
  • f

    fast-rain-20339

    07/02/2020, 11:40 AM
    Feels like potentially a bug maybe? I get this error as soon as the UI loads
  • f

    fast-rain-20339

    07/02/2020, 11:48 AM
    Okay so I think the loop is because I have
    editor
    in
    AssetBrowser
    , I call
    editor.setSelectedAsset
    which changes the (private) field
    editor.selectedAsset
    , as a field in
    editor
    has been changed, and
    AssetBrowser
    has the
    editor
    field,
    onChange
    is triggered and it loops. Whew.
  • f

    fast-rain-20339

    07/02/2020, 11:50 AM
    Bypassing
    setSelectedAsset
    and just changing the (now public) field directly causes the same issue, this feels buggy
  • b

    bright-gpu-74537

    07/02/2020, 12:01 PM
    any chance of a minimal test case? Hard to fully understand by just reading the above 🙂
  • f

    fast-rain-20339

    07/02/2020, 12:02 PM
    Ah yep I'll try and whip something together
  • f

    fast-rain-20339

    07/02/2020, 12:11 PM
    Arghhh the test case works 😆
  • b

    bright-gpu-74537

    07/02/2020, 12:13 PM
    haha... ofc! 😄
  • f

    fast-rain-20339

    07/02/2020, 12:20 PM
    "TEST" isn't printing when I hit the button... have I forgotten something basic for the testcase?
  • b

    bright-gpu-74537

    07/02/2020, 12:27 PM
    buttons dispatch click, not change
  • b

    bright-gpu-74537

    07/02/2020, 12:27 PM
    MouseEvent.CLICK
  • b

    bright-gpu-74537

    07/02/2020, 12:27 PM
    toggle buttons dispatch change though
  • f

    fast-rain-20339

    07/02/2020, 12:28 PM
    Ah, very unfortunate, the test case still works 😆
  • f

    fast-rain-20339

    07/02/2020, 12:28 PM
    Logs fine. Hmmm. Can't spot structural difference. There are differences, obviously - button instead of listview, organisation of classes, etc, but I thought I recreated cycle 🤔
  • f

    fast-rain-20339

    07/02/2020, 12:34 PM
    Aha, in my code if I use a button and
    CLICK
    the issue doesn't happen, I'm guessing now it's something
    CHANGE
    related
  • f

    fast-rain-20339

    07/02/2020, 12:34 PM
    I'll test with a checkbox
  • f

    fast-rain-20339

    07/02/2020, 12:35 PM
    That works 😠 Why won't this code break lol
  • b

    bright-gpu-74537

    07/02/2020, 12:57 PM
    i would try to recreate with listview
  • f

    fast-rain-20339

    07/02/2020, 12:57 PM
    Yeah, that's what I'm doing now 🙂
  • f

    fast-rain-20339

    07/02/2020, 1:10 PM
    Aha oh my gosh okay check this out for a finding! This is why I try to run far, far away from macros and other dark magic
  • b

    bright-gpu-74537

    07/02/2020, 1:17 PM
    weird... whats the macro there though?
  • f

    fast-rain-20339

    07/02/2020, 1:17 PM
    Wouldn't validation stuff all be macros?
  • b

    bright-gpu-74537

    07/02/2020, 1:17 PM
    and whats the error? I mean, how does that cause an invalidation loop?
  • f

    fast-rain-20339

    07/02/2020, 1:18 PM
    Same as before I think

    https://cdn.discordapp.com/attachments/565569107701923852/728213540208377856/unknown.pngâ–¾

  • b

    bright-gpu-74537

    07/02/2020, 1:18 PM
    the validation stuff is just haxe code
1...302303304...1687Latest