Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | None |
A widget used to guide users through multi-step operations
- Module available since Gtk+ version 2.10
- data Assistant
- class WindowClass o => AssistantClass o
- castToAssistant :: GObjectClass obj => obj -> Assistant
- toAssistant :: AssistantClass o => o -> Assistant
- data AssistantPageType
- assistantNew :: IO Assistant
- assistantGetNPages :: AssistantClass self => self -> IO Int
- assistantGetNthPage :: AssistantClass self => self -> Int -> IO (Maybe Widget)
- assistantPrependPage :: (AssistantClass self, WidgetClass page) => self -> page -> IO Int
- assistantAppendPage :: (AssistantClass self, WidgetClass page) => self -> page -> IO Int
- assistantInsertPage :: (AssistantClass self, WidgetClass page) => self -> page -> Int -> IO Int
- assistantSetForwardPageFunc :: AssistantClass self => self -> Maybe (Int -> IO Int) -> IO ()
- assistantAddActionWidget :: (AssistantClass self, WidgetClass child) => self -> child -> IO ()
- assistantRemoveActionWidget :: (AssistantClass self, WidgetClass child) => self -> child -> IO ()
- assistantUpdateButtonsState :: AssistantClass self => self -> IO ()
- assistantSetPageType :: (AssistantClass self, WidgetClass page) => self -> page -> AssistantPageType -> IO ()
- assistantGetPageType :: (AssistantClass self, WidgetClass page) => self -> page -> IO AssistantPageType
- assistantSetPageTitle :: (AssistantClass self, WidgetClass page) => self -> page -> String -> IO ()
- assistantGetPageTitle :: (AssistantClass self, WidgetClass page) => self -> page -> IO String
- assistantSetPageHeaderImage :: (AssistantClass self, WidgetClass page) => self -> page -> Pixbuf -> IO ()
- assistantGetPageHeaderImage :: (AssistantClass self, WidgetClass page) => self -> page -> IO (Maybe Pixbuf)
- assistantSetPageSideImage :: (AssistantClass self, WidgetClass page) => self -> page -> Pixbuf -> IO ()
- assistantGetPageSideImage :: (AssistantClass self, WidgetClass page) => self -> page -> IO (Maybe Pixbuf)
- assistantSetPageComplete :: (AssistantClass self, WidgetClass page) => self -> page -> Bool -> IO ()
- assistantGetPageComplete :: (AssistantClass self, WidgetClass page) => self -> page -> IO Bool
- assistantCommit :: AssistantClass self => self -> IO ()
- assistantCurrentPage :: AssistantClass self => Attr self Int
- assistantChildPageType :: AssistantClass self => Attr self AssistantPageType
- assistantChildTitle :: AssistantClass self => Attr self String
- assistantChildHeaderImage :: AssistantClass self => Attr self Pixbuf
- assistantChildSidebarImage :: AssistantClass self => Attr self Pixbuf
- assistantChildComplete :: AssistantClass self => Attr self Bool
- assistantCancel :: AssistantClass self => Signal self (IO ())
- assistantPrepare :: AssistantClass self => Signal self (Widget -> IO ())
- assistantApply :: AssistantClass self => Signal self (IO ())
- assistantClose :: AssistantClass self => Signal self (IO ())
Detail
A 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.
GtkAssistant as GtkBuildable
The Assistant
implementation of the Buildable
interface exposes the
actionArea
as internal children with the name "action_area".
To add pages to an assistant in Builder
, simply add it as a <child> to
the Assistant
object, and set its child properties as necessary.
Class Hierarchy
Types
class WindowClass o => AssistantClass o Source
castToAssistant :: GObjectClass obj => obj -> AssistantSource
toAssistant :: AssistantClass o => o -> AssistantSource
Enums.
data AssistantPageType Source
Constructors
assistantNew :: IO AssistantSource
Creates a new Assistant
.
- Available since Gtk+ version 2.10
Methods
:: AssistantClass self | |
=> self | |
-> IO Int | returns The number of pages in the |
Returns the number of pages in the assistant
- Available since Gtk+ version 2.10
:: AssistantClass self | |
=> self | |
-> Int |
|
-> IO (Maybe Widget) | returns The child widget, or |
Returns the child widget contained in page number pageNum
.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO Int | returns the index (starting at 0) of the inserted page |
Prepends a page to the assistant
.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO Int | returns the index (starting at 0) of the inserted page |
Appends a page to the assistant
.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> Int |
|
-> IO Int | returns the index (starting from 0) of the inserted page |
Inserts a page in the assistant
at a given position.
- Available since Gtk+ version 2.10
assistantSetForwardPageFuncSource
:: AssistantClass self | |
=> self | |
-> Maybe (Int -> IO Int) |
|
-> IO () |
Sets the page forwarding function to be pageFunc
, this function will be
used to determine what will be the next page when the user presses the
forward button. Setting pageFunc
to Nothing
will make the assistant to use the
default forward function, which just goes to the next visible page.
- Available since Gtk+ version 2.10
assistantAddActionWidgetSource
:: (AssistantClass self, WidgetClass child) | |
=> self | |
-> child |
|
-> IO () |
Adds a widget to the action area of a Assistant
.
- Available since Gtk+ version 2.10
assistantRemoveActionWidgetSource
:: (AssistantClass self, WidgetClass child) | |
=> self | |
-> child |
|
-> IO () |
Removes a widget from the action area of a Assistant
.
- Available since Gtk+ version 2.10
assistantUpdateButtonsState :: AssistantClass self => self -> IO ()Source
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.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> AssistantPageType |
|
-> IO () |
Sets the page type for page
. The page type determines the page behavior
in the assistant
.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO AssistantPageType | returns the page type of |
Gets the page type of page
.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> String |
|
-> IO () |
Sets a title for page
. The title is displayed in the header area of the
assistant when page
is the current page.
- Available since Gtk+ version 2.10
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO String | returns the title for |
Gets the title for page
.
- Available since Gtk+ version 2.10
assistantSetPageHeaderImageSource
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> Pixbuf |
|
-> IO () |
Sets a header image for page
. This image is displayed in the header
area of the assistant when page
is the current page.
- Available since Gtk+ version 2.10
assistantGetPageHeaderImageSource
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO (Maybe Pixbuf) | returns the header image for |
Gets the header image for page
.
- Available since Gtk+ version 2.10
assistantSetPageSideImageSource
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> Pixbuf |
|
-> IO () |
Sets a header image for page
. This image is displayed in the side area
of the assistant when page
is the current page.
- Available since Gtk+ version 2.10
assistantGetPageSideImageSource
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO (Maybe Pixbuf) | returns the side image for |
Gets the header image for page
.
- Available since Gtk+ version 2.10
assistantSetPageCompleteSource
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> Bool |
|
-> IO () |
Sets whether page
contents are complete. This will make assistant
update the buttons state to be able to continue the task.
- Available since Gtk+ version 2.10
assistantGetPageCompleteSource
:: (AssistantClass self, WidgetClass page) | |
=> self | |
-> page |
|
-> IO Bool | returns |
Gets whether page
is complete.
- Available since Gtk+ version 2.10
assistantCommit :: AssistantClass self => self -> IO ()Source
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.
- Available since Gtk+ version 2.22
Attributes
assistantCurrentPage :: AssistantClass self => Attr self IntSource
Switches the page to pageNum
. Note that this will only be necessary in
custom buttons, as the assistant
flow can be set with
assistantSetForwardPageFunc
.
Returns the page number of the current page
- Available since Gtk+ version 2.10
Child Attributes
assistantChildPageType :: AssistantClass self => Attr self AssistantPageTypeSource
The type of the assistant page.
Default value: AssistantPageContent
- Available since Gtk+ version 2.10
assistantChildTitle :: AssistantClass self => Attr self StringSource
The title that is displayed in the page header.
If title and header-image are both, no header is displayed.
- Available since Gtk+ version 2.10
assistantChildHeaderImage :: AssistantClass self => Attr self PixbufSource
The image that is displayed next to the page.
- Available since Gtk+ version 2.10
assistantChildSidebarImage :: AssistantClass self => Attr self PixbufSource
Sidebar image for the assistant page.
- Available since Gtk+ version 2.10
assistantChildComplete :: AssistantClass self => Attr self BoolSource
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.
Default value: False
- Available since Gtk+ version 2.10
Signals
assistantCancel :: AssistantClass self => Signal self (IO ())Source
The ::assistantCancel signal is emitted when then the assistantCancel button is clicked.
- Available since Gtk+ version 2.10
assistantPrepare :: AssistantClass self => Signal self (Widget -> IO ())Source
The ::assistantPrepare 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
.
- Available since Gtk+ version 2.10
assistantApply :: AssistantClass self => Signal self (IO ())Source
The ::assistantApply signal is emitted when the assistantApply button is clicked. The
default behavior of the Assistant
is to switch to the page after the
current page, unless the current page is the last one.
A handler for the ::assistantApply 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 AssistantPageProgress
after the
confirmation page and handle this operation within the assistantPrepare
signal of the progress page.
- Available since Gtk+ version 2.10
assistantClose :: AssistantClass self => Signal self (IO ())Source
The ::assistantClose signal is emitted either when the assistantClose button of a summary
page is clicked, or when the apply button in the last page in the flow (of
type AssistantPageConfirm
) is clicked.