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

    bright-gpu-74537

    06/03/2020, 9:57 PM
    you have a few options, you can se the width in the constructor, or, you can set the width in the instance either in xml or code
  • b

    bright-gpu-74537

    06/03/2020, 9:57 PM
    so would be:
  • b

    bright-gpu-74537

    06/03/2020, 9:58 PM
    Copy code
    <hbox width="50%">
        <vbox width="100%">
            <button />
        </vbox>
    </hbox>
  • b

    bright-gpu-74537

    06/03/2020, 9:58 PM
    > it's not 0
  • b

    bright-gpu-74537

    06/03/2020, 9:58 PM
    well, it is 0
  • b

    bright-gpu-74537

    06/03/2020, 9:58 PM
    and then the vbox is 100% of 0
  • u

    user

    06/03/2020, 9:59 PM
    it's not 0, else it wouldn't work at all if you didn't use width/height at all
  • u

    user

    06/03/2020, 9:59 PM
    i mean
  • u

    user

    06/03/2020, 9:59 PM
    Copy code
    <hbox>
        <vbox>
            <button />
        </vbox>
    </hbox>
  • u

    user

    06/03/2020, 9:59 PM
    is not
  • u

    user

    06/03/2020, 10:00 PM
    Copy code
    <hbox width=0>
        <vbox width=0>
            <button  width=0/>
        </vbox>
    </hbox>
  • b

    bright-gpu-74537

    06/03/2020, 10:00 PM
    thats because the default is "autosized" which means "size of the children"
  • b

    bright-gpu-74537

    06/03/2020, 10:00 PM
    but the child is 100% so it has no size
  • b

    bright-gpu-74537

    06/03/2020, 10:01 PM
    the % means "% of the parent" and if no w / h are specified it means "size of the children" (based on layout)
  • b

    bright-gpu-74537

    06/03/2020, 10:02 PM
    so effectively you cant have a % if the parent doesnt have one (% or px) because it will try and size based on children
  • b

    bright-gpu-74537

    06/03/2020, 10:03 PM
    its not that stright forward in reality, eg:
  • b

    bright-gpu-74537

    06/03/2020, 10:03 PM
    Copy code
    <vbox>
        <button width="200" />
        <button width="100%" />
    </vbox>
  • b

    bright-gpu-74537

    06/03/2020, 10:04 PM
    the second button will be 200 also, as the autosized parent is 200, which 100% makes sense now
  • u

    user

    06/03/2020, 10:07 PM
    🤪
  • u

    user

    06/03/2020, 10:07 PM
    what if you use
  • u

    user

    06/03/2020, 10:07 PM
    Copy code
    <vbox>
        <button width="100%" />
        <button width="200" />
    </vbox>
  • u

    user

    06/03/2020, 10:08 PM
    ?
  • u

    user

    06/03/2020, 10:08 PM
    200 too ?
  • b

    bright-gpu-74537

    06/03/2020, 10:08 PM
    i feel like it would work yeah
  • b

    bright-gpu-74537

    06/03/2020, 10:10 PM
    http://haxeui.org/builder/?pxwazr
  • b

    bright-gpu-74537

    06/03/2020, 10:10 PM
    yeah, its fine
  • u

    user

    06/03/2020, 10:12 PM
    ok, another question are show(), hide() the only way to play with visibility ?
  • u

    user

    06/03/2020, 10:12 PM
    it makes it hard to do something like xx.visible = (value>5)
  • b

    bright-gpu-74537

    06/03/2020, 10:13 PM
    yeah, there is hidden too
  • b

    bright-gpu-74537

    06/03/2020, 10:13 PM
    originally it was because it clashed with "visible" in openfl but actually, i think thats not an issue anymore
1...258259260...1687Latest