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

    clever-oil-61353

    05/18/2020, 4:28 AM
    @WillNa as i'm digging around, i believe " trace " is the key to solving this menubar issue i have. About to try a few things, wouldnt have been on my mind if you hadnt mentioned trace earlier.
  • c

    clever-oil-61353

    05/18/2020, 6:00 AM
    Trying to figure this out reminds me of the ex that drove me to drinkin'
  • c

    clever-oil-61353

    05/18/2020, 6:00 AM
    🙂
  • b

    bright-gpu-74537

    05/18/2020, 6:31 AM
    @User - the build is failing i think because of the GH actions rather than the actual code build failing - ill take a look at it
  • b

    bright-gpu-74537

    05/18/2020, 6:31 AM
    @User - what are you trying to do?
  • b

    bright-gpu-74537

    05/18/2020, 6:32 AM
    @User - i think ListView does have some special rules for native / composite in wxWidgets, as you want to be able to use item renderers but three is no native counterpart... do you have an example?
  • b

    bright-gpu-74537

    05/18/2020, 6:33 AM
    are you trying to open a dialog in response to a menu event?
  • c

    clever-oil-61353

    05/18/2020, 6:33 AM
    Trying to make the About, under the Help tab in Menubar..... bring up a dialog box for now, but want it to open and xml Dialog box
  • b

    bright-gpu-74537

    05/18/2020, 6:34 AM
    right... two secs
  • c

    clever-oil-61353

    05/18/2020, 6:34 AM
    alright
  • c

    clever-oil-61353

    05/18/2020, 6:34 AM
    its been a learning experience, i can say that.
  • c

    clever-oil-61353

    05/18/2020, 6:34 AM
    lol
  • b

    bright-gpu-74537

    05/18/2020, 6:35 AM
    it should be pretty straight forward, unless im missing something, im not sure how you would expected it to work
  • c

    clever-oil-61353

    05/18/2020, 6:35 AM
    sometimes i tend to over complicate things.
  • c

    clever-oil-61353

    05/18/2020, 6:36 AM
    it seemed like i was close or right on the verge of.... but just didnt hit that sweet spot of making it happen
  • b

    bright-gpu-74537

    05/18/2020, 6:41 AM
    so, my main looks like:
  • b

    bright-gpu-74537

    05/18/2020, 6:41 AM
    Copy code
    xml
    <vbox width="100%">
        <menubar width="100%">
            <menu text="Menu">
                <menu-item text="Show Dialog" id="showDialog" />
            </menu>
        </menubar>
    </vbox>
  • b

    bright-gpu-74537

    05/18/2020, 6:42 AM
    the main class looks like (not ive just used the defaul generated main.hx, but in reality i would have created a MainView custom component):
  • b

    bright-gpu-74537

    05/18/2020, 6:42 AM
    Copy code
    haxe
    class Main {
        public static function main() {
            var app = new HaxeUIApp();
            app.ready(function() {
                var main:Component = ComponentMacros.buildComponent("assets/main.xml");
                app.addComponent(main);
    
                var menuBar = main.findComponent(MenuBar);
                menuBar.onMenuSelected = function(e:MenuEvent) {
                    switch (e.menuItem.id) {
                        case "showDialog":
                            var dialog = new MyDialog();
                            dialog.onDialogClosed = function(e:DialogEvent) {
                                trace("you clicked: " + e.button);
                            }
                            dialog.show();
                    }
                }
                
                app.start();
            });
        }
    }
  • b

    bright-gpu-74537

    05/18/2020, 6:43 AM
    (if i was using a MainView custom component then i could have just used
    @:bind(mainMenu, MenuEvent.MENU_SELECTED)
    )
  • b

    bright-gpu-74537

    05/18/2020, 6:43 AM
    and the MyDialog just looks like this:
  • b

    bright-gpu-74537

    05/18/2020, 6:43 AM
    Copy code
    haxe
    @:build(haxe.ui.macros.ComponentMacros.build("assets/mydialog.xml"))
    class MyDialog extends Dialog {
        public function new() {
            super();
            buttons = DialogButton.SAVE | DialogButton.CANCEL | DialogButton.YES;
            title = "My super dialog";
        }
        
    }
  • b

    bright-gpu-74537

    05/18/2020, 6:44 AM
    Copy code
    xml
    <vbox>
        <image resource="haxeui-core/styles/default/haxeui.png" />
    </vbox>
  • c

    clever-oil-61353

    05/18/2020, 6:44 AM
    earlier i was trying to use @:build like i had seen in some examples of yours, but.... i kept getting errors for some reason.
  • b

    bright-gpu-74537

    05/18/2020, 6:45 AM
    maybe the path to your xml is wrong?
  • b

    bright-gpu-74537

    05/18/2020, 6:45 AM
    thats the whole project
  • c

    clever-oil-61353

    05/18/2020, 6:45 AM
    a few hours ago it was .... could have kicked myself for that
  • c

    clever-oil-61353

    05/18/2020, 6:48 AM
    thank you, i'll try that... and I believe WillNa was trying to update changes to ListView.
  • c

    clever-oil-61353

    05/18/2020, 6:49 AM
    i may have overlooked it, but i couldnt find an onItemChange...... only an onChange
  • c

    clever-oil-61353

    05/18/2020, 6:50 AM
    for what Will was doing
1...216217218...1687Latest