簡體   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