LayoutRef
public struct LayoutRef : LayoutProtocol, GWeakCapturing
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 LayoutRef
type acts as a lightweight Swift reference to an underlying GtkLayout
instance.
It exposes methods that can operate on this data type through LayoutProtocol
conformance.
Use LayoutRef
only as an unowned
reference to an existing GtkLayout
instance.
-
Untyped pointer to the underlying `GtkLayout` instance.
For type-safe access, use the generated, typed pointer
layout_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkLayout>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkLayout>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkLayout>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkLayout>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
LayoutProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : LayoutProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> LayoutRef where T : LayoutProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
LayoutProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
LayoutProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
LayoutProtocol
.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
LayoutProtocol
.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
LayoutProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new `GtkLayout`. Unless you have a specific adjustment
you’d like the layout to use for scrolling, pass
nil
forhadjustment
andvadjustment
.Declaration
Swift
@inlinable init<AdjustmentT>(hadjustment: AdjustmentT?, vadjustment: AdjustmentT?) where AdjustmentT : AdjustmentProtocol