LayoutProtocol
public protocol LayoutProtocol : ContainerProtocol, ScrollableProtocol
GtkLayout is similar to GtkDrawingArea in that it’s a “blank slate” and
doesn’t do anything except paint a blank background by default. It’s
different in that it supports scrolling natively due to implementing
GtkScrollable, and can contain child widgets since it’s a GtkContainer.
If you just want to draw, a GtkDrawingArea is a better choice since it has
lower overhead. If you just need to position child widgets at specific
points, then GtkFixed provides that functionality on its own.
When handling expose events on a GtkLayout, you must draw to the GdkWindow
returned by gtk_layout_get_bin_window(), rather than to the one returned by
gtk_widget_get_window() as you would for a GtkDrawingArea.
The LayoutProtocol protocol exposes the methods and properties of an underlying GtkLayout 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 Layout.
Alternatively, use LayoutRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkLayoutinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
layout_ptrDefault implementationTyped pointer to the underlying
GtkLayoutinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkLayoutinstance.Declaration
Swift
var layout_ptr: UnsafeMutablePointer<GtkLayout>! { get } -
Required Initialiser for types conforming to
LayoutProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
LayoutPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: LayoutPropertyName, 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 Layout property
Declaration
Swift
@inlinable func get(property: LayoutPropertyName) -> 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 Layout property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: LayoutPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getBinWindow()Extension methodRetrieve the bin window of the layout used for drawing operations.
Declaration
Swift
@inlinable func getBinWindow() -> Gdk.WindowRef! -
getHadjustment()Extension methodThis function should only be called after the layout has been placed in a
GtkScrolledWindowor otherwise configured for scrolling. It returns theGtkAdjustmentused for communication between the horizontal scrollbar andlayout.See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.get_hadjustment is deprecated: Use gtk_scrollable_get_hadjustment()
Declaration
Swift
@available(*, deprecated) @inlinable func getHadjustment() -> AdjustmentRef! -
getSize(width:Extension methodheight: ) Gets the size that has been set on the layout, and that determines the total extents of the layout’s scrollbar area. See gtk_layout_set_size ().
Declaration
Swift
@inlinable func getSize(width: UnsafeMutablePointer<guint>! = nil, height: UnsafeMutablePointer<guint>! = nil) -
getVadjustment()Extension methodThis function should only be called after the layout has been placed in a
GtkScrolledWindowor otherwise configured for scrolling. It returns theGtkAdjustmentused for communication between the vertical scrollbar andlayout.See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.get_vadjustment is deprecated: Use gtk_scrollable_get_vadjustment()
Declaration
Swift
@available(*, deprecated) @inlinable func getVadjustment() -> AdjustmentRef! -
move(childWidget:Extension methodx: y: ) Moves a current child of
layoutto a new position.Declaration
Swift
@inlinable func move<WidgetT>(childWidget: WidgetT, x: Int, y: Int) where WidgetT : WidgetProtocol -
put(childWidget:Extension methodx: y: ) Adds
child_widgettolayout, at position (x,y).layoutbecomes the new parent container ofchild_widget.Declaration
Swift
@inlinable func put<WidgetT>(childWidget: WidgetT, x: Int, y: Int) where WidgetT : WidgetProtocol -
setHadjustment(adjustment:Extension method) Sets the horizontal scroll adjustment for the layout.
See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.set_hadjustment is deprecated: Use gtk_scrollable_set_hadjustment()
Declaration
Swift
@available(*, deprecated) @inlinable func setHadjustment(adjustment: AdjustmentRef? = nil) -
setHadjustment(adjustment:Extension method) Sets the horizontal scroll adjustment for the layout.
See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.set_hadjustment is deprecated: Use gtk_scrollable_set_hadjustment()
Declaration
Swift
@available(*, deprecated) @inlinable func setHadjustment<AdjustmentT>(adjustment: AdjustmentT?) where AdjustmentT : AdjustmentProtocol -
setSize(width:Extension methodheight: ) Sets the size of the scrollable area of the layout.
Declaration
Swift
@inlinable func setSize(width: Int, height: Int) -
setVadjustment(adjustment:Extension method) Sets the vertical scroll adjustment for the layout.
See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.set_vadjustment is deprecated: Use gtk_scrollable_set_vadjustment()
Declaration
Swift
@available(*, deprecated) @inlinable func setVadjustment(adjustment: AdjustmentRef? = nil) -
setVadjustment(adjustment:Extension method) Sets the vertical scroll adjustment for the layout.
See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.set_vadjustment is deprecated: Use gtk_scrollable_set_vadjustment()
Declaration
Swift
@available(*, deprecated) @inlinable func setVadjustment<AdjustmentT>(adjustment: AdjustmentT?) where AdjustmentT : AdjustmentProtocol -
binWindowExtension methodRetrieve the bin window of the layout used for drawing operations.
Declaration
Swift
@inlinable var binWindow: Gdk.WindowRef! { get } -
hadjustmentExtension methodThis function should only be called after the layout has been placed in a
GtkScrolledWindowor otherwise configured for scrolling. It returns theGtkAdjustmentused for communication between the horizontal scrollbar andlayout.See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.get_hadjustment is deprecated: Use gtk_scrollable_get_hadjustment()
Declaration
Swift
@inlinable var hadjustment: AdjustmentRef! { get nonmutating set } -
vadjustmentExtension methodThis function should only be called after the layout has been placed in a
GtkScrolledWindowor otherwise configured for scrolling. It returns theGtkAdjustmentused for communication between the vertical scrollbar andlayout.See
GtkScrolledWindow,GtkScrollbar,GtkAdjustmentfor details.get_vadjustment is deprecated: Use gtk_scrollable_get_vadjustment()
Declaration
Swift
@inlinable var vadjustment: AdjustmentRef! { get nonmutating set } -
containerExtension methodUndocumented
Declaration
Swift
@inlinable var container: GtkContainer { get }
View on GitHub
Install in Dash
LayoutProtocol Protocol Reference