A widget used to guide users through multi-step operations
A <gtk-assistant>
is a widget 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 ::close 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 (of type GTK_ASSISTANT_PAGE_CONFIRM) is clicked.
Since 2.10
The ::cancel signal is emitted when then the cancel button is clicked.
Since 2.10
<gtk-widget>
)The ::prepared signal is 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 preparation which are necessary before showing page.
Since 2.10
The ::apply signal is emitted when the apply button is clicked. The default behavior of the
<gtk-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 to put a page of type GTK_ASSISTANT_PAGE_PROGRESS after the confirmation page and handle this operation within the ::prepare signal of the progress page.
Since 2.10
<gtk-widget>
)Creates a new
<gtk-assistant>
.
- ret
- a newly created
<gtk-assistant>
Since 2.10
<gtk-assistant>
) ⇒ (ret int
)Returns the page number of the current page
- assistant
- a
<gtk-assistant>
- ret
- The index (starting from 0) of the current page in the assistant, if the assistant has no pages, -1 will be returned
Since 2.10
<gtk-assistant>
) (page_num int
)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
.
- assistant
- a
<gtk-assistant>
- 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.
Since 2.10
<gtk-assistant>
) ⇒ (ret int
)Returns the number of pages in the assistant
- assistant
- a
<gtk-assistant>
- ret
- The number of pages in the assistant.
Since 2.10
<gtk-assistant>
) (page_num int
) ⇒ (ret <gtk-widget>
)Returns the child widget contained in page number page-num.
- assistant
- a
<gtk-assistant>
- page-num
- The index of a page in the assistant, or -1 to get the last page;
- ret
- The child widget, or ‘
#f
’ if page-num is out of bounds.Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret int
)Prepends a page to the assistant.
- assistant
- a
<gtk-assistant>
- page
- a
<gtk-widget>
- ret
- the index (starting at 0) of the inserted page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret int
)Appends a page to the assistant.
- assistant
- a
<gtk-assistant>
- page
- a
<gtk-widget>
- ret
- the index (starting at 0) of the inserted page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) (position int
) ⇒ (ret int
)Inserts a page in the assistant at a given position.
- assistant
- a
<gtk-assistant>
- page
- a
<gtk-widget>
- position
- the index (starting at 0) at which to insert the page, or -1 to append the page to the assistant
- ret
- the index (starting from 0) of the inserted page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) (type <gtk-assistant-page-type>
)Sets the page type for page. The page type determines the page behavior in the assistant.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- type
- the new type for page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret <gtk-assistant-page-type>
)Gets the page type of page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- ret
- the page type of page.
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) (title mchars
)Sets a title for page. The title is displayed in the header area of the assistant when page is the current page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- title
- the new title for page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret mchars
)Gets the title for page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- ret
- the title for page.
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) (pixbuf <gdk-pixbuf>
)Sets a header image for page. This image is displayed in the header area of the assistant when page is the current page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- pixbuf
- the new header image page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret <gdk-pixbuf>
)Gets the header image for page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- ret
- the header image for page, or ‘
#f
’ if there's no header image for the page.Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) (pixbuf <gdk-pixbuf>
)Sets a header image for page. This image is displayed in the side area of the assistant when page is the current page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- pixbuf
- the new header image page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret <gdk-pixbuf>
)Gets the header image for page.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- ret
- the side image for page, or ‘
#f
’ if there's no side image for the page.Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) (complete bool
)Sets whether page contents are complete. This will make assistant update the buttons state to be able to continue the task.
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- complete
- the completeness status of the page
Since 2.10
<gtk-assistant>
) (page <gtk-widget>
) ⇒ (ret bool
)Gets whether page is complete..
- assistant
- a
<gtk-assistant>
- page
- a page of assistant
- ret
- ‘
#t
’ if page is complete.Since 2.10
<gtk-assistant>
) (child <gtk-widget>
)Adds a widget to the action area of a
<gtk-assistant>
.
- assistant
- a
<gtk-assistant>
- child
- a
<gtk-widget>
Since 2.10
<gtk-assistant>
) (child <gtk-widget>
)Removes a widget from the action area of a
<gtk-assistant>
.
- assistant
- a
<gtk-assistant>
- child
- a
<gtk-widget>
Since 2.10
<gtk-assistant>
)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.
- assistant
- a
<gtk-assistant>
Since 2.10