ActionProtocol
public protocol ActionProtocol : ObjectProtocol, BuildableProtocol
> In GTK+ 3.10, GtkAction has been deprecated. Use
GAction> instead, and associate actions withGtkActionablewidgets. Use >GMenuModelfor creating menus withgtk_menu_new_from_model().
Actions represent operations that the user can be perform, along with some information how it should be presented in the interface. Each action provides methods to create icons, menu items and toolbar items representing itself.
As well as the callback that is called when the action gets activated, the following also gets associated with the action:
a name (not translated, for path lookup)
a label (translated, for display)
an accelerator
whether label indicates a stock id
a tooltip (optional, translated)
a toolbar label (optional, shorter than label)
The action will also have some state information:
visible (shown/hidden)
sensitive (enabled/disabled)
Apart from regular actions, there are toggle actions,
which can be toggled between two states and
radio actions, of which only one in a group
can be in the “active” state. Other actions can be implemented as GtkAction
subclasses.
Each action can have one or more proxy widgets. To act as an action proxy,
widget needs to implement GtkActivatable interface. Proxies mirror the state
of the action and should change when the action’s state changes. Properties
that are always mirrored by proxies are GtkAction:sensitive and
GtkAction:visible. GtkAction:gicon, GtkAction:icon-name, GtkAction:label,
GtkAction:short-label and GtkAction:stock-id properties are only mirorred
if proxy widget has GtkActivatable:use-action-appearance property set to
true.
When the proxy is activated, it should activate its action.
The ActionProtocol protocol exposes the methods and properties of an underlying GtkAction 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 Action.
Alternatively, use ActionRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkActioninstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
action_ptrDefault implementationTyped pointer to the underlying
GtkActioninstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkActioninstance.Declaration
Swift
var action_ptr: UnsafeMutablePointer<GtkAction>! { get } -
Required Initialiser for types conforming to
ActionProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
ActionPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: ActionPropertyName, 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 Action property
Declaration
Swift
@inlinable func get(property: ActionPropertyName) -> 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 Action property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: ActionPropertyName, 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
ActionSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ActionSignalName, 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
ActionSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ActionSignalName, 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)
-
onActivate(flags:Extension methodhandler: ) The “activate” signal is emitted when the action is activated.
Note
This represents the underlyingactivatesignalDeclaration
Swift
@discardableResult @inlinable func onActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
activatesignal is emitted -
activateSignalExtension methodTyped
activatesignal for using theconnect(signal:)methodsDeclaration
Swift
static var activateSignal: ActionSignalName { get } -
onNotifyActionGroup(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::action-groupsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyActionGroup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyActionGroupsignal is emitted -
notifyActionGroupSignalExtension methodTyped
notify::action-groupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyActionGroupSignal: ActionSignalName { get } -
onNotifyAlwaysShowImage(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::always-show-imagesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAlwaysShowImage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyAlwaysShowImagesignal is emitted -
notifyAlwaysShowImageSignalExtension methodTyped
notify::always-show-imagesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAlwaysShowImageSignal: ActionSignalName { get } -
onNotifyIcon(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::giconsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIcon(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyIconsignal is emitted -
notifyIconSignalExtension methodTyped
notify::giconsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIconSignal: ActionSignalName { get } -
onNotifyHideIfEmpty(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::hide-if-emptysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHideIfEmpty(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyHideIfEmptysignal is emitted -
notifyHideIfEmptySignalExtension methodTyped
notify::hide-if-emptysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHideIfEmptySignal: ActionSignalName { get } -
onNotifyIconName(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::icon-namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIconName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyIconNamesignal is emitted -
notifyIconNameSignalExtension methodTyped
notify::icon-namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIconNameSignal: ActionSignalName { get } -
onNotifyIsImportant(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::is-importantsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyIsImportant(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyIsImportantsignal is emitted -
notifyIsImportantSignalExtension methodTyped
notify::is-importantsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyIsImportantSignal: ActionSignalName { get } -
onNotifyLabel(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::labelsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyLabelsignal is emitted -
notifyLabelSignalExtension methodTyped
notify::labelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyLabelSignal: ActionSignalName { get } -
onNotifyName(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::namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyNamesignal is emitted -
notifyNameSignalExtension methodTyped
notify::namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNameSignal: ActionSignalName { get } -
onNotifySensitive(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::sensitivesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySensitive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifySensitivesignal is emitted -
notifySensitiveSignalExtension methodTyped
notify::sensitivesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySensitiveSignal: ActionSignalName { get } -
onNotifyShortLabel(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::short-labelsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShortLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyShortLabelsignal is emitted -
notifyShortLabelSignalExtension methodTyped
notify::short-labelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShortLabelSignal: ActionSignalName { get } -
onNotifyStockID(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::stock-idsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyStockID(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyStockIDsignal is emitted -
notifyStockIDSignalExtension methodTyped
notify::stock-idsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStockIDSignal: ActionSignalName { get } -
onNotifyTooltip(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::tooltipsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTooltip(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyTooltipsignal is emitted -
notifyTooltipSignalExtension methodTyped
notify::tooltipsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTooltipSignal: ActionSignalName { get } -
onNotifyVisible(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::visiblesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisible(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyVisiblesignal is emitted -
notifyVisibleSignalExtension methodTyped
notify::visiblesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyVisibleSignal: ActionSignalName { get } -
onNotifyVisibleHorizontal(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::visible-horizontalsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisibleHorizontal(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyVisibleHorizontalsignal is emitted -
notifyVisibleHorizontalSignalExtension methodTyped
notify::visible-horizontalsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyVisibleHorizontalSignal: ActionSignalName { get } -
onNotifyVisibleOverflown(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::visible-overflownsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisibleOverflown(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyVisibleOverflownsignal is emitted -
notifyVisibleOverflownSignalExtension methodTyped
notify::visible-overflownsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyVisibleOverflownSignal: ActionSignalName { get } -
onNotifyVisibleVertical(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::visible-verticalsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisibleVertical(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ActionRef, _ 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
notifyVisibleVerticalsignal is emitted -
notifyVisibleVerticalSignalExtension methodTyped
notify::visible-verticalsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyVisibleVerticalSignal: ActionSignalName { get }
-
activate()Extension methodEmits the “activate” signal on the specified action, if it isn’t insensitive. This gets called by the proxy widgets when they get activated.
It can also be used to manually activate an action.
activate is deprecated: Use g_action_group_activate_action() on a #GAction instead
Declaration
Swift
@available(*, deprecated) @inlinable func activate() -
blockActivate()Extension methodDisable activation signals from the action
This is needed when updating the state of your proxy
GtkActivatablewidget could result in callinggtk_action_activate(), this is a convenience function to avoid recursing in those cases (updating toggle state for instance).block_activate is deprecated: Use g_simple_action_set_enabled() to disable the
GSimpleAction instead
Declaration
Swift
@available(*, deprecated) @inlinable func blockActivate() -
connectAccelerator()Extension methodInstalls the accelerator for
actionifactionhas an accel path and group. Seegtk_action_set_accel_path()andgtk_action_set_accel_group()Since multiple proxies may independently trigger the installation of the accelerator, the
actioncounts the number of times this function has been called and doesn’t remove the accelerator untilgtk_action_disconnect_accelerator()has been called as many times.connect_accelerator is deprecated: Use #GAction and the accelerator group on an associated
GtkMenu instead
Declaration
Swift
@available(*, deprecated) @inlinable func connectAccelerator() -
createIcon(iconSize:Extension method) This function is intended for use by action implementations to create icons displayed in the proxy widgets.
create_icon is deprecated: Use g_menu_item_set_icon() to set an icon on a #GMenuItem, or gtk_container_add() to add a #GtkImage to a #GtkButton
Declaration
Swift
@available(*, deprecated) @inlinable func createIcon(iconSize: GtkIconSize) -> WidgetRef! -
createMenu()Extension methodIf
actionprovides aGtkMenuwidget as a submenu for the menu item or the toolbar item it creates, this function returns an instance of that menu.create_menu is deprecated: Use #GAction and #GMenuModel instead, and create a
GtkMenu with gtk_menu_new_from_model()
Declaration
Swift
@available(*, deprecated) @inlinable func createMenu() -> WidgetRef! -
createMenuItem()Extension methodCreates a menu item widget that proxies for the given action.
create_menu_item is deprecated: Use g_menu_item_new() and associate it with a #GAction instead.
Declaration
Swift
@available(*, deprecated) @inlinable func createMenuItem() -> WidgetRef! -
createToolItem()Extension methodCreates a toolbar item widget that proxies for the given action.
create_tool_item is deprecated: Use a #GtkToolItem and associate it with a #GAction using gtk_actionable_set_action_name() instead
Declaration
Swift
@available(*, deprecated) @inlinable func createToolItem() -> WidgetRef! -
disconnectAccelerator()Extension methodUndoes the effect of one call to
gtk_action_connect_accelerator().disconnect_accelerator is deprecated: Use #GAction and the accelerator group on an associated
GtkMenu instead
Declaration
Swift
@available(*, deprecated) @inlinable func disconnectAccelerator() -
getAccelClosure()Extension methodReturns the accel closure for this action.
get_accel_closure is deprecated: Use #GAction and #GtkMenu instead, which have no equivalent for getting the accel closure
Declaration
Swift
@available(*, deprecated) @inlinable func getAccelClosure() -> GLibObject.ClosureRef! -
getAccelPath()Extension methodReturns the accel path for this action.
get_accel_path is deprecated: Use #GAction and the accelerator path on an associated
GtkMenu instead
Declaration
Swift
@available(*, deprecated) @inlinable func getAccelPath() -> String! -
getAlwaysShowImage()Extension methodReturns whether
action‘s menu item proxies will always show their image, if available.get_always_show_image is deprecated: Use g_menu_item_get_attribute_value() on a #GMenuItem instead
Declaration
Swift
@available(*, deprecated) @inlinable func getAlwaysShowImage() -> Bool -
getIcon()Extension methodGets the gicon of
action.get_gicon is deprecated: Use #GAction instead, and g_menu_item_get_attribute_value() to get an icon from a #GMenuItem associated with a #GAction
Declaration
Swift
@available(*, deprecated) @inlinable func getIcon() -> GIO.IconRef! -
getIconName()Extension methodGets the icon name of
action.get_icon_name is deprecated: Use #GAction instead, and g_menu_item_get_attribute_value() to get an icon from a #GMenuItem associated with a #GAction
Declaration
Swift
@available(*, deprecated) @inlinable func getIconName() -> String! -
getIsImportant()Extension methodChecks whether
actionis important or notget_is_important is deprecated: Use #GAction instead, and control and monitor whether labels are shown directly
Declaration
Swift
@available(*, deprecated) @inlinable func getIsImportant() -> Bool -
getLabel()Extension methodGets the label text of
action.get_label is deprecated: Use #GAction instead, and get a label from a menu item with g_menu_item_get_attribute_value(). For #GtkActionable widgets, use the widget-specific API to get a label
Declaration
Swift
@available(*, deprecated) @inlinable func getLabel() -> String! -
getName()Extension methodReturns the name of the action.
get_name is deprecated: Use g_action_get_name() on a #GAction instead
Declaration
Swift
@available(*, deprecated) @inlinable func getName() -> String! -
getProxies()Extension methodReturns the proxy widgets for an action. See also
gtk_activatable_get_related_action().get_proxies is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getProxies() -> GLib.SListRef! -
getSensitive()Extension methodReturns whether the action itself is sensitive. Note that this doesn’t necessarily mean effective sensitivity. See
gtk_action_is_sensitive()for that.get_sensitive is deprecated: Use g_action_get_enabled() on a #GAction instead
Declaration
Swift
@available(*, deprecated) @inlinable func getSensitive() -> Bool -
getShortLabel()Extension methodGets the short label text of
action.get_short_label is deprecated: Use #GAction instead, which has no equivalent of short labels
Declaration
Swift
@available(*, deprecated) @inlinable func getShortLabel() -> String! -
getStockID()Extension methodGets the stock id of
action.get_stock_id is deprecated: Use #GAction instead, which has no equivalent of stock items
Declaration
Swift
@available(*, deprecated) @inlinable func getStockID() -> String! -
getTooltip()Extension methodGets the tooltip text of
action.get_tooltip is deprecated: Use #GAction instead, and get tooltips from associated
GtkActionable widgets with gtk_widget_get_tooltip_text()
Declaration
Swift
@available(*, deprecated) @inlinable func getTooltip() -> String! -
getVisible()Extension methodReturns whether the action itself is visible. Note that this doesn’t necessarily mean effective visibility. See
gtk_action_is_sensitive()for that.get_visible is deprecated: Use #GAction instead, and control and monitor the state of
GtkActionable widgets directly
Declaration
Swift
@available(*, deprecated) @inlinable func getVisible() -> Bool -
getVisibleHorizontal()Extension methodChecks whether
actionis visible when horizontalget_visible_horizontal is deprecated: Use #GAction instead, and control and monitor the visibility of associated widgets and menu items directly
Declaration
Swift
@available(*, deprecated) @inlinable func getVisibleHorizontal() -> Bool -
getVisibleVertical()Extension methodChecks whether
actionis visible when horizontalget_visible_vertical is deprecated: Use #GAction instead, and control and monitor the visibility of associated widgets and menu items directly
Declaration
Swift
@available(*, deprecated) @inlinable func getVisibleVertical() -> Bool -
set(accelGroup:Extension method) Sets the
GtkAccelGroupin which the accelerator for this action will be installed.set_accel_group is deprecated: Use #GAction and the accelerator group on an associated
GtkMenu instead
Declaration
Swift
@available(*, deprecated) @inlinable func set(accelGroup: AccelGroupRef? = nil) -
set(accelGroup:Extension method) Sets the
GtkAccelGroupin which the accelerator for this action will be installed.set_accel_group is deprecated: Use #GAction and the accelerator group on an associated
GtkMenu instead
Declaration
Swift
@available(*, deprecated) @inlinable func set<AccelGroupT>(accelGroup: AccelGroupT?) where AccelGroupT : AccelGroupProtocol -
set(accelPath:Extension method) Sets the accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.
Note that
accel_pathstring will be stored in aGQuark. Therefore, if you pass a static string, you can save some memory by interning it first withg_intern_static_string().set_accel_path is deprecated: Use #GAction and the accelerator path on an associated
GtkMenu instead
Declaration
Swift
@available(*, deprecated) @inlinable func set(accelPath: UnsafePointer<gchar>!) -
setAlwaysShowImage(alwaysShow:Extension method) Sets whether
action‘s menu item proxies will ignore theGtkSettings:gtk-menu-imagessetting and always show their image, if available.Use this if the menu item would be useless or hard to use without their image.
set_always_show_image is deprecated: Use g_menu_item_set_icon() on a #GMenuItem instead, if the item should have an image
Declaration
Swift
@available(*, deprecated) @inlinable func setAlwaysShowImage(alwaysShow: Bool) -
setIcon(icon:Extension method) Sets the icon of
action.set_gicon is deprecated: Use #GAction instead, and g_menu_item_set_icon() to set an icon on a #GMenuItem associated with a #GAction, or gtk_container_add() to add a #GtkImage to a #GtkButton
Declaration
Swift
@available(*, deprecated) @inlinable func setIcon<IconT>(icon: IconT) where IconT : IconProtocol -
set(iconName:Extension method) Sets the icon name on
actionset_icon_name is deprecated: Use #GAction instead, and g_menu_item_set_icon() to set an icon on a #GMenuItem associated with a #GAction, or gtk_container_add() to add a #GtkImage to a #GtkButton
Declaration
Swift
@available(*, deprecated) @inlinable func set(iconName: UnsafePointer<gchar>!) -
set(isImportant:Extension method) Sets whether the action is important, this attribute is used primarily by toolbar items to decide whether to show a label or not.
set_is_important is deprecated: Use #GAction instead, and control and monitor whether labels are shown directly
Declaration
Swift
@available(*, deprecated) @inlinable func set(isImportant: Bool) -
set(label:Extension method) Sets the label of
action.set_label is deprecated: Use #GAction instead, and set a label on a menu item with g_menu_item_set_label(). For #GtkActionable widgets, use the widget-specific API to set a label
Declaration
Swift
@available(*, deprecated) @inlinable func set(label: UnsafePointer<gchar>!) -
set(sensitive:Extension method) Sets the :sensitive property of the action to
sensitive. Note that this doesn’t necessarily mean effective sensitivity. Seegtk_action_is_sensitive()for that.set_sensitive is deprecated: Use g_simple_action_set_enabled() on a #GSimpleAction instead
Declaration
Swift
@available(*, deprecated) @inlinable func set(sensitive: Bool) -
set(shortLabel:Extension method) Sets a shorter label text on
action.set_short_label is deprecated: Use #GAction instead, which has no equivalent of short labels
Declaration
Swift
@available(*, deprecated) @inlinable func set(shortLabel: UnsafePointer<gchar>!) -
set(stockID:Extension method) Sets the stock id on
actionset_stock_id is deprecated: Use #GAction instead, which has no equivalent of stock items
Declaration
Swift
@available(*, deprecated) @inlinable func set(stockID: UnsafePointer<gchar>!) -
set(tooltip:Extension method) Sets the tooltip text on
actionset_tooltip is deprecated: Use #GAction instead, and set tooltips on associated
GtkActionable widgets with gtk_widget_set_tooltip_text()
Declaration
Swift
@available(*, deprecated) @inlinable func set(tooltip: UnsafePointer<gchar>!) -
set(visible:Extension method) Sets the :visible property of the action to
visible. Note that this doesn’t necessarily mean effective visibility. Seegtk_action_is_visible()for that.set_visible is deprecated: Use #GAction instead, and control and monitor the state of
GtkActionable widgets directly
Declaration
Swift
@available(*, deprecated) @inlinable func set(visible: Bool) -
set(visibleHorizontal:Extension method) Sets whether
actionis visible when horizontalset_visible_horizontal is deprecated: Use #GAction instead, and control and monitor the visibility of associated widgets and menu items directly
Declaration
Swift
@available(*, deprecated) @inlinable func set(visibleHorizontal: Bool) -
set(visibleVertical:Extension method) Sets whether
actionis visible when verticalset_visible_vertical is deprecated: Use #GAction instead, and control and monitor the visibility of associated widgets and menu items directly
Declaration
Swift
@available(*, deprecated) @inlinable func set(visibleVertical: Bool) -
unblockActivate()Extension methodReenable activation signals from the action
unblock_activate is deprecated: Use g_simple_action_set_enabled() to enable the
GSimpleAction instead
Declaration
Swift
@available(*, deprecated) @inlinable func unblockActivate() -
accelClosureExtension methodReturns the accel closure for this action.
get_accel_closure is deprecated: Use #GAction and #GtkMenu instead, which have no equivalent for getting the accel closure
Declaration
Swift
@inlinable var accelClosure: GLibObject.ClosureRef! { get } -
accelPathExtension methodReturns the accel path for this action.
get_accel_path is deprecated: Use #GAction and the accelerator path on an associated
GtkMenu instead
Declaration
Swift
@inlinable var accelPath: String! { get nonmutating set } -
alwaysShowImageExtension methodReturns whether
action‘s menu item proxies will always show their image, if available.get_always_show_image is deprecated: Use g_menu_item_get_attribute_value() on a #GMenuItem instead
Declaration
Swift
@inlinable var alwaysShowImage: Bool { get nonmutating set } -
giconExtension methodThe
GIcondisplayed in theGtkAction.Note that the stock icon is preferred, if the
GtkAction:stock-idproperty holds the id of an existing stock icon.This is an appearance property and thus only applies if
GtkActivatable:use-action-appearanceistrue.gicon is deprecated: Use the “icon” attribute on a #GMenuItem instead
Declaration
Swift
@inlinable var gicon: GIO.IconRef! { get nonmutating set } -
iconNameExtension methodGets the icon name of
action.get_icon_name is deprecated: Use #GAction instead, and g_menu_item_get_attribute_value() to get an icon from a #GMenuItem associated with a #GAction
Declaration
Swift
@inlinable var iconName: String! { get nonmutating set } -
isImportantExtension methodChecks whether
actionis important or notget_is_important is deprecated: Use #GAction instead, and control and monitor whether labels are shown directly
Declaration
Swift
@inlinable var isImportant: Bool { get nonmutating set } -
isSensitiveExtension methodReturns whether the action is effectively sensitive.
is_sensitive is deprecated: Use g_action_get_enabled() on a #GAction instead
Declaration
Swift
@inlinable var isSensitive: Bool { get } -
isVisibleExtension methodReturns whether the action is effectively visible.
is_visible is deprecated: Use #GAction instead, and control and monitor the state of
GtkActionable widgets directly
Declaration
Swift
@inlinable var isVisible: Bool { get } -
labelExtension methodThe label used for menu items and buttons that activate this action. If the label is
nil, GTK+ uses the stock label specified via the stock-id property.This is an appearance property and thus only applies if
GtkActivatable:use-action-appearanceistrue.label is deprecated: Use the “label” attribute on #GMenuItem instead
Declaration
Swift
@inlinable var label: String! { get nonmutating set } -
nameExtension methodA unique name for the action.
name is deprecated: Use #GAction:name instead
Declaration
Swift
@inlinable var name: String! { get } -
proxiesExtension methodReturns the proxy widgets for an action. See also
gtk_activatable_get_related_action().get_proxies is deprecated: This method is deprecated.
Declaration
Swift
@inlinable var proxies: GLib.SListRef! { get } -
sensitiveExtension methodWhether the action is enabled.
sensitive is deprecated: Use #GAction:enabled and #GSimpleAction:enabled instead
Declaration
Swift
@inlinable var sensitive: Bool { get nonmutating set } -
shortLabelExtension methodGets the short label text of
action.get_short_label is deprecated: Use #GAction instead, which has no equivalent of short labels
Declaration
Swift
@inlinable var shortLabel: String! { get nonmutating set } -
stockIDExtension methodGets the stock id of
action.get_stock_id is deprecated: Use #GAction instead, which has no equivalent of stock items
Declaration
Swift
@inlinable var stockID: String! { get nonmutating set } -
tooltipExtension methodA tooltip for this action.
tooltip is deprecated: Use gtk_widget_set_tooltip_text() instead
Declaration
Swift
@inlinable var tooltip: String! { get nonmutating set } -
visibleExtension methodWhether the action is visible.
visible is deprecated: There is no corresponding replacement when using
GAction
Declaration
Swift
@inlinable var visible: Bool { get nonmutating set } -
visibleHorizontalExtension methodChecks whether
actionis visible when horizontalget_visible_horizontal is deprecated: Use #GAction instead, and control and monitor the visibility of associated widgets and menu items directly
Declaration
Swift
@inlinable var visibleHorizontal: Bool { get nonmutating set } -
visibleVerticalExtension methodChecks whether
actionis visible when horizontalget_visible_vertical is deprecated: Use #GAction instead, and control and monitor the visibility of associated widgets and menu items directly
Declaration
Swift
@inlinable var visibleVertical: Bool { get nonmutating set } -
objectExtension methodUndocumented
Declaration
Swift
@inlinable var object: GObject { get }
View on GitHub
Install in Dash
ActionProtocol Protocol Reference