NumerableIconProtocol
public protocol NumerableIconProtocol : EmblemedIconProtocol
GtkNumerableIcon is a subclass of GEmblemedIcon that can
show a number or short string as an emblem. The number can
be overlayed on top of another emblem, if desired.
It supports theming by taking font and color information
from a provided GtkStyleContext; see
gtk_numerable_icon_set_style_context().
Typical numerable icons:
![]()
The NumerableIconProtocol protocol exposes the methods and properties of an underlying GtkNumerableIcon 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 NumerableIcon.
Alternatively, use NumerableIconRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkNumerableIconinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
numerable_icon_ptrDefault implementationTyped pointer to the underlying
GtkNumerableIconinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkNumerableIconinstance.Declaration
Swift
var numerable_icon_ptr: UnsafeMutablePointer<GtkNumerableIcon>! { get } -
Required Initialiser for types conforming to
NumerableIconProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
NumerableIconPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: NumerableIconPropertyName, 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 NumerableIcon property
Declaration
Swift
@inlinable func get(property: NumerableIconPropertyName) -> 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 NumerableIcon property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: NumerableIconPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getBackgroundIcon()Extension methodReturns the
GIconthat was set as the base background image, ornilif there’s none. The caller of this function does not own a reference to the returnedGIcon.get_background_gicon is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getBackgroundIcon() -> GIO.IconRef! -
getBackgroundIconName()Extension methodReturns the icon name used as the base background image, or
nilif there’s none.get_background_icon_name is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getBackgroundIconName() -> String! -
getCount()Extension methodReturns the value currently displayed by
self.get_count is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getCount() -> Int -
getLabel()Extension methodReturns the currently displayed label of the icon, or
nil.get_label is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getLabel() -> String! -
getStyleContext()Extension methodReturns the
GtkStyleContextused by the icon for theming, ornilif there’s none.get_style_context is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getStyleContext() -> StyleContextRef! -
setBackgroundIcon(icon:Extension method) Updates the icon to use
iconas the base background image. Ificonisnil,selfwill go back using style information or default theming for its background image.If this method is called and an icon name was already set as background for the icon,
iconwill be used, i.e. the last method called betweengtk_numerable_icon_set_background_gicon()andgtk_numerable_icon_set_background_icon_name()has always priority.set_background_gicon is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setBackgroundIcon(icon: GIO.IconRef? = nil) -
setBackgroundIcon(icon:Extension method) Updates the icon to use
iconas the base background image. Ificonisnil,selfwill go back using style information or default theming for its background image.If this method is called and an icon name was already set as background for the icon,
iconwill be used, i.e. the last method called betweengtk_numerable_icon_set_background_gicon()andgtk_numerable_icon_set_background_icon_name()has always priority.set_background_gicon is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setBackgroundIcon<IconT>(icon: IconT?) where IconT : IconProtocol -
setBackground(iconName:Extension method) Updates the icon to use the icon named
icon_namefrom the current icon theme as the base background image. Ificon_nameisnil,selfwill go back using style information or default theming for its background image.If this method is called and a
GIconwas already set as background for the icon,icon_namewill be used, i.e. the last method called betweengtk_numerable_icon_set_background_icon_name()andgtk_numerable_icon_set_background_gicon()has always priority.set_background_icon_name is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setBackground(iconName: UnsafePointer<gchar>? = nil) -
set(count:Extension method) Sets the currently displayed value of
selftocount.The numeric value is always clamped to make it two digits, i.e. between -99 and 99. Setting a count of zero removes the emblem. If this method is called, and a label was already set on the icon, it will automatically be reset to
nilbefore rendering the number, i.e. the last method called betweengtk_numerable_icon_set_count()andgtk_numerable_icon_set_label()has always priority.set_count is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func set(count: Int) -
set(label:Extension method) Sets the currently displayed value of
selfto the string inlabel. Setting an empty label removes the emblem.Note that this is meant for displaying short labels, such as roman numbers, or single letters. For roman numbers, consider using the Unicode characters U+2160 - U+217F. Strings longer than two characters will likely not be rendered very well.
If this method is called, and a number was already set on the icon, it will automatically be reset to zero before rendering the label, i.e. the last method called between
gtk_numerable_icon_set_label()andgtk_numerable_icon_set_count()has always priority.set_label is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func set(label: UnsafePointer<gchar>? = nil) -
setStyleContext(style:Extension method) Updates the icon to fetch theme information from the given
GtkStyleContext.set_style_context is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func setStyleContext<StyleContextT>(style: StyleContextT) where StyleContextT : StyleContextProtocol -
backgroundIconExtension methodReturns the
GIconthat was set as the base background image, ornilif there’s none. The caller of this function does not own a reference to the returnedGIcon.get_background_gicon is deprecated: This method is deprecated.
Declaration
Swift
@inlinable var backgroundIcon: GIO.IconRef! { get nonmutating set } -
backgroundIconNameExtension methodReturns the icon name used as the base background image, or
nilif there’s none.get_background_icon_name is deprecated: This method is deprecated.
Declaration
Swift
@inlinable var backgroundIconName: String! { get nonmutating set } -
countExtension methodUndocumented
Declaration
Swift
@inlinable var count: Int { get nonmutating set } -
labelExtension methodUndocumented
Declaration
Swift
@inlinable var label: String! { get nonmutating set } -
styleContextExtension methodReturns the
GtkStyleContextused by the icon for theming, ornilif there’s none.get_style_context is deprecated: This method is deprecated.
Declaration
Swift
@inlinable var styleContext: StyleContextRef! { get nonmutating set } -
parentExtension methodUndocumented
Declaration
Swift
@inlinable var parent: GEmblemedIcon { get }
View on GitHub
Install in Dash
NumerableIconProtocol Protocol Reference