Methods
gtk.Assistant.get_current_page
Returns :, :, | The index (starting from 0) of the current page
in the assistant, if the assistant has no pages, -1 will be
returned. |
Note
This method is available in PyGTK 2.10 and above.
The get_current_page() method returns
the page number of the current page.
gtk.Assistant.set_current_page
def set_current_page(page_num)
|
page_num : | the 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, there will be no
change. |
Note
This method is available in PyGTK 2.10 and above.
The set_current_page() method switches
the page to the page specified by
page_num. Note that this will only be necessary
in custom buttons, as the assistant flow can be set with the set_forward_page_func()
method.
gtk.Assistant.get_n_pages
Returns : | The number of pages in the assistant. |
Note
This method is available in PyGTK 2.10 and above.
The get_n_pages() method returns the
number of pages in the assistant
gtk.Assistant.get_nth_page
def get_nth_page(page_num)
|
page_num : | The index of a page in the assistant, or -1 to
get the last page; |
Returns : | The child widget, or None if
page_num is out of
bounds. |
Note
This method is available in PyGTK 2.10 and above.
The get_nth_page() method returns the
child widget contained in the page specified by
page_num.
gtk.Assistant.prepend_page
page : | a gtk.Widget |
Returns : | the index (starting at 0) of the inserted
page |
Note
This method is available in PyGTK 2.10 and above.
The prepend_page() method prepends the
page specified by page to the assistant.
gtk.Assistant.append_page
page : | a gtk.Widget |
Returns : | the index (starting at 0) of the inserted
page |
Note
This method is available in PyGTK 2.10 and above.
The append_page() method appends the
page specified by page to the assistant.
gtk.Assistant.insert_page
def insert_page(page, position)
|
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 |
Returns : | the index (starting from 0) of the inserted
page |
Note
This method is available in PyGTK 2.10 and above.
The insert_page() method inserts the
page specified by page in the assistant at the
position index specified by position.
gtk.Assistant.set_forward_page_func
def set_forward_page_func(page_func, data)
|
page_func : | the function, or None to use
the default function. |
data : | user data for
page_func |
Note
This method is available in PyGTK 2.10 and above.
The set_forward_page_func() method 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
None will make the assistant use the default
forward function, which just goes to the next visible page.
The signature of page_func is:
def page_func(current_page, user_data):
|
where current_page is the index of the
current page and user_data is
data.
gtk.Assistant.set_page_type
def set_page_type(page, type)
|
page : | a page in the assistant |
type : | the new type for
page |
Note
This method is available in PyGTK 2.10 and above.
The set_page_type() method sets the
page type, which specifies the page behavior, for the page specified
by page to the value specified by
type. The page type must be one of the GTK Assistant Page Type Constants.
gtk.Assistant.get_page_type
page : | a page in the assistant |
Returns : | the page type of
page. |
Note
This method is available in PyGTK 2.10 and above.
The get_page_type() method returns the
page type of the page specified by page. The
page type will be one of the GTK Assistant Page Type Constants.
gtk.Assistant.set_page_title
def set_page_title(page, title)
|
page : | a page of the assistant |
title : | the new title for
page |
Note
This method is available in PyGTK 2.10 and above.
The set_page_title() method sets the
title for the page specified by page to the
string specified by title. The title is
displayed in the header area of the assistant when
page is the current page.
gtk.Assistant.get_page_title
page : | a page of the assistant |
Returns : | the title for
page. |
Note
This method is available in PyGTK 2.10 and above.
The get_page_title() method returns the
title for the page specified by page.
gtk.Assistant.set_page_header_image
def set_page_header_image(page, pixbuf=None)
|
page : | a page of the assistant |
pixbuf : | the new header image for
page or
None. |
Note
This method is available in PyGTK 2.10 and above.
The set_page_header_image() method sets
the gtk.gdk.Pixbuf
specified by pixbuf as the header image for the
page specified by page. This image is displayed
in the header area of the assistant when page
is the current page. If pixbuf is
None the header image will be removed.
gtk.Assistant.get_page_header_image
def get_page_header_image(page)
|
page : | a page of the assistant |
Returns : | the header image for page,
or None if there's no header image for the
page. |
Note
This method is available in PyGTK 2.10 and above.
The get_page_header_image() method
returns the header image for the page specified by
page.
gtk.Assistant.set_page_side_image
def set_page_side_image(page, pixbuf=None)
|
page : | a page of the assistant |
pixbuf : | the new side image for
page or
None. |
Note
This method is available in PyGTK 2.10 and above.
The set_page_side_image() method sets
the gtk.gdk.Pixbuf
specified by pixbuf as the header image for the
page specified by page. This image is displayed
in the side area of the assistant when page is
the current page. If pixbuf is
None the side image will be removed.
gtk.Assistant.get_page_side_image
def get_page_side_image(page)
|
page : | a page of the assistant |
Returns : | the side image for page,
or None if there's no side image for the
page. |
Note
This method is available in PyGTK 2.10 and above.
The get_page_side_image() method
returns the header image for the page specified by
page.
gtk.Assistant.set_page_complete
def set_page_complete(page, complete)
|
page : | a page of the assistant |
complete : | if TRUE the page status is
complete. |
Note
This method is available in PyGTK 2.10 and above.
The set_page_complete() method sets the
"complete" property of the page specified by
page to the value specified by
complete. If complete is
TRUE the page contents are
complete. This will make the assistant update the state of its
buttons.
gtk.Assistant.get_page_complete
def get_page_complete(page)
|
page : | a page of the assistant |
Returns : | TRUE if
page is complete. |
Note
This method is available in PyGTK 2.10 and above.
The get_page_complete() method returns
the value of the "complete" property of the page specified by
page. If the return value is
TRUE, the page contents are
complete.
gtk.Assistant.add_action_widget
def add_action_widget(child)
|
Note
This method is available in PyGTK 2.10 and above.
The add_action_widget() method adds the
widget specified by child to the action area of
the assistant.
gtk.Assistant.remove_action_widget
def remove_action_widget(child)
|
Note
This method is available in PyGTK 2.10 and above.
The remove_action_widget() method
removes the widget specified by child from the
action area of the assistant.
gtk.Assistant.update_buttons_state
def update_buttons_state()
|
Note
This method is available in PyGTK 2.10 and above.
The update_buttons_state() method
forces the assistant to recompute the state of its buttons.
PyGTK 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.
Signals
The "apply" Signal
def callback(assistant, user_param1, ...)
|
assistant : | the gtk.Assistant
that received the signal |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
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.
The "cancel" Signal
def callback(assistant, user_param1, ...)
|
assistant : | the gtk.Assistant
that received the signal |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
The "cancel" signal is emitted when the cancel button is
clicked.
The "close" Signal
def callback(assistant, user_param1, ...)
|
assistant : | the gtk.Assistant
that received the signal |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
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.
The "prepare" Signal
def callback(assistant, page, user_param1, ...)
|
assistant : | the gtk.Assistant
that received the signal |
page : | the new page to prepare for
display |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
The "prepare" signal is emitted when a new page is set as the
assistant's current page, but before making the new page visible. A
handler for this signal can do any preparation that are necessary
before showing page.