1424 lines
96 KiB
Swift
1424 lines
96 KiB
Swift
// Generated by PorticoGen. DO NOT EDIT. See Sources/PorticoGen to make changes.
|
||
|
||
import Adw
|
||
import Gtk
|
||
import Gio
|
||
import Gdk
|
||
|
||
// PorticoGen: generateStruct | source: Gtk.TreeView
|
||
/// A widget for displaying both trees and lists
|
||
///
|
||
/// <picture>
|
||
/// <source srcset="list-and-tree-dark.png" media="(prefers-color-scheme: dark)">
|
||
/// <img alt="An example GtkTreeView" src="list-and-tree.png">
|
||
/// </picture>
|
||
///
|
||
/// Widget that displays any object that implements the [iface`Gtk`.TreeModel] interface.
|
||
///
|
||
/// Please refer to the [tree widget conceptual overview](section-tree-widget.html)
|
||
/// for an overview of all the objects and data types related to the tree
|
||
/// widget and how they work together.
|
||
///
|
||
/// ## Coordinate systems in GtkTreeView API
|
||
///
|
||
/// Several different coordinate systems are exposed in the `GtkTreeView` API.
|
||
/// These are:
|
||
///
|
||
/// 
|
||
///
|
||
/// - Widget coordinates: Coordinates relative to the widget (usually `widget->window`).
|
||
///
|
||
/// - Bin window coordinates: Coordinates relative to the window that GtkTreeView renders to.
|
||
///
|
||
/// - Tree coordinates: Coordinates relative to the entire scrollable area of GtkTreeView. These
|
||
/// coordinates start at (0, 0) for row 0 of the tree.
|
||
///
|
||
/// Several functions are available for converting between the different
|
||
/// coordinate systems. The most common translations are between widget and bin
|
||
/// window coordinates and between bin window and tree coordinates. For the
|
||
/// former you can use [method`Gtk`.TreeView.convert_widget_to_bin_window_coords]
|
||
/// (and vice versa), for the latter [method`Gtk`.TreeView.convert_bin_window_to_tree_coords]
|
||
/// (and vice versa).
|
||
///
|
||
/// ## `GtkTreeView` as `GtkBuildable`
|
||
///
|
||
/// The `GtkTreeView` implementation of the `GtkBuildable` interface accepts
|
||
/// [class`Gtk`.TreeViewColumn] objects as `<child>` elements and exposes the
|
||
/// internal [class`Gtk`.TreeSelection] in UI definitions.
|
||
///
|
||
/// An example of a UI definition fragment with `GtkTreeView`:
|
||
///
|
||
/// ```xml
|
||
/// <object class="GtkTreeView" id="treeview">
|
||
/// <property name="model">liststore1</property>
|
||
/// <child>
|
||
/// <object class="GtkTreeViewColumn" id="test-column">
|
||
/// <property name="title">Test</property>
|
||
/// <child>
|
||
/// <object class="GtkCellRendererText" id="test-renderer"/>
|
||
/// <attributes>
|
||
/// <attribute name="text">1</attribute>
|
||
/// </attributes>
|
||
/// </child>
|
||
/// </object>
|
||
/// </child>
|
||
/// <child internal-child="selection">
|
||
/// <object class="GtkTreeSelection" id="selection">
|
||
/// <signal name="changed" handler="on_treeview_selection_changed"/>
|
||
/// </object>
|
||
/// </child>
|
||
/// </object>
|
||
/// ```
|
||
///
|
||
/// ## CSS nodes
|
||
///
|
||
/// ```
|
||
/// treeview.view
|
||
/// ├── header
|
||
/// │ ├── button
|
||
/// │ │ ╰── [sort-indicator]
|
||
/// ┊ ┊
|
||
/// │ ╰── button
|
||
/// │ ╰── [sort-indicator]
|
||
/// │
|
||
/// ├── [rubberband]
|
||
/// ╰── [dndtarget]
|
||
/// ```
|
||
///
|
||
/// `GtkTreeView` has a main CSS node with name `treeview` and style class `.view`.
|
||
/// It has a subnode with name `header`, which is the parent for all the column
|
||
/// header widgets' CSS nodes.
|
||
///
|
||
/// Each column header consists of a `button`, which among other content, has a
|
||
/// child with name `sort-indicator`, which carries the `.ascending` or `.descending`
|
||
/// style classes when the column header should show a sort indicator. The CSS
|
||
/// is expected to provide a suitable image using the `-gtk-icon-source` property.
|
||
///
|
||
/// For rubberband selection, a subnode with name `rubberband` is used.
|
||
///
|
||
/// For the drop target location during DND, a subnode with name `dndtarget` is used.
|
||
///
|
||
/// A Portico view that mounts a `Gtk.TreeView`.
|
||
@MainActor public struct TreeView: View {
|
||
private let make: (MountContext) -> Gtk.TreeView
|
||
private var configure: [(Gtk.TreeView, MountContext) -> Void] = []
|
||
|
||
public var body: Never { fatalError() }
|
||
|
||
// PorticoGen: generateInits(static) | source: Gtk.TreeView.init()
|
||
/// Creates a new `GtkTreeView` widget.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for values that change.
|
||
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
|
||
///
|
||
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.
|
||
/// - Parameter enableSearch: If `enable_search` is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
|
||
/// - Parameter enableTreeLines: Sets whether to draw lines interconnecting the expanders in `tree_view`. This does not have any visible effects for lists.
|
||
/// - Parameter expanderColumn: Sets the column to draw the expander arrow at. It must be in `tree_view`. If `column` is `nil`, then the expander arrow is always at the first visible column.
|
||
/// - Parameter fixedHeightMode: Setting the ::fixed-height-mode property to `true` speeds up `GtkTreeView` by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
|
||
/// - Parameter headersClickable: Allow the column title buttons to be clicked.
|
||
/// - Parameter headersVisible: Sets the visibility state of the headers.
|
||
/// - Parameter hoverExpand: Enables or disables the hover expansion mode of `tree_view`. Hover expansion makes rows expand or collapse if the pointer moves over them.
|
||
/// - Parameter hoverSelection: Enables or disables the hover selection mode of `tree_view`. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
/// - Parameter levelIndentation: Extra indentation for each level.
|
||
/// - Parameter reorderable: This function is a convenience function to allow you to reorder models that support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model’s `GtkTreeModel::row-inserted` and `GtkTreeModel::row-deleted` signals. The reordering is implemented by setting up the tree view as a drag source and destination. Therefore, drag and drop can not be used in a reorderable view for any other purpose.
|
||
/// - Parameter rubberBanding: Enables or disables rubber banding in `tree_view`. If the selection mode is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select multiple rows by dragging the mouse.
|
||
/// - Parameter searchColumn: Sets `column` as the column where the interactive search code should search in for the current model.
|
||
/// - Parameter showExpanders: `true` if the view has expanders.
|
||
/// - Parameter tooltipColumn: If you only plan to have simple (text-only) tooltips on full rows, you can use this function to have `GtkTreeView` handle these automatically for you. `column` should be set to the column in `tree_view`’s model containing the tooltip texts, or -1 to disable this feature.
|
||
/// - Parameter onColumnsChanged: Invoked when the widget emits the `columns-changed` signal.
|
||
/// - Parameter onCursorChanged: Invoked when the widget emits the `cursor-changed` signal.
|
||
/// - Parameter onExpandCollapseCursorRow: Invoked when the widget emits the `expand-collapse-cursor-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onMoveCursor: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onRowActivated: Invoked when the widget emits the `row-activated` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onRowCollapsed: Invoked when the widget emits the `row-collapsed` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onRowExpanded: Invoked when the widget emits the `row-expanded` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onSelectAll: Invoked when the widget emits the `select-all` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onSelectCursorParent: Invoked when the widget emits the `select-cursor-parent` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onSelectCursorRow: Invoked when the widget emits the `select-cursor-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onStartInteractiveSearch: Invoked when the widget emits the `start-interactive-search` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onTestCollapseRow: Invoked when the widget emits the `test-collapse-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onTestExpandRow: Invoked when the widget emits the `test-expand-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onToggleCursorRow: Invoked when the widget emits the `toggle-cursor-row` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onUnselectAll: Invoked when the widget emits the `unselect-all` signal. Its return value is forwarded to GTK as the signal's result.
|
||
public init(activateOnSingleClick: Bool? = nil, enableSearch: Bool? = nil, enableTreeLines: Bool? = nil, expanderColumn: Gtk.TreeViewColumn? = nil, fixedHeightMode: Bool? = nil, headersClickable: Bool? = nil, headersVisible: Bool? = nil, hoverExpand: Bool? = nil, hoverSelection: Bool? = nil, levelIndentation: Int32? = nil, reorderable: Bool? = nil, rubberBanding: Bool? = nil, searchColumn: Int32? = nil, showExpanders: Bool? = nil, tooltipColumn: Int32? = nil, onColumnsChanged: (() -> Void)? = nil, onCursorChanged: (() -> Void)? = nil, onExpandCollapseCursorRow: ((Bool, Bool, Bool) -> Bool)? = nil, onMoveCursor: ((Gtk.MovementStep, Int32, Bool, Bool) -> Bool)? = nil, onRowActivated: ((Gtk.TreePath, Gtk.TreeViewColumn?) -> Void)? = nil, onRowCollapsed: ((Gtk.TreeIter, Gtk.TreePath) -> Void)? = nil, onRowExpanded: ((Gtk.TreeIter, Gtk.TreePath) -> Void)? = nil, onSelectAll: (() -> Bool)? = nil, onSelectCursorParent: (() -> Bool)? = nil, onSelectCursorRow: ((Bool) -> Bool)? = nil, onStartInteractiveSearch: (() -> Bool)? = nil, onTestCollapseRow: ((Gtk.TreeIter, Gtk.TreePath) -> Bool)? = nil, onTestExpandRow: ((Gtk.TreeIter, Gtk.TreePath) -> Bool)? = nil, onToggleCursorRow: (() -> Bool)? = nil, onUnselectAll: (() -> Bool)? = nil) {
|
||
make = { _ in Gtk.TreeView() }
|
||
configure.append { w, ctx in
|
||
if let activateOnSingleClick { w.setActivateOnSingleClick(single: activateOnSingleClick) }
|
||
if let enableSearch { w.setEnableSearch(enableSearch: enableSearch) }
|
||
if let enableTreeLines { w.setEnableTreeLines(enabled: enableTreeLines) }
|
||
if let expanderColumn { w.setExpanderColumn(column: expanderColumn) }
|
||
if let fixedHeightMode { w.setFixedHeightMode(enable: fixedHeightMode) }
|
||
if let headersClickable { w.setHeadersClickable(setting: headersClickable) }
|
||
if let headersVisible { w.setHeadersVisible(headersVisible: headersVisible) }
|
||
if let hoverExpand { w.setHoverExpand(expand: hoverExpand) }
|
||
if let hoverSelection { w.setHoverSelection(hover: hoverSelection) }
|
||
if let levelIndentation { w.setLevelIndentation(indentation: levelIndentation) }
|
||
if let reorderable { w.setReorderable(reorderable: reorderable) }
|
||
if let rubberBanding { w.setRubberBanding(enable: rubberBanding) }
|
||
if let searchColumn { w.setSearchColumn(column: searchColumn) }
|
||
if let showExpanders { w.setShowExpanders(enabled: showExpanders) }
|
||
if let tooltipColumn { w.setTooltipColumn(column: tooltipColumn) }
|
||
if let onColumnsChanged { ctx.registry.add(w.connectColumnsChanged { _ in onColumnsChanged() }) }
|
||
if let onCursorChanged { ctx.registry.add(w.connectCursorChanged { _ in onCursorChanged() }) }
|
||
if let onExpandCollapseCursorRow { ctx.registry.add(w.connectExpandCollapseCursorRow { _, a0, a1, a2 in onExpandCollapseCursorRow(a0, a1, a2) }) }
|
||
if let onMoveCursor { ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in onMoveCursor(a0, a1, a2, a3) }) }
|
||
if let onRowActivated { ctx.registry.add(w.connectRowActivated { _, a0, a1 in onRowActivated(a0, a1) }) }
|
||
if let onRowCollapsed { ctx.registry.add(w.connectRowCollapsed { _, a0, a1 in onRowCollapsed(a0, a1) }) }
|
||
if let onRowExpanded { ctx.registry.add(w.connectRowExpanded { _, a0, a1 in onRowExpanded(a0, a1) }) }
|
||
if let onSelectAll { ctx.registry.add(w.connectSelectAll { _ in onSelectAll() }) }
|
||
if let onSelectCursorParent { ctx.registry.add(w.connectSelectCursorParent { _ in onSelectCursorParent() }) }
|
||
if let onSelectCursorRow { ctx.registry.add(w.connectSelectCursorRow { _, a0 in onSelectCursorRow(a0) }) }
|
||
if let onStartInteractiveSearch { ctx.registry.add(w.connectStartInteractiveSearch { _ in onStartInteractiveSearch() }) }
|
||
if let onTestCollapseRow { ctx.registry.add(w.connectTestCollapseRow { _, a0, a1 in onTestCollapseRow(a0, a1) }) }
|
||
if let onTestExpandRow { ctx.registry.add(w.connectTestExpandRow { _, a0, a1 in onTestExpandRow(a0, a1) }) }
|
||
if let onToggleCursorRow { ctx.registry.add(w.connectToggleCursorRow { _ in onToggleCursorRow() }) }
|
||
if let onUnselectAll { ctx.registry.add(w.connectUnselectAll { _ in onUnselectAll() }) }
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateInits(static) | source: Gtk.TreeView.init(model:)
|
||
/// Creates a new `GtkTreeView` widget with the model initialized to `model`.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for values that change.
|
||
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
|
||
///
|
||
/// - Parameter model: Sets the model for a `GtkTreeView`. If the `tree_view` already has a model set, it will remove it before setting the new model. If `model` is `nil`, then it will unset the old model.
|
||
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.
|
||
/// - Parameter enableSearch: If `enable_search` is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
|
||
/// - Parameter enableTreeLines: Sets whether to draw lines interconnecting the expanders in `tree_view`. This does not have any visible effects for lists.
|
||
/// - Parameter expanderColumn: Sets the column to draw the expander arrow at. It must be in `tree_view`. If `column` is `nil`, then the expander arrow is always at the first visible column.
|
||
/// - Parameter fixedHeightMode: Setting the ::fixed-height-mode property to `true` speeds up `GtkTreeView` by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
|
||
/// - Parameter headersClickable: Allow the column title buttons to be clicked.
|
||
/// - Parameter headersVisible: Sets the visibility state of the headers.
|
||
/// - Parameter hoverExpand: Enables or disables the hover expansion mode of `tree_view`. Hover expansion makes rows expand or collapse if the pointer moves over them.
|
||
/// - Parameter hoverSelection: Enables or disables the hover selection mode of `tree_view`. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
/// - Parameter levelIndentation: Extra indentation for each level.
|
||
/// - Parameter reorderable: This function is a convenience function to allow you to reorder models that support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model’s `GtkTreeModel::row-inserted` and `GtkTreeModel::row-deleted` signals. The reordering is implemented by setting up the tree view as a drag source and destination. Therefore, drag and drop can not be used in a reorderable view for any other purpose.
|
||
/// - Parameter rubberBanding: Enables or disables rubber banding in `tree_view`. If the selection mode is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select multiple rows by dragging the mouse.
|
||
/// - Parameter searchColumn: Sets `column` as the column where the interactive search code should search in for the current model.
|
||
/// - Parameter showExpanders: `true` if the view has expanders.
|
||
/// - Parameter tooltipColumn: If you only plan to have simple (text-only) tooltips on full rows, you can use this function to have `GtkTreeView` handle these automatically for you. `column` should be set to the column in `tree_view`’s model containing the tooltip texts, or -1 to disable this feature.
|
||
/// - Parameter onColumnsChanged: Invoked when the widget emits the `columns-changed` signal.
|
||
/// - Parameter onCursorChanged: Invoked when the widget emits the `cursor-changed` signal.
|
||
/// - Parameter onExpandCollapseCursorRow: Invoked when the widget emits the `expand-collapse-cursor-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onMoveCursor: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onRowActivated: Invoked when the widget emits the `row-activated` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onRowCollapsed: Invoked when the widget emits the `row-collapsed` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onRowExpanded: Invoked when the widget emits the `row-expanded` signal. The closure receives the signal's arguments in order.
|
||
/// - Parameter onSelectAll: Invoked when the widget emits the `select-all` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onSelectCursorParent: Invoked when the widget emits the `select-cursor-parent` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onSelectCursorRow: Invoked when the widget emits the `select-cursor-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onStartInteractiveSearch: Invoked when the widget emits the `start-interactive-search` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onTestCollapseRow: Invoked when the widget emits the `test-collapse-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onTestExpandRow: Invoked when the widget emits the `test-expand-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onToggleCursorRow: Invoked when the widget emits the `toggle-cursor-row` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Parameter onUnselectAll: Invoked when the widget emits the `unselect-all` signal. Its return value is forwarded to GTK as the signal's result.
|
||
public init(model: Gtk.TreeModel, activateOnSingleClick: Bool? = nil, enableSearch: Bool? = nil, enableTreeLines: Bool? = nil, expanderColumn: Gtk.TreeViewColumn? = nil, fixedHeightMode: Bool? = nil, headersClickable: Bool? = nil, headersVisible: Bool? = nil, hoverExpand: Bool? = nil, hoverSelection: Bool? = nil, levelIndentation: Int32? = nil, reorderable: Bool? = nil, rubberBanding: Bool? = nil, searchColumn: Int32? = nil, showExpanders: Bool? = nil, tooltipColumn: Int32? = nil, onColumnsChanged: (() -> Void)? = nil, onCursorChanged: (() -> Void)? = nil, onExpandCollapseCursorRow: ((Bool, Bool, Bool) -> Bool)? = nil, onMoveCursor: ((Gtk.MovementStep, Int32, Bool, Bool) -> Bool)? = nil, onRowActivated: ((Gtk.TreePath, Gtk.TreeViewColumn?) -> Void)? = nil, onRowCollapsed: ((Gtk.TreeIter, Gtk.TreePath) -> Void)? = nil, onRowExpanded: ((Gtk.TreeIter, Gtk.TreePath) -> Void)? = nil, onSelectAll: (() -> Bool)? = nil, onSelectCursorParent: (() -> Bool)? = nil, onSelectCursorRow: ((Bool) -> Bool)? = nil, onStartInteractiveSearch: (() -> Bool)? = nil, onTestCollapseRow: ((Gtk.TreeIter, Gtk.TreePath) -> Bool)? = nil, onTestExpandRow: ((Gtk.TreeIter, Gtk.TreePath) -> Bool)? = nil, onToggleCursorRow: (() -> Bool)? = nil, onUnselectAll: (() -> Bool)? = nil) {
|
||
make = { _ in Gtk.TreeView(model: model) }
|
||
configure.append { w, ctx in
|
||
if let activateOnSingleClick { w.setActivateOnSingleClick(single: activateOnSingleClick) }
|
||
if let enableSearch { w.setEnableSearch(enableSearch: enableSearch) }
|
||
if let enableTreeLines { w.setEnableTreeLines(enabled: enableTreeLines) }
|
||
if let expanderColumn { w.setExpanderColumn(column: expanderColumn) }
|
||
if let fixedHeightMode { w.setFixedHeightMode(enable: fixedHeightMode) }
|
||
if let headersClickable { w.setHeadersClickable(setting: headersClickable) }
|
||
if let headersVisible { w.setHeadersVisible(headersVisible: headersVisible) }
|
||
if let hoverExpand { w.setHoverExpand(expand: hoverExpand) }
|
||
if let hoverSelection { w.setHoverSelection(hover: hoverSelection) }
|
||
if let levelIndentation { w.setLevelIndentation(indentation: levelIndentation) }
|
||
if let reorderable { w.setReorderable(reorderable: reorderable) }
|
||
if let rubberBanding { w.setRubberBanding(enable: rubberBanding) }
|
||
if let searchColumn { w.setSearchColumn(column: searchColumn) }
|
||
if let showExpanders { w.setShowExpanders(enabled: showExpanders) }
|
||
if let tooltipColumn { w.setTooltipColumn(column: tooltipColumn) }
|
||
if let onColumnsChanged { ctx.registry.add(w.connectColumnsChanged { _ in onColumnsChanged() }) }
|
||
if let onCursorChanged { ctx.registry.add(w.connectCursorChanged { _ in onCursorChanged() }) }
|
||
if let onExpandCollapseCursorRow { ctx.registry.add(w.connectExpandCollapseCursorRow { _, a0, a1, a2 in onExpandCollapseCursorRow(a0, a1, a2) }) }
|
||
if let onMoveCursor { ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in onMoveCursor(a0, a1, a2, a3) }) }
|
||
if let onRowActivated { ctx.registry.add(w.connectRowActivated { _, a0, a1 in onRowActivated(a0, a1) }) }
|
||
if let onRowCollapsed { ctx.registry.add(w.connectRowCollapsed { _, a0, a1 in onRowCollapsed(a0, a1) }) }
|
||
if let onRowExpanded { ctx.registry.add(w.connectRowExpanded { _, a0, a1 in onRowExpanded(a0, a1) }) }
|
||
if let onSelectAll { ctx.registry.add(w.connectSelectAll { _ in onSelectAll() }) }
|
||
if let onSelectCursorParent { ctx.registry.add(w.connectSelectCursorParent { _ in onSelectCursorParent() }) }
|
||
if let onSelectCursorRow { ctx.registry.add(w.connectSelectCursorRow { _, a0 in onSelectCursorRow(a0) }) }
|
||
if let onStartInteractiveSearch { ctx.registry.add(w.connectStartInteractiveSearch { _ in onStartInteractiveSearch() }) }
|
||
if let onTestCollapseRow { ctx.registry.add(w.connectTestCollapseRow { _, a0, a1 in onTestCollapseRow(a0, a1) }) }
|
||
if let onTestExpandRow { ctx.registry.add(w.connectTestExpandRow { _, a0, a1 in onTestExpandRow(a0, a1) }) }
|
||
if let onToggleCursorRow { ctx.registry.add(w.connectToggleCursorRow { _ in onToggleCursorRow() }) }
|
||
if let onUnselectAll { ctx.registry.add(w.connectUnselectAll { _ in onUnselectAll() }) }
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
extension TreeView: WidgetView {
|
||
public typealias Target = Gtk.TreeView
|
||
|
||
@_spi(Portico) public func appending(
|
||
_ step: @escaping (Gtk.TreeView, MountContext) -> Void
|
||
) -> Self {
|
||
var c = self
|
||
c.configure.append(step)
|
||
return c
|
||
}
|
||
}
|
||
|
||
@_spi(Portico) extension TreeView: Mountable {
|
||
@_spi(Portico) public func mount(_ ctx: MountContext) -> Gtk.Widget {
|
||
let w = make(ctx)
|
||
for step in configure { step(w, ctx) }
|
||
return w
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension | source: Gtk.TreeView
|
||
/// Modifiers for `Gtk.TreeView`, available on every Portico view whose
|
||
/// backing widget is `Gtk.TreeView` or one of its subclasses.
|
||
extension WidgetView where Target: Gtk.TreeView {
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setActivateOnSingleClick(single:)
|
||
/// Cause the `GtkTreeView`::row-activated signal to be emitted
|
||
/// on a single click instead of a double click.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func activateOnSingleClick(_ activateOnSingleClick: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setActivateOnSingleClick(single: activateOnSingleClick)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setActivateOnSingleClick(single:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getActivateOnSingleClick()
|
||
/// Cause the `GtkTreeView`::row-activated signal to be emitted
|
||
/// on a single click instead of a double click.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func activateOnSingleClick(_ activateOnSingleClick: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, activateOnSingleClick, registry: ctx.registry, notifyDetail: "activate-on-single-click",
|
||
read: { [w] in w.getActivateOnSingleClick() },
|
||
write: { [w] v in w.setActivateOnSingleClick(single: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setActivateOnSingleClick(single:)
|
||
/// Cause the `GtkTreeView`::row-activated signal to be emitted
|
||
/// on a single click instead of a double click.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setActivateOnSingleClick(single:)`.
|
||
///
|
||
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func activateOnSingleClick(_ activateOnSingleClick: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setActivateOnSingleClick(single: activateOnSingleClick()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setEnableSearch(enableSearch:)
|
||
/// If `enable_search` is set, then the user can type in text to search through
|
||
/// the tree interactively (this is sometimes called "typeahead find").
|
||
///
|
||
/// Note that even if this is `false`, the user can still initiate a search
|
||
/// using the “start-interactive-search” key binding.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter enableSearch: If `enable_search` is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func enableSearch(_ enableSearch: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setEnableSearch(enableSearch: enableSearch)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setEnableSearch(enableSearch:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getEnableSearch()
|
||
/// If `enable_search` is set, then the user can type in text to search through
|
||
/// the tree interactively (this is sometimes called "typeahead find").
|
||
///
|
||
/// Note that even if this is `false`, the user can still initiate a search
|
||
/// using the “start-interactive-search” key binding.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func enableSearch(_ enableSearch: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, enableSearch, registry: ctx.registry, notifyDetail: "enable-search",
|
||
read: { [w] in w.getEnableSearch() },
|
||
write: { [w] v in w.setEnableSearch(enableSearch: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setEnableSearch(enableSearch:)
|
||
/// If `enable_search` is set, then the user can type in text to search through
|
||
/// the tree interactively (this is sometimes called "typeahead find").
|
||
///
|
||
/// Note that even if this is `false`, the user can still initiate a search
|
||
/// using the “start-interactive-search” key binding.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setEnableSearch(enableSearch:)`.
|
||
///
|
||
/// - Parameter enableSearch: If `enable_search` is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func enableSearch(_ enableSearch: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setEnableSearch(enableSearch: enableSearch()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setEnableTreeLines(enabled:)
|
||
/// Sets whether to draw lines interconnecting the expanders in `tree_view`.
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter enableTreeLines: Sets whether to draw lines interconnecting the expanders in `tree_view`. This does not have any visible effects for lists.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func enableTreeLines(_ enableTreeLines: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setEnableTreeLines(enabled: enableTreeLines)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setEnableTreeLines(enabled:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getEnableTreeLines()
|
||
/// Sets whether to draw lines interconnecting the expanders in `tree_view`.
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func enableTreeLines(_ enableTreeLines: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, enableTreeLines, registry: ctx.registry, notifyDetail: "enable-tree-lines",
|
||
read: { [w] in w.getEnableTreeLines() },
|
||
write: { [w] v in w.setEnableTreeLines(enabled: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setEnableTreeLines(enabled:)
|
||
/// Sets whether to draw lines interconnecting the expanders in `tree_view`.
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setEnableTreeLines(enabled:)`.
|
||
///
|
||
/// - Parameter enableTreeLines: Sets whether to draw lines interconnecting the expanders in `tree_view`. This does not have any visible effects for lists.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func enableTreeLines(_ enableTreeLines: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setEnableTreeLines(enabled: enableTreeLines()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setExpanderColumn(column:)
|
||
/// Sets the column to draw the expander arrow at. It must be in `tree_view`.
|
||
/// If `column` is `nil`, then the expander arrow is always at the first
|
||
/// visible column.
|
||
///
|
||
/// If you do not want expander arrow to appear in your tree, set the
|
||
/// expander column to a hidden column.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter expanderColumn: Sets the column to draw the expander arrow at. It must be in `tree_view`. If `column` is `nil`, then the expander arrow is always at the first visible column.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func expanderColumn(_ expanderColumn: Gtk.TreeViewColumn?) -> Self {
|
||
appending { w, _ in
|
||
w.setExpanderColumn(column: expanderColumn)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setExpanderColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getExpanderColumn()
|
||
/// Sets the column to draw the expander arrow at. It must be in `tree_view`.
|
||
/// If `column` is `nil`, then the expander arrow is always at the first
|
||
/// visible column.
|
||
///
|
||
/// If you do not want expander arrow to appear in your tree, set the
|
||
/// expander column to a hidden column.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Gtk.TreeViewColumn?` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func expanderColumn(_ expanderColumn: Portico.Binding<Gtk.TreeViewColumn?>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, expanderColumn, registry: ctx.registry, notifyDetail: "expander-column",
|
||
read: { [w] in w.getExpanderColumn() },
|
||
write: { [w] v in w.setExpanderColumn(column: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Gtk.TreeView.setExpanderColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getExpanderColumn()
|
||
/// Sets the column to draw the expander arrow at. It must be in `tree_view`.
|
||
/// If `column` is `nil`, then the expander arrow is always at the first
|
||
/// visible column.
|
||
///
|
||
/// If you do not want expander arrow to appear in your tree, set the
|
||
/// expander column to a hidden column.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// `Binding` is invariant, so a `Binding<Gtk.TreeViewColumn>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Gtk.TreeViewColumn?>` to be able to clear the property.
|
||
/// When `Gtk.TreeViewColumn` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
/// A `nil` widget value is never written back into the binding.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func expanderColumn(_ expanderColumn: Portico.Binding<Gtk.TreeViewColumn>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, expanderColumn, registry: ctx.registry, notifyDetail: "expander-column",
|
||
read: { [w] in w.getExpanderColumn() },
|
||
write: { [w] v in w.setExpanderColumn(column: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setExpanderColumn(column:)
|
||
/// Sets the column to draw the expander arrow at. It must be in `tree_view`.
|
||
/// If `column` is `nil`, then the expander arrow is always at the first
|
||
/// visible column.
|
||
///
|
||
/// If you do not want expander arrow to appear in your tree, set the
|
||
/// expander column to a hidden column.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setExpanderColumn(column:)`.
|
||
///
|
||
/// - Parameter expanderColumn: Sets the column to draw the expander arrow at. It must be in `tree_view`. If `column` is `nil`, then the expander arrow is always at the first visible column.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func expanderColumn(_ expanderColumn: @escaping () -> Gtk.TreeViewColumn?) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setExpanderColumn(column: expanderColumn()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setFixedHeightMode(enable:)
|
||
/// Enables or disables the fixed height mode of `tree_view`.
|
||
/// Fixed height mode speeds up `GtkTreeView` by assuming that all
|
||
/// rows have the same height.
|
||
/// Only enable this option if all rows are the same height and all
|
||
/// columns are of type `GTK_TREE_VIEW_COLUMN_FIXED`.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter fixedHeightMode: Setting the ::fixed-height-mode property to `true` speeds up `GtkTreeView` by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func fixedHeightMode(_ fixedHeightMode: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setFixedHeightMode(enable: fixedHeightMode)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setFixedHeightMode(enable:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getFixedHeightMode()
|
||
/// Enables or disables the fixed height mode of `tree_view`.
|
||
/// Fixed height mode speeds up `GtkTreeView` by assuming that all
|
||
/// rows have the same height.
|
||
/// Only enable this option if all rows are the same height and all
|
||
/// columns are of type `GTK_TREE_VIEW_COLUMN_FIXED`.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func fixedHeightMode(_ fixedHeightMode: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, fixedHeightMode, registry: ctx.registry, notifyDetail: "fixed-height-mode",
|
||
read: { [w] in w.getFixedHeightMode() },
|
||
write: { [w] v in w.setFixedHeightMode(enable: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setFixedHeightMode(enable:)
|
||
/// Enables or disables the fixed height mode of `tree_view`.
|
||
/// Fixed height mode speeds up `GtkTreeView` by assuming that all
|
||
/// rows have the same height.
|
||
/// Only enable this option if all rows are the same height and all
|
||
/// columns are of type `GTK_TREE_VIEW_COLUMN_FIXED`.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setFixedHeightMode(enable:)`.
|
||
///
|
||
/// - Parameter fixedHeightMode: Setting the ::fixed-height-mode property to `true` speeds up `GtkTreeView` by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func fixedHeightMode(_ fixedHeightMode: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setFixedHeightMode(enable: fixedHeightMode()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setHeadersClickable(setting:)
|
||
/// Allow the column title buttons to be clicked.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter headersClickable: Allow the column title buttons to be clicked.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func headersClickable(_ headersClickable: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setHeadersClickable(setting: headersClickable)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setHeadersClickable(setting:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getHeadersClickable()
|
||
/// Allow the column title buttons to be clicked.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func headersClickable(_ headersClickable: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, headersClickable, registry: ctx.registry, notifyDetail: "headers-clickable",
|
||
read: { [w] in w.getHeadersClickable() },
|
||
write: { [w] v in w.setHeadersClickable(setting: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setHeadersClickable(setting:)
|
||
/// Allow the column title buttons to be clicked.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setHeadersClickable(setting:)`.
|
||
///
|
||
/// - Parameter headersClickable: Allow the column title buttons to be clicked.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func headersClickable(_ headersClickable: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setHeadersClickable(setting: headersClickable()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setHeadersVisible(headersVisible:)
|
||
/// Sets the visibility state of the headers.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter headersVisible: Sets the visibility state of the headers.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func headersVisible(_ headersVisible: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setHeadersVisible(headersVisible: headersVisible)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setHeadersVisible(headersVisible:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getHeadersVisible()
|
||
/// Sets the visibility state of the headers.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func headersVisible(_ headersVisible: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, headersVisible, registry: ctx.registry, notifyDetail: "headers-visible",
|
||
read: { [w] in w.getHeadersVisible() },
|
||
write: { [w] v in w.setHeadersVisible(headersVisible: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setHeadersVisible(headersVisible:)
|
||
/// Sets the visibility state of the headers.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setHeadersVisible(headersVisible:)`.
|
||
///
|
||
/// - Parameter headersVisible: Sets the visibility state of the headers.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func headersVisible(_ headersVisible: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setHeadersVisible(headersVisible: headersVisible()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setHoverExpand(expand:)
|
||
/// Enables or disables the hover expansion mode of `tree_view`.
|
||
/// Hover expansion makes rows expand or collapse if the pointer
|
||
/// moves over them.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter hoverExpand: Enables or disables the hover expansion mode of `tree_view`. Hover expansion makes rows expand or collapse if the pointer moves over them.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hoverExpand(_ hoverExpand: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setHoverExpand(expand: hoverExpand)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setHoverExpand(expand:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getHoverExpand()
|
||
/// Enables or disables the hover expansion mode of `tree_view`.
|
||
/// Hover expansion makes rows expand or collapse if the pointer
|
||
/// moves over them.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hoverExpand(_ hoverExpand: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, hoverExpand, registry: ctx.registry, notifyDetail: "hover-expand",
|
||
read: { [w] in w.getHoverExpand() },
|
||
write: { [w] v in w.setHoverExpand(expand: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setHoverExpand(expand:)
|
||
/// Enables or disables the hover expansion mode of `tree_view`.
|
||
/// Hover expansion makes rows expand or collapse if the pointer
|
||
/// moves over them.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setHoverExpand(expand:)`.
|
||
///
|
||
/// - Parameter hoverExpand: Enables or disables the hover expansion mode of `tree_view`. Hover expansion makes rows expand or collapse if the pointer moves over them.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hoverExpand(_ hoverExpand: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setHoverExpand(expand: hoverExpand()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setHoverSelection(hover:)
|
||
/// Enables or disables the hover selection mode of `tree_view`.
|
||
/// Hover selection makes the selected row follow the pointer.
|
||
/// Currently, this works only for the selection modes
|
||
/// `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter hoverSelection: Enables or disables the hover selection mode of `tree_view`. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hoverSelection(_ hoverSelection: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setHoverSelection(hover: hoverSelection)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setHoverSelection(hover:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getHoverSelection()
|
||
/// Enables or disables the hover selection mode of `tree_view`.
|
||
/// Hover selection makes the selected row follow the pointer.
|
||
/// Currently, this works only for the selection modes
|
||
/// `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hoverSelection(_ hoverSelection: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, hoverSelection, registry: ctx.registry, notifyDetail: "hover-selection",
|
||
read: { [w] in w.getHoverSelection() },
|
||
write: { [w] v in w.setHoverSelection(hover: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setHoverSelection(hover:)
|
||
/// Enables or disables the hover selection mode of `tree_view`.
|
||
/// Hover selection makes the selected row follow the pointer.
|
||
/// Currently, this works only for the selection modes
|
||
/// `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setHoverSelection(hover:)`.
|
||
///
|
||
/// - Parameter hoverSelection: Enables or disables the hover selection mode of `tree_view`. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes `GTK_SELECTION_SINGLE` and `GTK_SELECTION_BROWSE`.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func hoverSelection(_ hoverSelection: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setHoverSelection(hover: hoverSelection()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setLevelIndentation(indentation:)
|
||
/// Sets the amount of extra indentation for child levels to use in `tree_view`
|
||
/// in addition to the default indentation. The value should be specified in
|
||
/// pixels, a value of 0 disables this feature and in this case only the default
|
||
/// indentation will be used.
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter levelIndentation: Extra indentation for each level.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func levelIndentation(_ levelIndentation: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setLevelIndentation(indentation: levelIndentation)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setLevelIndentation(indentation:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getLevelIndentation()
|
||
/// Sets the amount of extra indentation for child levels to use in `tree_view`
|
||
/// in addition to the default indentation. The value should be specified in
|
||
/// pixels, a value of 0 disables this feature and in this case only the default
|
||
/// indentation will be used.
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func levelIndentation(_ levelIndentation: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, levelIndentation, registry: ctx.registry, notifyDetail: "level-indentation",
|
||
read: { [w] in w.getLevelIndentation() },
|
||
write: { [w] v in w.setLevelIndentation(indentation: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setLevelIndentation(indentation:)
|
||
/// Sets the amount of extra indentation for child levels to use in `tree_view`
|
||
/// in addition to the default indentation. The value should be specified in
|
||
/// pixels, a value of 0 disables this feature and in this case only the default
|
||
/// indentation will be used.
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setLevelIndentation(indentation:)`.
|
||
///
|
||
/// - Parameter levelIndentation: Extra indentation for each level.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func levelIndentation(_ levelIndentation: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setLevelIndentation(indentation: levelIndentation()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setModel(model:)
|
||
/// Sets the model for a `GtkTreeView`. If the `tree_view` already has a model
|
||
/// set, it will remove it before setting the new model. If `model` is `nil`,
|
||
/// then it will unset the old model.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter model: Sets the model for a `GtkTreeView`. If the `tree_view` already has a model set, it will remove it before setting the new model. If `model` is `nil`, then it will unset the old model.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func model(_ model: Gtk.TreeModel?) -> Self {
|
||
appending { w, _ in
|
||
w.setModel(model: model)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setModel(model:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getModel()
|
||
/// Sets the model for a `GtkTreeView`. If the `tree_view` already has a model
|
||
/// set, it will remove it before setting the new model. If `model` is `nil`,
|
||
/// then it will unset the old model.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Gtk.TreeModel?` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func model(_ model: Portico.Binding<Gtk.TreeModel?>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, model, registry: ctx.registry, notifyDetail: "model",
|
||
read: { [w] in w.getModel() },
|
||
write: { [w] v in w.setModel(model: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Gtk.TreeView.setModel(model:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getModel()
|
||
/// Sets the model for a `GtkTreeView`. If the `tree_view` already has a model
|
||
/// set, it will remove it before setting the new model. If `model` is `nil`,
|
||
/// then it will unset the old model.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// `Binding` is invariant, so a `Binding<Gtk.TreeModel>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Gtk.TreeModel?>` to be able to clear the property.
|
||
/// When `Gtk.TreeModel` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
/// A `nil` widget value is never written back into the binding.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func model(_ model: Portico.Binding<Gtk.TreeModel>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, model, registry: ctx.registry, notifyDetail: "model",
|
||
read: { [w] in w.getModel() },
|
||
write: { [w] v in w.setModel(model: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setModel(model:)
|
||
/// Sets the model for a `GtkTreeView`. If the `tree_view` already has a model
|
||
/// set, it will remove it before setting the new model. If `model` is `nil`,
|
||
/// then it will unset the old model.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setModel(model:)`.
|
||
///
|
||
/// - Parameter model: Sets the model for a `GtkTreeView`. If the `tree_view` already has a model set, it will remove it before setting the new model. If `model` is `nil`, then it will unset the old model.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func model(_ model: @escaping () -> Gtk.TreeModel?) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setModel(model: model()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setReorderable(reorderable:)
|
||
/// This function is a convenience function to allow you to reorder
|
||
/// models that support the `GtkTreeDragSourceIface` and the
|
||
/// `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support
|
||
/// these. If `reorderable` is `true`, then the user can reorder the
|
||
/// model by dragging and dropping rows. The developer can listen to
|
||
/// these changes by connecting to the model’s `GtkTreeModel::row-inserted`
|
||
/// and `GtkTreeModel::row-deleted` signals. The reordering is implemented
|
||
/// by setting up the tree view as a drag source and destination.
|
||
/// Therefore, drag and drop can not be used in a reorderable view for any
|
||
/// other purpose.
|
||
///
|
||
/// This function does not give you any degree of control over the order -- any
|
||
/// reordering is allowed. If more control is needed, you should probably
|
||
/// handle drag and drop manually.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter reorderable: This function is a convenience function to allow you to reorder models that support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model’s `GtkTreeModel::row-inserted` and `GtkTreeModel::row-deleted` signals. The reordering is implemented by setting up the tree view as a drag source and destination. Therefore, drag and drop can not be used in a reorderable view for any other purpose.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func reorderable(_ reorderable: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setReorderable(reorderable: reorderable)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setReorderable(reorderable:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getReorderable()
|
||
/// This function is a convenience function to allow you to reorder
|
||
/// models that support the `GtkTreeDragSourceIface` and the
|
||
/// `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support
|
||
/// these. If `reorderable` is `true`, then the user can reorder the
|
||
/// model by dragging and dropping rows. The developer can listen to
|
||
/// these changes by connecting to the model’s `GtkTreeModel::row-inserted`
|
||
/// and `GtkTreeModel::row-deleted` signals. The reordering is implemented
|
||
/// by setting up the tree view as a drag source and destination.
|
||
/// Therefore, drag and drop can not be used in a reorderable view for any
|
||
/// other purpose.
|
||
///
|
||
/// This function does not give you any degree of control over the order -- any
|
||
/// reordering is allowed. If more control is needed, you should probably
|
||
/// handle drag and drop manually.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func reorderable(_ reorderable: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, reorderable, registry: ctx.registry, notifyDetail: "reorderable",
|
||
read: { [w] in w.getReorderable() },
|
||
write: { [w] v in w.setReorderable(reorderable: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setReorderable(reorderable:)
|
||
/// This function is a convenience function to allow you to reorder
|
||
/// models that support the `GtkTreeDragSourceIface` and the
|
||
/// `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support
|
||
/// these. If `reorderable` is `true`, then the user can reorder the
|
||
/// model by dragging and dropping rows. The developer can listen to
|
||
/// these changes by connecting to the model’s `GtkTreeModel::row-inserted`
|
||
/// and `GtkTreeModel::row-deleted` signals. The reordering is implemented
|
||
/// by setting up the tree view as a drag source and destination.
|
||
/// Therefore, drag and drop can not be used in a reorderable view for any
|
||
/// other purpose.
|
||
///
|
||
/// This function does not give you any degree of control over the order -- any
|
||
/// reordering is allowed. If more control is needed, you should probably
|
||
/// handle drag and drop manually.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setReorderable(reorderable:)`.
|
||
///
|
||
/// - Parameter reorderable: This function is a convenience function to allow you to reorder models that support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model’s `GtkTreeModel::row-inserted` and `GtkTreeModel::row-deleted` signals. The reordering is implemented by setting up the tree view as a drag source and destination. Therefore, drag and drop can not be used in a reorderable view for any other purpose.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func reorderable(_ reorderable: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setReorderable(reorderable: reorderable()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setRubberBanding(enable:)
|
||
/// Enables or disables rubber banding in `tree_view`. If the selection mode
|
||
/// is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select
|
||
/// multiple rows by dragging the mouse.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter rubberBanding: Enables or disables rubber banding in `tree_view`. If the selection mode is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select multiple rows by dragging the mouse.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func rubberBanding(_ rubberBanding: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setRubberBanding(enable: rubberBanding)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setRubberBanding(enable:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getRubberBanding()
|
||
/// Enables or disables rubber banding in `tree_view`. If the selection mode
|
||
/// is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select
|
||
/// multiple rows by dragging the mouse.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func rubberBanding(_ rubberBanding: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, rubberBanding, registry: ctx.registry, notifyDetail: "rubber-banding",
|
||
read: { [w] in w.getRubberBanding() },
|
||
write: { [w] v in w.setRubberBanding(enable: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setRubberBanding(enable:)
|
||
/// Enables or disables rubber banding in `tree_view`. If the selection mode
|
||
/// is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select
|
||
/// multiple rows by dragging the mouse.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setRubberBanding(enable:)`.
|
||
///
|
||
/// - Parameter rubberBanding: Enables or disables rubber banding in `tree_view`. If the selection mode is `GTK_SELECTION_MULTIPLE`, rubber banding will allow the user to select multiple rows by dragging the mouse.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func rubberBanding(_ rubberBanding: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setRubberBanding(enable: rubberBanding()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setSearchColumn(column:)
|
||
/// Sets `column` as the column where the interactive search code should
|
||
/// search in for the current model.
|
||
///
|
||
/// If the search column is set, users can use the “start-interactive-search”
|
||
/// key binding to bring up search popup. The enable-search property controls
|
||
/// whether simply typing text will also start an interactive search.
|
||
///
|
||
/// Note that `column` refers to a column of the current model. The search
|
||
/// column is reset to -1 when the model is changed.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter searchColumn: Sets `column` as the column where the interactive search code should search in for the current model.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func searchColumn(_ searchColumn: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setSearchColumn(column: searchColumn)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setSearchColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getSearchColumn()
|
||
/// Sets `column` as the column where the interactive search code should
|
||
/// search in for the current model.
|
||
///
|
||
/// If the search column is set, users can use the “start-interactive-search”
|
||
/// key binding to bring up search popup. The enable-search property controls
|
||
/// whether simply typing text will also start an interactive search.
|
||
///
|
||
/// Note that `column` refers to a column of the current model. The search
|
||
/// column is reset to -1 when the model is changed.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func searchColumn(_ searchColumn: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, searchColumn, registry: ctx.registry, notifyDetail: "search-column",
|
||
read: { [w] in w.getSearchColumn() },
|
||
write: { [w] v in w.setSearchColumn(column: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setSearchColumn(column:)
|
||
/// Sets `column` as the column where the interactive search code should
|
||
/// search in for the current model.
|
||
///
|
||
/// If the search column is set, users can use the “start-interactive-search”
|
||
/// key binding to bring up search popup. The enable-search property controls
|
||
/// whether simply typing text will also start an interactive search.
|
||
///
|
||
/// Note that `column` refers to a column of the current model. The search
|
||
/// column is reset to -1 when the model is changed.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setSearchColumn(column:)`.
|
||
///
|
||
/// - Parameter searchColumn: Sets `column` as the column where the interactive search code should search in for the current model.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func searchColumn(_ searchColumn: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setSearchColumn(column: searchColumn()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setShowExpanders(enabled:)
|
||
/// Sets whether to draw and enable expanders and indent child rows in
|
||
/// `tree_view`. When disabled there will be no expanders visible in trees
|
||
/// and there will be no way to expand and collapse rows by default. Also
|
||
/// note that hiding the expanders will disable the default indentation. You
|
||
/// can set a custom indentation in this case using
|
||
/// gtk_tree_view_set_level_indentation().
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter showExpanders: `true` if the view has expanders.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func showExpanders(_ showExpanders: Bool) -> Self {
|
||
appending { w, _ in
|
||
w.setShowExpanders(enabled: showExpanders)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setShowExpanders(enabled:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getShowExpanders()
|
||
/// Sets whether to draw and enable expanders and indent child rows in
|
||
/// `tree_view`. When disabled there will be no expanders visible in trees
|
||
/// and there will be no way to expand and collapse rows by default. Also
|
||
/// note that hiding the expanders will disable the default indentation. You
|
||
/// can set a custom indentation in this case using
|
||
/// gtk_tree_view_set_level_indentation().
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func showExpanders(_ showExpanders: Portico.Binding<Bool>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, showExpanders, registry: ctx.registry, notifyDetail: "show-expanders",
|
||
read: { [w] in w.getShowExpanders() },
|
||
write: { [w] v in w.setShowExpanders(enabled: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setShowExpanders(enabled:)
|
||
/// Sets whether to draw and enable expanders and indent child rows in
|
||
/// `tree_view`. When disabled there will be no expanders visible in trees
|
||
/// and there will be no way to expand and collapse rows by default. Also
|
||
/// note that hiding the expanders will disable the default indentation. You
|
||
/// can set a custom indentation in this case using
|
||
/// gtk_tree_view_set_level_indentation().
|
||
/// This does not have any visible effects for lists.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setShowExpanders(enabled:)`.
|
||
///
|
||
/// - Parameter showExpanders: `true` if the view has expanders.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func showExpanders(_ showExpanders: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setShowExpanders(enabled: showExpanders()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.TreeView.setTooltipColumn(column:)
|
||
/// If you only plan to have simple (text-only) tooltips on full rows, you
|
||
/// can use this function to have `GtkTreeView` handle these automatically
|
||
/// for you. `column` should be set to the column in `tree_view`’s model
|
||
/// containing the tooltip texts, or -1 to disable this feature.
|
||
///
|
||
/// When enabled, `GtkWidget:has-tooltip` will be set to `true` and
|
||
/// `tree_view` will connect a `GtkWidget::query-tooltip` signal handler.
|
||
///
|
||
/// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
|
||
/// so &, <, etc have to be escaped in the text.
|
||
///
|
||
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
||
///
|
||
/// - Parameter tooltipColumn: If you only plan to have simple (text-only) tooltips on full rows, you can use this function to have `GtkTreeView` handle these automatically for you. `column` should be set to the column in `tree_view`’s model containing the tooltip texts, or -1 to disable this feature.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func tooltipColumn(_ tooltipColumn: Int32) -> Self {
|
||
appending { w, _ in
|
||
w.setTooltipColumn(column: tooltipColumn)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.TreeView.setTooltipColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.TreeView.getTooltipColumn()
|
||
/// If you only plan to have simple (text-only) tooltips on full rows, you
|
||
/// can use this function to have `GtkTreeView` handle these automatically
|
||
/// for you. `column` should be set to the column in `tree_view`’s model
|
||
/// containing the tooltip texts, or -1 to disable this feature.
|
||
///
|
||
/// When enabled, `GtkWidget:has-tooltip` will be set to `true` and
|
||
/// `tree_view` will connect a `GtkWidget::query-tooltip` signal handler.
|
||
///
|
||
/// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
|
||
/// so &, <, etc have to be escaped in the text.
|
||
///
|
||
/// Applied at mount and re-applied on every change the binding publishes.
|
||
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
||
///
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func tooltipColumn(_ tooltipColumn: Portico.Binding<Int32>) -> Self {
|
||
appending { w, ctx in
|
||
Portico.bindProperty(
|
||
w, tooltipColumn, registry: ctx.registry, notifyDetail: "tooltip-column",
|
||
read: { [w] in w.getTooltipColumn() },
|
||
write: { [w] v in w.setTooltipColumn(column: v) }
|
||
)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.TreeView.setTooltipColumn(column:)
|
||
/// If you only plan to have simple (text-only) tooltips on full rows, you
|
||
/// can use this function to have `GtkTreeView` handle these automatically
|
||
/// for you. `column` should be set to the column in `tree_view`’s model
|
||
/// containing the tooltip texts, or -1 to disable this feature.
|
||
///
|
||
/// When enabled, `GtkWidget:has-tooltip` will be set to `true` and
|
||
/// `tree_view` will connect a `GtkWidget::query-tooltip` signal handler.
|
||
///
|
||
/// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
|
||
/// so &, <, etc have to be escaped in the text.
|
||
///
|
||
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.TreeView.setTooltipColumn(column:)`.
|
||
///
|
||
/// - Parameter tooltipColumn: If you only plan to have simple (text-only) tooltips on full rows, you can use this function to have `GtkTreeView` handle these automatically for you. `column` should be set to the column in `tree_view`’s model containing the tooltip texts, or -1 to disable this feature.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func tooltipColumn(_ tooltipColumn: @escaping () -> Int32) -> Self {
|
||
appending { w, ctx in
|
||
let tracker = DependencyTracker { [w] in w.setTooltipColumn(column: tooltipColumn()) }
|
||
tracker.run()
|
||
ctx.registry.add(tracker)
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectColumnsChanged(_:)
|
||
/// The number of columns of the treeview has changed.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `columns-changed` signal.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onColumnsChanged(_ handler: @escaping () -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectColumnsChanged { _ in handler() })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectCursorChanged(_:)
|
||
/// The position of the cursor (focused cell) has changed.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `cursor-changed` signal.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onCursorChanged(_ handler: @escaping () -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectCursorChanged { _ in handler() })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectExpandCollapseCursorRow(_:)
|
||
/// Connects a handler to the `expand-collapse-cursor-row` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `expand-collapse-cursor-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onExpandCollapseCursorRow(_ handler: @escaping (Bool, Bool, Bool) -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectExpandCollapseCursorRow { _, a0, a1, a2 in handler(a0, a1, a2) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectMoveCursor(_:)
|
||
/// The `GtkTreeView`::move-cursor signal is a [keybinding
|
||
/// signal][class`Gtk`.SignalAction] which gets emitted when the user
|
||
/// presses one of the cursor keys.
|
||
///
|
||
/// Applications should not connect to it, but may emit it with
|
||
/// g_signal_emit_by_name() if they need to control the cursor
|
||
/// programmatically. In contrast to gtk_tree_view_set_cursor() and
|
||
/// gtk_tree_view_set_cursor_on_cell() when moving horizontally
|
||
/// `GtkTreeView`::move-cursor does not reset the current selection.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onMoveCursor(_ handler: @escaping (Gtk.MovementStep, Int32, Bool, Bool) -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in handler(a0, a1, a2, a3) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectRowActivated(_:)
|
||
/// The "row-activated" signal is emitted when the method
|
||
/// [method`Gtk`.TreeView.row_activated] is called.
|
||
///
|
||
/// This signal is emitted when the user double-clicks a treeview row with the
|
||
/// [property`Gtk`.TreeView:activate-on-single-click] property set to `false`,
|
||
/// or when the user single-clicks a row when that property set to `true`.
|
||
///
|
||
/// This signal is also emitted when a non-editable row is selected and one
|
||
/// of the keys: <kbd>Space</kbd>, <kbd>Shift</kbd>+<kbd>Space</kbd>,
|
||
/// <kbd>Return</kbd> or <kbd>Enter</kbd> is pressed.
|
||
///
|
||
/// For selection handling refer to the
|
||
/// [tree widget conceptual overview](section-tree-widget.html)
|
||
/// as well as `GtkTreeSelection`.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `row-activated` signal. The closure receives the signal's arguments in order.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onRowActivated(_ handler: @escaping (Gtk.TreePath, Gtk.TreeViewColumn?) -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectRowActivated { _, a0, a1 in handler(a0, a1) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectRowCollapsed(_:)
|
||
/// The given row has been collapsed (child nodes are hidden).
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `row-collapsed` signal. The closure receives the signal's arguments in order.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onRowCollapsed(_ handler: @escaping (Gtk.TreeIter, Gtk.TreePath) -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectRowCollapsed { _, a0, a1 in handler(a0, a1) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectRowExpanded(_:)
|
||
/// The given row has been expanded (child nodes are shown).
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `row-expanded` signal. The closure receives the signal's arguments in order.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onRowExpanded(_ handler: @escaping (Gtk.TreeIter, Gtk.TreePath) -> Void) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectRowExpanded { _, a0, a1 in handler(a0, a1) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectSelectAll(_:)
|
||
/// Connects a handler to the `select-all` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `select-all` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onSelectAll(_ handler: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectSelectAll { _ in handler() })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectSelectCursorParent(_:)
|
||
/// Connects a handler to the `select-cursor-parent` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `select-cursor-parent` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onSelectCursorParent(_ handler: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectSelectCursorParent { _ in handler() })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectSelectCursorRow(_:)
|
||
/// Connects a handler to the `select-cursor-row` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `select-cursor-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onSelectCursorRow(_ handler: @escaping (Bool) -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectSelectCursorRow { _, a0 in handler(a0) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectStartInteractiveSearch(_:)
|
||
/// Connects a handler to the `start-interactive-search` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `start-interactive-search` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onStartInteractiveSearch(_ handler: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectStartInteractiveSearch { _ in handler() })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectTestCollapseRow(_:)
|
||
/// The given row is about to be collapsed (hide its children nodes). Use this
|
||
/// signal if you need to control the collapsibility of individual rows.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `test-collapse-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onTestCollapseRow(_ handler: @escaping (Gtk.TreeIter, Gtk.TreePath) -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectTestCollapseRow { _, a0, a1 in handler(a0, a1) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectTestExpandRow(_:)
|
||
/// The given row is about to be expanded (show its children nodes). Use this
|
||
/// signal if you need to control the expandability of individual rows.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `test-expand-row` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onTestExpandRow(_ handler: @escaping (Gtk.TreeIter, Gtk.TreePath) -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectTestExpandRow { _, a0, a1 in handler(a0, a1) })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectToggleCursorRow(_:)
|
||
/// Connects a handler to the `toggle-cursor-row` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `toggle-cursor-row` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onToggleCursorRow(_ handler: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectToggleCursorRow { _ in handler() })
|
||
}
|
||
}
|
||
|
||
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.TreeView.connectUnselectAll(_:)
|
||
/// Connects a handler to the `unselect-all` signal.
|
||
///
|
||
/// - Parameter handler: Invoked when the widget emits the `unselect-all` signal. Its return value is forwarded to GTK as the signal's result.
|
||
/// - Returns: A copy of this view with the modifier applied.
|
||
public func onUnselectAll(_ handler: @escaping () -> Bool) -> Self {
|
||
appending { w, ctx in
|
||
ctx.registry.add(w.connectUnselectAll { _ in handler() })
|
||
}
|
||
}
|
||
|
||
}
|