-
Notifications
You must be signed in to change notification settings - Fork 17
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
Tkinter on OSX #4
Comments
Hey Malte, Can you figure out the line (in _tkinter.c (?)) where the application is hanging? Let's strip down the demo to a bare window: from Tkinter import Tk Is this already hanging? (I suppose so) |
So, it's time for an update in this thread. In case a reader is wondering why it took so long: Stefan and I were working in person on this problem (and others) for some time, and while JyNI is now working really well on OSX, the problem with Tkinter still stands. As suspected by Stefan, the stripped down version of the demo already freezes on OSX. We could identify the hanging function call in _tkinter.c: it's a call to Tcl_DoOneEvent(0) in line 3036. PS: We've also looked into OSX specific code in _tkinter.c. There's a call to Tk_MacOSXSetupTkNotifier in init_tkinter(void), protected by an #ifdef TK_AQUA, but this can't be the culprit, since TK_AQUA isn't defined in my configuration (and doing so doesn't help either). |
I prepared the JyNI-unstable repository to debug JyNI regarding _tkinter.c (statically linking it now). I inserted debugging output in _tkinter.c (JyNI-C/src/Modules/_tkinter.c) to log every call to Tk or Tcl-API and every method call in _tkinter.c. The test tkinter-program JyNI-Demo/src/JyNITkinterTest.py displays a bare tkinter window and I directly clicked the closing button; you can see corresponding closing events at the bottom of the log. So far I did not log Python-part of tkinter (actually wouldn't know where to start). Malte produced the following output on OSX (hanging run): I produced this log on Linux (LMDE2) (successful run): You will note that they are identical except the OSX one stucks at some point while the linux one continues. Running the logged tkinter with CPython 2.7.8 on Linux produces this output: Only difference to JyNI-run is that it skips these calls that were present in the JyNI-log: Tcl_AppInit (680) Another thing we tried was to call Tcl_DoOneEvent(0) in line 3049 with TCL_DONT_WAIT. This crashes Java on OSX while it runs fine on Linux (with an infinit background loop though). We are currently debugging this issue (probably another uninitialized memory thing). JyNI-unstable/TCL_DONT_WAIT branch is about this topic. However I suspect the TCL_DONT_WAIT-triggered crash is a separate issue. Any hints (how to debug the original issue) appreciated. |
Tcl_DoOneEvent calls Tcl_WaitForEvent which is platform specific (see macosx/tclMacOSXNotify.c at |
Hi all,
I've successfully compiled JyNI on OSX and none of the unit tests is failing.
But there's trouble with the Tkinter demo: java starts an osx application (with the Tk icon), that shows no window and is not responding at all.
Has anyone experienced the same issue?
I'll look into the problem and try to collect all information about it in this thread.
Best,
Malte
The text was updated successfully, but these errors were encountered: