AlignmentProtocol
public protocol AlignmentProtocol : BinProtocol
The GtkAlignment widget controls the alignment and size of its child widget.
It has four settings: xscale, yscale, xalign, and yalign.
The scale settings are used to specify how much the child widget should
expand to fill the space allocated to the GtkAlignment.
The values can range from 0 (meaning the child doesn’t expand at all) to
1 (meaning the child expands to fill all of the available space).
The align settings are used to place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.
GtkAlignment has been deprecated in 3.14 and should not be used in
newly-written code. The desired effect can be achieved by using the
GtkWidget:halign, GtkWidget:valign and GtkWidget:margin properties on the
child widget.
The AlignmentProtocol protocol exposes the methods and properties of an underlying GtkAlignment 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 Alignment.
Alternatively, use AlignmentRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkAlignmentinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
alignment_ptrDefault implementationTyped pointer to the underlying
GtkAlignmentinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkAlignmentinstance.Declaration
Swift
var alignment_ptr: UnsafeMutablePointer<GtkAlignment>! { get } -
Required Initialiser for types conforming to
AlignmentProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
AlignmentPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: AlignmentPropertyName, 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 Alignment property
Declaration
Swift
@inlinable func get(property: AlignmentPropertyName) -> 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 Alignment property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: AlignmentPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getPadding(paddingTop:Extension methodpaddingBottom: paddingLeft: paddingRight: ) Gets the padding on the different sides of the widget. See gtk_alignment_set_padding ().
get_padding is deprecated: Use #GtkWidget alignment and margin properties
Declaration
Swift
@available(*, deprecated) @inlinable func getPadding(paddingTop: UnsafeMutablePointer<guint>! = nil, paddingBottom: UnsafeMutablePointer<guint>! = nil, paddingLeft: UnsafeMutablePointer<guint>! = nil, paddingRight: UnsafeMutablePointer<guint>! = nil) -
set(xalign:Extension methodyalign: xscale: yscale: ) Sets the
GtkAlignmentvalues.set is deprecated: Use #GtkWidget alignment and margin properties
Declaration
Swift
@available(*, deprecated) @inlinable func set(xalign: Double, yalign: Double, xscale: Double, yscale: Double) -
setPadding(paddingTop:Extension methodpaddingBottom: paddingLeft: paddingRight: ) Sets the padding on the different sides of the widget. The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left.
set_padding is deprecated: Use #GtkWidget alignment and margin properties
Declaration
Swift
@available(*, deprecated) @inlinable func setPadding(paddingTop: Int, paddingBottom: Int, paddingLeft: Int, paddingRight: Int) -
binExtension methodUndocumented
Declaration
Swift
@inlinable var bin: GtkBin { get }
View on GitHub
Install in Dash
AlignmentProtocol Protocol Reference