Comments (35)
Oh what fun when Apple releases a new version of software. It's not unusual for things to break, sometimes badly. I meet with our Mac expert today so I'll be sure and discuss the new release and fun that accompanies it.
from pysimplegui.
Thank you for giving it a try! I appreciate the help. I've got a call starting in 5 minutes with our Mac expert so I'll pass along the info.
from pysimplegui.
I saw a StackOverflow post where an upgrade to Python 3.12 fixed their problem. The only thing I can think of that maybe doing is upgrading tkinter to 8.6.13, but I'm not sure if that's the result. I have to think a lot of other Mac users are running 14.0, 14.1 and are not having this issue or there would be a lot more people complaining in this issue.
from pysimplegui.
I've been watching pip installs for months and so few people, a shockingly tiny number, have used 3.12 with PySimpleGUI as 3.12 was being released in stages. Here's a snap from a few days back:
Only 3 people that day were running 3.12, and those were likely Windows users. Only about 5% of our users are on the Mac.
I would have expected quite a number of Mac users to be reporting this problem since it deals with buttons. It may be an inverse setup problem where a version of tkinter, like 8.6.12, has the problem, but other versions do not. It's hard to tell but I'll have @Chr0nicT be sure and check out these combinations. He knows how to swap around tkinter versions. It is possible to do on the Mac.... it's more difficult to do on the PC.
Since you managed to get running on 3.12, I'm going to mark this issue as having a workaround in case others have the same problem.
For reference, this is the StackOverflow issue that I saw 3.12 posted earlier this morning. I've been watching it to see if anything popped up.
from pysimplegui.
@PySimpleGUI
I cleaned up all the older versions of the python and freshly installed 3.12 and then PySimpleGUI again. This time PySimpleGUI installed tkinter 8.6.13
I still see the warning message: WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
However the GUI control elements seems to be functioning well now
from pysimplegui.
Which exact version of the Mac 14 are you using? 14.0, 14.1, ...? If 14.0, can you try upgrading to 14.1 to see if they've fixed something?
from pysimplegui.
Which exact version of the Mac 14 are you using? 14.0, 14.1, ...? If 14.0, can you try upgrading to 14.1 to see if they've fixed something?
The exact version is: Version 14.0 (23A344)
. I'm updating to the 14.1 beta version now and i'll see if the problem remains.
from pysimplegui.
Which exact version of the Mac 14 are you using? 14.0, 14.1, ...? If 14.0, can you try upgrading to 14.1 to see if they've fixed something?
The exact version is:
Version 14.0 (23A344)
. I'm updating to the 14.1 beta version now and i'll see if the problem remains.
I updated to Mac OS 14.1 beta Version 14.1 Beta (23B5056e)
and the issue still exists.
from pysimplegui.
Here's a copy of your test program with only PySimpleGUI code. Thank you very much for doing a great job of writing this code for us. It helps tremendously.
import PySimpleGUI as sg
layout = [
[sg.Text("This is a button test")],
[sg.Combo(["option1", "option2", "option3", "option4"], enable_events=True, key="Combo",)],
[sg.Button("Submit")],
[sg.Multiline(autoscroll=True, size=(30, 20), reroute_stdout=True)],]
window = sg.Window("Test", layout=layout, finalize=True)
while True:
event, values = window.read()
if event in (None, "Quit", sg.WIN_CLOSED):
window.close()
break
if event == "Submit":
print("Button Clicked")
if event == "Combo":
print("Combo Selection", values[event])
from pysimplegui.
I updated to python 3.12 and the problem seems to have gone away. I will keep checking over the next couple days, but looks like its fixed!
Python version: 3.12.0 (v3.12.0:0fb18b02c8, Oct 2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)]
port: tkinter
tkinter version: 8.6.13
PySimpleGUI version: 4.60.5
PySimpleGUI filename: .virtualenvs/ll/lib/python3.12/site-packages/PySimpleGUI/PySimpleGUI.py
Is it possible to update tkinter to 8.6.13 without updating python 3.12? I don't think it matters in my use case, but that would be one way of isolating a variable to see if the problem is fixed. Happy to check, but don't want to mess up anything by trying to force an incompatible update or something.
from pysimplegui.
It is definitely an issue with Mac OS Sonoma 14.0
Got the same problem. Installing Python 3.12 improves it slightly, but mouse clicks still get lost regularly.
Strangely enough, when moving the cursor slightly when clicking an element, the click always registers...
Pretty annoying...
from pysimplegui.
BTW
Started all over, creating the project as new.
Reinstalled PySimpleGUI, using Python 3.11
And the problem is GONE !
Unreal...
from pysimplegui.
But after restarting... again, the same...
Will try to downgrade to Mac OS 13.
from pysimplegui.
Please check your tkinter version number. We're testing this and 8.6.13 seems to be a potential fix.
from pysimplegui.
YES!!!
tkinter 8.6.13 solves the problem indeed...
Everything works again like a charm!
Thank you so much, not only for pysimplegui, but also for the great support and fast feedback...
I am going to buy you a coffee!
from pysimplegui.
Is there a way or procedure to update tkinter from 8.6.12 to 8.6.13? Python3.12 doesn't work for my project in some other ways (particularly utilizing py2app to build a standalone. Its incompatible with python3.12.
from pysimplegui.
Specific Tkinter Installation....
It's difficult to update only tkinter, without updating Python itself. It's something that we've wanted to be able to instruct users on how to do for a long time but have found only 1 way to get a specific version of tkinter and that's to rebuild from source.
So... the best way for users to move onto a specific tkinter version is to install a specific version of Python from python.org.
Question For Mac Users....
We're trying to get a handle on how frequent this problem is occurring in the PySimpleGUI user base. I would think that if every user of MacOS 14.x that was not running tkinter version 8.6.13 had an issue, then we would see a lot of people replying to this thread or opening new issues.
This leaves a few possibilities that I can think of for the fewer reported problems:
- Not every user with MacOS 14 + tkinter 8.6.not-13 has a problem
- The problem is "minor" to the user experience
These feel "unlikely" however.
What I could use help in determining is the scope of potentially impacted users. Or, how "basic" of a problem is this?
Do All Windows Experience a Problem?
If using only sg.popup()
will users have any problems, some problems, infrequent problems, no problems, ....
I just don't have a feel for this. It would be helpful to know.
A Remedy...
If the only "fix" is to upgrade to 8.6.13, then something needs to be told to MacOS 14.x users when they run PySimpleGUI or install PySimpleGUI. A message printed on the console would be a good start.
Something along the lines of...
"You're running MacOS 14.x with tkitner version 8.6.12. This has a known problem with button clicks, and other degraded features. It's recommended that you upgrade to Python version 3.12 which has tkinter version 8.6.13."
from pysimplegui.
I have the same issues, as my MacOS 14 users can't run the application.
The application is packaged with Pyinstaller by using Python 3.12.0
Could you please provide a detailed guide on how to fix it?
from pysimplegui.
If you created the executable using 3.12 then you shouldn't have the problem as you'll have 8.6.13.
Add this line to your code that you compile and see what's printed on the console.
print(sg.get_versions())
Or you could show it in a popup if you're running without a console:
sg.popup(sg.get_versions())
Could you please provide a detailed guide on how to fix it?
- Go to python.org
- Install Python 3.12 or later for the Mac (whatever gives you tkinter 8.6.13 or greater)
from pysimplegui.
I also see below warning. The checkboxes, radio buttons and buttons are not clickable:
Mac OS Version is 14.1 and patch enabled so applying the patch
2023-11-01 16:15:33.950 Python[10596:835109] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
Versions:
Mac OS Version is 14.1 and patch enabled so applying the patch
Python version: 3.11.1
Port: PySimpleGUI
tkinter version: 8.6.12
PySimpleGUI version: 4.60.5
so if I use 3.12 and tkinter 8.6.13 the warning that I am seeing would be resolved? Also the GUI control elements function normally?
I am using Pycharm Community edition
from pysimplegui.
any suggestions on how to install tkinter 8.6.13 on MacOs Sonoma?
from pysimplegui.
any suggestions on how to install tkinter 8.6.13 on MacOs Sonoma?
YES.... install Python 3.11 or Python 3.12 for the Mac from Python.org.
That will install tkinter 8.6.13.
from pysimplegui.
It would be helpful for someone to write a pure tkinter program and see if it has the problem. If it does, then the tkinter project should know about this and help Mac users through the problem. All indicators show it to be in tkinter since changing the tkinter from 8.6.12 to 8.6.13 fixes the problem.
from pysimplegui.
@PySimpleGUI
I have updated to Python 3.12. However I am still not able to run my application. When I add 3.12 as Python Interpreter for my program, it gives an error to install some packages. When I try to install those, I get some error message. It indicates some issue with disutils. Looks like 3.12 has deprecated disutils.
If I continue to use 3.11, I am not sure how to install tkinter 8.6.13 on Mac.
I wrote a simple tkinter program on the Mac terminal and I see the warning. Same behavior when I use the Pycharm as well. Python version is 3.12 as you can see below.
gsusmi@88665a372ef6 ~ % python3
Python 3.12.0 (v3.12.0:0fb18b02c8, Oct 2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import tkinter
import tkinter as tk
window = tk.Tk()
2023-11-02 10:01:28.915 Python[69552:1517281] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
from pysimplegui.
Hi, just want to thank you for this information. I upgraded to macOS 14.1.1 yesterday. Same issue. Going to look into tkinter 8.6.13 later.
Kind regards /Martin
from pysimplegui.
Hello
My environment configuration is
Mac OS: 14.1.1
Python: 3.11.3(Anaconda)
tkinter: 8.6.12
Pysimplegui : 4.60.5
When run the tkeinter by "python -m tkinter" the click can correct working.
But click does not work on pysimplegui.
It seems difficult to use tkeinter 8.6.13 on anaconda.(I can not found a solution to update tkinter on Anaconda)
from pysimplegui.
8.6.13 is the only fix we've seen.
tkinter is not pip installable. It comes packaged with Python when installing Python from python.org.
Python 3.12 is what you need in order to pick up tkinter 8.6.13.
from pysimplegui.
8.6.13 is the only fix we've seen. tkinter is not pip installable. It comes packaged with Python when installing Python from python.org.
Python 3.12 is what you need in order to pick up tkinter 8.6.13.
Thank you!!
Finally I setup the Python3.12 environment by Homebrew.
It can work fine Pysimplegui from VSCode on Mac OS 14.1.1 (Now it updated to 14.1.2)
from pysimplegui.
Finally I setup the Python3.12 environment by Homebrew.
We've had the most consistency using the python.org installers. They packaged tkinter 8.6.13 with Python 3.12. Homebrew has at times caused problems.
from pysimplegui.
8.6.13 is the only fix we've seen. tkinter is not pip installable. It comes packaged with Python when installing Python from python.org.
Python 3.12 is what you need in order to pick up tkinter 8.6.13.
Just to add my case to the incidence count:
In my up-to-date setup, I still receive the "dreaded" message, although the button in the test I have works correctly every time. Granted, I did not yet try the repeated event capture demo I saw earlier in this thread, but, for what it's worth, the interface seems to work well, if I ignore the message in the terminal. Here is the "sg" code I used:
import PySimpleGUI as sg
layout = [[sg.Text("Hello from PySimpleGUI")], [sg.Button("OK")]]
# Create window
window = sg.Window("Demo", layout=layout, margins=(200, 200))
# Create an event loop
while True:
event, values = window.read()
# End program when user closes the window or presses the "OK" button
if event == "OK" or event == sg.WIN_CLOSED:
break
window.close()
print(sg.get_versions())
The result I get in the terminal, after I close the demo window, is shown below. To be precise, the "Secure coding ..." message appears immediately after invoking the program, before the demo window pops up. The versions printout, obviously appears only after I close the window.
2023-12-03 10:26:07.368 Python[18135:1799904] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
Python version: 3.12.0
Port: PySimpleGUI
tkinter version: 8.6.13
PySimpleGUI version: 4.60.5
PySimpleGUI filename: /Users/xxx/repos/python_tutorial/project1/venv/lib/python3.12/site-packages/PySimpleGUI/PySimpleGUI.py
I am on MacOS = 14.1.2
The other test I ran was to invoke tkinter directly using the code @susmi1980 wrote. Sure enough, the "Secure coding ..." message is generated there, too.
from pysimplegui.
Can you add this to the top of your program to see if it stops the printed warning?
import os
import warnings
# Filter out the warning
warnings.filterwarnings('ignore', category=UserWarning, message='Secure coding is not enabled for restorable state!')
Low chances of success... but worth tossing into your program to see.
from pysimplegui.
@PySimpleGUI - thank you for the interaction ;-).
I tried your suggestion. I placed the "warning" at the top of the program. I also added spy prints before each method call. See below:
import PySimpleGUI as sg
import os
import warnings
# Filter out the warning
warnings.filterwarnings('ignore', category=UserWarning, message='Secure coding is not enabled for restorable state!')
layout = [[sg.Text("Hello from PySimpleGUI")], [sg.Button("OK")]]
# Create window
print('--> Before the window definition')
window = sg.Window("Demo", layout=layout, margins=(200, 200))
# Create an event loop
while True:
print('--> In "while" before window.read()')
event, values = window.read()
# End program when user closes the window or presses the "OK" button
if event == "OK" or event == sg.WIN_CLOSED:
break
print('--> Before the window.close()')
window.close()
print('--> Before get_versions()')
print(sg.get_versions())
The response is:
--> Before the window definition
--> In "while" before window.read()
2023-12-03 13:55:53.230 Python[19361:1930622] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
--> Before the window.close()
--> Before get_versions()
Python version: 3.12.0
Port: PySimpleGUI
tkinter version: 8.6.13
PySimpleGUI version: 4.60.5
PySimpleGUI filename: /Users/marius/repos/python_tutorial/project1/venv/lib/python3.12/site-packages/PySimpleGUI/PySimpleGUI.py
It looks like the message is generated by the call of the "window.read" method.
I will be glad to run any other experiments you wish. I am checking my computer on-an off during the day.
from pysimplegui.
This problem is below PySimpleGUI.... you'll find that tkinter has the problem. Of course PySimpleGUI is built on top of tkinter. The reason you see if follow the window.read
is because that's when tkinter's event loop begins. Like the other problems in this issue, the root causes are well below the PySimpleGUI layer.
from pysimplegui.
@PySimpleGUI - I completely agree - it is a tkinter issue.
Since you are well versed with "tkinter" and you are plugged-in the developer community, would you be so kind to open an issue with the "tkinter" maintainers?
Appreciated,
from pysimplegui.
It's already been logged with the tkinter from the searching I've done. From previously opened bugs we've opened, It's the PySimpleGUI users that have the most influence on the tkinter team.
from pysimplegui.
Related Issues (20)
- [Question] How To Re-Enter Data For A Specific Field - AND 'CR to act like TAB HOT 1
- [ Bug] sg.ColorChooserButton Unless Additional Tkinter Import HOT 2
- [Bug] Hitting the image-count limit [Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize] HOT 6
- [Question] Import error HOT 3
- [Question] Change focus highlight when tabbing to button HOT 8
- [ Enhancement/Bug/Question] NOTE - you can also call sg.main() or sg.main_open_github_issue() to post an issue HOT 1
- [ Question] Compiling Errors since License validation HOT 2
- [ Bug] Broken Doc Link HOT 2
- [Question] NOTE - Table get doesn't work HOT 6
- [ Enhancement] allow arrowheads for lines in tkinter graphs HOT 8
- [Question] Question of shortcut HOT 17
- [Question] How to Use PySimpleGui Programs on Other PCs HOT 1
- [ Question] How to detect when we manually enter a value in combo box in Pysimple GUI HOT 1
- [Bug] Table colored rows flashes when updating in 5.0, while they didn't in 4.x HOT 10
- [Question] No right_click_menu in Combo HOT 3
- [Enhancement] Reusing Context Menu HOT 7
- [ Bug] Garbled output on WSL HOT 5
- Question. How to get a value from a return? HOT 3
- [Question] PySimpleGUI Web Deprecated? HOT 1
- Bug: Error dialog when programatically updating PySimpleGUIQt Checkbox HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysimplegui.