Class Assistant

All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public class Assistant extends Window implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager
Deprecated.
This widget will be removed in GTK 5

GtkAssistant is used to represent a complex as a series of steps.

An example GtkAssistant

Each step consists of one or more pages. GtkAssistant guides the user through the pages, and controls the page flow to collect the data needed for the operation.

GtkAssistant handles which buttons to show and to make sensitive based on page sequence knowledge and the Gtk.AssistantPageType of each page in addition to state information like the completed and committed page statuses.

If you have a case that doesn’t quite fit in GtkAssistants way of handling buttons, you can use the AssistantPageType.CUSTOM page type and handle buttons yourself.

GtkAssistant maintains a GtkAssistantPage object for each added child, which holds additional per-child properties. You obtain the GtkAssistantPage for a child with getPage(Widget).

GtkAssistant as GtkBuildable

The GtkAssistant implementation of the GtkBuildable interface exposes the actionArea as internal children with the name “action_area”.

To add pages to an assistant in GtkBuilder, simply add it as a child to the GtkAssistant object. If you need to set per-object properties, create a GtkAssistantPage object explicitly, and set the child widget as a property on it.

CSS nodes

GtkAssistant has a single CSS node with the name window and style class .assistant.

  • Constructor Details

    • Assistant

      public Assistant(MemorySegment address)
      Deprecated.
      Create a Assistant instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Assistant

      public Assistant()
      Deprecated.
      Create a new Assistant.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Deprecated.
      Get the GType of the Assistant class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      Deprecated.
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected Assistant asParent()
      Deprecated.
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Window
      Returns:
      the instance as if it were its parent type
    • addActionWidget

      @Deprecated public void addActionWidget(Widget child)
      Deprecated.
      This widget will be removed in GTK 5
      Adds a widget to the action area of a GtkAssistant.
      Parameters:
      child - a GtkWidget
    • appendPage

      @Deprecated public int appendPage(Widget page)
      Deprecated.
      This widget will be removed in GTK 5
      Appends a page to the assistant.
      Parameters:
      page - a GtkWidget
      Returns:
      the index (starting at 0) of the inserted page
    • commit

      @Deprecated public void commit()
      Deprecated.
      This widget will be removed in GTK 5

      Erases the visited page history.

      GTK will then hide the back button on the current page, and removes the cancel button from subsequent pages.

      Use this when the information provided up to the current page is hereafter deemed permanent and cannot be modified or undone. For example, showing a progress page to track a long-running, unreversible operation after the user has clicked apply on a confirmation page.

    • getCurrentPage

      @Deprecated public int getCurrentPage()
      Deprecated.
      This widget will be removed in GTK 5
      Returns the page number of the current page.
      Returns:
      The index (starting from 0) of the current page in the assistant, or -1 if the this Assistant has no pages, or no current page
    • getNPages

      @Deprecated public int getNPages()
      Deprecated.
      This widget will be removed in GTK 5
      Returns the number of pages in the this Assistant
      Returns:
      the number of pages in the this Assistant
    • getNthPage

      @Deprecated public @Nullable Widget getNthPage(int pageNum)
      Deprecated.
      This widget will be removed in GTK 5
      Returns the child widget contained in page number pageNum.
      Parameters:
      pageNum - the index of a page in the assistant, or -1 to get the last page
      Returns:
      the child widget, or null if pageNum is out of bounds
    • getPage

      @Deprecated public AssistantPage getPage(Widget child)
      Deprecated.
      This widget will be removed in GTK 5
      Returns the GtkAssistantPage object for child.
      Parameters:
      child - a child of this Assistant
      Returns:
      the GtkAssistantPage for child
    • getPageComplete

      @Deprecated public boolean getPageComplete(Widget page)
      Deprecated.
      This widget will be removed in GTK 5
      Gets whether page is complete.
      Parameters:
      page - a page of this Assistant
      Returns:
      true if page is complete.
    • getPageTitle

      @Deprecated public String getPageTitle(Widget page)
      Deprecated.
      This widget will be removed in GTK 5
      Gets the title for page.
      Parameters:
      page - a page of this Assistant
      Returns:
      the title for page
    • getPageType

      @Deprecated public AssistantPageType getPageType(Widget page)
      Deprecated.
      This widget will be removed in GTK 5
      Gets the page type of page.
      Parameters:
      page - a page of this Assistant
      Returns:
      the page type of page
    • getPages

      @Deprecated public ListModel getPages()
      Deprecated.
      This widget will be removed in GTK 5
      Gets a list model of the assistant pages.
      Returns:
      A list model of the pages.
    • insertPage

      @Deprecated public int insertPage(Widget page, int position)
      Deprecated.
      This widget will be removed in GTK 5
      Inserts a page in the this Assistant at a given position.
      Parameters:
      page - a GtkWidget
      position - the index (starting at 0) at which to insert the page, or -1 to append the page to the this Assistant
      Returns:
      the index (starting from 0) of the inserted page
    • nextPage

      @Deprecated public void nextPage()
      Deprecated.
      This widget will be removed in GTK 5

      Navigate to the next page.

      It is a programming error to call this function when there is no next page.

      This function is for use when creating pages of the AssistantPageType.CUSTOM type.

    • prependPage

      @Deprecated public int prependPage(Widget page)
      Deprecated.
      This widget will be removed in GTK 5
      Prepends a page to the assistant.
      Parameters:
      page - a GtkWidget
      Returns:
      the index (starting at 0) of the inserted page
    • previousPage

      @Deprecated public void previousPage()
      Deprecated.
      This widget will be removed in GTK 5

      Navigate to the previous visited page.

      It is a programming error to call this function when no previous page is available.

      This function is for use when creating pages of the AssistantPageType.CUSTOM type.

    • removeActionWidget

      @Deprecated public void removeActionWidget(Widget child)
      Deprecated.
      This widget will be removed in GTK 5
      Removes a widget from the action area of a GtkAssistant.
      Parameters:
      child - a GtkWidget
    • removePage

      @Deprecated public void removePage(int pageNum)
      Deprecated.
      This widget will be removed in GTK 5
      Removes the pageNum’s page from assistant.
      Parameters:
      pageNum - the index of a page in the assistant, or -1 to remove the last page
    • setCurrentPage

      @Deprecated public void setCurrentPage(int pageNum)
      Deprecated.
      This widget will be removed in GTK 5

      Switches the page to pageNum.

      Note that this will only be necessary in custom buttons, as the this Assistant flow can be set with gtk_assistant_set_forward_page_func().

      Parameters:
      pageNum - index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the assistant, nothing will be done.
    • setForwardPageFunc

      @Deprecated public void setForwardPageFunc(@Nullable AssistantPageFunc pageFunc)
      Deprecated.
      This widget will be removed in GTK 5

      Sets the page forwarding function to be pageFunc.

      This function will be used to determine what will be the next page when the user presses the forward button. Setting pageFunc to null will make the assistant to use the default forward function, which just goes to the next visible page.

      Parameters:
      pageFunc - the GtkAssistantPageFunc, or null to use the default one
    • setPageComplete

      @Deprecated public void setPageComplete(Widget page, boolean complete)
      Deprecated.
      This widget will be removed in GTK 5

      Sets whether page contents are complete.

      This will make this Assistant update the buttons state to be able to continue the task.

      Parameters:
      page - a page of this Assistant
      complete - the completeness status of the page
    • setPageTitle

      @Deprecated public void setPageTitle(Widget page, String title)
      Deprecated.
      This widget will be removed in GTK 5

      Sets a title for page.

      The title is displayed in the header area of the assistant when page is the current page.

      Parameters:
      page - a page of this Assistant
      title - the new title for page
    • setPageType

      @Deprecated public void setPageType(Widget page, AssistantPageType type)
      Deprecated.
      This widget will be removed in GTK 5

      Sets the page type for page.

      The page type determines the page behavior in the assistant.

      Parameters:
      page - a page of this Assistant
      type - the new type for page
    • updateButtonsState

      @Deprecated public void updateButtonsState()
      Deprecated.
      This widget will be removed in GTK 5

      Forces this Assistant to recompute the buttons state.

      GTK automatically takes care of this in most situations, e.g. when the user goes to a different page, or when the visibility or completeness of a page changes.

      One situation where it can be necessary to call this function is when changing a value on the current page affects the future page flow of the assistant.

    • onApply

      Deprecated.
      This widget will be removed in GTK 5

      Emitted when the apply button is clicked.

      The default behavior of the GtkAssistant is to switch to the page after the current page, unless the current page is the last one.

      A handler for the ::apply signal should carry out the actions for which the wizard has collected data. If the action takes a long time to complete, you might consider putting a page of type AssistantPageType.PROGRESS after the confirmation page and handle this operation within the Gtk.Assistant::prepare signal of the progress page.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitApply

      @Deprecated public void emitApply()
      Deprecated.
      Emits the "apply" signal. See onApply(Assistant.ApplyCallback).
    • onCancel

      Deprecated.
      This widget will be removed in GTK 5
      Emitted when then the cancel button is clicked.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitCancel

      @Deprecated public void emitCancel()
      Deprecated.
      Emits the "cancel" signal. See onCancel(Assistant.CancelCallback).
    • onClose

      Deprecated.
      This widget will be removed in GTK 5
      Emitted either when the close button of a summary page is clicked, or when the apply button in the last page in the flow (of type AssistantPageType.CONFIRM) is clicked.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitClose

      @Deprecated public void emitClose()
      Deprecated.
      Emits the "close" signal. See onClose(Assistant.CloseCallback).
    • onEscape

      Deprecated.
      This widget will be removed in GTK 5
      The action signal for the Escape binding.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitEscape

      @Deprecated public void emitEscape()
      Deprecated.
      Emits the "escape" signal. See onEscape(Assistant.EscapeCallback).
    • onPrepare

      Deprecated.
      This widget will be removed in GTK 5

      Emitted when a new page is set as the assistant's current page, before making the new page visible.

      A handler for this signal can do any preparations which are necessary before showing page.

      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitPrepare

      @Deprecated public void emitPrepare(@Nullable Widget page)
      Deprecated.
      Emits the "prepare" signal. See onPrepare(Assistant.PrepareCallback).
    • builder

      public static Assistant.Builder<? extends Assistant.Builder> builder()
      Deprecated.
      A Assistant.Builder object constructs a Assistant with the specified properties. Use the various set...() methods to set properties, and finish construction with Assistant.Builder.build().
      Returns:
      the builder object