On 11/6/2020 7:02 AM, 17317302007 wrote:

Cool IDLE Developers,

I am some little user who loves IDLE (xD). When I was taking online courses, I thought it is better if I can use a half-transparent window to program, while having sources or teachers' codes in the background. (btw I use the "Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32" and I do not know if that feature is already there in newer versions.) For that reason, I yeeted through the code and added an "Alpha" tab on the menu to change the transparency of the editor, being noobified by myself (yeah I'm a noob).
Actually I just made little changes to the code...

Thanks for making this IDLE pure Python so I have the chance to do this!
the editor.py is attached below!

(In the future, please post plain text rather than html.)

The last time partial transparency was discussed, the answer was that tk did not support it. However, wm attributes now support an 'alpha' attribut (and some other new ones). I am at least glad you pushed me to look. But it might be ignored on any particular window manager system.

For testing, the patch added these lines
text.bind("<<alpha-0>>", lambda event: self.top.attributes("-alpha",1)) text.bind("<<alpha-1>>", lambda event: self.top.attributes("-alpha",0.8)) text.bind("<<alpha-2>>", lambda event: self.top.attributes("-alpha",0.6)) text.bind("<<alpha-3>>", lambda event: self.top.attributes("-alpha",0.4))

and an 'Alpha' menu after the 'Help' menu.

However, the idlelib changes since 3.6.6 are so extensive that current IDLE will not start with the revised editor.py even after the easy fixups. So I have not tested it yet.

Notepad++ has an option to decrease the alpha of the Find dialog to an adjustable number either when it looses focus or always. I believe that one of these may have been the default, so some people must like it. But I did not and turned it off. To me, it seems to me even less likely to be useful for editor windows.

--
Terry Jan Reedy

_______________________________________________
IDLE-dev mailing list
IDLE-dev@python.org
https://mail.python.org/mailman/listinfo/idle-dev

Reply via email to