tkinter窗体半透明效果演示

python演示了tkinte窗体的半透明效果

"""本程序演示了tkinter窗体的半透明效果"""


import math
from turtle import *

width,height=640,640
screen = Screen()
screen.delay(0)
root = screen._root                          # 获取屏幕的根,就是窗体对象
#root.wm_attributes('-fullscreen','true')
root.wm_attributes('-alpha',0.8)             # 半透明
root.overrideredirect(True)
root.config(borderwidth= 0,highlightthickness = 0 )

screen.setup(width,height)
screen.bgpic("bg.png")
screen.addshape("redball.gif")

ball1 = Turtle(shape="redball.gif")
ball1.penup()
ball1.speed(0)
ball1.angle = 0
ball2 = ball1.clone()
ball2.angle = 180 

You must log in to read the rest of this article. Please log in or register as a user.