[Python] Edit button in Tkinter message-box

Discussão em 'Python' iniciado por Stack, Maio 10, 2025.

  1. Stack

    Stack Membro Participativo

    I am using Tkinter to make GUI. I included a messagebox in my code, here's the detail:

    from tkinter import *
    from tkinter.messagebox import *
    root=Tk()

    askyesno(message="Are you sure you want to choose this text file?")


    When the askyesno pops up, there are 2 buttons: Yes and No, but I want to customize these buttons to "OK" and "Cancel", for example. I have been looking for how to customize Tkinter messagebox buttons many times but I found nothing. Any help? Thanks

    Continue reading...

Compartilhe esta Página