This code opens a message box on the first window. But I want to open the message box on the second window.
From tkinter import *
From tkinter import messagebox as m
Def b():
A=m.askquestion (" question ","really want to go back")
if(A=1):
R2.destroy()
Def a():
global R2
R2=Toplevel()
Label(R2,text='This is second window').pack()
Button(R2 ,text='back',command=b).pack()
Def c():
global Root
Root=Tk()
Button(root, text='next',command=a).pack()
c()
I'm looking for any suggestions about how to open the message box on the second window.