FixedLayoutRef

public struct FixedLayoutRef : FixedLayoutProtocol, GWeakCapturing

GtkFixedLayout is a layout manager which can place child widgets at fixed positions.

Most applications should never use this layout manager; fixed positioning and sizing requires constant recalculations on where children need to be positioned and sized. Other layout managers perform this kind of work internally so that application developers don’t need to do it. Specifically, widgets positioned in a fixed layout manager will need to take into account:

  • Themes, which may change widget sizes.

  • Fonts other than the one you used to write the app will of course change the size of widgets containing text; keep in mind that users may use a larger font because of difficulty reading the default, or they may be using a different OS that provides different fonts.

  • Translation of text into other languages changes its size. Also, display of non-English text will use a different font in many cases.

In addition, GtkFixedLayout does not pay attention to text direction and thus may produce unwanted results if your app is run under right-to-left languages such as Hebrew or Arabic. That is: normally GTK will order containers appropriately depending on the text direction, e.g. to put labels to the right of the thing they label when using an RTL language; GtkFixedLayout won’t be able to do that for you.

Finally, fixed positioning makes it kind of annoying to add/remove UI elements, since you have to reposition all the other elements. This is a long-term maintenance problem for your application.

The FixedLayoutRef type acts as a lightweight Swift reference to an underlying GtkFixedLayout instance. It exposes methods that can operate on this data type through FixedLayoutProtocol conformance. Use FixedLayoutRef only as an unowned reference to an existing GtkFixedLayout instance.

  • ptr
    Untyped pointer to the underlying `GtkFixedLayout` instance.
    

    For type-safe access, use the generated, typed pointer fixed_layout_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

FixedLayout Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkFixedLayout>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkFixedLayout>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkFixedLayout>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkFixedLayout>?)
  • 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 FixedLayoutProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : FixedLayoutProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> FixedLayoutRef where T : FixedLayoutProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to FixedLayoutProtocol.

    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 FixedLayoutProtocol.

    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 FixedLayoutProtocol.

    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 FixedLayoutProtocol.

    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 FixedLayoutProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new GtkFixedLayout.

    Declaration

    Swift

    @inlinable
    init()