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

    icy-zebra-52882

    02/09/2023, 1:08 PM
    Copy code
    src/MainView.hx:95: reactionDropdown selected index: -1
    src/MainView.hx:98: reactionDropdown selected index: -1
    trace of before and after changing
  • b

    bright-gpu-74537

    02/09/2023, 1:09 PM
    might be an issue with the validation sequence, what happens if you just do (for testing):
    reactionDropdown.selectedIndex = 1
  • i

    icy-zebra-52882

    02/09/2023, 1:09 PM
    I was doing that before (setting it to 0) and had the same problem
  • b

    bright-gpu-74537

    02/09/2023, 1:09 PM
    sounds like a bug then
  • i

    icy-zebra-52882

    02/09/2023, 1:10 PM
    should it also be calling any bound
    onChange
    after that?
  • b

    bright-gpu-74537

    02/09/2023, 1:10 PM
    yup
  • i

    icy-zebra-52882

    02/09/2023, 1:11 PM
    ah that makes it easier then
  • b

    bright-gpu-74537

    02/09/2023, 1:11 PM
    can you do me a tiny, but totally unrelated, favour: in
    haxe.ui.backend.hxwidgets.size.NotebookSize.hx
    can you remove the windows check on line 14 (and 16) so it just always does
    h += 4
  • b

    bright-gpu-74537

    02/09/2023, 1:11 PM
    and send me a screenshot like the above
  • b

    bright-gpu-74537

    02/09/2023, 1:13 PM
    interesting, thanks, i thought it was a windows only thing, seems its a wx thing
  • i

    icy-zebra-52882

    02/09/2023, 1:14 PM
    the bottom padding of notebook/tabview?
  • b

    bright-gpu-74537

    02/09/2023, 1:14 PM
    yeah, wx "best size" is 4px off
  • b

    bright-gpu-74537

    02/09/2023, 1:15 PM
    you can see that now your text input looks better, ie, the page has uniform padding all round
  • i

    icy-zebra-52882

    02/09/2023, 1:15 PM
    ah yeah it does look nicer
  • b

    bright-gpu-74537

    02/09/2023, 1:16 PM
    alright, that 4px fix is in now... so you can revert your local changes, ill try and repro the dropdown issue
  • m

    magnificent-fireman-89458

    02/09/2023, 1:19 PM
    hi
  • b

    bright-gpu-74537

    02/09/2023, 1:21 PM
    i cant repro:
  • b

    bright-gpu-74537

    02/09/2023, 1:21 PM
    Copy code
    xml
        <dropdown id="dd1" width="100">
            <data>
                <item text="Item A" />
                <item text="Item B" />
                <item text="Item C" />
            </data>
        </dropdown>
        <dropdown id="dd2" width="100" />
  • b

    bright-gpu-74537

    02/09/2023, 1:22 PM
    Copy code
    haxe
            dd1.onChange = (_) -> {
                var selectedText = dd1.selectedItem.text;
                var ds = new ArrayDataSource<String>();
                ds.add(selectedText + " - 1");
                ds.add(selectedText + " - 2");
                ds.add(selectedText + " - 3");
                ds.add(selectedText + " - 4");
                ds.add(selectedText + " - 5");
                dd2.dataSource = ds;
                dd2.selectedIndex = 2;
            }
  • b

    bright-gpu-74537

    02/09/2023, 1:22 PM
    am i doing something differently to you @icy-zebra-52882 ?
  • i

    icy-zebra-52882

    02/09/2023, 1:22 PM
    doesn't seem like it, I'm adding datasource like that and then setting selectedIndex
  • i

    icy-zebra-52882

    02/09/2023, 1:23 PM
    possibly it's different behaviour on GTK or wxGTK?
  • b

    bright-gpu-74537

    02/09/2023, 1:23 PM
    seems odd if that is the case
  • b

    bright-gpu-74537

    02/09/2023, 1:23 PM
    does the code above work for you?
  • i

    icy-zebra-52882

    02/09/2023, 1:25 PM
    Copy code
    hx
    var source = new ArrayDataSource<String>();
    trace("Character datasource data:");
    for (react in npc.reactions) {
        trace(react.id);
        source.add('${react.tag} (${react.id})');
    }
    reactionDropdown.dataSource = source;
    // trace('Reaction dropdown data:');
    // for (i in 0...reactionDropdown.dataSource.size) {
    //     trace(reactionDropdown.dataSource.get(i));
    // }
    
    reactionDropdown.selectedIndex = 0;
    is my current code
  • i

    icy-zebra-52882

    02/09/2023, 1:25 PM
    functionally it looks identical
  • b

    bright-gpu-74537

    02/09/2023, 1:26 PM
    defo looks identical
  • c

    cuddly-finland-31869

    02/09/2023, 1:27 PM
    Sorry if this has been asked before, not able to find it anywhere by search, or in the docs. Basic problem, using the html5 backend, I have a component which builds a raw DOM child element, and I need to update the class property of that element. The child was originally added with
    this.element.append(child)
    , I thought keeping the child around in a class member field would allow me to mutate it later by
    this._child.className = "foobar"
    . However this doesn't update the DOM, but printing the child I can see that class was updated. Are all interactions with the DOM immutable (by value / copy)? In that case, how would I mutate elements? Would I need to remove that element, and append the modified child again? If so I don't see any API to remove children.
  • b

    bright-gpu-74537

    02/09/2023, 1:29 PM
    certainly, by description, sounds totally fine... if the DOMElement is there (and added) as it appears to be, then you should be able to change that like you any other node
  • b

    bright-gpu-74537

    02/09/2023, 1:30 PM
    does the _child (or child) have a size? Maybe thats the issue
1...148314841485...1687Latest