[Idle-dev] Bug in cursor placement in IDLE editor windows

Irv Kalb Irv at furrypants.com
Mon Nov 6 23:54:27 EST 2017


Hi,

I have installed  the 8.5.18 version of tk/tcl that you suggested.  But I am still seeing this problem on my Mac.

Rather than trying to explain the details and my configuration, I have made a 3 minute video so you can see exactly what I am seeing.  You can find that here:

https://youtu.be/Us8px0BY5rg <https://youtu.be/Us8px0BY5rg>

In answer to your question, I would guess that I am the same IrvKalb that is registered, but it would take me hours to figure out how to register a bug (since I have never done it before).  So if you believe that this is a real bug, I would greatly appreciate it if you could register it for me.  

Again, please let me know if there is any more information I can give you.

(I forgot to test this out on my Windows computer at my school today - I'll try to remember to do it tomorrow.  I remember seeing this last semester on the Windows system, but we were running Python 2 back then.)

Irv


> On Nov 3, 2017, at 12:59 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> 
> On 11/3/2017 12:49 AM, Irv Kalb wrote:
>> Hi Terry,
>> Thanks for your message.
>>> On Nov 2, 2017, at 5:24 PM, Terry Reedy <tjreedy at udel.edu <mailto:tjreedy at udel.edu>> wrote:
>>> 
>>> On 11/2/2017 7:20 PM, Irv Kalb wrote:
>>> 
>>>> I use IDLE when teaching classes, and I use it to develop small programs for my lessons.  I have found a bug that has been in IDLE for a while, and I finally got frustrated enough with it to write.
>>>> I am running on a Mac using IDLE version 3.6.1:
>>>> Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
>>>> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> 
>>> From the date, this appears to be the binary from python.org <http://python.org>.
>> Yes, I am using an absolutely standard download from python.org <http://python.org>.  No modifications at all.
>>> Did you upgrade tcl/tk as specified at
>>> https://www.python.org/download/mac/tcltk/ ?
>> No, I have not.  I had no idea that I needed to do this.  I just took a look at that page, and it does suggest that I need to upgrade.
>>> What Tk version is shown by Help => About IDLE?
>> It says Tk version: 8.5.15
> 
> I am a bit surprised that you are having a problem with that.  8.5.9 is the really awful version.
> 
>>>> running Max OS X 10.12.6 - but I also see this same problem when I am in class running Windows 10, with Python 3.6.???
>>> I use Windows 10 and I cannot reproduce the problem you report with any of 2.7.14, 3.6.3, or 3.7.0a2.  I used
>>> if a:
>>>    if b:
>>>        if c:
>>>            d
>>>            d
>>>            f
>>> for testing.  Please post a sample text that fails on Windows 10.  If you want, do what I would do and insert it into the following code.
>> Unfortunately, I won't be able to do that until next week when I am back at the school.  I will try to remember to do that then.
>>> 
>>> import tkinter as tk
>>> root = tk.Tk()
>>> text = tk.Text(root)
>>> sample = '''
>>> <replace this with sample that allows reported error>
>>> '''
>>> text.insert('1.0', sample)
>>> text.pack()
>>> root.mainloop()
>>> 
>>> Then run and click in the resulting Text window and see if the behavior is the same or different.  Mouse clicks in the text area of an editor window are primarily handled by tk, not IDLE or even tkinter.  Without running this control experiment, there is no reason to blame IDLE.
>> I just tried your test on my Mac with the following:
>> import tkinter as tk
>> root = tk.Tk()
>> text = tk.Text(root)
>> sample = '''
>> if x:
>>     y = 1
>> '''
>> text.insert('1.0', sample)
>> text.pack()
>> root.mainloop()
>> I run it, it brings up a widow with the two lines, and the same problem occurs there.
> 
> Then this is either a tkinter or tk issue, most like the latter. But this behavior is so annoying that I would expect to have seen a report before if it were widespread.
> 
>>> > One thing to point out, I always use the Tab key to indent my lines. However, even if I type many space characters to indent, I see the same (incorrect behavior).
>>> 
>>> Unless you have a particular undocumented entry in <HOME>/.idlerc/config-main.cfg, tabs are converted to spaces (default 4) before insertion into the text widget.  If the <- and -> arrow keys always move one character, you have spaces.
>> I have not changed any configuration like this.
>>> 
>>>> If I have an indented line, and I click just to the left of the first real character on that line, often IDLE will place the insertion cursor at the wrong place - at one character to the right of the left edge of the window.  If I click in the same spot (Just to the left of the first real character on the line), IDLE responds by moving the insertion cursor one space to the right.  Depending on how many times the line I'm clicking on has been indented, IDLE eventually highlights a section from the last character of the previous line to just before the first real character of the line where I clicked.  If I click one more time, IDLE puts the insertion character in the correct place.
>>> 
>>> For me, a sinple click places the the cursor on the nearest between-character slice line, either to the left or right of where I click.  Two clicks that are rapid enough to be interpreted as a double click select a word or non-word slice.  Similarly, clicks with the bar overlapping two lines are pushed to the 'closer' line, either up or down.
> 
>> Sounds like I need to upgrade TCL.  Following the links on the page you provided, it looks like I need to download ActiveTCL, with the newest version being 8.6.6 from ActiveState.com <http://ActiveState.com>.
>> Does that sound right?
> 
> No, our 3.6 Mac binary is compiled against 8.5 and will not work with 8.6.  The page says 8.5.18.  Try that.  If there is still a problem, one of us should open an issue on the tracker and make sure that the Mac and tkinter experts are nosy. it.  The exact OSX version would be needed. (Are you the IrvKalb already registered?)
> 
>> How would the average person (who doesn't follow links on forums like this and get expert help from someone like you) know to do this???
> 
> Some people see the following line on the download page
> 
> macOS users: There is important information about IDLE, Tkinter, and Tcl/Tk on macOS here.
> 
> and click the link.  Others miss it and ask various places.  Or they take classes that use pre-loaded machines or walk students through installation on their own machines.  Or maybe they blame IDLE for the tk bugs and stop trying to use it.
> 
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev at python.org
> https://mail.python.org/mailman/listinfo/idle-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20171106/83b9807a/attachment.html>


More information about the IDLE-dev mailing list