ComboBoxProtocol
public protocol ComboBoxProtocol : CellEditableProtocol, CellLayoutProtocol
A GtkComboBox
is a widget that allows the user to choose from a list of
valid choices.
The GtkComboBox
displays the selected choice; when activated, the
GtkComboBox
displays a popup which allows the user to make a new choice.
The GtkComboBox
uses the model-view pattern; the list of valid choices
is specified in the form of a tree model, and the display of the choices
can be adapted to the data in the model by using cell renderers, as you
would in a tree view. This is possible since GtkComboBox
implements the
[ifaceGtk.CellLayout
] interface. The tree model holding the valid
choices is not restricted to a flat list, it can be a real tree, and the
popup will reflect the tree structure.
To allow the user to enter values not in the model, the
[propertyGtk.ComboBox:has-entry
] property allows the GtkComboBox
to
contain a [classGtk.Entry
]. This entry can be accessed by calling
[methodGtk.ComboBox.get_child
] on the combo box.
For a simple list of textual choices, the model-view API of GtkComboBox
can be a bit overwhelming. In this case, [classGtk.ComboBoxText
] offers
a simple alternative. Both GtkComboBox
and GtkComboBoxText
can contain
an entry.
CSS nodes
combobox
├── box.linked
│ ╰── button.combo
│ ╰── box
│ ├── cellview
│ ╰── arrow
╰── window.popup
A normal combobox contains a box with the .linked class, a button with the .combo class and inside those buttons, there are a cellview and an arrow.
combobox
├── box.linked
│ ├── entry.combo
│ ╰── button.combo
│ ╰── box
│ ╰── arrow
╰── window.popup
A GtkComboBox
with an entry has a single CSS node with name combobox.
It contains a box with the .linked class. That box contains an entry and
a button, both with the .combo class added. The button also contains another
node with name arrow.
Accessibility
GtkComboBox
uses the GTK_ACCESSIBLE_ROLE_COMBO_BOX
role.
The ComboBoxProtocol
protocol exposes the methods and properties of an underlying GtkComboBox
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 ComboBox
.
Alternatively, use ComboBoxRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkComboBox
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
combo_box_ptr
Default implementationTyped pointer to the underlying
GtkComboBox
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkComboBox
instance.Declaration
Swift
var combo_box_ptr: UnsafeMutablePointer<GtkComboBox>! { get }
-
Required Initialiser for types conforming to
ComboBoxProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
ComboBoxPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: ComboBoxPropertyName, 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 : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a ComboBox property
Declaration
Swift
@inlinable func get(property: ComboBoxPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a ComboBox property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: ComboBoxPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
ComboBoxSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ComboBoxSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
ComboBoxSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ComboBoxSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onChanged(flags:
Extension methodhandler: ) Emitted when the active item is changed.
The can be due to the user selecting a different item from the list, or due to a call to [method
Gtk.ComboBox.set_active_iter
]. It will also be emitted while typing into the entry of a combo box with an entry.Note
This represents the underlyingchanged
signalDeclaration
Swift
@discardableResult @inlinable func onChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
changed
signal is emitted -
changedSignal
Extension methodTyped
changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var changedSignal: ComboBoxSignalName { get }
-
onFormatEntryText(flags:
Extension methodhandler: ) Emitted to allow changing how the text in a combo box’s entry is displayed.
See [property
Gtk.ComboBox:has-entry
].Connect a signal handler which returns an allocated string representing
path
. That string will then be used to set the text in the combo box’s entry. The default signal handler uses the text from the [propertyGtk.ComboBox:entry-text-column
] model column.Here’s an example signal handler which fetches data from the model and displays it in the entry.
static char * format_entry_text_callback (GtkComboBox *combo, const char *path, gpointer user_data) { GtkTreeIter iter; GtkTreeModel model; double value; model = gtk_combo_box_get_model (combo); gtk_tree_model_get_iter_from_string (model, &iter, path); gtk_tree_model_get (model, &iter, THE_DOUBLE_VALUE_COLUMN, &value, -1); return g_strdup_printf ("`g`", value); }
Note
This represents the underlyingformat-entry-text
signalDeclaration
Swift
@discardableResult @inlinable func onFormatEntryText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ path: String) -> String) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
path
the [struct
Gtk.TreePath
] string from the combo box’s current model to format text forhandler
a newly allocated string representing
path
for the currentGtkComboBox
model. Run the given callback whenever theformatEntryText
signal is emitted -
formatEntryTextSignal
Extension methodTyped
format-entry-text
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var formatEntryTextSignal: ComboBoxSignalName { get }
-
onMoveActive(flags:
Extension methodhandler: ) Emitted to move the active selection.
This is an keybinding signal.
Note
This represents the underlyingmove-active
signalDeclaration
Swift
@discardableResult @inlinable func onMoveActive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ scrollType: ScrollType) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
scrollType
a
GtkScrollType
handler
The signal handler to call Run the given callback whenever the
moveActive
signal is emitted -
moveActiveSignal
Extension methodTyped
move-active
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveActiveSignal: ComboBoxSignalName { get }
-
onPopdown(flags:
Extension methodhandler: ) Emitted to popdown the combo box list.
This is an keybinding signal.
The default bindings for this signal are Alt+Up and Escape.
Note
This represents the underlyingpopdown
signalDeclaration
Swift
@discardableResult @inlinable func onPopdown(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
popdown
signal is emitted -
popdownSignal
Extension methodTyped
popdown
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var popdownSignal: ComboBoxSignalName { get }
-
onPopup(flags:
Extension methodhandler: ) Emitted to popup the combo box list.
This is an keybinding signal.
The default binding for this signal is Alt+Down.
Note
This represents the underlyingpopup
signalDeclaration
Swift
@discardableResult @inlinable func onPopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
popup
signal is emitted -
popupSignal
Extension methodTyped
popup
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var popupSignal: ComboBoxSignalName { get }
-
onNotifyActive(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::active
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyActive(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyActive
signal is emitted -
notifyActiveSignal
Extension methodTyped
notify::active
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyActiveSignal: ComboBoxSignalName { get }
-
onNotifyActiveId(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::active-id
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyActiveId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyActiveId
signal is emitted -
notifyActiveIdSignal
Extension methodTyped
notify::active-id
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyActiveIdSignal: ComboBoxSignalName { get }
-
onNotifyButtonSensitivity(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::button-sensitivity
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyButtonSensitivity(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyButtonSensitivity
signal is emitted -
notifyButtonSensitivitySignal
Extension methodTyped
notify::button-sensitivity
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyButtonSensitivitySignal: ComboBoxSignalName { get }
-
onNotifyChild(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::child
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyChild(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyChild
signal is emitted -
notifyChildSignal
Extension methodTyped
notify::child
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyChildSignal: ComboBoxSignalName { get }
-
onNotifyEntryTextColumn(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::entry-text-column
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyEntryTextColumn(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyEntryTextColumn
signal is emitted -
notifyEntryTextColumnSignal
Extension methodTyped
notify::entry-text-column
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyEntryTextColumnSignal: ComboBoxSignalName { get }
-
onNotifyHasEntry(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-entry
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasEntry(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasEntry
signal is emitted -
notifyHasEntrySignal
Extension methodTyped
notify::has-entry
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasEntrySignal: ComboBoxSignalName { get }
-
onNotifyHasFrame(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-frame
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasFrame(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyHasFrame
signal is emitted -
notifyHasFrameSignal
Extension methodTyped
notify::has-frame
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasFrameSignal: ComboBoxSignalName { get }
-
onNotifyIdColumn(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::id-column
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyIdColumn(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyIdColumn
signal is emitted -
notifyIdColumnSignal
Extension methodTyped
notify::id-column
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyIdColumnSignal: ComboBoxSignalName { get }
-
onNotifyModel(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::model
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyModel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyModel
signal is emitted -
notifyModelSignal
Extension methodTyped
notify::model
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyModelSignal: ComboBoxSignalName { get }
-
onNotifyPopupFixedWidth(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::popup-fixed-width
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPopupFixedWidth(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPopupFixedWidth
signal is emitted -
notifyPopupFixedWidthSignal
Extension methodTyped
notify::popup-fixed-width
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPopupFixedWidthSignal: ComboBoxSignalName { get }
-
onNotifyPopupShown(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::popup-shown
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPopupShown(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ComboBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPopupShown
signal is emitted -
notifyPopupShownSignal
Extension methodTyped
notify::popup-shown
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPopupShownSignal: ComboBoxSignalName { get }
-
getActive()
Extension methodReturns the index of the currently active item.
If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns
gtk_tree_path_get_indices (path)[0]
, wherepath
is the [structGtk.TreePath
] of the active item.Declaration
Swift
@inlinable func getActive() -> Int
-
getActiveId()
Extension methodReturns the ID of the active row of
combo_box
.This value is taken from the active row and the column specified by the [property
Gtk.ComboBox:id-column
] property ofcombo_box
(see [methodGtk.ComboBox.set_id_column
]).The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it.
If the [property
Gtk.ComboBox:id-column
] property ofcombo_box
is not set, or if no row is active, or if the active row has anil
ID value, thennil
is returned.Declaration
Swift
@inlinable func getActiveId() -> String!
-
getActive(iter:
Extension method) Sets
iter
to point to the currently active item.If no item is active,
iter
is left unchanged.Declaration
Swift
@inlinable func getActive<TreeIterT>(iter: TreeIterT) -> Bool where TreeIterT : TreeIterProtocol
-
getButtonSensitivity()
Extension methodReturns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.
Declaration
Swift
@inlinable func getButtonSensitivity() -> GtkSensitivityType
-
getChild()
Extension methodGets the child widget of
combo_box
.Declaration
Swift
@inlinable func getChild() -> WidgetRef!
-
getEntryTextColumn()
Extension methodReturns the column which
combo_box
is using to get the strings from to display in the internal entry.Declaration
Swift
@inlinable func getEntryTextColumn() -> Int
-
getHasEntry()
Extension methodReturns whether the combo box has an entry.
Declaration
Swift
@inlinable func getHasEntry() -> Bool
-
getIdColumn()
Extension methodReturns the column which
combo_box
is using to get string IDs for values from.Declaration
Swift
@inlinable func getIdColumn() -> Int
-
getModel()
Extension methodReturns the
GtkTreeModel
ofcombo_box
.Declaration
Swift
@inlinable func getModel() -> TreeModelRef!
-
getPopupFixedWidth()
Extension methodGets whether the popup uses a fixed width.
Declaration
Swift
@inlinable func getPopupFixedWidth() -> Bool
-
getRowSeparatorFunc()
Extension methodReturns the current row separator function.
Declaration
Swift
@inlinable func getRowSeparatorFunc() -> GtkTreeViewRowSeparatorFunc!
-
popdown()
Extension methodHides the menu or dropdown list of
combo_box
.This function is mostly intended for use by accessibility technologies; applications should have little use for it.
Declaration
Swift
@inlinable func popdown()
-
popup()
Extension methodPops up the menu or dropdown list of
combo_box
.This function is mostly intended for use by accessibility technologies; applications should have little use for it.
Before calling this,
combo_box
must be mapped, or nothing will happen.Declaration
Swift
@inlinable func popup()
-
popupFor(device:
Extension method) Pops up the menu of
combo_box
.Note that currently this does not do anything with the device, as it was previously only used for list-mode combo boxes, and those were removed in GTK 4. However, it is retained in case similar functionality is added back later.
Declaration
Swift
@inlinable func popupFor<DeviceT>(device: DeviceT) where DeviceT : DeviceProtocol
-
setActive(index:
Extension method) Sets the active item of
combo_box
to be the item atindex
.Declaration
Swift
@inlinable func setActive(index: Int)
-
set(activeId:
Extension method) Changes the active row of
combo_box
to the one that has an ID equal toactive_id
.If
active_id
isnil
, the active row is unset. Rows having anil
ID string cannot be made active by this function.If the [property
Gtk.ComboBox:id-column
] property ofcombo_box
is unset or if no row has the given ID then the function does nothing and returnsfalse
.Declaration
Swift
@inlinable func set(activeId: UnsafePointer<CChar>? = nil) -> Bool
-
setActive(iter:
Extension method) Sets the current active item to be the one referenced by
iter
.If
iter
isnil
, the active item is unset.Declaration
Swift
@inlinable func setActive(iter: TreeIterRef? = nil)
-
setActive(iter:
Extension method) Sets the current active item to be the one referenced by
iter
.If
iter
isnil
, the active item is unset.Declaration
Swift
@inlinable func setActive<TreeIterT>(iter: TreeIterT?) where TreeIterT : TreeIterProtocol
-
setButton(sensitivity:
Extension method) Sets whether the dropdown button of the combo box should update its sensitivity depending on the model contents.
Declaration
Swift
@inlinable func setButton(sensitivity: GtkSensitivityType)
-
set(child:
Extension method) Sets the child widget of
combo_box
.Declaration
Swift
@inlinable func set(child: WidgetRef? = nil)
-
set(child:
Extension method) Sets the child widget of
combo_box
.Declaration
Swift
@inlinable func set<WidgetT>(child: WidgetT?) where WidgetT : WidgetProtocol
-
setEntry(textColumn:
Extension method) Sets the model column which
combo_box
should use to get strings from to betext_column
.For this column no separate [class
Gtk.CellRenderer
] is needed.The column
text_column
in the model ofcombo_box
must be of typeG_TYPE_STRING
.This is only relevant if
combo_box
has been created with [propertyGtk.ComboBox:has-entry
] astrue
.Declaration
Swift
@inlinable func setEntry(textColumn: Int)
-
set(idColumn:
Extension method) Sets the model column which
combo_box
should use to get string IDs for values from.The column
id_column
in the model ofcombo_box
must be of typeG_TYPE_STRING
.Declaration
Swift
@inlinable func set(idColumn: Int)
-
set(model:
Extension method) Sets the model used by
combo_box
to bemodel
.Will unset a previously set model (if applicable). If model is
nil
, then it will unset the model.Note that this function does not clear the cell renderers, you have to call [method
Gtk.CellLayout.clear
] yourself if you need to set up different cell renderers for the new model.Declaration
Swift
@inlinable func set(model: TreeModelRef? = nil)
-
set(model:
Extension method) Sets the model used by
combo_box
to bemodel
.Will unset a previously set model (if applicable). If model is
nil
, then it will unset the model.Note that this function does not clear the cell renderers, you have to call [method
Gtk.CellLayout.clear
] yourself if you need to set up different cell renderers for the new model.Declaration
Swift
@inlinable func set<TreeModelT>(model: TreeModelT?) where TreeModelT : TreeModelProtocol
-
setPopupFixedWidth(fixed:
Extension method) Specifies whether the popup’s width should be a fixed width.
If
fixed
istrue
, the popup’s width is set to match the allocated width of the combo box.Declaration
Swift
@inlinable func setPopupFixedWidth(fixed: Bool)
-
setRowSeparatorFunc(func:
Extension methoddata: destroy: ) Sets the row separator function, which is used to determine whether a row should be drawn as a separator.
If the row separator function is
nil
, no separators are drawn. This is the default value.Declaration
Swift
@inlinable func setRowSeparatorFunc(func: GtkTreeViewRowSeparatorFunc? = nil, data: gpointer! = nil, destroy: GDestroyNotify? = nil)
-
active
Extension methodThe item which is currently active.
If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this property has the value
gtk_tree_path_get_indices (path)[0]
, wherepath
is the [structGtk.TreePath
] of the active item.Declaration
Swift
@inlinable var active: Int { get nonmutating set }
-
activeId
Extension methodReturns the ID of the active row of
combo_box
.This value is taken from the active row and the column specified by the [property
Gtk.ComboBox:id-column
] property ofcombo_box
(see [methodGtk.ComboBox.set_id_column
]).The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it.
If the [property
Gtk.ComboBox:id-column
] property ofcombo_box
is not set, or if no row is active, or if the active row has anil
ID value, thennil
is returned.Declaration
Swift
@inlinable var activeId: String! { get nonmutating set }
-
buttonSensitivity
Extension methodReturns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.
Declaration
Swift
@inlinable var buttonSensitivity: GtkSensitivityType { get nonmutating set }
-
child
Extension methodThe child widget.
Declaration
Swift
@inlinable var child: WidgetRef! { get nonmutating set }
-
entryTextColumn
Extension methodReturns the column which
combo_box
is using to get the strings from to display in the internal entry.Declaration
Swift
@inlinable var entryTextColumn: Int { get nonmutating set }
-
hasEntry
Extension methodReturns whether the combo box has an entry.
Declaration
Swift
@inlinable var hasEntry: Bool { get }
-
idColumn
Extension methodReturns the column which
combo_box
is using to get string IDs for values from.Declaration
Swift
@inlinable var idColumn: Int { get nonmutating set }
-
model
Extension methodThe model from which the combo box takes its values.
Declaration
Swift
@inlinable var model: TreeModelRef! { get nonmutating set }
-
popupFixedWidth
Extension methodGets whether the popup uses a fixed width.
Declaration
Swift
@inlinable var popupFixedWidth: Bool { get nonmutating set }
-
rowSeparatorFunc
Extension methodReturns the current row separator function.
Declaration
Swift
@inlinable var rowSeparatorFunc: GtkTreeViewRowSeparatorFunc! { get }
-
parentInstance
Extension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GtkWidget { get }