A
gtk-assistant widget is used to represent a generally complex
operation splitted in several steps, guiding the user through its pages and
controlling the page flow to collect the necessary data.
The design of the
gtk-assistant widget is that it controls what buttons
to show and to make sensitive, based on what it knows about the page sequence
and the type of each page, in addition to state information like the page
completion and committed status.
If you have a case that does not quite fit in an assistants way of handling buttons, you can use the
:custom page type of the
gtk-assistant-page-type enumeration and handle buttons yourself.
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 a
gtk-builder object, simply add it as a
<child> to the
gtk-assistant widget and set its child properties as necessary.
CSS nodes
The
gtk-assistant implementation has a single CSS node with the name
assistant.
Child Property Details
- complete
- The complete child property of type :boolean (Read / Write)
Setting to true marks a page as complete, i.e. all the required
fields are filled out. GTK uses this information to control the sensitivity of the navigation buttons.
Default value: false
- has-padding
- The has-padding child property of type :boolean (Read / Write)
Whether the assistant adds padding around the page. Since 3.18
Default value: true - header-image
- The header-image child property of type gdk-pixbuf (Read / Write)
The image used to be displayed in the page header.
Warning: The header-image child property has been deprecated
since version 3.2 and should not be used in newly written code. Since
GTK 3.2, a header is no longer shown. Add your header decoration to the
page content instead. - page-type
- The page-type child property of type gtk-assistant-page-type (Read / Write)
The type of the assistant page.
Default value: :content - sidebar-image
- The sidebar-image child property of type gdk-pixbuf (Read / Write)
The image used to be displayed in the sidebar.
Warning: The sidebar-image child property has been
deprecated since version 3.2 and should not be used in newly written
code. Since GTK 3.2, the sidebar image is no longer shown. - title
- The title child property of type :string (Read / Write)
The title of the page.
Default value: nil
Style Property Details
- content-padding
- The content-padding style property of type :int (Read)
Number of pixels around the content pages.
Warning: The content-padding style property has been
deprecated since version 3.20 and should not be used in newly written code. This style property is ignored.
Allowed values: >= 0
Default value: 1 - header-padding
- The header-padding style property of type :int (Read)
Number of pixels around the header.
Warning: The content-padding has been deprecated since
version 3.20 and should not be used in newly written code. This style property is ignored.
Allowed values: >= 0
Default value: 6
Signal Details
The "apply" signal
lambda (assistant) :run-last
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.
- assistant
- The gtk-assistant widget which received the signal.
The "cancel" signal
lambda (assistant) :run-last
The signal is emitted when the Cancel button is clicked.
- assistant
- The gtk-assistant widget which received the signal.
The "close" signal
lambda (assistant) :run-last
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.
- assistant
- The gtk-assistant widget which received the signal.
The "escape" signal
lambda (assistant) :action
No documentation.
- assistant
- The gtk-assistant widget which received the signal.
The "prepare" signal
lambda (assistant page) :run-last
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.
- assistant
- The gtk-assistant widget which received the signal.
- page
- The gtk-widget widget for the current page.