how to change font size of messages inside messagebox.showinfo(message='Hello') in tkinter python3.7

安稳与你 提交于 2021-01-29 10:11:56

问题


I am trying to make displayed message fonts bigger for certain messages when it get displayed so that its easier for eyes to read than standard size. I checked on past post regarding this issue and couldn't found any answers that helps. I found answer using r.option_add but it seems not to have any effect on windows. If any one has gone through this issue and have suggestion/answer to fix this problem i would be thankful to everyone who put their time and effort on it. Thank you.

Code i found on previous posts or link: https://grokbase.com/t/python/tkinter-discuss/054chdx51f/font-control-in-tkmessagebox

from tkinter import *

from tkinter import messagebox

r = Tk()

r.option_add('*font', 'Helvetica-18')

messagebox.showinfo(message='Hello')


回答1:


In the Tcler's wiki it says: "With recent versions, the Windows messageBox is "native"...", which as far as I can tell means it's using a windows component and you can't change the mesage box font.

You could try to make your own custom dialog with the help of tkinters simpledialog. Have a look at effbot: Dialog Windows



来源:https://stackoverflow.com/questions/53694345/how-to-change-font-size-of-messages-inside-messagebox-showinfomessage-hello

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!