我开始盯着python。我有一个udemy课程,还阅读了这篇文章:如何在Tkinter成功登录后让你的主窗口出现(PYTHON 3.6
尽管如此,我仍然无法实施 recired 事件。我想在登录后打开桌面应用程序的新(主)窗口。由于某种原因,该脚本还突然打开了第三个窗口。自从 2 天以来,我对那些东西的工作感到非常沮丧......
感谢帮助 :)
from tkinter import Tk, Label, Button, messagebox
from tkinter import *
class AirsoftGunRack:
##### Main Window #####
##### Login Page #####
def __init__(self,master):
"""
:type master: object
"""
##### Login Page #####
self.master = master
master.title("Login - Airsoft GunRack 3.0")
master.geometry("450x230+450+170")
# Creating describtions
self.username = Label(master, text="Username:")
self.username.place(relx=0.285, rely=0.298, height=20, width=55)
self.password = Label(master, text="Password:")
self.password.place(relx=0.285, rely=0.468, height=20, width=55)
# Creating Buttons
self.login_button = Button(master, text="Login")
self.login_button.place(relx=0.440, rely=0.638, height=30, width=60)
self.login_button.configure(command=self.login_user)
self.exit_button = Button(master, text="Exit") # , command=master.quit)
self.exit_button.place(relx=0.614, rely=0.638, height=30, width=60)
self.exit_button.configure(command=self.exit_login)
# Creating entry boxes
self.username_box = Entry(master)
self.username_box.place(relx=0.440, rely=0.298, height=20, relwidth=0.35)
self.password_box = Entry(master)
self.password_box.place(relx=0.440, rely=0.468, height=20, relwidth=0.35)
self.password_box.configure(show="*")
self.password_box.configure(background="white")
摇曳的蔷薇
qq_花开花谢_0
隔江千里
相关分类