FlowBoxProtocol
public protocol FlowBoxProtocol : OrientableProtocol, WidgetProtocol
A GtkFlowBox
puts child widgets in reflowing grid.
For instance, with the horizontal orientation, the widgets will be arranged from left to right, starting a new row under the previous row when necessary. Reducing the width in this case will require more rows, so a larger height will be requested.
Likewise, with the vertical orientation, the widgets will be arranged from top to bottom, starting a new column to the right when necessary. Reducing the height will require more columns, so a larger width will be requested.
The size request of a GtkFlowBox
alone may not be what you expect;
if you need to be able to shrink it along both axes and dynamically
reflow its children, you may have to wrap it in a GtkScrolledWindow
to enable that.
The children of a GtkFlowBox
can be dynamically sorted and filtered.
Although a GtkFlowBox
must have only GtkFlowBoxChild
children, you
can add any kind of widget to it via [methodGtk.FlowBox.insert
], and a
GtkFlowBoxChild
widget will automatically be inserted between the box
and the widget.
Also see [classGtk.ListBox
].
CSS nodes
flowbox
├── flowboxchild
│ ╰── <child>
├── flowboxchild
│ ╰── <child>
┊
╰── [rubberband]
GtkFlowBox
uses a single CSS node with name flowbox. GtkFlowBoxChild
uses a single CSS node with name flowboxchild. For rubberband selection,
a subnode with name rubberband is used.
Accessibility
GtkFlowBox
uses the GTK_ACCESSIBLE_ROLE_GRID
role, and GtkFlowBoxChild
uses the GTK_ACCESSIBLE_ROLE_GRID_CELL
role.
The FlowBoxProtocol
protocol exposes the methods and properties of an underlying GtkFlowBox
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 FlowBox
.
Alternatively, use FlowBoxRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkFlowBox
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
flow_box_ptr
Default implementationTyped pointer to the underlying
GtkFlowBox
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkFlowBox
instance.Declaration
Swift
var flow_box_ptr: UnsafeMutablePointer<GtkFlowBox>! { get }
-
Required Initialiser for types conforming to
FlowBoxProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
FlowBoxPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: FlowBoxPropertyName, 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 FlowBox property
Declaration
Swift
@inlinable func get(property: FlowBoxPropertyName) -> 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 FlowBox property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: FlowBoxPropertyName, 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
FlowBoxSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: FlowBoxSignalName, 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
FlowBoxSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: FlowBoxSignalName, 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)
-
onActivateCursorChild(flags:
Extension methodhandler: ) Emitted when the user activates the
box
.This is a keybinding signal.
Note
This represents the underlyingactivate-cursor-child
signalDeclaration
Swift
@discardableResult @inlinable func onActivateCursorChild(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
activateCursorChild
signal is emitted -
activateCursorChildSignal
Extension methodTyped
activate-cursor-child
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var activateCursorChildSignal: FlowBoxSignalName { get }
-
onChildActivated(flags:
Extension methodhandler: ) Emitted when a child has been activated by the user.
Note
This represents the underlyingchild-activated
signalDeclaration
Swift
@discardableResult @inlinable func onChildActivated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ child: FlowBoxChildRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
child
the child that is activated
handler
The signal handler to call Run the given callback whenever the
childActivated
signal is emitted -
childActivatedSignal
Extension methodTyped
child-activated
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var childActivatedSignal: FlowBoxSignalName { get }
-
onMoveCursor(flags:
Extension methodhandler: ) Emitted when the user initiates a cursor movement.
This is a keybinding signal. Applications should not connect to it, but may emit it with
g_signal_emit_by_name()
if they need to control the cursor programmatically.The default bindings for this signal come in two variants, the variant with the Shift modifier extends the selection, the variant without the Shift modifier does not. There are too many key combinations to list them all here.
- <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move by individual children
- <kbd>Home</kbd>, <kbd>End</kbd> move to the ends of the box
- <kbd>PgUp</kbd>, <kbd>PgDn</kbd> move vertically by pages
Note
This represents the underlyingmove-cursor
signalDeclaration
Swift
@discardableResult @inlinable func onMoveCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ step: MovementStep, _ count: Int, _ extend: Bool, _ modify: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
step
the granularity fo the move, as a
GtkMovementStep
count
the number of
step
units to moveextend
whether to extend the selection
modify
whether to modify the selection
handler
true
to stop other handlers from being invoked for the event.false
to propagate the event further. Run the given callback whenever themoveCursor
signal is emitted -
moveCursorSignal
Extension methodTyped
move-cursor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveCursorSignal: FlowBoxSignalName { get }
-
onSelectAll(flags:
Extension methodhandler: ) Emitted to select all children of the box, if the selection mode permits it.
This is a keybinding signal.
The default bindings for this signal is <kbd>Ctrl</kbd>-<kbd>a</kbd>.
Note
This represents the underlyingselect-all
signalDeclaration
Swift
@discardableResult @inlinable func onSelectAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
selectAll
signal is emitted -
selectAllSignal
Extension methodTyped
select-all
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectAllSignal: FlowBoxSignalName { get }
-
onSelectedChildrenChanged(flags:
Extension methodhandler: ) Emitted when the set of selected children changes.
Use [method
Gtk.FlowBox.selected_foreach
] or [methodGtk.FlowBox.get_selected_children
] to obtain the selected children.Note
This represents the underlyingselected-children-changed
signalDeclaration
Swift
@discardableResult @inlinable func onSelectedChildrenChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
selectedChildrenChanged
signal is emitted -
selectedChildrenChangedSignal
Extension methodTyped
selected-children-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectedChildrenChangedSignal: FlowBoxSignalName { get }
-
onToggleCursorChild(flags:
Extension methodhandler: ) Emitted to toggle the selection of the child that has the focus.
This is a keybinding signal.
The default binding for this signal is <kbd>Ctrl</kbd>-<kbd>Space</kbd>.
Note
This represents the underlyingtoggle-cursor-child
signalDeclaration
Swift
@discardableResult @inlinable func onToggleCursorChild(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
toggleCursorChild
signal is emitted -
toggleCursorChildSignal
Extension methodTyped
toggle-cursor-child
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var toggleCursorChildSignal: FlowBoxSignalName { get }
-
onUnselectAll(flags:
Extension methodhandler: ) Emitted to unselect all children of the box, if the selection mode permits it.
This is a keybinding signal.
The default bindings for this signal is <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>a</kbd>.
Note
This represents the underlyingunselect-all
signalDeclaration
Swift
@discardableResult @inlinable func onUnselectAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
unselectAll
signal is emitted -
unselectAllSignal
Extension methodTyped
unselect-all
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var unselectAllSignal: FlowBoxSignalName { get }
-
onNotifyAcceptUnpairedRelease(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::accept-unpaired-release
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyAcceptUnpairedRelease(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyAcceptUnpairedRelease
signal is emitted -
notifyAcceptUnpairedReleaseSignal
Extension methodTyped
notify::accept-unpaired-release
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyAcceptUnpairedReleaseSignal: FlowBoxSignalName { get }
-
onNotifyActivateOnSingleClick(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::activate-on-single-click
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyActivateOnSingleClick(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyActivateOnSingleClick
signal is emitted -
notifyActivateOnSingleClickSignal
Extension methodTyped
notify::activate-on-single-click
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyActivateOnSingleClickSignal: FlowBoxSignalName { get }
-
onNotifyColumnSpacing(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::column-spacing
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyColumnSpacing(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyColumnSpacing
signal is emitted -
notifyColumnSpacingSignal
Extension methodTyped
notify::column-spacing
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyColumnSpacingSignal: FlowBoxSignalName { get }
-
onNotifyHomogeneous(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::homogeneous
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyHomogeneous(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyHomogeneous
signal is emitted -
notifyHomogeneousSignal
Extension methodTyped
notify::homogeneous
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHomogeneousSignal: FlowBoxSignalName { get }
-
onNotifyMaxChildrenPerLine(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::max-children-per-line
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMaxChildrenPerLine(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyMaxChildrenPerLine
signal is emitted -
notifyMaxChildrenPerLineSignal
Extension methodTyped
notify::max-children-per-line
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMaxChildrenPerLineSignal: FlowBoxSignalName { get }
-
onNotifyMinChildrenPerLine(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::min-children-per-line
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyMinChildrenPerLine(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyMinChildrenPerLine
signal is emitted -
notifyMinChildrenPerLineSignal
Extension methodTyped
notify::min-children-per-line
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMinChildrenPerLineSignal: FlowBoxSignalName { get }
-
onNotifyRowSpacing(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::row-spacing
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyRowSpacing(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifyRowSpacing
signal is emitted -
notifyRowSpacingSignal
Extension methodTyped
notify::row-spacing
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyRowSpacingSignal: FlowBoxSignalName { get }
-
onNotifySelectionMode(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::selection-mode
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySelectionMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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
notifySelectionMode
signal is emitted -
notifySelectionModeSignal
Extension methodTyped
notify::selection-mode
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySelectionModeSignal: FlowBoxSignalName { get }
-
bind(model:
Extension methodcreateWidgetFunc: userData: userDataFreeFunc: ) Binds
model
tobox
.If
box
was already bound to a model, that previous binding is destroyed.The contents of
box
are cleared and then filled with widgets that represent items frommodel
.box
is updated whenevermodel
changes. Ifmodel
isnil
,box
is left empty.It is undefined to add or remove widgets directly (for example, with [method
Gtk.FlowBox.insert
]) whilebox
is bound to a model.Note that using a model is incompatible with the filtering and sorting functionality in
GtkFlowBox
. When using a model, filtering and sorting should be implemented by the model.Declaration
Swift
@inlinable func bind(model: GIO.ListModelRef? = nil, createWidgetFunc: GtkFlowBoxCreateWidgetFunc?, userData: gpointer! = nil, userDataFreeFunc: GDestroyNotify?)
-
bind(model:
Extension methodcreateWidgetFunc: userData: userDataFreeFunc: ) Binds
model
tobox
.If
box
was already bound to a model, that previous binding is destroyed.The contents of
box
are cleared and then filled with widgets that represent items frommodel
.box
is updated whenevermodel
changes. Ifmodel
isnil
,box
is left empty.It is undefined to add or remove widgets directly (for example, with [method
Gtk.FlowBox.insert
]) whilebox
is bound to a model.Note that using a model is incompatible with the filtering and sorting functionality in
GtkFlowBox
. When using a model, filtering and sorting should be implemented by the model.Declaration
Swift
@inlinable func bind<ListModelT>(model: ListModelT?, createWidgetFunc: GtkFlowBoxCreateWidgetFunc?, userData: gpointer! = nil, userDataFreeFunc: GDestroyNotify?) where ListModelT : ListModelProtocol
-
getActivateOnSingleClick()
Extension methodReturns whether children activate on single clicks.
Declaration
Swift
@inlinable func getActivateOnSingleClick() -> Bool
-
getChildAtIndex(idx:
Extension method) Gets the nth child in the
box
.Declaration
Swift
@inlinable func getChildAtIndex(idx: Int) -> FlowBoxChildRef!
-
getChildAtPos(x:
Extension methody: ) Gets the child in the (
x
,y
) position.Both
x
andy
are assumed to be relative to the origin ofbox
.Declaration
Swift
@inlinable func getChildAtPos(x: Int, y: Int) -> FlowBoxChildRef!
-
getColumnSpacing()
Extension methodGets the horizontal spacing.
Declaration
Swift
@inlinable func getColumnSpacing() -> Int
-
getHomogeneous()
Extension methodReturns whether the box is homogeneous.
Declaration
Swift
@inlinable func getHomogeneous() -> Bool
-
getMaxChildrenPerLine()
Extension methodGets the maximum number of children per line.
Declaration
Swift
@inlinable func getMaxChildrenPerLine() -> Int
-
getMinChildrenPerLine()
Extension methodGets the minimum number of children per line.
Declaration
Swift
@inlinable func getMinChildrenPerLine() -> Int
-
getRowSpacing()
Extension methodGets the vertical spacing.
Declaration
Swift
@inlinable func getRowSpacing() -> Int
-
getSelectedChildren()
Extension methodCreates a list of all selected children.
Declaration
Swift
@inlinable func getSelectedChildren() -> GLib.ListRef!
-
getSelectionMode()
Extension methodGets the selection mode of
box
.Declaration
Swift
@inlinable func getSelectionMode() -> GtkSelectionMode
-
insert(widget:
Extension methodposition: ) Inserts the
widget
intobox
atposition
.If a sort function is set, the widget will actually be inserted at the calculated position.
If
position
is -1, or larger than the total number of children in thebox
, then thewidget
will be appended to the end.Declaration
Swift
@inlinable func insert<WidgetT>(widget: WidgetT, position: Int) where WidgetT : WidgetProtocol
-
invalidateFilter()
Extension methodUpdates the filtering for all children.
Call this function when the result of the filter function on the
box
is changed due ot an external factor. For instance, this would be used if the filter function just looked for a specific search term, and the entry with the string has changed.Declaration
Swift
@inlinable func invalidateFilter()
-
invalidateSort()
Extension methodUpdates the sorting for all children.
Call this when the result of the sort function on
box
is changed due to an external factor.Declaration
Swift
@inlinable func invalidateSort()
-
remove(widget:
Extension method) Removes a child from
box
.Declaration
Swift
@inlinable func remove<WidgetT>(widget: WidgetT) where WidgetT : WidgetProtocol
-
selectAll()
Extension methodSelect all children of
box
, if the selection mode allows it.Declaration
Swift
@inlinable func selectAll()
-
select(child:
Extension method) Selects a single child of
box
, if the selection mode allows it.Declaration
Swift
@inlinable func select<FlowBoxChildT>(child: FlowBoxChildT) where FlowBoxChildT : FlowBoxChildProtocol
-
selectedForeach(func:
Extension methoddata: ) Calls a function for each selected child.
Note that the selection cannot be modified from within this function.
Declaration
Swift
@inlinable func selectedForeach(func: GtkFlowBoxForeachFunc?, data: gpointer! = nil)
-
setActivateOnSingleClick(single:
Extension method) If
single
istrue
, children will be activated when you click on them, otherwise you need to double-click.Declaration
Swift
@inlinable func setActivateOnSingleClick(single: Bool)
-
setColumn(spacing:
Extension method) Sets the horizontal space to add between children.
Declaration
Swift
@inlinable func setColumn(spacing: Int)
-
set(filterFunc:
Extension methoduserData: destroy: ) By setting a filter function on the
box
one can decide dynamically which of the children to show.For instance, to implement a search function that only shows the children matching the search terms.
The
filter_func
will be called for each child after the call, and it will continue to be called each time a child changes (via [methodGtk.FlowBoxChild.changed
]) or when [methodGtk.FlowBox.invalidate_filter
] is called.Note that using a filter function is incompatible with using a model (see [method
Gtk.FlowBox.bind_model
]).Declaration
Swift
@inlinable func set(filterFunc: GtkFlowBoxFilterFunc? = nil, userData: gpointer! = nil, destroy: GDestroyNotify?)
-
setHadjustment(adjustment:
Extension method) Hooks up an adjustment to focus handling in
box
.The adjustment is also used for autoscrolling during rubberband selection. See [method
Gtk.ScrolledWindow.get_hadjustment
] for a typical way of obtaining the adjustment, and [methodGtk.FlowBox.set_vadjustment
] for setting the vertical adjustment.The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the box.
Declaration
Swift
@inlinable func setHadjustment<AdjustmentT>(adjustment: AdjustmentT) where AdjustmentT : AdjustmentProtocol
-
set(homogeneous:
Extension method) Sets whether or not all children of
box
are given equal space in the box.Declaration
Swift
@inlinable func set(homogeneous: Bool)
-
setMaxChildrenPerLine(nChildren:
Extension method) Sets the maximum number of children to request and allocate space for in
box
’s orientation.Setting the maximum number of children per line limits the overall natural size request to be no more than
n_children
children long in the given orientation.Declaration
Swift
@inlinable func setMaxChildrenPerLine(nChildren: Int)
-
setMinChildrenPerLine(nChildren:
Extension method) Sets the minimum number of children to line up in
box
’s orientation before flowing.Declaration
Swift
@inlinable func setMinChildrenPerLine(nChildren: Int)
-
setRow(spacing:
Extension method) Sets the vertical space to add between children.
Declaration
Swift
@inlinable func setRow(spacing: Int)
-
setSelection(mode:
Extension method) Sets how selection works in
box
.Declaration
Swift
@inlinable func setSelection(mode: GtkSelectionMode)
-
set(sortFunc:
Extension methoduserData: destroy: ) By setting a sort function on the
box
, one can dynamically reorder the children of the box, based on the contents of the children.The
sort_func
will be called for each child after the call, and will continue to be called each time a child changes (via [methodGtk.FlowBoxChild.changed
]) and when [methodGtk.FlowBox.invalidate_sort
] is called.Note that using a sort function is incompatible with using a model (see [method
Gtk.FlowBox.bind_model
]).Declaration
Swift
@inlinable func set(sortFunc: GtkFlowBoxSortFunc? = nil, userData: gpointer! = nil, destroy: GDestroyNotify?)
-
setVadjustment(adjustment:
Extension method) Hooks up an adjustment to focus handling in
box
.The adjustment is also used for autoscrolling during rubberband selection. See [method
Gtk.ScrolledWindow.get_vadjustment
] for a typical way of obtaining the adjustment, and [methodGtk.FlowBox.set_hadjustment
] for setting the horizontal adjustment.The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the box.
Declaration
Swift
@inlinable func setVadjustment<AdjustmentT>(adjustment: AdjustmentT) where AdjustmentT : AdjustmentProtocol
-
unselectAll()
Extension methodUnselect all children of
box
, if the selection mode allows it.Declaration
Swift
@inlinable func unselectAll()
-
unselect(child:
Extension method) Unselects a single child of
box
, if the selection mode allows it.Declaration
Swift
@inlinable func unselect<FlowBoxChildT>(child: FlowBoxChildT) where FlowBoxChildT : FlowBoxChildProtocol
-
activateOnSingleClick
Extension methodReturns whether children activate on single clicks.
Declaration
Swift
@inlinable var activateOnSingleClick: Bool { get nonmutating set }
-
columnSpacing
Extension methodGets the horizontal spacing.
Declaration
Swift
@inlinable var columnSpacing: Int { get nonmutating set }
-
homogeneous
Extension methodDetermines whether all children should be allocated the same size.
Declaration
Swift
@inlinable var homogeneous: Bool { get nonmutating set }
-
maxChildrenPerLine
Extension methodGets the maximum number of children per line.
Declaration
Swift
@inlinable var maxChildrenPerLine: Int { get nonmutating set }
-
minChildrenPerLine
Extension methodGets the minimum number of children per line.
Declaration
Swift
@inlinable var minChildrenPerLine: Int { get nonmutating set }
-
rowSpacing
Extension methodGets the vertical spacing.
Declaration
Swift
@inlinable var rowSpacing: Int { get nonmutating set }
-
selectedChildren
Extension methodCreates a list of all selected children.
Declaration
Swift
@inlinable var selectedChildren: GLib.ListRef! { get }
-
selectionMode
Extension methodGets the selection mode of
box
.Declaration
Swift
@inlinable var selectionMode: GtkSelectionMode { get nonmutating set }