Class FontButton

All Implemented Interfaces:
PointerInterface

public class FontButton extends Widget
The `GtkFontButton` allows to open a font chooser dialog to change
the font.

![An example GtkFontButton](font-button.png)

It is suitable widget for selecting a font in a preference dialog.

# CSS nodes

```
fontbutton
╰── button.font
╰── [content]
```

`GtkFontButton` has a single CSS node with name fontbutton which
contains a button node with the .font style class.

https://docs.gtk.org/gtk4/class.FontButton.html

  • Field Details

  • Constructor Details

    • FontButton

      public FontButton(PointerContainer pointer)
    • FontButton

      public FontButton()
      Creates a new font picker widget.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newWithFontFontButton

      public static FontButton newWithFontFontButton(@Nonnull Str fontname)
      Creates a new font picker widget showing the given font.
      Parameters:
      fontname - Name of font to display in font chooser dialog
      Returns:
      a new font picker widget.
    • newWithFontFontButton

      public static FontButton newWithFontFontButton(String fontname)
      Creates a new font picker widget showing the given font.
      Parameters:
      fontname - Name of font to display in font chooser dialog
      Returns:
      a new font picker widget.
    • getModal

      public boolean getModal()
      Gets whether the dialog is modal.
      Returns:
      %TRUE if the dialog is modal
    • getTitle

      public Str getTitle()
      Retrieves the title of the font chooser dialog.
      Returns:
      an internal copy of the title string which must not be freed.
    • getUseFont

      public boolean getUseFont()
      Returns whether the selected font is used in the label.
      Returns:
      whether the selected font is used in the label.
    • getUseSize

      public boolean getUseSize()
      Returns whether the selected size is used in the label.
      Returns:
      whether the selected size is used in the label.
    • setModal

      public void setModal(boolean modal)
      Sets whether the dialog should be modal.
      Parameters:
      modal - %TRUE to make the dialog modal
    • setTitle

      public void setTitle(@Nonnull Str title)
      Sets the title for the font chooser dialog.
      Parameters:
      title - a string containing the font chooser dialog title
    • setTitle

      public void setTitle(String title)
      Sets the title for the font chooser dialog.
      Parameters:
      title - a string containing the font chooser dialog title
    • setUseFont

      public void setUseFont(boolean use_font)
      If @use_font is %TRUE, the font name will be written
      using the selected font.
      Parameters:
      use_font - If %TRUE, font name will be written using font chosen.
    • setUseSize

      public void setUseSize(boolean use_size)
      If @use_size is %TRUE, the font name will be written using
      the selected size.
      Parameters:
      use_size - If %TRUE, font name will be written using the selected size.
    • onActivate

      public SignalHandler onActivate(FontButton.OnActivate signal)
      Connect to signal "activate".
      See FontButton.OnActivate.onActivate() for signal description.
      Field SIGNAL_ON_ACTIVATE contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onFontSet

      public SignalHandler onFontSet(FontButton.OnFontSet signal)
      Connect to signal "font-set".
      See FontButton.OnFontSet.onFontSet() for signal description.
      Field SIGNAL_ON_FONT_SET contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asFontChooser

      public FontChooser asFontChooser()
      Implements interface FontChooser. Call this to get access to interface functions.
      Returns:
      FontChooser
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()