Klasse Assistant

Alle implementierten Schnittstellen:
PointerInterface

public class Assistant extends Window
`GtkAssistant` is used to represent a complex as a series of steps.

<picture>
<source srcset="assistant-dark.png" media="(prefers-color-scheme: dark)">
<img alt="An example GtkAssistant" src="assistant.png">
</picture>

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 [enum@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 `GtkAssistant`s way of
handling buttons, you can use the %GTK_ASSISTANT_PAGE_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 [method@Gtk.Assistant.get_page].

# GtkAssistant as GtkBuildable

The `GtkAssistant` implementation of the `GtkBuildable` interface
exposes the @action_area 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.

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

  • Felddetails

  • Konstruktordetails

    • Assistant

      public Assistant(PointerContainer pointer)
    • Assistant

      @Deprecated public Assistant()
      Veraltet.
      Creates a new `GtkAssistant`.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addActionWidget

      @Deprecated public void addActionWidget(@Nonnull Widget child)
      Veraltet.
      Adds a widget to the action area of a `GtkAssistant`.
      Parameter:
      child - a `GtkWidget`
    • appendPage

      @Deprecated public int appendPage(@Nonnull Widget page)
      Veraltet.
      Appends a page to the @assistant.
      Parameter:
      page - a `GtkWidget`
      Gibt zurück:
      the index (starting at 0) of the inserted page
    • commit

      @Deprecated public void commit()
      Veraltet.
      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()
      Veraltet.
      Returns the page number of the current page.
      Gibt zurück:
      The index (starting from 0) of the current page in the @assistant, or -1 if the @assistant has no pages, or no current page
    • getNPages

      @Deprecated public int getNPages()
      Veraltet.
      Returns the number of pages in the @assistant
      Gibt zurück:
      the number of pages in the @assistant
    • getNthPage

      @Deprecated public Widget getNthPage(int page_num)
      Veraltet.
      Returns the child widget contained in page number @page_num.
      Parameter:
      page_num - the index of a page in the @assistant, or -1 to get the last page
      Gibt zurück:
      the child widget, or %NULL if @page_num is out of bounds
    • getPage

      @Deprecated public AssistantPage getPage(@Nonnull Widget child)
      Veraltet.
      Returns the `GtkAssistantPage` object for @child.
      Parameter:
      child - a child of @assistant
      Gibt zurück:
      the `GtkAssistantPage` for @child
    • getPageComplete

      @Deprecated public boolean getPageComplete(@Nonnull Widget page)
      Veraltet.
      Gets whether @page is complete.
      Parameter:
      page - a page of @assistant
      Gibt zurück:
      %TRUE if @page is complete.
    • getPageTitle

      @Deprecated public Str getPageTitle(@Nonnull Widget page)
      Veraltet.
      Gets the title for @page.
      Parameter:
      page - a page of @assistant
      Gibt zurück:
      the title for @page
    • getPageType

      @Deprecated public int getPageType(@Nonnull Widget page)
      Veraltet.
      Gets the page type of @page.
      Parameter:
      page - a page of @assistant
      Gibt zurück:
      the page type of @page
    • getPages

      @Deprecated public ListModel getPages()
      Veraltet.
      Gets a list model of the assistant pages.
      Gibt zurück:
      A list model of the pages.
    • insertPage

      @Deprecated public int insertPage(@Nonnull Widget page, int position)
      Veraltet.
      Inserts a page in the @assistant at a given position.
      Parameter:
      page - a `GtkWidget`
      position - the index (starting at 0) at which to insert the page, or -1 to append the page to the @assistant
      Gibt zurück:
      the index (starting from 0) of the inserted page
    • nextPage

      @Deprecated public void nextPage()
      Veraltet.
      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
      %GTK_ASSISTANT_PAGE_CUSTOM type.
    • prependPage

      @Deprecated public int prependPage(@Nonnull Widget page)
      Veraltet.
      Prepends a page to the @assistant.
      Parameter:
      page - a `GtkWidget`
      Gibt zurück:
      the index (starting at 0) of the inserted page
    • previousPage

      @Deprecated public void previousPage()
      Veraltet.
      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
      %GTK_ASSISTANT_PAGE_CUSTOM type.
    • removeActionWidget

      @Deprecated public void removeActionWidget(@Nonnull Widget child)
      Veraltet.
      Removes a widget from the action area of a `GtkAssistant`.
      Parameter:
      child - a `GtkWidget`
    • removePage

      @Deprecated public void removePage(int page_num)
      Veraltet.
      Removes the @page_num’s page from @assistant.
      Parameter:
      page_num - the index of a page in the @assistant, or -1 to remove the last page
    • setCurrentPage

      @Deprecated public void setCurrentPage(int page_num)
      Veraltet.
      Switches the page to @page_num.

      Note that this will only be necessary in custom buttons,
      as the @assistant flow can be set with
      gtk_assistant_set_forward_page_func().
      Parameter:
      page_num - 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(Assistant.OnAssistantPageFunc page_func, @Nullable Pointer data, Assistant.OnDestroyNotify destroy)
      Veraltet.
      Sets the page forwarding function to be @page_func.

      This function will be used to determine what will be
      the next page when the user presses the forward button.
      Setting @page_func to %NULL will make the assistant to
      use the default forward function, which just goes to the
      next visible page.
      Parameter:
      page_func - the `GtkAssistantPageFunc`, or %NULL to use the default one
      data - user data for @page_func
      destroy - destroy notifier for @data
    • setPageComplete

      @Deprecated public void setPageComplete(@Nonnull Widget page, boolean complete)
      Veraltet.
      Sets whether @page contents are complete.

      This will make @assistant update the buttons state
      to be able to continue the task.
      Parameter:
      page - a page of @assistant
      complete - the completeness status of the page
    • setPageTitle

      @Deprecated public void setPageTitle(@Nonnull Widget page, @Nonnull Str title)
      Veraltet.
      Sets a title for @page.

      The title is displayed in the header area of the assistant
      when @page is the current page.
      Parameter:
      page - a page of @assistant
      title - the new title for @page
    • setPageTitle

      @Deprecated public void setPageTitle(@Nonnull Widget page, String title)
      Veraltet.
      Sets a title for @page.

      The title is displayed in the header area of the assistant
      when @page is the current page.
      Parameter:
      page - a page of @assistant
      title - the new title for @page
    • setPageType

      @Deprecated public void setPageType(@Nonnull Widget page, int type)
      Veraltet.
      Sets the page type for @page.

      The page type determines the page behavior in the @assistant.
      Parameter:
      page - a page of @assistant
      type - the new type for @page
    • updateButtonsState

      @Deprecated public void updateButtonsState()
      Veraltet.
      Forces @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

      public SignalHandler onApply(Assistant.OnApply signal)
      Connect to signal "apply".
      See Assistant.OnApply.onApply() for signal description.
      Field SIGNAL_ON_APPLY contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onCancel

      public SignalHandler onCancel(Assistant.OnCancel signal)
      Connect to signal "cancel".
      See Assistant.OnCancel.onCancel() for signal description.
      Field SIGNAL_ON_CANCEL contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onClose

      public SignalHandler onClose(Assistant.OnClose signal)
      Connect to signal "close".
      See Assistant.OnClose.onClose() for signal description.
      Field SIGNAL_ON_CLOSE contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onEscape

      public SignalHandler onEscape(Assistant.OnEscape signal)
      Connect to signal "escape".
      See Assistant.OnEscape.onEscape() for signal description.
      Field SIGNAL_ON_ESCAPE contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onPrepare

      public SignalHandler onPrepare(Assistant.OnPrepare signal)
      Connect to signal "prepare".
      See Assistant.OnPrepare.onPrepare(ch.bailu.gtk.gtk.Widget) for signal description.
      Field SIGNAL_ON_PREPARE contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      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.
      Setzt außer Kraft:
      asAccessible in Klasse Window
      Gibt zurück:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Setzt außer Kraft:
      asBuildable in Klasse Window
      Gibt zurück:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Setzt außer Kraft:
      asConstraintTarget in Klasse Window
      Gibt zurück:
      ConstraintTarget
    • asNative

      public Native asNative()
      Implements interface Native. Call this to get access to interface functions.
      Setzt außer Kraft:
      asNative in Klasse Window
      Gibt zurück:
      Native
    • asRoot

      public Root asRoot()
      Implements interface Root. Call this to get access to interface functions.
      Setzt außer Kraft:
      asRoot in Klasse Window
      Gibt zurück:
      Root
    • asShortcutManager

      public ShortcutManager asShortcutManager()
      Implements interface ShortcutManager. Call this to get access to interface functions.
      Setzt außer Kraft:
      asShortcutManager in Klasse Window
      Gibt zurück:
      ShortcutManager
    • 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()