[Patches] [ python-Patches-1621265 ] Auto-completion list placement

SourceForge.net noreply at sourceforge.net
Mon Feb 5 13:03:47 CET 2007

Patches item #1621265, was opened at 2006-12-23 15:16
Message generated for change (Comment added) made by taleinat
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tal Einat (taleinat)
Assigned to: Kurt B. Kaiser (kbk)
Summary: Auto-completion list placement

Initial Comment:
The completion list placement logic is currently very primitive. Sometimes the completion list extends outside of the editor window, or even outside the screen so that part of it is not visible.

This patch places the completion list inside the text widget if possible, above or below the typed text, as appropriate. It will not hide the currently typed text in any case.

* If the text widget is not high enough, the completion list is placed below the currently typed text.
* If the text widget is not wide enough, the completion list is aligned with the left-most edge of the text widget.

In any case the size of the completion list is not altered to fit the text widget, though this would probably be the best solution when the text widget is too small. This means that with this patch, the completion list may extend beyond the text widget if it is small.

I have not implemented resizing of the list this since the list's size is currently not set at all - Tk's default is used. Changing it anywhere in the code would require setting it elsewhere, hard-coding a default or making it configurable, etc.

Comments please!


>Comment By: Tal Einat (taleinat)
Date: 2007-02-05 14:03

Logged In: YES 
Originator: YES

My mistake - I missed the changes at the top! I meant only to patch the
placement mechanism.

The newly attached patch includes only the fix for window placement.

BTW, that change to the completion logic seems buggy - if a duplicate
completion entry is selected, only one more letter (if available) will be

IMO the current completion logic is weird and non-intuitive. When
selecting a completion from the list (in any way) I would expect it all to
appear where I am typing, not just some of it...
File Added: AutoCompleteWindow.placement.070205.patch


Comment By: Kurt B. Kaiser (kbk)
Date: 2007-02-05 06:16

Logged In: YES 
Originator: NO

Haven't you introduced a regression on [ 1571112 ] simple moves freeze
IDLE by the changes at the beginning of the patch?  Also, the assignment to
previous_completion was intended to make the code clearer.


You can respond by visiting: 

More information about the Patches mailing list