问题描述
限时送ChatGPT账号..我试图在显示某些消息时使显示的消息字体更大,以便眼睛比标准尺寸更容易阅读.我查看了过去有关此问题的帖子,但找不到任何有帮助的答案.我使用 r.option_add 找到了答案,但它似乎对 Windows 没有任何影响.如果有人解决了这个问题并有解决这个问题的建议/答案,我将感谢所有投入时间和精力的人.谢谢.
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.
我在以前的帖子或链接中找到的代码:https://grokbase/t/python/tkinter-discuss/054chdx51f/font-control-in-tkmessagebox
Code i found on previous posts or link: https://grokbase/t/python/tkinter-discuss/054chdx51f/font-control-in-tkmessagebox
从 tkinter 导入 *
from tkinter import *
从 tkinter 导入消息框
from tkinter import messagebox
r = Tk()
r.option_add('*font', 'Helvetica-18')
r.option_add('*font', 'Helvetica-18')
messagebox.showinfo(message='Hello')
messagebox.showinfo(message='Hello')
推荐答案
在 Tcler 的wiki 它说:在最近的版本中,Windows messageBox 是本机"...",据我所知,这意味着它使用的是 Windows 组件,并且您无法更改消息框字体.
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.
您可以尝试在 tkinters simpledialog 的帮助下制作自己的自定义对话框.看看 effbot: Dialog Windows
You could try to make your own custom dialog with the help of tkinters simpledialog. Have a look at effbot: Dialog Windows
这篇关于如何在 tkinter python3.7 中更改 messagebox.showinfo(message='Hello') 中消息的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论