How to create Message Box? #30
|
on button click I want to create Message Box with "OK" or "Yes or No" button |
Answered by
ObaraEmmanuel
Mar 13, 2024
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 |
0 replies
Answer selected by
ewwink
|
OK thanks again |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

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_messagemust match the name you provided in the command option.