Control Font in tkMessageBox

前端 未结 3 1626
失恋的感觉
失恋的感觉 2021-01-12 04:20

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,

3条回答
  •  萌比男神i
    2021-01-12 05:01

    option_add may only work for linux operating systems, but you can control font, where the lines wrap, and the width of the box:

        root.option_add('*Dialog.msg.font', 'Helvetica 24')
        root.master.option_add('*Dialog.msg.width', 34)
        root.master.option_add("*Dialog.msg.wrapLength", "6i")
    

提交回复
热议问题