frang75 / nappgui_src

SDK for building cross-platform desktop apps in ANSI-C
https://www.nappgui.com
MIT License
442 stars 43 forks source link

Cannot clear PopUp, popup_clear(..) not working on Mac #123

Open SamSandq opened 1 month ago

SamSandq commented 1 month ago

I needed to have one popup button clear and re-populate another popup button, and discovered that the popup_clear(...) does not work on Mac.

Checking the code, it's not implemented. Correct by inserting the following code in ospopup.m : ospopup_elem, at line 180:

    else if (op == ekCTRL_OP_DEL) {
        [((OSXPopUp*)popup) removeItemAtIndex: idx];
    }

This seems to do the trick, but there might be other ramifications as well.