FontChooserWidget

A FontChooserWidget allows for the selection of fonts including the styling and size.

Constructor

The FontChooserWidget can be constructed using the following:

fontchooserwidget = Gtk.FontChooserWidget()

Example

Below is an example of a FontChooserWidget:

#!/usr/bin/env python3

from gi.repository import Gtk

def font_chooser(fontchooserwidget, font):
    print("Font selected: %s" % font)

window = Gtk.Window()
window.connect("destroy", Gtk.main_quit)

fontchooserwidget = Gtk.FontChooserWidget()
fontchooserwidget.connect("font-activated", font_chooser)
window.add(fontchooserwidget)

window.show_all()

Gtk.main()

Download: FontChooserWidget