DropDownRef
public struct DropDownRef : DropDownProtocol, GWeakCapturing
GtkDropDown
is a widget that allows the user to choose an item
from a list of options.
The GtkDropDown
displays the selected choice.
The options are given to GtkDropDown
in the form of GListModel
and how the individual options are represented is determined by
a [classGtk.ListItemFactory
]. The default factory displays simple strings.
GtkDropDown
knows how to obtain strings from the items in a
[classGtk.StringList
]; for other models, you have to provide an expression
to find the strings via [methodGtk.DropDown.set_expression
].
GtkDropDown
can optionally allow search in the popup, which is
useful if the list of options is long. To enable the search entry,
use [methodGtk.DropDown.set_enable_search
].
CSS nodes
GtkDropDown
has a single CSS node with name dropdown,
with the button and popover nodes as children.
Accessibility
GtkDropDown
uses the GTK_ACCESSIBLE_ROLE_COMBO_BOX
role.
The DropDownRef
type acts as a lightweight Swift reference to an underlying GtkDropDown
instance.
It exposes methods that can operate on this data type through DropDownProtocol
conformance.
Use DropDownRef
only as an unowned
reference to an existing GtkDropDown
instance.
-
Untyped pointer to the underlying `GtkDropDown` instance.
For type-safe access, use the generated, typed pointer
drop_down_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkDropDown>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkDropDown>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkDropDown>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkDropDown>?)
-
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
DropDownProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : DropDownProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> DropDownRef where T : DropDownProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DropDownProtocol
.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
DropDownProtocol
.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
DropDownProtocol
.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
DropDownProtocol
.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
DropDownProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Creates a new `GtkDropDown`.
You may want to call [method
Gtk.DropDown.set_factory
] to set up a way to map its items to widgets.Declaration
Swift
@inlinable init<ExpressionT, ListModelT>(model: ListModelT?, expression: ExpressionT?) where ExpressionT : ExpressionProtocol, ListModelT : ListModelProtocol
-
Creates a new
GtkDropDown
that is populated with the strings.Declaration
Swift
@inlinable init(strings: UnsafePointer<UnsafePointer<CChar>?>!)
-
Creates a new
GtkDropDown
that is populated with the strings.Declaration
Swift
@inlinable static func newFrom(strings: UnsafePointer<UnsafePointer<CChar>?>!) -> WidgetRef!