繁体   English   中英

我想要一个按钮来执行双重命令一个命令将终止我当前的 window 另一个命令将在 tkinter 中打开一个新的 window

[英]I want a single button to do double command one command will terminate my present window and another command will open a new window in tkinter

def newwindow():
   -----------

def exit():
  exit()


root=Tk()
signup=Button(root,text="Sign Up",command=[ newwindow(),exitt() ],
              width=12,bg='green',fg='white',font=("arial",12,'bold'))

使用 function 作为命令:

def newwindow():
       -----------
   
    
def myexit():
    exit()

def my_command():
    newwindow()
    myexit()
    
    root=Tk()
    signup=Button(root,text="Sign Up",command=mycommand,
                  width=12,bg='green',fg='white',font=("arial",12,'bold'))```

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM