adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
531 stars 125 forks source link

Minigui: dialog function broken with master #363

Closed andre2007 closed 1 year ago

andre2007 commented 1 year ago

With "master" the dialog function is broken when a struct is passed. The struct is returned empty in delegate. It is still working with https://github.com/adamdruppe/arsd/blob/5a8f0a7448c300b6ef215c2c49abe1b1b93cbf7b/minigui.d.

void addFishSpecies()
{
    struct NewSpecies 
    {
        string EnterSpecies;
    }

    dialog((NewSpecies ns) {
        writeln(ns);
    });
} 
adamdruppe commented 1 year ago

ok ill look later. i prolly shouldn't have committed yet, im in the middle of a breaking change but i messed up the git process.

andre2007 commented 1 year ago

No problem. One thing I noticed, maybe you could position the dialog in the center of the screen, this would be great.

Another thing, but this is rather very low priority and matter of taste: I wonder whether a dialog window should be sizeable and should have the minimize and maximize windows buttons.

andre2007 commented 1 year ago

Sorry, I just found another issue :) While pressing the X windows button in the dialog window, the "onCancel" delegate is not called. (Here I enable the main window again, but it stays disabled, as the delegate is not called. It is called fine from the Cancel button")

adamdruppe commented 1 year ago

window positioning is supposed to be done by the operating system.... i might not have the right class/parent relationship there. since you don't pass a parent window that's probably part of the problem so i might have to extend the api. but once the OS knows the relationship it should be able to position it automatically.

and the close window is surely just an oversight on my part.

adamdruppe commented 1 year ago

Well github closed this automatically w/ the commit, btu the dialog position thing hasn't changed. PRetty sure the other two are fixed though, it should call that delegate now and......... yeah the content change event never triggered which is what the dialog box listens to to update the struct. that explains why my browser "find" suddenly stopped working too, golly.

thanks for the bug report, it ended up being simple but something i wouldn't have thought to check for some time without the prompting

andre2007 commented 1 year ago

Thank you Adam, it now works perfectly fine.