gtk.Assistanta widget used to guide users through multi-step operations
(new in PyGTK 2.10)Synopsisgtk.Assistantgtk.Windowgtk.Assistantget_current_pageset_current_pagepage_numget_n_pagesget_nth_pagepage_numprepend_pagepageappend_pagepageinsert_pagepagepositionset_forward_page_funcpage_funcdataset_page_typepagetypeget_page_typepageset_page_titlepagetitleget_page_titlepageset_page_header_imagepagepixbufNoneget_page_header_imagepageset_page_side_imagepagepixbufNoneget_page_side_imagepageset_page_completepagecompleteget_page_completepageadd_action_widgetchildremove_action_widgetchildupdate_buttons_statecommitAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Container
+-- gtk.Bin
+-- gtk.Window
+-- gtk.Assistant
Implemented Interfacesgtk.Assistant
implements
gtk.Buildablegtk.Assistant Propertiesgtk.Object Propertiesgtk.Widget Propertiesgtk.Container Propertiesgtk.Window Propertiesgtk.Assistant Style Propertiesgtk.Widget Style Properties
"content-padding"ReadNumber of pixels around the content pages. Allowed
values: >= 0. Default value: 1. This property is available in
GTK+ 2.10 and above."header-padding"ReadNumber of pixels around the header. Allowed values: >=
0 Default value: 6. This property is available in GTK+ 2.10
and above.
gtk.Assistant Child Properties
"complete"Read-WriteIf 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. This property
is available in GTK+ 2.10 and above."header-image"Read-WriteThe gtk.gdk.Pixbuf
image that is displayed in the page header. This property is
available in GTK+ 2.10 and above."page-type"Read-WriteThe type of the assistant page - one of the .
Default value:
gtk.ASSISTANT_PAGE_CONTENT. This property
is available in GTK+ 2.10 and above."sidebar-image"Read-WriteThe gtk.gdk.Pixbuf
image displayed in the sidebar for the assistant page. Set
this to None to make the sidebar
disappear. This property is available in GTK+ 2.10 and
above."title"Read-WriteThe title that is displayed in the page header. If
"title" and "header-image" are both None,
no header is displayed. Default value:
None. This property is available in GTK+
2.10 and above.
gtk.Assistant Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypesgtk.Window Signal Prototypes"apply"callbackwidgetuser_param1..."cancel"callbackwidgetuser_param1..."close"callbackwidgetuser_param1..."prepare"callbackwidgetpageuser_param1...DescriptionA gtk.Assistant
is a widget used to guide the user through a complex operation by
breaking it into several steps. Each step is generally handled by one
assistant page. The assistant controls the page flow to collect the
necessary data to complete the application task.Constructorgtk.Assistantgtk.AssistantReturns :a new gtk.Assistant
object.This constructor is available in PyGTK 2.10 and above.Creates a new gtk.Assistant.Methodsgtk.Assistant.get_current_pageget_current_pageReturns : :The index (starting from 0) of the current page
in the assistant, if the assistant has no pages, -1 will be
returned.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_pageset_current_pagepage_numpage_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.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_pagesget_n_pagesReturns :The number of pages in the assistant.This method is available in PyGTK 2.10 and above.The get_n_pages() method returns the
number of pages in the assistantgtk.Assistant.get_nth_pageget_nth_pagepage_numpage_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.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_pageprepend_pagepagepage :a gtk.WidgetReturns :the index (starting at 0) of the inserted
pageThis 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_pageappend_pagepagepage :a gtk.WidgetReturns :the index (starting at 0) of the inserted
pageThis 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_pageinsert_pagepagepositionpage :a gtk.Widgetposition :the index (starting at 0) at which to insert the
page, or -1 to append the page to the assistantReturns :the index (starting from 0) of the inserted
pageThis 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_funcset_forward_page_funcpage_funcdatapage_func :the function, or None to use
the default function.data :user data for
page_funcThis 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_typeset_page_typepagetypepage :a page in the assistanttype :the new type for
pageThis 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.get_page_typeget_page_typepagepage :a page in the assistantReturns :the page type of
page.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.set_page_titleset_page_titlepagetitlepage :a page of the assistanttitle :the new title for
pageThis 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_titleget_page_titlepagepage :a page of the assistantReturns :the title for
page.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_imageset_page_header_imagepagepixbufNonepage :a page of the assistantpixbuf :the new header image for
page or
None.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_imageget_page_header_imagepagepage :a page of the assistantReturns :the header image for page,
or None if there's no header image for the
page.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_imageset_page_side_imagepagepixbufNonepage :a page of the assistantpixbuf :the new side image for
page or
None.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_imageget_page_side_imagepagepage :a page of the assistantReturns :the side image for page,
or None if there's no side image for the
page.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_completeset_page_completepagecompletepage :a page of the assistantcomplete :if True the page status is
complete.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_completeget_page_completepagepage :a page of the assistantReturns :True if
page is complete.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_widgetadd_action_widgetchildchild :a gtk.WidgetThis 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_widgetremove_action_widgetchildchild :a gtk.WidgetThis 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_stateupdate_buttons_stateThis 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.gtk.Assistant.commitcommitThis method is available in PyGTK 2.22 and above.The commit() method 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.SignalsThe "apply" Signalcallbackassistantuser_param1...assistant :the gtk.Assistant
that received the signaluser_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" Signalcallbackassistantuser_param1...assistant :the gtk.Assistant
that received the signaluser_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" Signalcallbackassistantuser_param1...assistant :the gtk.Assistant
that received the signaluser_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" Signalcallbackassistantpageuser_param1...assistant :the gtk.Assistant
that received the signalpage :the new page to prepare for
displayuser_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.