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

    bright-gpu-74537

    06/03/2020, 9:39 PM
    so, button has "@:behaviour(TextBehaviour) var text:String"
  • b

    bright-gpu-74537

    06/03/2020, 9:39 PM
    and what this reall does is:
  • b

    bright-gpu-74537

    06/03/2020, 9:39 PM
    private function set_text(value) behaviours.set("text", value)
  • b

    bright-gpu-74537

    06/03/2020, 9:40 PM
    and then finally in the native backends (or any backend really) you can replace that behaviour (which defaults to TextBehaviour) with anything you want
  • b

    bright-gpu-74537

    06/03/2020, 9:40 PM
    so in the case of button:
  • b

    bright-gpu-74537

    06/03/2020, 9:41 PM
    Copy code
    haxe
        <component id="haxe.ui.components.Button" class="hx.widgets.Button" allowChildren="false">
            <behaviour id="text" class="haxe.ui.backend.hxwidgets.behaviours.ControlLabel" />
            <behaviour id="value" class="haxe.ui.backend.hxwidgets.behaviours.ControlLabel" />
            <behaviour id="icon" class="haxe.ui.backend.hxwidgets.behaviours.ControlBitmap" />
            <behaviour id="disabled" class="haxe.ui.backend.hxwidgets.behaviours.ControlDisable" />
            <size class="haxe.ui.backend.hxwidgets.size.BestSize" includePadding="false" />
            <handler class="haxe.ui.backend.hxwidgets.handlers.ButtonHandler" />
        </component>
  • u

    user

    06/03/2020, 9:41 PM
    wow
  • b

    bright-gpu-74537

    06/03/2020, 9:41 PM
    only behaviour and size are understood by haxeui-core, the handler is just for haxeui-hxwidgets
  • b

    bright-gpu-74537

    06/03/2020, 9:41 PM
    yeah, bit of a long explanation! 😄
  • u

    user

    06/03/2020, 9:42 PM
    it gave me the time to write my first try
  • u

    user

    06/03/2020, 9:42 PM
    failure
  • u

    user

    06/03/2020, 9:42 PM
    but I wonder if it's because the @:build doesn"t work for a component...
  • b

    bright-gpu-74537

    06/03/2020, 9:43 PM
    can you paste the code if its just test / small code
  • u

    user

    06/03/2020, 9:44 PM
    the components aren't even visible on screen
  • u

    user

    06/03/2020, 9:44 PM
    so I assume I'm fighting with width/height again
  • b

    bright-gpu-74537

    06/03/2020, 9:44 PM
    can you paste the custom component?
  • u

    user

    06/03/2020, 9:44 PM
    .error { font-size: 14px; color: red; font-style: italic; } .hint { font-size: 14px; font-style: italic; }
  • u

    user

    06/03/2020, 9:45 PM
    (i removed every width/height value to debug)
  • c

    clever-oil-61353

    06/03/2020, 9:45 PM
    i missed 154 messages wow
  • b

    bright-gpu-74537

    06/03/2020, 9:45 PM
    🙂
  • b

    bright-gpu-74537

    06/03/2020, 9:45 PM
    looks fine to me, let me try it
  • u

    user

    06/03/2020, 9:46 PM
    @User you missed the guide about behaviors 😉
  • c

    clever-oil-61353

    06/03/2020, 9:46 PM
    lol
  • u

    user

    06/03/2020, 9:46 PM
    it should be copy/pasted on https://github.com/haxeui/haxeui-guides
  • b

    bright-gpu-74537

    06/03/2020, 9:46 PM
    a rather long winded, fragmented guide 😄
  • c

    clever-oil-61353

    06/03/2020, 9:46 PM
    i'll be scrolling for it later lol
  • u

    user

    06/03/2020, 9:46 PM
    ok it works with no width/height
  • b

    bright-gpu-74537

    06/03/2020, 9:47 PM
    yeah, i should probably write a little guide about it, to be honest, for the most part you dont really need to touch behaviours unless you are introducing a new native component type
  • u

    user

    06/03/2020, 9:48 PM
    an all in one component with button is common
  • u

    user

    06/03/2020, 9:48 PM
    "composite component" sorry
1...256257258...1687Latest