Class FontButton.Builder<B extends FontButton.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, FontChooser.Builder<B>, BuilderInterface
Enclosing class:
FontButton

public static class FontButton.Builder<B extends FontButton.Builder<B>> extends Widget.Builder<B> implements Accessible.Builder<B>, FontChooser.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public FontButton build()
      Finish building the FontButton object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to FontButton.
      Overrides:
      build in class Widget.Builder<B extends FontButton.Builder<B>>
      Returns:
      a new instance of FontButton with the properties that were set in the Builder object.
    • setModal

      public B setModal(boolean modal)
      Whether the font chooser dialog should be modal.
      Parameters:
      modal - the value for the modal property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTitle

      public B setTitle(String title)
      The title of the font chooser dialog.
      Parameters:
      title - the value for the title property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseFont

      public B setUseFont(boolean useFont)
      Whether the buttons label will be drawn in the selected font.
      Parameters:
      useFont - the value for the use-font property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseSize

      public B setUseSize(boolean useSize)
      Whether the buttons label will use the selected font size.
      Parameters:
      useSize - the value for the use-size property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onActivate

      public B onActivate(FontButton.ActivateCallback handler)

      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.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.4
      See Also:
    • onFontSet

      public B onFontSet(FontButton.FontSetCallback handler)

      Emitted when the user selects a font.

      When handling this signal, use FontChooser.getFont() to find out which font was just selected.

      Note that this signal is only emitted when the user changes the font. If you need to react to programmatic font changes as well, use the notify::font signal.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: