Next: , Previous: GtkAboutDialog, Up: Top


8 GtkAssistant

A widget used to guide users through multi-step operations

8.1 Overview

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.

8.2 Usage

— Class: <gtk-assistant>

Derives from <gtk-window>.

This class defines no direct slots.

— Signal on <gtk-assistant>: close

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

— Signal on <gtk-assistant>: cancel

The ::cancel signal is emitted when then the cancel button is clicked.

Since 2.10

— Signal on <gtk-assistant>: prepare (arg0 <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

— Signal on <gtk-assistant>: apply

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

— Function: gtk-assistant-new ⇒  (ret <gtk-widget>)

Creates a new <gtk-assistant>.

ret
a newly created <gtk-assistant>

Since 2.10

— Function: gtk-assistant-get-current-page (self <gtk-assistant>) ⇒  (ret int)
— Method: get-current-page

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

— Function: gtk-assistant-set-current-page (self <gtk-assistant>) (page_num int)
— Method: set-current-page

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

— Function: gtk-assistant-get-n-pages (self <gtk-assistant>) ⇒  (ret int)
— Method: get-n-pages

Returns the number of pages in the assistant

assistant
a <gtk-assistant>
ret
The number of pages in the assistant.

Since 2.10

— Function: gtk-assistant-get-nth-page (self <gtk-assistant>) (page_num int) ⇒  (ret <gtk-widget>)
— Method: get-nth-page

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

— Function: gtk-assistant-prepend-page (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret int)
— Method: prepend-page

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

— Function: gtk-assistant-append-page (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret int)
— Method: append-page

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

— Function: gtk-assistant-insert-page (self <gtk-assistant>) (page <gtk-widget>) (position int) ⇒  (ret int)
— Method: insert-page

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

— Function: gtk-assistant-set-page-type (self <gtk-assistant>) (page <gtk-widget>) (type <gtk-assistant-page-type>)
— Method: set-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

— Function: gtk-assistant-get-page-type (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret <gtk-assistant-page-type>)
— Method: get-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

— Function: gtk-assistant-set-page-title (self <gtk-assistant>) (page <gtk-widget>) (title mchars)
— Method: set-page-title

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

— Function: gtk-assistant-get-page-title (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret mchars)
— Method: get-page-title

Gets the title for page.

assistant
a <gtk-assistant>
page
a page of assistant
ret
the title for page.

Since 2.10

— Function: gtk-assistant-set-page-header-image (self <gtk-assistant>) (page <gtk-widget>) (pixbuf <gdk-pixbuf>)
— Method: set-page-header-image

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

— Function: gtk-assistant-get-page-header-image (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret <gdk-pixbuf>)
— Method: get-page-header-image

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

— Function: gtk-assistant-set-page-side-image (self <gtk-assistant>) (page <gtk-widget>) (pixbuf <gdk-pixbuf>)
— Method: set-page-side-image

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

— Function: gtk-assistant-get-page-side-image (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret <gdk-pixbuf>)
— Method: get-page-side-image

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

— Function: gtk-assistant-set-page-complete (self <gtk-assistant>) (page <gtk-widget>) (complete bool)
— Method: set-page-complete

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

— Function: gtk-assistant-get-page-complete (self <gtk-assistant>) (page <gtk-widget>) ⇒  (ret bool)
— Method: get-page-complete

Gets whether page is complete..

assistant
a <gtk-assistant>
page
a page of assistant
ret
#t’ if page is complete.

Since 2.10

— Function: gtk-assistant-add-action-widget (self <gtk-assistant>) (child <gtk-widget>)
— Method: add-action-widget

Adds a widget to the action area of a <gtk-assistant>.

assistant
a <gtk-assistant>
child
a <gtk-widget>

Since 2.10

— Function: gtk-assistant-remove-action-widget (self <gtk-assistant>) (child <gtk-widget>)
— Method: remove-action-widget

Removes a widget from the action area of a <gtk-assistant>.

assistant
a <gtk-assistant>
child
a <gtk-widget>

Since 2.10

— Function: gtk-assistant-update-buttons-state (self <gtk-assistant>)
— Method: update-buttons-state

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