Package: gtk

Class gtk:assistant

Superclasses

Documented Subclasses

None

Direct Slots

pages
The pages property of type g:list-model (Read)
The pages of the assistant.
use-header-bar
The use-header-bar property of type :int (Read / Write / Construct)
True if the assistant uses a header bar for action buttons instead of the action area. For technical reasons, this property is declared as an integer property, use the value 1 for true or -1 for false.
Allowed values: [-1, 1]
Default value: -1

Details

The gtk:assistant widget is used to represent a generally complex operation splitted in several steps. Each step consists of one or more pages. The assitant guides the user through the pages, and controls the page flow to collect the data needed for the operation.

Figure: GtkAssistant

The gtk:assistant widget handles which buttons to show and to make sensitive based on page sequence knowledge and the type of each page in addition to state information like the completion and committed page statuses.

If you have a case that does not quite fit in the gtk:assistant widgets way of handling buttons, you can use the :custom value of the gtk:assistant-page-type enumeration and handle buttons yourself.

The gtk:assistant widget maintains a gtk:assistant-page object for each added child, which holds additional per-child properties. You obtain the gtk:assistant-page object for the child widget with the gtk:assistant-page function.

GtkAssistant as GtkBuildable

The gtk:assistant implementation of the gtk:buildable interface exposes the action area as internal children with the name "action_area". To add pages to an assistant in the gtk:builder object, simply add it as a child widget to the assistant. If you need to set per-object properties, create a gtk:assistant-page object explicitly, and set the child widget as a property on it.

CSS nodes

The gtk:assistant implementation has a single CSS node with the name window and .assistant style class.

Warning

The gtk:assistant implementation is deprecated since 4.10. This widget will be removed in GTK 5.

Signal Details

The "apply" signal
lambda (assistant)    :run-last      
assistant
The gtk:assistant widget which received the signal.
The signal is emitted when the Apply button is clicked. The default behavior of the assistant 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 :progress page after the :confirm page and handle this operation within the "prepare" signal of the progress page.
The "cancel" signal
lambda (assistant)    :run-last      
assistant
The gtk:assistant widget which received the signal.
The signal is emitted when the Cancel button is clicked.
The "close" signal
lambda (assistant)    :run-last      
assistant
The gtk:assistant widget which received the signal.
The signal is emitted either when the Close button of a summary page is clicked, or when the Apply button in the last page in the flow is clicked, which is the :confirm page.
The "escape" signal
lambda (assistant)    :action      
assistant
The gtk:assistant widget which received the signal.
The action signal for the Escape binding.
The "prepare" signal
lambda (assistant page)    :run-last      
assistant
The gtk:assistant widget which received the signal.
page
The gtk:widget object for the current page.
The signal is emitted when a new page is set as the assistants current page, before making the new page visible. A handler for this signal can do any preparations which are necessary before showing the page.
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2025-2-27