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

    refined-greece-48002

    02/28/2023, 11:25 PM
    For the most part it's easy enough to get it to do things, but often when I've had a problem and shown code, the cause of the problem is that you're not supposed to do it like that
  • r

    refined-greece-48002

    02/28/2023, 11:25 PM
    So definitely having a bunch of "how this is intended to be used" things would be handy
  • p

    purple-businessperson-14467

    03/01/2023, 1:27 AM
    I have this @:bind(sourcetxt, KeyboardEvent.KEY_UP) function updatetxet1(_){ destinationtxt.text=sourcetxt.text; } If sourcetxt is dynamically added how can I do this. I always use the bind meta. Should I just add a getter/setter on dynamic field?
  • b

    billowy-waiter-28954

    03/01/2023, 7:59 AM
    What behavior?
  • b

    bright-gpu-74537

    03/01/2023, 8:10 AM
    you cant use bind meta if the component is added at runtime, bind builds up code at compile time, so the component will need to be known then
  • b

    bright-gpu-74537

    03/01/2023, 8:26 AM
    i think the general question was: how to remove (and optionally destroy) ceramic "things" (visuals i think)...
    App.app.scenes.main.remove(component.visual);
    doesnt seem to do anything (visually) - but NotBilly knows his backend better than i do ofc 🙂
  • b

    billowy-waiter-28954

    03/01/2023, 8:30 AM
    Ah right, a visual with no parent is still visible
  • b

    billowy-waiter-28954

    03/01/2023, 8:30 AM
    Setting visual.active = false is the way to go
  • b

    billowy-waiter-28954

    03/01/2023, 8:31 AM
    (If you plan to reuse that visual later, otherwise just destroy())
  • b

    bright-gpu-74537

    03/01/2023, 8:31 AM
    cool - he did mention maybe that was the prop... and what about if you wanted to remove and destroy... like "i dont need this anymore"
  • b

    bright-gpu-74537

    03/01/2023, 8:31 AM
    ok, destroy, gotcha
  • b

    bright-gpu-74537

    03/01/2023, 8:32 AM
    out of curiosity, what does "remove" do then?
  • b

    billowy-waiter-28954

    03/01/2023, 8:32 AM
    It removes a visual from its parent, that’s it
  • b

    bright-gpu-74537

    03/01/2023, 8:32 AM
    gotcha... but still draws it?
  • b

    billowy-waiter-28954

    03/01/2023, 8:39 AM
    Yes
  • b

    billowy-waiter-28954

    03/01/2023, 8:40 AM
    I have been wondering about changing this behavior or not but that certainly would be a breaking change
  • b

    bright-gpu-74537

    03/01/2023, 8:50 AM
    maybe:
    function remove(x, deactivate:Bool = false)
    ?
  • b

    bright-gpu-74537

    03/01/2023, 8:50 AM
    ¯\_(ツ)_/¯
  • b

    bright-gpu-74537

    03/01/2023, 8:51 AM
    might just be me, but removing an item from a parent and it still rendering seems counter intuitive, remove (to me) kinda implies "remove from display" also
  • b

    bright-gpu-74537

    03/01/2023, 8:52 AM
    so maybe
    function remove(x, deactivate:Bool = true)
    - but as you say, breaking change
  • b

    billowy-waiter-28954

    03/01/2023, 8:55 AM
    This kind of api is not really ceramic-style
  • b

    billowy-waiter-28954

    03/01/2023, 8:55 AM
    And no that’s not the same thing
  • b

    billowy-waiter-28954

    03/01/2023, 8:55 AM
    Think about the DOM in html
  • b

    billowy-waiter-28954

    03/01/2023, 8:57 AM
    Oh well forget that my point is not even one
  • b

    bright-gpu-74537

    03/01/2023, 8:57 AM
    whats not ceramic style? Default params?
  • b

    billowy-waiter-28954

    03/01/2023, 8:58 AM
    Calling a method that change the state of the object
  • b

    bright-gpu-74537

    03/01/2023, 8:58 AM
    i guess with docs its not an issue, but personally, i would certainly be a little "huh?" when i removed a visual and it was still rendering, but im sure some docs on remove would clear it up easy enough
  • b

    bright-gpu-74537

    03/01/2023, 8:58 AM
    gotcha
  • b

    billowy-waiter-28954

    03/01/2023, 9:19 AM
    In general, I think it's more readable to have
    thing.active = true
    than a
    true
    argument that doesn't mean anything unless you already know the context, check the documentation of the
    remove()
    method etc...
  • b

    billowy-waiter-28954

    03/01/2023, 9:20 AM
    And regarding Ceramic, most settings on visuals and entities are vars/properties
1...155915601561...1687Latest