Skip to content

Conversation

@sherry0429
Copy link

fix bug when

for i in range(0, 100):
    toaster.show_toast(...., duration=300)
    time.sleep(1)

and program create window instance many times

and remove destroy window after toast show.
now window will be destroy after this:

toast.destroy()

or

with CustomToastNotifier() as toaster:
    toaster....

text codes:

import time


count = 0
with CustomToastNotifier() as toaster:
    while True:
        time.sleep(3)
        toaster.show_toast("Hello World!!!",
                           "Python is 10 seconds awsm!",
                           icon_path="custom.ico",
                           duration=100)
        count += 1
        if count >= 5:
            break

fix bug when 

for i in range(0, 100):
    toaster.show_toast(...., duration=300)
    time.sleep(1)

and program create window instance many times

and remove destroy window after toast show.
now window will be destroy after this:

toast.destroy()

or

with CustomToastNotifier() as toaster:
    toaster....

text codes:

import time


count = 0
with CustomToastNotifier() as toaster:
    while True:
        time.sleep(3)
        toaster.show_toast("Hello World!!!",
                           "Python is 10 seconds awsm!",
                           icon_path="custom.ico",
                           duration=100)
        count += 1
        if count >= 5:
            break
fix bug when run many times, LoadImage function will raise OOM exceptions
1. remove duration params, now destory control by 'destroy' method or auto destory after with block.
2. add with block usage examples
fix bug when call 'destory', and then call 'show_toast', toast now show correctly
@sherry0429
Copy link
Author

@jithurjacob I add some function here, could you merge this PR ? it's will allow user use this through with block, and run many times in loop without create window manytimes.

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant