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
IDLE: no calltips on MacOS with tk 8.6 #78456
Comments
In bpo-34055, Raymond said "tool tips no longer display on the newest mac builds". On idledev, Walter S reported the same using 64-bit python.org "Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin" on multiple machines with 10.13.5. He also verified that the htest part of 'python3 -m idlelib.calltip_w' fails (no calltip appears when typing '('. I have doubts that this is a new problem with IDLE. calltip.py was not touched for 3.7.0. calltip_w.py was only touched to change return None to return 'break' where appropriate. This is one of 3 new Mac-specific failures reported after the release of 3.7.0. The others are bpo-34047, scrolling problems, and bpo-34120, freeze on some dialog closings. I have to suspect that the problem is with tkinter (_tkinter) and the new tcl/tk 8.6.8. How to debug (help appreciated with any of these):
|
Two more pieces of evidence that there is a problem with tkinter/tk8.6 on Mac. On bpo-34120, Vlad T. confirmed the misbehavior on 3.5 compiled for 8.6. bpo-34281 reports another problem with an editor subwindow on 3.7 Mac. There are now 4 issues about some IDLE feature failing specifically on MacOS with tcl/tk 8.6.8. (All but 1 with 3.7.0.) The editor scrollbar was touched last May. The config and about dialogs contents were edited last summer. But the calltip and and goto code is essentially untouched for 2 years. I am changing the title from 'IDLE: no calltips on MacOS with tk 8.6' and adding tkinter as component and Serhiy as Nosy. I have never used a Mac, but I have available a 2012 MacBook Air, which I just upgraded to current High Sierra 10.13.6. I intend to install 3.7, confirm the bugs, and try to find simpler failing examples. But I cannot patch _tkinter, let alone tcl/tk. |
https://core.tcl.tk/tk/tktview/769367b4c9b8e4fc05afaf67dc0aa6e3c1dba682 is an Tcl/Tk issue about bpo-34275, which is also about Tooltips. I've added a comment to the Tk issue to note that IDLE also has problems (the other ticket is about a 3th-party library). |
Please provide a short working Python script that reproduces the problem. Also, please point me to the internal implementation of tooltips in idlelib. Tooltips work just fine on Tk on the Mac, but there are many different ways to implement them and I suspect Python's implementation can likely be tweaked. It also may be related to event handling. |
@terry.reed: Kevin Walzer is a maintainer for Tk on macOS. I know too little of IDLE to answer his questions. |
IDLE currently uses tooltips only for calltips describing a function's call signature. Within Lib/idlelib: Issue bpo-1529353 and PR7626) proposes a second use of tooltips. I would also like to add helptips to some dialog fields and if possible, some menu entries. tooltip.py has simple generic tooltip code. calltip_w does not import this but says in its docstring 'after tooltip.py'. Since tooltip is not currently used anywhere in IDLE, I have considered removing it. Issue bpo-33839 and PR7683 instead propose to upgrade tooltip and refactor calltip_w to import and use tooltip. I have held off merging the PR because of tooltips not working on Mac. But I need to do so soon to unblock the issue above and possible other enchancements. Both tooltip and calltip_w have run-when-main test functions that work on Windows (and I presume Linux) but fail on 10.13.6 with 3.7.0. The tooltip test is simpler in that it does not involve any truly IDLE-specific code. The calltip_w test does not involve calltip. Both use IDLE's human-verification test driver that provides a root window with test instructions. In the bash terminal, run Kevin, I would be very appreciative if you can suggest a tweak that makes tooltips work everywhere. |
With the attached patch, the calltip now displays in the test in calltips_w.py on macOS. As I suspected, a judicious call to "update" forces the event loop to cycle on macOS. It should be harmless on other platforms, but if it causes some sort of performance slowdown, it can be wrapped in a call to "tk windowingsystem" eq "aqua" (not sure how to implement that in this module) so it only runs on the Mac. I also removed the platform call to "MacWindowStyle" as it is no longer needed on recent versions of the Mac. |
Thank you! Adding update worked for calltip_w. Adding update to tooltip and copying |
Perhaps we can use .update_idletasks() rather than .update()? That tends to have less of a performance hit. My macOS setup is currently not working so I can't test this myself. Regarding the "MacWindowStyle" call, IDLE is backported to older versions of Python and generally strives to support older systems. Can you tell which versions of macOS/OSX this is needed in? If so, I suggest surrounding that call with an OS version check, which could be removed at a later time when the relevant OS versions are truly irrelevant. |
Tal, your proposed revisions to the patch work fine. It's harmless to leave the older calls to MacWindowStyle there. New patch attached. |
I verified for my machine also that adding .update_idletasks(), as in calltips_2-2.diff works for my 3.7.0 installation. I will assume until someone says otherwise that this is generally sufficient. I am preparing a PR with the patch and will separately deal with the merge conflict I expect for PR7683. |
Thank you again, Kevin. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: