You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But for some reason, the 'is_shown' method on a window does not do, what i would expect it to do.
To demonstrate the issue:
from webui import webui
import time
window = webui.window()
window.show('<html><head><script src="webui.js"></script></head><body>close me</body></html>')
while window.is_shown():
print('is shown')
time.sleep(1)
now, when i close the window that opens - i would expect the console to stop printing 'is shown'.
but it happily continues.
instead, i found
from webui import webui
window = webui.window()
if window.is_shown():
print('is shown')
also prints 'is shown'.
which.. kindof seems, that this whole method doesn't do anything useful?
okay, after further looking into it:
from webui import webui
window = webui.window()
window.close()
if window.is_shown():
print('is shown - even when closed')
window.destroy()
if window.is_shown():
print('is not shown anymore!')
so the 'is_shown()' method only reacts to a '.destroy()' on the window. Which.. sounds like a 'is_not_destroyed()' tbh (:
'webui.wait()' - to further illustrate my problem:
from webui import webui
_ = webui.window()
window = webui.window()
webui.wait()
print('BOTH(!) windows are closed now.')
if window.is_shown():
print('and even now the window "is_shown"')
so:
is there a way to catch an event of ONE SPECIFIC window being closed?
I can close it programatically from within python and manage things on that side, sure - no issues there.
But I also need to know when the window itself is being closed, without any code being the reason.
This is probably a bug in the Python wrapper.
We will update this wrapper as soon as core v2.5 gets released.
Thank you @ludwigkraatz for reporting this.
I like the project a lot, so far.
But for some reason, the 'is_shown' method on a window does not do, what i would expect it to do.
To demonstrate the issue:
now, when i close the window that opens - i would expect the console to stop printing 'is shown'.
but it happily continues.
instead, i found
also prints 'is shown'.
which.. kindof seems, that this whole method doesn't do anything useful?
okay, after further looking into it:
so the 'is_shown()' method only reacts to a '.destroy()' on the window. Which.. sounds like a 'is_not_destroyed()' tbh (:
'webui.wait()' - to further illustrate my problem:
so:
is there a way to catch an event of ONE SPECIFIC window being closed?
I can close it programatically from within python and manage things on that side, sure - no issues there.
But I also need to know when the window itself is being closed, without any code being the reason.
I'd appreciate useful hints!
tested with:
Python 3.7
WebUI v2.4.5
MacOS 10.15.7
The text was updated successfully, but these errors were encountered: