Gtk.FontChooserDialog


Gtk.FontChooserDialog — A dialog for selecting fonts

Object Hierarchy:

    GObject
    ╰── GInitiallyUnowned
        ╰── Gtk.Widget
            ╰── Gtk.Container
                ╰── Gtk.Bin
                    ╰── Gtk.Window
                        ╰── Gtk.Dialog
                            ╰── Gtk.FontChooserDialog

See also:

Gtk.FontChooser, Gtk.Dialog


Functions:

  • new (title:str=None, parent:Gtk.Window=None) -> Gtk.Widget

Description:

The Gtk.FontChooserDialog widget is a dialog for selecting a font.

It implements the Gtk.FontChooser interface.

Gtk.FontChooserDialog as GtkBuildable

The Gtk.FontChooserDialog implementation of the GtkBuildable interface exposes the buttons with the names select_button and cancel_button.


Function Details:

new()

new (title:str=None, parent:Gtk.Window=None) -> Gtk.Widget

Creates a new Gtk.FontChooserDialog.

  • Returns: a new Gtk.FontChooserDialog

  • Since: 3.2


Example:

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

fontchooserdialog = Gtk.FontChooserDialog()
fontchooserdialog.set_title("FontChooserDialog")

response = fontchooserdialog.run()

if response == Gtk.ResponseType.OK:
    print("Font selected: %s" % fontchooserdialog.get_font())

fontchooserdialog.destroy()

results matching ""

    No results matching ""