[Idle-dev] bug or annoyance in IDLE on win32

rt8396 at gmail.com rt8396 at gmail.com
Thu Oct 16 05:09:12 CEST 2008


bug or annoyance in IDLE:

Acutually this has to do with the tk Text widget.
By default the Text widget binds mouse event "<Button-2>" to paste currently

highlighted text. Now i guess this would not be a problem EXCEPT for the
fact that
IDLE does not have a Left/Right scroll bar, So the only way to scroll left
and right is
to hold down <B2> and move, causing the <B2> binding to be called, and in
turn
pasting text were you did not want it pasted. : -(

if you dont believe me try this:
1. open idle, then goto... file...New Window
2. in the New Window type a string
3. highlight a portion of the string.
4. now press button 2 and the highlighted text will be pasted every time you
click and release b2

Maybe there is a use for this but for me it just serves to frustrate me.

Ok back to the solution:
I know how to override this <B2> binding, i do it in all my programs that
include a text editor. By inserting this line: text.bind_class('Text',
'<Button-2>', lambda e: None)...and
WHAMO no more annoying paste action...i love power :-D. I would love to code
a
solution and submit it to someone but only problem is i have looked through
every module in idlelib and i cant make heads or tails of it. So i will have
to leave this to someone more qualified than I.

Couple of ways to solve this:

1. Allow users to rebind mouse events along with keyboard events...GOOD
 (Power to the people!)

2. hack the code..BAD

3. write an extension that rebinds <B2> at runtime...UGLY

4. Add a left/write scrollbar to IDLE...BAD...i find draging with the mouse
to be quicker


I really like Python IDLE except for this one little problem,
if anyone could help i would be very happy.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20081016/5c4dd04f/attachment.htm>


More information about the IDLE-dev mailing list