I am changing the default font for a Tkinter application:

class FuelControl(Tkinter.Frame):
    def __init__(self,master):
        self.version='0.02'
        self.font=tkFont.Font(family="Helvetica",size=18) 
        print self.font.actual()
.
.
.

and everything looks ok:

{'family': 'Nimbus Sans L', 'weight': 'normal', 'slant': 'roman', 'overstrike': 
0, 'underline': 0, 'size': 18}

and the size of the text are 18 on the screen. Then a button creates a new 
window through this callback:

    def loc_add(self):
        addw=Tix.Tk()
        addw.title('Add location')
        print self.font.actual()
        Tkinter.Label(addw,text='Nickname:', 
font=self.font).grid(row=0,column=0)
        Tkinter.Label(addw,text='Fullname:', 
font=self.font).grid(row=1,column=0)
        Tkinter.Label(addw,text='Address:',  
font=self.font).grid(row=2,column=0)
        Tkinter.Label(addw,text='Fuel 
name:',font=self.font).grid(row=3,column=0)
...

The self.font stays with the right value:

{'family': 'Nimbus Sans L', 'weight': 'normal', 'slant': 'roman', 'overstrike': 
0, 'underline': 0, 'size': 18}

but the real displayed fonts in the window are smaller (default size of 12, 
maybe).

Am I missing something?

Thanks in advance,
A.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to