How to create Message Box? #30
-
on button click I want to create Message Box with "OK" or "Yes or No" button |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is no way to directly do this on the designer yet. However, you can easily do this on the code side. You will need to attach a command to the button like so: Note the name You can then call the dialog in your code from formation.loader import AppBuilder
from tkinter.messagebox import askyesno
class App(AppBuilder):
def __init__(self):
super().__init__(path="test.xml")
self.connect_callbacks(self)
def show_message(self):
result = askyesno("Test", "This is a test message box")
print(result)
if __name__ == "__main__":
App().mainloop() The name of the method |
Beta Was this translation helpful? Give feedback.
-
OK thanks again |
Beta Was this translation helpful? Give feedback.
There is no way to directly do this on the designer yet. However, you can easily do this on the code side. You will need to attach a command to the button like so:
Note the name
show_message
.You can then call the dialog in your code
The name of the method
show_message
must match the name you provided in the command option.