| FAQ Index - Search - Recent Changes - Everything - Add entry |
4.17. Why does FontSelection's set_font_name return False?
It needs to be added to a window before the font lists are populated.
>>> w = gtk.Window()
>>> f = gtk.FontSelection()
>>> f.get_font_name()
'Sans 10'
>>> f.set_font_name('Sans 12')
False
>>> w.add(f)
>>> f.set_font_name('Sans 12')
True
Once added to the window, the result will indeed be True.
