New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Bug] one_line_progress_meter does not return False when pressing X on Windows #5034
Comments
For the window of Extra statement to call import time
import PySimpleGUI as sg
for i in range(1, 200):
time.sleep(0.1)
if not sg.one_line_progress_meter(title="test", current_value=i, max_value=200, no_button=False):
print('returned false')
break
sg.one_line_progress_meter_cancel() |
Thanks for your reply. |
Just add one more statement to your code to close the progress meter window. |
Thanks for your fast reply. |
OK, following code show the hack way
import time
import PySimpleGUI as sg
sg.one_line_progress_meter(title="test", current_value=0, max_value=200, no_button=False)
key='OK for 1 meter'
meter = sg.QuickMeter.active_meters[key]
meter.window.DisableClose = False
for i in range(1, 200):
time.sleep(0.1)
if not sg.one_line_progress_meter(title="test", current_value=i, max_value=200, no_button=False):
print('returned false')
break
sg.one_line_progress_meter_cancel() |
Thank you very much! It works now. Have a nice day. |
Let's open this as a documentation issue. There's a reason I changed this behavior and want to make sure it's documented that using the X will cause problems in some situations which is why it's no longer an option. |
Thanks for your fast help and kind words also on StackOverflow! I donated in order that this project will continue in the next years. Good luck! |
Thank you SO SO MUCH Martin! The help, the kind words from you, it's all part of what makes this project the special thing that it's been and I hope will continue to be. I really appreciate you going the extra mile to come and open an issue! That's really taking support way beyond what most would do on StackOverflow, and wow, it's really appreciated. |
Why does my direct use of sg. QuickMeter cause Python to not respond? |
It didn't tell us how you direct use of Better have one new issue to describe your issue in detail . |
|
For example,I use it like this import PySimpleGUI as sg
for i in range(20):
sg.QuickMeter("A",i+1,20,"*** B ***") |
The instance of the class |
Oh, I see. |
Type of Issue (Bug)
BUG: one_line_progress_meter does not return False and does not close the window when pressing X on Windows. The 'X' button isn not working at all.
Operating System
Windows 10 - 64 Bit
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
'4.55.1 Released 7-Nov-2021'
Python version (
sg.sys.version
)'3.9.4 (tags/v3.9.4:1f2e308, Apr 4 2021, 13:27:16) [MSC v.1928 64 bit (AMD64)]'
PySimpleGUI Version (
sg.__version__
)4.55.1
GUI Version (tkinter (
sg.tclversion_detailed
), PySide2, WxPython, Remi)'8.6.9'
Your Experience In Months or Years (optional)
Years Python programming experience
Years Programming experience overall
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
Anything else you think would be helpful?
Troubleshooting
Detailed Description
One Line Progress Meter cannot be closed with the "X" Button in the Win10 titlebar. The functionality only works with the Cancel button.
Code To Duplicate
Screenshot, Sketch, or Drawing
Watcha Makin?
If you care to share something about your project, it would be awesome to hear what you're building.
The text was updated successfully, but these errors were encountered: