新しいtkinterウィンドウを開くとき、ユーザーが新しいウィンドウのボタンをクリックできるようにするだけです。アプリケーションの一部である他のウィンドウのボタンをクリックできないようにする必要があります。どうすればこれを達成できますか?
これが私のコードの一部です:
def exportEFS(self):
self.exportGUI = Toplevel()
Button(self.exportGUI, text='Backup', command=self.backup).pack(padx=100,pady=5)
Button(self.exportGUI, text='Restore', command=self.restore).pack(padx=100,pady=5)
def backup(self):
self.backupWindow = Toplevel()
message = "Enter a name for your Backup."
Label(self.backupWindow, text=message).pack()
self.entry = Entry(self.backupWindow,text="enter your choice")
self.entry.pack(side=TOP,padx=10,pady=12)
self.button = Button(self.backupWindow, text="Backup",command=self.backupCallBack)
self.button.pack(side=BOTTOM,padx=10,pady=10)
このスニップでは、backupWindowを開くと、exportGUIは開いたままになりますが、backupWindowが開いている間、ユーザーは[バックアップ]または[復元]をクリックできないようにする必要があります。
ありがとう!