pthom / imgui_bundle

Dear ImGui Bundle: an extensive set of Ready-to-use widgets and libraries, based on ImGui. Start your first app in 5 lines of code, or less. Whether you prefer Python or C++, this pack has your back!
https://pthom.github.io/imgui_bundle/
MIT License
590 stars 62 forks source link

Possibility to add imgui notification library ImGuiNotify #187

Closed kuchi closed 3 months ago

kuchi commented 3 months ago

I was wondering if you might have interest to add ImGuiNotify to imgui_bundle. I would be happy to sponsor the addition financially if you think this would be an appropriate library to add to imgui_bundle and you don't see long term issues including this.

And as always, thanks so much for developing imgui_bundle. It is a wonderful.

pthom commented 3 months ago

Hello Anthony,

Long time no talk. It's nice to hear from you!

I had a look at the library you mentioned: it only works under Windows and Linux, but not Mac OS, which is an issue for me, because I want the bundle to work on all platforms. Also, the code quality would need to be improved, before I can integrate it. This would require that I post quite a few pull requests to this library before being able to integrate it.

However, there might be a much easier solution. ImGui bundle already integrates a library named Portable File Dialogs, which provides notifications and message boxes which are native to the system (i.e. the notifications would be provided by Windows in your case, and they would show in the notification center).

Here is a sample usage:

from imgui_bundle import imgui, hello_imgui, portable_file_dialogs as pfd

msg: pfd.message | None = None
notif: pfd.notify | None = None

def gui() -> None:
    global msg, notif
    if imgui.button("Add Notif"):
        pfd.notify("Hello", "World", pfd.icon.error)
    if imgui.button("Add message"):
        msg = pfd.message("Hello", "World", pfd.choice.yes_no_cancel, pfd.icon.warning)
    if msg is not None and msg.ready():
        print("msg ready: " + str(msg.result()))
        msg = None

def main() -> None:
    hello_imgui.run(gui)

if __name__ == "__main__":
    main()

Is that enough? Or are there other features from ImGuiNotify that you want to use, in which case I would be happy to discuss this with you.


Also, I'm working on a brand new project which I would really like to discuss with you because I think you might be interested and your inputs would be valuable to me. Would you have a moment for us to have a telephone conversation or maybe a video call so that I can show you this new project? I'm working from home this week, so I'm quite available at a France working times. Let's exchange by email about that.

kuchi commented 3 months ago

I didn’t realize that the portable file dialogs has the notifications. That is better and I also use Mac OS. I didn’t notice that library isn’t fully cross platform. I agree it doesn’t actually make sense. Thanks for looking into it.  The suggestion you have to use PDD is perfect! I apologize I hadn't noticed the notifications capability already available.

kuchi commented 3 months ago

The suggestions you made work and the library I suggested is not cross platform.