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


Groups > comp.lang.python > #102267 > unrolled thread

Re: Font issues Tkinter/Python 3.5

Started byMRAB <python@mrabarnett.plus.com>
First post2016-01-30 01:09 +0000
Last post2016-01-30 01:09 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Re: Font issues Tkinter/Python 3.5 MRAB <python@mrabarnett.plus.com> - 2016-01-30 01:09 +0000

#102267 — Re: Font issues Tkinter/Python 3.5

FromMRAB <python@mrabarnett.plus.com>
Date2016-01-30 01:09 +0000
SubjectRe: Font issues Tkinter/Python 3.5
Message-ID<mailman.106.1454116211.2338.python-list@python.org>

On 2016-01-29 22:04:57, "KP" <kai.peters@gmail.com> wrote:

>import tkinter as tk
>from tkinter import ttk
>from tkinter import font
>...
>     def __init__(self):
>         self.root = tk.Tk()
>         self.root.title('Main Window')
>         self.root.geometry('1000x800+200+200')
>         self.root.minsize(width=1000, height=800)
>
>         default_font = tkFont.nametofont("TkDefaultFont")
>         default_font.configure(size=12)
>         self.root.option_add("*Font", default_font)
>         ...
>         self.root.mainloop()
>...
>
>tells me that 'tkFont' is not defined. What am I missing?
>
>As always, thanks for any pointers!
>
  'nametofont' is in tkinter.font, which you have imported as 'font', so 
'tkFont.nametofont' should be 'font.nametofont'.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web