jithurjacob / Windows-10-Toast-Notifications

Python library to display Windows 10 Toast Notifications
MIT License
971 stars 168 forks source link

.show_toast() breaks PySimpleGUI and PyMsgBox #110

Open JanChec opened 2 years ago

JanChec commented 2 years ago

Hey! 🙂

I'm trying to use Windows 10 Toast Notifications for notifications while I have simple interactions with the user by opening new windows when necessary. Unfortunately when I do:

toast = win10toast.ToastNotifier()
toast.show_toast(
    "Title",
    "some explanation",
    duration=2,
    threaded=False,  # this WORKS for True
)

import pymsgbox
pymsgbox.confirm('PyMsgBox', 'window')  # <- this doesn't even appear

Similarly for PySimpleGUI, but in this case, it freezes after partially rendering the window. Both PySimpleGUI and PyMsgBox can work at the same time.

My guess is that it locks something that the other libraries are trying to use. I think it's worth at least documenting the usage of threaded=True as a workaround to the problem.