[Enhancement] Create function PySimpleGUI.KillLinux() using code found in window.Disable() (freezes entire environment) #1485
Comments
Wow! I'll work on it.... but will rename existing Thank you for taking the time to fill out the form so completely. It's greatly appreciated and ensures you're problem received priority treatment (it helps having code too like you posted!) |
Yes, I'm quite amazed by this, too I tried the ssame on another Ubuntu 16.04 machine and also tried python 3.6.6 but it's the same issue. I'm surprised that this is even possible, but have no idea how to investigate this any further. |
Can I work on this issue? if this is not assigned to anyone? |
Long time passed, not sure what state the issue is now. Anyway, it still need to wait PySimpleGUI/Mike back to work on them. |
I think I'm missing something most likely.... if so, I'm sorry about that. Maybe these will help until I can return.... Tip #1 - don't call window.disable() Tip #2 - you don't need to wait for change to the package to implement workarounds yourself. import PySimpleGUI as sg
def my_func(*args):
sg.popup("don't call window disable please")
sg.Window.disable = my_func
def main():
window = sg.Window('Window Title', [[sg.Button('Go'), sg.Button('Exit')]])
while True: # Event Loop
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Exit':
break
if event == 'Go':
window.disable()
window.close()
if __name__ == '__main__':
main() THANK YOU for your patience.... everyone.... |
👆🏼 |
This issue is quite old. The worst that should happen is an exception due to the bad attribute "-disabled" Go {}
Traceback (most recent call last):
File "/home/mike/PycharmProjects/pythonProject/test.py", line 26, in <module>
main()
File "/home/mike/PycharmProjects/pythonProject/test.py", line 22, in main
window.disable()
File "/home/mike/PycharmProjects/pythonProject/PySimpleGUI.py", line 8826, in disable
self.TKroot.attributes('-disabled', 1)
File "/usr/lib/python3.8/tkinter/__init__.py", line 1967, in wm_attributes
return self.tk.call(args)
_tkinter.TclError: bad attribute "-disabled": must be -alpha, -topmost, -zoomed, -fullscreen, or -type
Process finished with exit code 1 That should not / will not freeze an entire environment. @Darklight-user do you have a specific solution in mind? I'm listening. |
from tkinter import * window.mainloop() guys i am running this code but it is showing error can anyone tell me what's wrong even the img file is in the same folder.. its showing error in init.py file. i even tried to run it with those line that i am showing them as comments for now. |
Here's not the right place to talk about tkinter issue. but it look like wrong path for your png file. file= 'Dual.png'
Image_path = os.path.join(path, file) |
Type of Issues (Enhancement, Error, Bug, Question)
Bug:
window.Read()
)window.Disable()
Operating System
Ubuntu 16.04 LTS 64 bit
Python version
Python 3.5.2
PySimpleGUI Port and Version
PySimpleGUI==3.35.0
Code or partial code causing the problem
Minimal example (freeze occurs after 'OK' is clicked):
The text was updated successfully, but these errors were encountered: