Class Dialog.Builder<B extends Dialog.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
Accessible.Builder<B>, BuilderInterface
Direct Known Subclasses:
AppChooserDialog.Builder, ColorChooserDialog.Builder, FileChooserDialog.Builder, FontChooserDialog.Builder, MessageDialog.Builder, PageSetupUnixDialog.Builder, PrintUnixDialog.Builder
Enclosing class:
Dialog

public static class Dialog.Builder<B extends Dialog.Builder<B>> extends Window.Builder<B> implements Accessible.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 Dialog build()
      Finish building the Dialog object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Dialog.
      Overrides:
      build in class Window.Builder<B extends Dialog.Builder<B>>
      Returns:
      a new instance of Dialog with the properties that were set in the Builder object.
    • setUseHeaderBar

      @Deprecated public B setUseHeaderBar(int useHeaderBar)
      Deprecated.
      Use Window instead

      true if the dialog uses a headerbar for action buttons instead of the action-area.

      For technical reasons, this property is declared as an integer property, but you should only set it to true or false.

      Creating a dialog with headerbar

      Builtin GtkDialog subclasses such as ColorChooserDialog set this property according to platform conventions (using the Gtk.Settings:gtk-dialogs-use-header setting).

      Here is how you can achieve the same:

      g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
      dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
      
      Parameters:
      useHeaderBar - the value for the use-header-bar property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onClose

      @Deprecated public B onClose(Dialog.CloseCallback handler)
      Deprecated.
      Use Window instead

      Emitted when the user uses a keybinding to close the dialog.

      This is a keybinding signal.

      The default binding for this signal is the Escape key.

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

      @Deprecated public B onResponse(Dialog.ResponseCallback handler)
      Deprecated.
      Use Window instead

      Emitted when an action widget is clicked.

      The signal is also emitted when the dialog receives a delete event, and when Dialog.response(int) is called. On a delete event, the response ID is ResponseType.DELETE_EVENT. Otherwise, it depends on which action widget was clicked.

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