Re: A Recommendation On Transparent IDLE (with code)

Guido van Rossum <[email protected]> Fri, 6 Nov 2020 21:47:35 -0800
Newsgroups gmane.comp.python.idle
Message-ID <CAP7+vJL3c6zmLyT0sSeXiT1Aiko=hOyW6FDR+iiC_SW6p_i15A@mail.gmail.com>
--===============5040270732801951843==
Content-Type: multipart/alternative; boundary="00000000000056cba905b37ddea4"

--00000000000056cba905b37ddea4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I had the same thought =E2=80=94 =E2=80=9Cwhy would anyone want semi-transp=
arent Windows?=E2=80=9D

I always assumed the feature existed to show off GPU features.

But here we have a user who found this so useful that they wrote code to do
it!

So I think it would be interesting to try and understand the use case,
rather than dismissing it.

=E2=80=94Guido

On Fri, Nov 6, 2020 at 21:41 Terry Reedy <[email protected]> wrote:

> 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
> [email protected]
> https://mail.python.org/mailman/listinfo/idle-dev
>
--=20
--Guido (mobile)

--00000000000056cba905b37ddea4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">I had the same thought =E2=80=94 =E2=80=9Cwhy would anyon=
e want semi-transparent Windows?=E2=80=9D</div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">I always assumed the feature existed to show off GPU feat=
ures.</div><div dir=3D"auto"><br></div><div dir=3D"auto">But here we have a=
 user who found this so useful that they wrote code to do it!</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">So I think it would be interesting to=
 try and understand the use case, rather than dismissing it.</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">=E2=80=94Guido</div><div><br><div cla=
ss=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Nov 6, 202=
0 at 21:41 Terry Reedy &lt;<a href=3D"mailto:[email protected]">tjreedy@udel=
.edu</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/6/2020 7:=
02 AM, 17317302007 wrote:<br>
&gt; <br>
&gt; Cool IDLE Developers,<br>
&gt; <br>
&gt; I am some little user who loves IDLE (xD). When I was taking online <b=
r>
&gt; courses, I thought it is better if I can use a half-transparent window=
 <br>
&gt; to program, while having sources or teachers&#39; codes in the backgro=
und.<br>
&gt; (btw I use the &quot;Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:=
37:03) <br>
&gt; [MSC v.1900 64 bit (AMD64)] on win32&quot; and I do not know if that f=
eature <br>
&gt; is already there in newer versions.)<br>
&gt; For that reason, I yeeted through the code and added an &quot;Alpha&qu=
ot; tab on <br>
&gt; the menu to change the transparency of the editor, being noobified by =
<br>
&gt; myself (yeah I&#39;m a noob).<br>
&gt; Actually I just made little changes to the code...<br>
&gt; <br>
&gt; Thanks for making this IDLE pure Python so I have the chance to do thi=
s!<br>
&gt; the editor.py is attached below!<br>
<br>
(In the future, please post plain text rather than html.)<br>
<br>
The last time partial transparency was discussed, the answer was that tk <b=
r>
did not support it.=C2=A0 However, wm attributes now support an &#39;alpha&=
#39; <br>
attribut (and some other new ones).=C2=A0 I am at least glad you pushed me =
to <br>
look.=C2=A0 But it might be ignored on any particular window manager system=
.<br>
<br>
For testing, the patch added these lines<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0text.bind(&quot;&lt;&lt;alpha-0&gt;&gt;&q=
uot;, lambda event: <br>
self.top.attributes(&quot;-alpha&quot;,1))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0text.bind(&quot;&lt;&lt;alpha-1&gt;&gt;&q=
uot;, lambda event: <br>
self.top.attributes(&quot;-alpha&quot;,0.8))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0text.bind(&quot;&lt;&lt;alpha-2&gt;&gt;&q=
uot;, lambda event: <br>
self.top.attributes(&quot;-alpha&quot;,0.6))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0text.bind(&quot;&lt;&lt;alpha-3&gt;&gt;&q=
uot;, lambda event: <br>
self.top.attributes(&quot;-alpha&quot;,0.4))<br>
<br>
and an &#39;Alpha&#39; menu after the &#39;Help&#39; menu.<br>
<br>
However, the idlelib changes since 3.6.6 are so extensive that current <br>
IDLE will not start with the revised editor.py even after the easy <br>
fixups. So I have not tested it yet.<br>
<br>
Notepad++ has an option to decrease the alpha of the Find dialog to an <br>
adjustable number either when it looses focus or always.=C2=A0 I believe th=
at <br>
one of these may have been the default, so some people must like it. <br>
But I did not and turned it off.=C2=A0 To me, it seems to me even less like=
ly <br>
to be useful for editor windows.<br>
<br>
-- <br>
Terry Jan Reedy<br>
<br>
_______________________________________________<br>
IDLE-dev mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
g</a><br>
<a href=3D"https://mail.python.org/mailman/listinfo/idle-dev" rel=3D"norefe=
rrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/idle-dev</=
a><br>
</blockquote></div></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature" =
data-smartmail=3D"gmail_signature">--Guido (mobile)</div>

--00000000000056cba905b37ddea4--

--===============5040270732801951843==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
IDLE-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/idle-dev

--===============5040270732801951843==--