StringListRef

public struct StringListRef : StringListProtocol, GWeakCapturing

GtkStringList is a list model that wraps an array of strings.

The objects in the model have a “string” property.

GtkStringList is well-suited for any place where you would typically use a char*[], but need a list model.

GtkStringList as GtkBuildable

The GtkStringList implementation of the GtkBuildable interface supports adding items directly using the <items> element and specifying <item> elements for each item. Each <item> element supports the regular translation attributes “translatable”, “context” and “comments”.

Here is a UI definition fragment specifying a GtkStringList

&lt;object class="GtkStringList"&gt;
  &lt;items&gt;
    &lt;item translatable="yes"&gt;Factory&lt;/item&gt;
    &lt;item translatable="yes"&gt;Home&lt;/item&gt;
    &lt;item translatable="yes"&gt;Subway&lt;/item&gt;
  &lt;/items&gt;
&lt;/object&gt;

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

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

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

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

StringList Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

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

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

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

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

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new GtkStringList with the given strings.

    Declaration

    Swift

    @inlinable
    init(strings: UnsafePointer<UnsafePointer<CChar>?>! = nil)