Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37710

Fonts & Tinker

Newsgroups comp.lang.python
Date 2013-01-25 20:41 -0800
Message-ID <5356f7a4-252a-46ac-8225-c8dec1fe9523@googlegroups.com> (permalink)
Subject Fonts & Tinker
From Angel <angel.gutierrez.rodriguez@gmail.com>

Show all headers | View raw


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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Fonts & Tinker Angel <angel.gutierrez.rodriguez@gmail.com> - 2013-01-25 20:41 -0800
  Re: Fonts & Tinker Angel <angel.gutierrez.rodriguez@gmail.com> - 2013-01-25 20:42 -0800
  Re: Fonts & Tinker Paul <aquagnu@gmail.com> - 2013-01-25 21:18 -0800
  Re: Fonts & Tinker Rick Johnson <rantingrickjohnson@gmail.com> - 2013-01-27 07:34 -0800
  Re: [SPAM] Fonts & Tinker Łukasz Posadowski <mail@lukaszposadowski.pl> - 2013-01-28 12:28 +0100
  Re: Fonts & Tinker Angel <angel.gutierrez.rodriguez@gmail.com> - 2013-01-30 02:08 -0800

csiph-web