猫史档案馆


【Python作品分享】tim

用户:RAINBOWS_AMRAINBOWS_AM查看:0 回复:0 评论:0 创建时间:2020-12-26T12:55:27


【作品展示】

center_image

 

【作品介绍】

他热腾腾

 

【作品源代码】

import tkinter as T 
from tkinter import ttk
winX = 300
winY = 100
beginX = 0
beginY = 0
count = 0

def winMove(event):
    global winX, winY, beginX, beginY, count
    if count == 0:
        beginX = event.x
        beginY = event.y
    count+=1
    winX += event.x 
    winY += event.y
    winX -= beginX
    winY -= beginY
    win.geometry('680x520+%s+%s' % (winX, winY))

def winRelease(event):  #  判断初始化 判断第一次点击屏幕的计数器
    global count
    count=0

win = T.Tk()
# win.attributes("-fullscreen", True)   # 全屏
win.overrideredirect(True)  # 去除边框
win.geometry('680x520+%s+%s' %(winX, winY))
win['background'] = 'white'

win.bind('', winMove)    # 鼠标长按事件
win.bind('', winRelease)   # 鼠标松开事件


leftImg = T.PhotoImage(file='pic1.gif')
lLab = T.Label(image=leftImg).place(x=0,y=0)

def winQuit(events):
    win.destroy()

exitImg = T.PhotoImage(file='icon5.gif')
exitLab = T.Label(image=exitImg, bg='white', cursor='hand2')
exitLab.bind('', winQuit)
exitLab.place(x=喵0, y=10)

qqIcon = T.PhotoImage(file='qqLogo.gif')
T.Label(image=qqIcon, bg='white', cursor='hand2').place(x=450, y=100)
T.Label(text='QQ登录', bg='white', cursor='hand2', fg='#1191ff').place(x=458, y=170)
wxIcon = T.PhotoImage(file='wxLogo.gif')
T.Label(image=wxIcon, bg='white', cursor='hand2').place(x=550, y=100)
wxLab = T.Label(text='微信登录', bg='white', cursor='hand2', fg='#a6a6a6').place(x=558, y=170)

userValue = T.StringVar()
userEnt = T.Entry(font="Helvetica 14", cursor='hand2', borderwidth=0, 
                    textvariable=userValue, width=16).place(x=420, y=250)

pwdValue = T.StringVar()    # font = ('黑体', 23)
pwdEnt = T.Entry(show = '*', font="Helvetica 13", cursor='hand2', borderwidth=0, 
                    textvariable=pwdValue, width=16).place(x=420, y=305)

cv = T.Canvas(win, bg='white', height=6, width=220)
cv['highlightthickness'] = 0    # 去除cavas边框
cv.create_line(0, 3, 220, 3, fill='#a6a6a6', width=0.5)
cv.place(x=420, y=280)

cv2 = T.Canvas(win, bg='white', height=6, width=220)
cv2['highlightthickness'] = 0    # 去除cavas边框
cv2.create_line(0, 3, 220, 3, fill='#a6a6a6', width=0.5)
cv2.place(x=420, y=330)

icon1 = T.PhotoImage(file='icon.gif')
iconLab = T.Label(image=icon1, bg='white', cursor='hand2')
iconLab.place(x=610, y=249)


icon2 = T.PhotoImage(file='icon3.gif')
iconLab = T.Label(image=icon2, bg='white', cursor='hand2')
iconLab.place(x=610, y=292)


def ck1_func(): # 判断记住密码的多选框是不是 不打勾
    if not ck1.get():
        ck2.set(False)

def ck2_func(): #  判断 自动登录的多选框是不是 打勾 
    if ck2.get():
        ck1.set(True)

ck1 = T.BooleanVar()    # IntVar()
ck2 = T.BooleanVar()
T.Checkbutton(variable=ck1, command=ck1_func, bg='white').place(x=420, y=450)
T.Checkbutton(variable=ck2, command=ck2_func, bg='white').place(x=420, y=480)
T.Label(text='记住密码', bg='white', fg='#a6a6a6').place(x=435, y=451)
T.Label(text='自动登录', bg='white', fg='#a6a6a6').place(x=435, y=481)

T.Label(text='找回密码', bg='white', fg='#a6a6a6', cursor='hand2').place(x=590, y=451)

regIcon = T.Label(text='注册账号', bg='white', fg='#a6a6a6', cursor='hand2')
regIcon.place(x=590, y=481)
def func(event):        # event 事件
    # print('注册账号')
    pass
    # 把注册账号的界面布局完成  regWin  goto
    
regIcon.bind('',func)

T.mainloop()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页