AssistantProtocol
public protocol AssistantProtocol : WindowProtocol
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 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 of each page, in addition to state information like the page completion and committed 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 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.
CSS nodes
GtkAssistant has a single CSS node with the name assistant.
The AssistantProtocol protocol exposes the methods and properties of an underlying GtkAssistant instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Assistant.
Alternatively, use AssistantRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkAssistantinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
assistant_ptrDefault implementationTyped pointer to the underlying
GtkAssistantinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkAssistantinstance.Declaration
Swift
var assistant_ptr: UnsafeMutablePointer<GtkAssistant>! { get } -
Required Initialiser for types conforming to
AssistantProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
AssistantPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: AssistantPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Assistant property
Declaration
Swift
@inlinable func get(property: AssistantPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a Assistant property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: AssistantPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
AssistantSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: AssistantSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
AssistantSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: AssistantSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onApply(flags:Extension methodhandler: ) The
applysignal is emitted when the apply button is clicked.The default behavior of the
GtkAssistantis to switch to the page after the current page, unless the current page is the last one.A handler for the
applysignal 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 typeGTK_ASSISTANT_PAGE_PROGRESSafter the confirmation page and handle this operation within theGtkAssistant::preparesignal of the progress page.Note
This represents the underlyingapplysignalDeclaration
Swift
@discardableResult @inlinable func onApply(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AssistantRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
applysignal is emitted -
applySignalExtension methodTyped
applysignal for using theconnect(signal:)methodsDeclaration
Swift
static var applySignal: AssistantSignalName { get } -
onCancel(flags:Extension methodhandler: ) The
cancelsignal is emitted when then the cancel button is clicked.Note
This represents the underlyingcancelsignalDeclaration
Swift
@discardableResult @inlinable func onCancel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AssistantRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
cancelsignal is emitted -
cancelSignalExtension methodTyped
cancelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var cancelSignal: AssistantSignalName { get } -
onClose(flags:Extension methodhandler: ) The
closesignal 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 typeGTK_ASSISTANT_PAGE_CONFIRM) is clicked.Note
This represents the underlyingclosesignalDeclaration
Swift
@discardableResult @inlinable func onClose(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AssistantRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
closesignal is emitted -
closeSignalExtension methodTyped
closesignal for using theconnect(signal:)methodsDeclaration
Swift
static var closeSignal: AssistantSignalName { get } -
onEscape(flags:Extension methodhandler: ) Note
This represents the underlyingescapesignalDeclaration
Swift
@discardableResult @inlinable func onEscape(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AssistantRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
escapesignal is emitted -
escapeSignalExtension methodTyped
escapesignal for using theconnect(signal:)methodsDeclaration
Swift
static var escapeSignal: AssistantSignalName { get } -
onPrepare(flags:Extension methodhandler: ) The
preparesignal 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.Note
This represents the underlyingpreparesignalDeclaration
Swift
@discardableResult @inlinable func onPrepare(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AssistantRef, _ page: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pagethe current page
handlerThe signal handler to call Run the given callback whenever the
preparesignal is emitted -
prepareSignalExtension methodTyped
preparesignal for using theconnect(signal:)methodsDeclaration
Swift
static var prepareSignal: AssistantSignalName { get } -
onNotifyUseHeaderBar(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::use-header-barsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUseHeaderBar(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AssistantRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUseHeaderBarsignal is emitted -
notifyUseHeaderBarSignalExtension methodTyped
notify::use-header-barsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUseHeaderBarSignal: AssistantSignalName { get }
-
addActionWidget(child:Extension method) Adds a widget to the action area of a
GtkAssistant.Declaration
Swift
@inlinable func addActionWidget<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol -
append(page:Extension method) Appends a page to the
assistant.Declaration
Swift
@inlinable func append<WidgetT>(page: WidgetT) -> Int where WidgetT : WidgetProtocol -
commit()Extension methodErases 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.
Declaration
Swift
@inlinable func commit() -
getCurrentPage()Extension methodReturns the page number of the current page.
Declaration
Swift
@inlinable func getCurrentPage() -> Int -
getNPages()Extension methodReturns the number of pages in the
assistantDeclaration
Swift
@inlinable func getNPages() -> Int -
getNthPage(pageNum:Extension method) Returns the child widget contained in page number
page_num.Declaration
Swift
@inlinable func getNthPage(pageNum: Int) -> WidgetRef! -
getPageComplete(page:Extension method) Gets whether
pageis complete.Declaration
Swift
@inlinable func getPageComplete<WidgetT>(page: WidgetT) -> Bool where WidgetT : WidgetProtocol -
getPageHasPadding(page:Extension method) Gets whether page has padding.
Declaration
Swift
@inlinable func getPageHasPadding<WidgetT>(page: WidgetT) -> Bool where WidgetT : WidgetProtocol -
getPageHeaderImage(page:Extension method) Gets the header image for
page.get_page_header_image is deprecated: Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.
Declaration
Swift
@available(*, deprecated) @inlinable func getPageHeaderImage<WidgetT>(page: WidgetT) -> PixbufRef! where WidgetT : WidgetProtocol -
getPageSideImage(page:Extension method) Gets the side image for
page.get_page_side_image is deprecated: Since GTK+ 3.2, sidebar images are not shown anymore.
Declaration
Swift
@available(*, deprecated) @inlinable func getPageSideImage<WidgetT>(page: WidgetT) -> PixbufRef! where WidgetT : WidgetProtocol -
getPageTitle(page:Extension method) Gets the title for
page.Declaration
Swift
@inlinable func getPageTitle<WidgetT>(page: WidgetT) -> String! where WidgetT : WidgetProtocol -
getPageType(page:Extension method) Gets the page type of
page.Declaration
Swift
@inlinable func getPageType<WidgetT>(page: WidgetT) -> GtkAssistantPageType where WidgetT : WidgetProtocol -
insert(page:Extension methodposition: ) Inserts a page in the
assistantat a given position.Declaration
Swift
@inlinable func insert<WidgetT>(page: WidgetT, position: Int) -> Int where WidgetT : WidgetProtocol -
nextPage()Extension methodNavigate 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_CUSTOMtype.Declaration
Swift
@inlinable func nextPage() -
prepend(page:Extension method) Prepends a page to the
assistant.Declaration
Swift
@inlinable func prepend<WidgetT>(page: WidgetT) -> Int where WidgetT : WidgetProtocol -
previousPage()Extension methodNavigate 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_CUSTOMtype.Declaration
Swift
@inlinable func previousPage() -
removeActionWidget(child:Extension method) Removes a widget from the action area of a
GtkAssistant.Declaration
Swift
@inlinable func removeActionWidget<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol -
removePage(pageNum:Extension method) Removes the
page_num’s page fromassistant.Declaration
Swift
@inlinable func removePage(pageNum: Int) -
setCurrentPage(pageNum:Extension method) Switches the page to
page_num.Note that this will only be necessary in custom buttons, as the
assistantflow can be set withgtk_assistant_set_forward_page_func().Declaration
Swift
@inlinable func setCurrentPage(pageNum: Int) -
setForward(pageFunc:Extension methoddata: 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_functonilwill make the assistant to use the default forward function, which just goes to the next visible page.Declaration
Swift
@inlinable func setForward(pageFunc: GtkAssistantPageFunc? = nil, data: gpointer! = nil, destroy: GDestroyNotify?) -
setPageComplete(page:Extension methodcomplete: ) Sets whether
pagecontents are complete.This will make
assistantupdate the buttons state to be able to continue the task.Declaration
Swift
@inlinable func setPageComplete<WidgetT>(page: WidgetT, complete: Bool) where WidgetT : WidgetProtocol -
setPageHasPadding(page:Extension methodhasPadding: ) Sets whether the assistant is adding padding around the page.
Declaration
Swift
@inlinable func setPageHasPadding<WidgetT>(page: WidgetT, hasPadding: Bool) where WidgetT : WidgetProtocol -
setPageHeaderImage(page:Extension methodpixbuf: ) Sets a header image for
page.set_page_header_image is deprecated: Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.
Declaration
Swift
@available(*, deprecated) @inlinable func setPageHeaderImage<WidgetT>(page: WidgetT, pixbuf: PixbufRef? = nil) where WidgetT : WidgetProtocol -
setPageHeaderImage(page:Extension methodpixbuf: ) Sets a header image for
page.set_page_header_image is deprecated: Since GTK+ 3.2, a header is no longer shown; add your header decoration to the page content instead.
Declaration
Swift
@available(*, deprecated) @inlinable func setPageHeaderImage<PixbufT, WidgetT>(page: WidgetT, pixbuf: PixbufT?) where PixbufT : PixbufProtocol, WidgetT : WidgetProtocol -
setPageSideImage(page:Extension methodpixbuf: ) Sets a side image for
page.This image used to be displayed in the side area of the assistant when
pageis the current page.set_page_side_image is deprecated: Since GTK+ 3.2, sidebar images are not shown anymore.
Declaration
Swift
@available(*, deprecated) @inlinable func setPageSideImage<WidgetT>(page: WidgetT, pixbuf: PixbufRef? = nil) where WidgetT : WidgetProtocol -
setPageSideImage(page:Extension methodpixbuf: ) Sets a side image for
page.This image used to be displayed in the side area of the assistant when
pageis the current page.set_page_side_image is deprecated: Since GTK+ 3.2, sidebar images are not shown anymore.
Declaration
Swift
@available(*, deprecated) @inlinable func setPageSideImage<PixbufT, WidgetT>(page: WidgetT, pixbuf: PixbufT?) where PixbufT : PixbufProtocol, WidgetT : WidgetProtocol -
setPageTitle(page:Extension methodtitle: ) Sets a title for
page.The title is displayed in the header area of the assistant when
pageis the current page.Declaration
Swift
@inlinable func setPageTitle<WidgetT>(page: WidgetT, title: UnsafePointer<gchar>!) where WidgetT : WidgetProtocol -
setPageType(page:Extension methodtype: ) Sets the page type for
page.The page type determines the page behavior in the
assistant.Declaration
Swift
@inlinable func setPageType<WidgetT>(page: WidgetT, type: GtkAssistantPageType) where WidgetT : WidgetProtocol -
updateButtonsState()Extension methodForces
assistantto 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.
Declaration
Swift
@inlinable func updateButtonsState() -
currentPageExtension methodReturns the page number of the current page.
Declaration
Swift
@inlinable var currentPage: Int { get nonmutating set } -
nPagesExtension methodReturns the number of pages in the
assistantDeclaration
Swift
@inlinable var nPages: Int { get } -
parentExtension methodUndocumented
Declaration
Swift
@inlinable var parent: GtkWindow { get }
View on GitHub
Install in Dash
AssistantProtocol Protocol Reference