pythonfontstkintertkmessagebox

Control Font in tkMessageBox


I would to like to control the font of the text on a tkMessageBox but I can't see any reference of such a stuff. Is it only implemented in Tkinter?

Thanks,


Solution

  • You can configure the font for just dialog boxes by doing the following:

    from Tkinter import *
    import tkMessageBox
    r = Tk()
    r.option_add('*Dialog.msg.font', 'Helvetica 12')
    tkMessageBox.showinfo(message='Hello')
    

    (Only the option_add invocation is modified from the accepted answer.)