On 4/13/05, Michael Lange <[EMAIL PROTECTED]> wrote:
> you can specify an application-wide default font which will be used by
> tkMessageBox , too.
>
> >>> from Tkinter import *
> >>> import tkMessageBox
> >>> r = Tk()
> >>> r.option_add('*font', 'Helvetica -12')
> >>> tkMessageBox.showinfo(message='Hello')
This seems to have no effect under WindowsXP.
If I use a different widget, I do get the font to be set, but only if
I add the following line before instantiating my widget:
r.option_readfile('optionDB')
also, you have to explicitly create your file optionDB before you run
your app. The following example does show colours and fonts set:
from Tkinter import *
import tkMessageBox, os
optionFile = 'optionDB'
if not os.path.exists(optionFile):
f1 = open(optionFile,'r')
f1.close()
r = Tk()
r.option_add('*font', ('Courier 6 italic'))
r.option_readfile('optionDB')
tkMessageBox.showinfo(message='Hello, World!')
l = Label(r, text = "What colour am I?")
b = Button(r, text = "Quit Now!", command= sys.exit)
l.pack()
b.pack()
r.mainloop()
--
Stewart Midwinter
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Skype: midtoad
_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss