Top |
GtkWidget * | gtk_assistant_new () |
gint | gtk_assistant_get_current_page () |
void | gtk_assistant_set_current_page () |
gint | gtk_assistant_get_n_pages () |
GtkWidget * | gtk_assistant_get_nth_page () |
gint | gtk_assistant_prepend_page () |
gint | gtk_assistant_append_page () |
gint | gtk_assistant_insert_page () |
gint | (*GtkAssistantPageFunc) () |
void | gtk_assistant_set_forward_page_func () |
void | gtk_assistant_set_page_type () |
GtkAssistantPageType | gtk_assistant_get_page_type () |
void | gtk_assistant_set_page_title () |
const gchar * | gtk_assistant_get_page_title () |
void | gtk_assistant_set_page_header_image () |
GdkPixbuf * | gtk_assistant_get_page_header_image () |
void | gtk_assistant_set_page_side_image () |
GdkPixbuf * | gtk_assistant_get_page_side_image () |
void | gtk_assistant_set_page_complete () |
gboolean | gtk_assistant_get_page_complete () |
void | gtk_assistant_add_action_widget () |
void | gtk_assistant_remove_action_widget () |
void | gtk_assistant_update_buttons_state () |
void | gtk_assistant_commit () |
gboolean | complete | Read / Write |
GdkPixbuf * | header-image | Read / Write |
GtkAssistantPageType | page-type | Read / Write |
GdkPixbuf * | sidebar-image | Read / Write |
char * | title | Read / Write |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ╰── GtkAssistant
A GtkAssistant 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 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, and set its child properties
as necessary.
gint
gtk_assistant_get_current_page (GtkAssistant *assistant
);
Returns the page number of the current page
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
void gtk_assistant_set_current_page (GtkAssistant *assistant
,gint page_num
);
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 |
||
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 |
Since: 2.10
gint
gtk_assistant_get_n_pages (GtkAssistant *assistant
);
Returns the number of pages in the assistant
Since: 2.10
GtkWidget * gtk_assistant_get_nth_page (GtkAssistant *assistant
,gint page_num
);
Returns the child widget contained in page number page_num
.
Since: 2.10
gint gtk_assistant_prepend_page (GtkAssistant *assistant
,GtkWidget *page
);
Prepends a page to the assistant
.
Since: 2.10
gint gtk_assistant_append_page (GtkAssistant *assistant
,GtkWidget *page
);
Appends a page to the assistant
.
Since: 2.10
gint gtk_assistant_insert_page (GtkAssistant *assistant
,GtkWidget *page
,gint position
);
Inserts a page in the assistant
at a given position.
assistant |
||
page |
||
position |
the index (starting at 0) at which to insert the page,
or -1 to append the page to the |
Since: 2.10
gint (*GtkAssistantPageFunc) (gint current_page
,gpointer data
);
A function used by gtk_assistant_set_forward_page_func()
to know which
is the next page given a current one. It's called both for computing the
next page when the user presses the "forward" button and for handling
the behavior of the "last" button.
void gtk_assistant_set_forward_page_func (GtkAssistant *assistant
,GtkAssistantPageFunc page_func
,gpointer data
,GDestroyNotify destroy
);
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.
assistant |
||
page_func |
the GtkAssistantPageFunc, or |
[allow-none] |
data |
user data for |
|
destroy |
destroy notifier for |
Since: 2.10
void gtk_assistant_set_page_type (GtkAssistant *assistant
,GtkWidget *page
,GtkAssistantPageType type
);
Sets the page type for page
. The page type determines the page
behavior in the assistant
.
Since: 2.10
GtkAssistantPageType gtk_assistant_get_page_type (GtkAssistant *assistant
,GtkWidget *page
);
Gets the page type of page
.
Since: 2.10
void gtk_assistant_set_page_title (GtkAssistant *assistant
,GtkWidget *page
,const gchar *title
);
Sets a title for page
. The title is displayed in the header
area of the assistant when page
is the current page.
Since: 2.10
const gchar * gtk_assistant_get_page_title (GtkAssistant *assistant
,GtkWidget *page
);
Gets the title for page
.
Since: 2.10
void gtk_assistant_set_page_header_image (GtkAssistant *assistant
,GtkWidget *page
,GdkPixbuf *pixbuf
);
Sets a header image for page
. This image is displayed in the header
area of the assistant when page
is the current page.
Since: 2.10
GdkPixbuf * gtk_assistant_get_page_header_image (GtkAssistant *assistant
,GtkWidget *page
);
Gets the header image for page
.
the header image for page
, or NULL
if there's no header image for the page.
[transfer none]
Since: 2.10
void gtk_assistant_set_page_side_image (GtkAssistant *assistant
,GtkWidget *page
,GdkPixbuf *pixbuf
);
Sets a header image for page
. This image is displayed in the side
area of the assistant when page
is the current page.
Since: 2.10
GdkPixbuf * gtk_assistant_get_page_side_image (GtkAssistant *assistant
,GtkWidget *page
);
Gets the header image for page
.
Since: 2.10
void gtk_assistant_set_page_complete (GtkAssistant *assistant
,GtkWidget *page
,gboolean complete
);
Sets whether page
contents are complete. This will make
assistant
update the buttons state to be able to continue the task.
Since: 2.10
gboolean gtk_assistant_get_page_complete (GtkAssistant *assistant
,GtkWidget *page
);
Gets whether page
is complete.
Since: 2.10
void gtk_assistant_add_action_widget (GtkAssistant *assistant
,GtkWidget *child
);
Adds a widget to the action area of a GtkAssistant.
Since: 2.10
void gtk_assistant_remove_action_widget (GtkAssistant *assistant
,GtkWidget *child
);
Removes a widget from the action area of a GtkAssistant.
Since: 2.10
void
gtk_assistant_update_buttons_state (GtkAssistant *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.
Since: 2.10
void
gtk_assistant_commit (GtkAssistant *assistant
);
Erases the visited page history so the back button is not shown 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.
Since: 2.22
An enum for determining the page role inside the GtkAssistant. It's used to handle buttons sensitivity and visibility.
Note that an assistant needs to end its page flow with a page of type
GTK_ASSISTANT_PAGE_CONFIRM
, GTK_ASSISTANT_PAGE_SUMMARY
or
GTK_ASSISTANT_PAGE_PROGRESS
to be correct.
The page has regular contents. |
||
The page contains an introduction to the assistant task. |
||
The page lets the user confirm or deny the changes. |
||
The page informs the user of the changes done. |
||
Used for tasks that take a long time to complete, blocks the assistant until the page is marked as complete. |
“complete”
child property “complete” gboolean
Setting the "complete" child property 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.
Owner: GtkAssistant
Flags: Read / Write
Default value: FALSE
Since: 2.10
“header-image”
child property“header-image” GdkPixbuf *
The image that is displayed next to the page.
Set this to NULL
to make the sidebar disappear.
Owner: GtkAssistant
Flags: Read / Write
Since: 2.10
“page-type”
child property“page-type” GtkAssistantPageType
The type of the assistant page.
Owner: GtkAssistant
Flags: Read / Write
Default value: GTK_ASSISTANT_PAGE_CONTENT
Since: 2.10
“sidebar-image”
child property“sidebar-image” GdkPixbuf *
Sidebar image for the assistant page.
Owner: GtkAssistant
Flags: Read / Write
“title”
child property “title” char *
The title that is displayed in the page header.
If title and header-image are both NULL
, no header is displayed.
Owner: GtkAssistant
Flags: Read / Write
Default value: NULL
Since: 2.10
“content-padding”
style property “content-padding” int
Number of pixels around the content pages.
Owner: GtkAssistant
Flags: Read
Allowed values: >= 0
Default value: 1
“apply”
signalvoid user_function (GtkAssistant *assistant, gpointer user_data)
The ::apply signal is emitted when the apply button is clicked. The default behavior of the GtkAssistant 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 page of type GTK_ASSISTANT_PAGE_PROGRESS
after the confirmation page and handle this operation within the
“prepare” signal of the progress page.
assistant |
the GtkAssistant |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10
“cancel”
signalvoid user_function (GtkAssistant *assistant, gpointer user_data)
The ::cancel signal is emitted when then the cancel button is clicked.
assistant |
the GtkAssistant |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10
“close”
signalvoid user_function (GtkAssistant *assistant, gpointer user_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.
assistant |
the GtkAssistant |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10
“prepare”
signalvoid user_function (GtkAssistant *assistant, GtkWidget *page, gpointer user_data)
The ::prepare 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
.
assistant |
the GtkAssistant |
|
page |
the current page |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10