:right-sidebar: True FontButton =================================================================== .. currentmodule:: gi.repository.Gtk .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead .. class:: FontButton(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.FontChooser` The ``GtkFontButton`` allows to open a font chooser dialog to change the font. .. image:: https://docs.gtk.org/gtk4/font-button.png It is suitable widget for selecting a font in a preference dialog. CSS nodes -------------------------------------------------------------------------------- .. code-block:: :dedent: fontbutton ╰── button.font ╰── [content] ``GtkFontButton`` has a single CSS node with name fontbutton which contains a button node with the .font style class. Constructors ------------ .. rst-class:: interim-class .. class:: FontButton :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new font picker widget. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead .. classmethod:: new_with_font(fontname: str) -> ~gi.repository.Gtk.Widget Creates a new font picker widget showing the given font. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead :param fontname: Name of font to display in font chooser dialog Methods ------- .. rst-class:: interim-class .. class:: FontButton :no-index: .. method:: get_modal() -> bool Gets whether the dialog is modal. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead .. method:: get_title() -> str Retrieves the title of the font chooser dialog. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead .. method:: get_use_font() -> bool Returns whether the selected font is used in the label. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead .. method:: get_use_size() -> bool Returns whether the selected size is used in the label. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead .. method:: set_modal(modal: bool) -> None Sets whether the dialog should be modal. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead :param modal: :const:`True` to make the dialog modal .. method:: set_title(title: str) -> None Sets the title for the font chooser dialog. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead :param title: a string containing the font chooser dialog title .. method:: set_use_font(use_font: bool) -> None If ``use_font`` is :const:`True`, the font name will be written using the selected font. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead :param use_font: If :const:`True`, font name will be written using font chosen. .. method:: set_use_size(use_size: bool) -> None If ``use_size`` is :const:`True`, the font name will be written using the selected size. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.FontDialogButton` instead :param use_size: If :const:`True`, font name will be written using the selected size. Properties ---------- .. rst-class:: interim-class .. class:: FontButton :no-index: .. attribute:: props.modal :type: bool The type of the None singleton. .. attribute:: props.title :type: str The type of the None singleton. .. attribute:: props.use_font :type: bool The type of the None singleton. .. attribute:: props.use_size :type: bool The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: FontButton.signals :no-index: .. method:: activate() -> None Emitted to when the font button is activated. The ``::activate`` signal on ``GtkFontButton`` is an action signal and emitting it causes the button to present its dialog. .. versionadded:: 4.4 .. method:: font_set() -> None The type of the None singleton.