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

    bright-gpu-74537

    04/24/2020, 9:09 PM
    ill take a look at it
  • m

    most-caravan-45834

    04/24/2020, 9:09 PM
    > menu items i could live with, menus is a little more importat @User I thought the exact same
  • b

    bright-gpu-74537

    04/24/2020, 9:31 PM
    @User - those should all be fixed now... you should be able to get a menu, or a menu item, from any menu or sub menu
  • b

    bright-gpu-74537

    04/24/2020, 9:31 PM
    (you'll need git haxeui-core)
  • b

    bright-gpu-74537

    04/24/2020, 9:32 PM
    eg:
  • b

    bright-gpu-74537

    04/24/2020, 9:32 PM
    Copy code
    haxe
                var menuBar = main.findComponent("menu-bar", MenuBar);
                var tools = menuBar.findComponent("tools", Menu);
                var nm = new MenuItem();
                nm.text = "bob";
                tools.addComponent(nm);
                
                var sub = tools.findComponent("sub", Menu);
                var nm = new MenuItem();
                nm.text = "bob2";
                sub.addComponent(nm);
                
                menuBar.findComponent("sub", Menu);
                var nm = new MenuItem();
                nm.text = "bob3";
                sub.addComponent(nm);
                
                var subitem = menuBar.findComponent("subitem", MenuItem);
                subitem.text = "bob4";
  • b

    bright-gpu-74537

    04/24/2020, 9:32 PM
    Copy code
    xml
        <menubar id="menu-bar" width="100%">
            <menu text="File">
                <menuitem id="new" text="New" />
                <menuitem id="export-png" text="Export PNG" />
                <menuitem id="config-scripts-path" text="Configure Scripts Path" />
                <menuitem id="quit" text="Quit" />
            </menu>
            <menu id="tools" text="Tools">
                <menu id="sub" text="Sub">
                    <menu-item id="subitem" text="Sub 1" />
                </menu>            
            </menu>
        </menubar>
  • b

    bright-gpu-74537

    04/24/2020, 9:40 PM
    now this type of stuff works too:
  • b

    bright-gpu-74537

    04/24/2020, 9:40 PM
    Copy code
    haxe
    main.findComponent("subitem", MenuItem).text = "From root";
  • b

    bright-gpu-74537

    04/24/2020, 9:41 PM
    ie, setting an menu item text from anywhere in the hierarchy ("main" in this example), presumably this means binding might work here also
  • b

    bright-gpu-74537

    04/24/2020, 9:45 PM
    yup... nice:
  • b

    bright-gpu-74537

    04/24/2020, 9:45 PM
    Copy code
    haxe
    @:build(haxe.ui.macros.ComponentMacros.build("assets/main.xml"))
    class MainView extends Box {
        @:bind(subitem.text) public var subItemText:String;
        
        public function new() {
            super();
            subItemText = "bound";
        }
    }
  • m

    most-caravan-45834

    04/24/2020, 9:48 PM
    Thanks a lot!
  • m

    most-caravan-45834

    04/24/2020, 9:48 PM
    Is this in the development branch of haxeui-core?
  • b

    bright-gpu-74537

    04/24/2020, 9:48 PM
    yeah, git master
  • m

    most-caravan-45834

    04/24/2020, 9:48 PM
    perfect
  • b

    bright-gpu-74537

    04/24/2020, 9:49 PM
    worth doing, as its a gotcha, esp for menus (rather than menu items)... and, to be fair, there is already a facility to handle these types of things (where children logically arent children on the display tree)
  • m

    most-caravan-45834

    04/24/2020, 10:31 PM
    Is there a color picker in the making?
  • b

    bright-gpu-74537

    04/24/2020, 10:37 PM
    there isnt... open to PRs 😉
  • b

    bright-gpu-74537

    04/24/2020, 10:37 PM
    the main issue is getting things cross framework
  • b

    bright-gpu-74537

    04/24/2020, 10:37 PM
    a colour picker with 16 colours would be pretty simple
  • b

    bright-gpu-74537

    04/24/2020, 10:37 PM
    or 32, or whatever
  • b

    bright-gpu-74537

    04/24/2020, 10:38 PM
    that is certainly much harder
  • l

    little-kite-81669

    04/25/2020, 8:11 AM
    Hi, I'm getting this UI problem on haxeui-kha. The image shows what happens to a side panel when I resize the window. I'm on MacOS and this might be related to how the library (or the backend) deals with the Retina Display resolution
  • l

    little-kite-81669

    04/25/2020, 8:13 AM
    I've checked it now and Screen.instance.isRetina is false. I'm running the test project on Kha:HTML5
  • l

    little-kite-81669

    04/25/2020, 8:15 AM
    is it a known problem?
  • b

    bright-gpu-74537

    04/25/2020, 9:53 AM
    that looks weird... does it just flicker like that even when not interacting with the UI?
  • b

    bright-gpu-74537

    04/25/2020, 9:54 AM
    dont think its anything to do with retina... try
    Toolkit.autoScale=false
    before you use
    Toolkit.init()
    but i dont think it will make a difference
  • l

    little-kite-81669

    04/25/2020, 10:32 AM
    I've tried with Toolkit.autoScale=false but it doesn't solve the problem. It happens only when resizing the window, when I stop the resizing the UI ends in one of those weird states you see in the gif, it doens't keep moving
  • l

    little-kite-81669

    04/25/2020, 10:32 AM
    so, during normal use of the components they are just weirdly drawn but everything works
1...202203204...1687Latest