The gtk.FontSelection widget lets users to choose and relate the font of a particular name, size and style. The dialog has a preview box containing some text which will be showed in selected font account, and two buttons CANCEL and OK.
PyGTK API covers a Pango module which describes classes and functionality essential to render high quality internationalized text. Font and text handling in gtk is supported by Pango. The pango.Font object signifies a font in a system independent way. The pango.FontDescription object contains the characteristics of a font.
gtk.FontSelectionDialog returns a pango.Font object. In order to apply the selected font, fontmetrics is fetched by obtaining the pango.FontDescription object from it.
The resulting is a constructor of the FontSelectionDialog class –
The resulting are some commonly used methods of this class −
The selected font is applied to the text in a widget using the modify_font() method.
When FontSelectionDialog menu item is activated, the resulting callback function is invoked –
The selected font is applied to the text of label placed on the toplevel window.
The resultingis the output –
PyGTK Related Interview Questions
|Python Interview Questions||PHP Interview Questions|
|Ruby on Rails Interview Questions||Ubuntu Certified Professional Interview Questions|
|Django Interview Questions||GNU Image Manipulation Program(GIMP) Interview Questions|
|TurboGears Interview Questions||Lisp programming Interview Questions|
|wxPython Interview Questions||Basic C Interview Questions|
|Python Automation Testing Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.