gi-gtk-3.0.31: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Assistant

Contents

Description

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.

The design of GtkAssistant is that it controls what buttons to show and to make sensitive, based on what it knows about the page sequence and the [type][GtkAssistantPageType] of each page, in addition to state information like the page [completion][gtk-assistant-set-page-complete] and [committed][gtk-assistant-commit] status.

If you have a case that doesn’t quite fit in GtkAssistants way of handling buttons, you can use the GTK_ASSISTANT_PAGE_CUSTOM page type and handle buttons yourself.

GtkAssistant as GtkBuildable

The GtkAssistant 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 GtkAssistant object, and set its child properties as necessary.

CSS nodes

GtkAssistant has a single CSS node with the name assistant.

Synopsis

Exported types

newtype Assistant Source #

Memory-managed wrapper type.

Instances
GObject Assistant Source # 
Instance details

Defined in GI.Gtk.Objects.Assistant

Methods

gobjectType :: IO GType #

HasParentTypes Assistant Source # 
Instance details

Defined in GI.Gtk.Objects.Assistant

type ParentTypes Assistant Source # 
Instance details

Defined in GI.Gtk.Objects.Assistant

type ParentTypes Assistant = Window ': (Bin ': (Container ': (Widget ': (Object ': (ImplementorIface ': (Buildable ': ([] :: [Type])))))))

class (GObject o, IsDescendantOf Assistant o) => IsAssistant o Source #

Type class for types which can be safely cast to Assistant, for instance with toAssistant.

Instances
(GObject o, IsDescendantOf Assistant o) => IsAssistant o Source # 
Instance details

Defined in GI.Gtk.Objects.Assistant

toAssistant :: (MonadIO m, IsAssistant o) => o -> m Assistant Source #

Cast to Assistant, for types for which this is known to be safe. For general casts, use castTo.

noAssistant :: Maybe Assistant Source #

A convenience alias for Nothing :: Maybe Assistant.

Methods

addActionWidget

assistantAddActionWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

child: a Widget

-> m () 

Adds a widget to the action area of a Assistant.

Since: 2.10

appendPage

assistantAppendPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a Widget

-> m Int32

Returns: the index (starting at 0) of the inserted page

Appends a page to the assistant.

Since: 2.10

commit

assistantCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> m () 

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

getCurrentPage

assistantGetCurrentPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> m Int32

Returns: The index (starting from 0) of the current page in the assistant, or -1 if the assistant has no pages, or no current page.

Returns the page number of the current page.

Since: 2.10

getNPages

assistantGetNPages Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> m Int32

Returns: the number of pages in the assistant

Returns the number of pages in the assistant

Since: 2.10

getNthPage

assistantGetNthPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> Int32

pageNum: the index of a page in the assistant, or -1 to get the last page

-> m (Maybe Widget)

Returns: the child widget, or Nothing if pageNum is out of bounds

Returns the child widget contained in page number pageNum.

Since: 2.10

getPageComplete

assistantGetPageComplete Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> m Bool

Returns: True if page is complete.

Gets whether page is complete.

Since: 2.10

getPageHasPadding

assistantGetPageHasPadding Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> m Bool

Returns: True if page has padding

Gets whether page has padding.

Since: 3.18

getPageHeaderImage

assistantGetPageHeaderImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> m Pixbuf

Returns: the header image for page, or Nothing if there’s no header image for the page

Deprecated: (Since version 3.2)Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.

Gets the header image for page.

Since: 2.10

getPageSideImage

assistantGetPageSideImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> m Pixbuf

Returns: the side image for page, or Nothing if there’s no side image for the page

Deprecated: (Since version 3.2)Since GTK+ 3.2, sidebar images are not shown anymore.

Gets the side image for page.

Since: 2.10

getPageTitle

assistantGetPageTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> m Text

Returns: the title for page

Gets the title for page.

Since: 2.10

getPageType

assistantGetPageType Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> m AssistantPageType

Returns: the page type of page

Gets the page type of page.

Since: 2.10

insertPage

assistantInsertPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a Widget

-> Int32

position: the index (starting at 0) at which to insert the page, or -1 to append the page to the assistant

-> m Int32

Returns: the index (starting from 0) of the inserted page

Inserts a page in the assistant at a given position.

Since: 2.10

new

assistantNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Assistant

Returns: a newly created Assistant

Creates a new Assistant.

Since: 2.10

nextPage

assistantNextPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> m () 

Navigate to the next page.

It is a programming error to call this function when there is no next page.

This function is for use when creating pages of the GTK_ASSISTANT_PAGE_CUSTOM type.

Since: 3.0

prependPage

assistantPrependPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a Widget

-> m Int32

Returns: the index (starting at 0) of the inserted page

Prepends a page to the assistant.

Since: 2.10

previousPage

assistantPreviousPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> m () 

Navigate to the previous visited page.

It is a programming error to call this function when no previous page is available.

This function is for use when creating pages of the GTK_ASSISTANT_PAGE_CUSTOM type.

Since: 3.0

removeActionWidget

assistantRemoveActionWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

child: a Widget

-> m () 

Removes a widget from the action area of a Assistant.

Since: 2.10

removePage

assistantRemovePage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> Int32

pageNum: the index of a page in the assistant, or -1 to remove the last page

-> m () 

Removes the pageNum’s page from assistant.

Since: 3.2

setCurrentPage

assistantSetCurrentPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> Int32

pageNum: 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.

-> m () 

Switches the page to pageNum.

Note that this will only be necessary in custom buttons, as the assistant flow can be set with assistantSetForwardPageFunc.

Since: 2.10

setForwardPageFunc

assistantSetForwardPageFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> Maybe AssistantPageFunc

pageFunc: the AssistantPageFunc, or Nothing to use the default one

-> m () 

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.

Since: 2.10

setPageComplete

assistantSetPageComplete Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> Bool

complete: the completeness status of the page

-> m () 

Sets whether page contents are complete.

This will make assistant update the buttons state to be able to continue the task.

Since: 2.10

setPageHasPadding

assistantSetPageHasPadding Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> Bool

hasPadding: whether this page has padding

-> m () 

Sets whether the assistant is adding padding around the page.

Since: 3.18

setPageHeaderImage

assistantSetPageHeaderImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b, IsPixbuf c) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> Maybe c

pixbuf: the new header image page

-> m () 

Deprecated: (Since version 3.2)Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.

Sets a header image for page.

Since: 2.10

setPageSideImage

assistantSetPageSideImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b, IsPixbuf c) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> Maybe c

pixbuf: the new side image page

-> m () 

Deprecated: (Since version 3.2)Since GTK+ 3.2, sidebar images are not shown anymore.

Sets a side image for page.

This image used to be displayed in the side area of the assistant when page is the current page.

Since: 2.10

setPageTitle

assistantSetPageTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> Text

title: the new title for page

-> m () 

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

setPageType

assistantSetPageType Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a, IsWidget b) 
=> a

assistant: a Assistant

-> b

page: a page of assistant

-> AssistantPageType

type: the new type for page

-> m () 

Sets the page type for page.

The page type determines the page behavior in the assistant.

Since: 2.10

updateButtonsState

assistantUpdateButtonsState Source #

Arguments

:: (HasCallStack, MonadIO m, IsAssistant a) 
=> a

assistant: a Assistant

-> m () 

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

Properties

useHeaderBar

True if the assistant uses a HeaderBar for action buttons instead of the action-area.

For technical reasons, this property is declared as an integer property, but you should only set it to True or False.

Since: 3.12

constructAssistantUseHeaderBar :: IsAssistant o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “use-header-bar” property. This is rarely needed directly, but it is used by new.

getAssistantUseHeaderBar :: (MonadIO m, IsAssistant o) => o -> m Int32 Source #

Get the value of the “use-header-bar” property. When overloading is enabled, this is equivalent to

get assistant #useHeaderBar

Signals

apply

type AssistantApplyCallback = IO () Source #

The ::apply signal is emitted when the apply 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 ::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 AssistantPageTypeProgress after the confirmation page and handle this operation within the Assistant::prepare signal of the progress page.

Since: 2.10

type C_AssistantApplyCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAssistantApply :: (IsAssistant a, MonadIO m) => a -> AssistantApplyCallback -> m SignalHandlerId Source #

Connect a signal handler for the “apply” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after assistant #apply callback

onAssistantApply :: (IsAssistant a, MonadIO m) => a -> AssistantApplyCallback -> m SignalHandlerId Source #

Connect a signal handler for the “apply” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on assistant #apply callback

cancel

type AssistantCancelCallback = IO () Source #

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

Since: 2.10

type C_AssistantCancelCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAssistantCancel :: (IsAssistant a, MonadIO m) => a -> AssistantCancelCallback -> m SignalHandlerId Source #

Connect a signal handler for the “cancel” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after assistant #cancel callback

onAssistantCancel :: (IsAssistant a, MonadIO m) => a -> AssistantCancelCallback -> m SignalHandlerId Source #

Connect a signal handler for the “cancel” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on assistant #cancel callback

close

type AssistantCloseCallback = IO () Source #

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 AssistantPageTypeConfirm) is clicked.

Since: 2.10

type C_AssistantCloseCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAssistantClose :: (IsAssistant a, MonadIO m) => a -> AssistantCloseCallback -> m SignalHandlerId Source #

Connect a signal handler for the “close” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after assistant #close callback

onAssistantClose :: (IsAssistant a, MonadIO m) => a -> AssistantCloseCallback -> m SignalHandlerId Source #

Connect a signal handler for the “close” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on assistant #close callback

escape

type AssistantEscapeCallback = IO () Source #

No description available in the introspection data.

type C_AssistantEscapeCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAssistantEscape :: (IsAssistant a, MonadIO m) => a -> AssistantEscapeCallback -> m SignalHandlerId Source #

Connect a signal handler for the “escape” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after assistant #escape callback

onAssistantEscape :: (IsAssistant a, MonadIO m) => a -> AssistantEscapeCallback -> m SignalHandlerId Source #

Connect a signal handler for the “escape” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on assistant #escape callback

prepare

type AssistantPrepareCallback Source #

Arguments

 = Widget

page: the current page

-> IO () 

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 preparations which are necessary before showing page.

Since: 2.10

type C_AssistantPrepareCallback = Ptr () -> Ptr Widget -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAssistantPrepare :: (IsAssistant a, MonadIO m) => a -> AssistantPrepareCallback -> m SignalHandlerId Source #

Connect a signal handler for the “prepare” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after assistant #prepare callback

onAssistantPrepare :: (IsAssistant a, MonadIO m) => a -> AssistantPrepareCallback -> m SignalHandlerId Source #

Connect a signal handler for the “prepare” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on assistant #prepare callback