Skip to main content

Interface: TreeViewProps

Defined in: react/src/generated/jsx.ts:6118

Props for the TreeView widget.

Extends

Properties

activateOnSingleClick?

optional activateOnSingleClick: boolean

Defined in: react/src/generated/jsx.ts:6123

The activate-on-single-click property specifies whether the "row-activated" signal will be emitted after a single click.


canFocus?

optional canFocus: boolean

Defined in: react/src/generated/jsx.ts:412

Whether the widget or any of its descendents can accept the input focus.

This property is meant to be set by widget implementations, typically in their instance init function.

Inherited from

WidgetProps.canFocus


canTarget?

optional canTarget: boolean

Defined in: react/src/generated/jsx.ts:414

Whether the widget can receive pointer events.

Inherited from

WidgetProps.canTarget


children?

optional children: ReactNode

Defined in: react/src/generated/jsx.ts:688

Inherited from

WidgetProps.children


cssClasses?

optional cssClasses: string[]

Defined in: react/src/generated/jsx.ts:416

A list of css classes applied to this widget.

Inherited from

WidgetProps.cssClasses


cssName?

optional cssName: string

Defined in: react/src/generated/jsx.ts:423

The name of this widget in the CSS tree.

This property is meant to be set by widget implementations, typically in their instance init function.

Inherited from

WidgetProps.cssName


cursor?

optional cursor: number

Defined in: react/src/generated/jsx.ts:425

The cursor used by @widget.

Inherited from

WidgetProps.cursor


enableGridLines?

optional enableGridLines: TreeViewGridLines

Defined in: react/src/generated/jsx.ts:6124


enableSearch?

optional enableSearch: boolean

Defined in: react/src/generated/jsx.ts:6125


enableTreeLines?

optional enableTreeLines: boolean

Defined in: react/src/generated/jsx.ts:6126


expanderColumn?

optional expanderColumn: TreeViewColumn

Defined in: react/src/generated/jsx.ts:6127


fixedHeightMode?

optional fixedHeightMode: boolean

Defined in: react/src/generated/jsx.ts:6135

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.


focusable?

optional focusable: boolean

Defined in: react/src/generated/jsx.ts:433

Whether this widget itself will accept the input focus.

Inherited from

WidgetProps.focusable


focusOnClick?

optional focusOnClick: boolean

Defined in: react/src/generated/jsx.ts:431

Whether the widget should grab focus when it is clicked with the mouse.

This property is only relevant for widgets that can take focus.

Inherited from

WidgetProps.focusOnClick


hadjustment?

optional hadjustment: Adjustment

Defined in: react/src/generated/jsx.ts:6171

Horizontal GtkAdjustment of the scrollable widget.

This adjustment is shared between the scrollable widget and its parent.


halign?

optional halign: Align

Defined in: react/src/generated/jsx.ts:435

How to distribute horizontal space if widget gets extra space.

Inherited from

WidgetProps.halign


hasDefault?

optional hasDefault: boolean

Defined in: react/src/generated/jsx.ts:437

Whether the widget is the default widget.

Inherited from

WidgetProps.hasDefault


hasFocus?

optional hasFocus: boolean

Defined in: react/src/generated/jsx.ts:439

Whether the widget has the input focus.

Inherited from

WidgetProps.hasFocus


hasTooltip?

optional hasTooltip: boolean

Defined in: react/src/generated/jsx.ts:448

Enables or disables the emission of the [signal@Gtk.Widget::query-tooltip] signal on @widget.

A true value indicates that widget can have a tooltip, in this case the widget will be queried using [signal@Gtk.Widget::query-tooltip] to determine whether it will provide a tooltip or not.

Inherited from

WidgetProps.hasTooltip


headersClickable?

optional headersClickable: boolean

Defined in: react/src/generated/jsx.ts:6136


headersVisible?

optional headersVisible: boolean

Defined in: react/src/generated/jsx.ts:6137


heightRequest?

optional heightRequest: number

Defined in: react/src/generated/jsx.ts:454

Overrides for height request of the widget.

If this is -1, the natural request will be used.

Inherited from

WidgetProps.heightRequest


hexpand?

optional hexpand: boolean

Defined in: react/src/generated/jsx.ts:456

Whether to expand horizontally.

Inherited from

WidgetProps.hexpand


hexpandSet?

optional hexpandSet: boolean

Defined in: react/src/generated/jsx.ts:458

Whether to use the hexpand property.

Inherited from

WidgetProps.hexpandSet


hoverExpand?

optional hoverExpand: boolean

Defined in: react/src/generated/jsx.ts:6146

Enables or disables the hover expansion mode of @tree_view. Hover expansion makes rows expand or collapse if the pointer moves over them.

This mode is primarily intended for treeviews in popups, e.g. in GtkComboBox or GtkEntryCompletion.


hoverSelection?

optional hoverSelection: boolean

Defined in: react/src/generated/jsx.ts:6156

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.

This mode is primarily intended for treeviews in popups, e.g. in GtkComboBox or GtkEntryCompletion.


hscrollPolicy?

optional hscrollPolicy: ScrollablePolicy

Defined in: react/src/generated/jsx.ts:6173

Determines when horizontal scrolling should start.


layoutManager?

optional layoutManager: LayoutManager

Defined in: react/src/generated/jsx.ts:466

The [class@Gtk.LayoutManager] instance to use to compute the preferred size of the widget, and allocate its children.

This property is meant to be set by widget implementations, typically in their instance init function.

Inherited from

WidgetProps.layoutManager


levelIndentation?

optional levelIndentation: number

Defined in: react/src/generated/jsx.ts:6158

Extra indentation for each level.


limitEvents?

optional limitEvents: boolean

Defined in: react/src/generated/jsx.ts:475

Makes this widget act like a modal dialog, with respect to event delivery.

Global event controllers will not handle events with targets inside the widget, unless they are set up to ignore propagation limits. See [method@Gtk.EventController.set_propagation_limit].

Inherited from

WidgetProps.limitEvents


marginBottom?

optional marginBottom: number

Defined in: react/src/generated/jsx.ts:483

Margin on bottom side of widget.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

Inherited from

WidgetProps.marginBottom


marginEnd?

optional marginEnd: number

Defined in: react/src/generated/jsx.ts:494

Margin on end of widget, horizontally.

This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

Inherited from

WidgetProps.marginEnd


marginStart?

optional marginStart: number

Defined in: react/src/generated/jsx.ts:505

Margin on start of widget, horizontally.

This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

Inherited from

WidgetProps.marginStart


marginTop?

optional marginTop: number

Defined in: react/src/generated/jsx.ts:513

Margin on top side of widget.

This property adds margin outside of the widget's normal size request, the margin will be added in addition to the size from [method@Gtk.Widget.set_size_request] for example.

Inherited from

WidgetProps.marginTop


model?

optional model: TreeModel

Defined in: react/src/generated/jsx.ts:6159


name?

optional name: string

Defined in: react/src/generated/jsx.ts:515

The name of the widget.

Inherited from

WidgetProps.name


onColumnsChanged()?

optional onColumnsChanged: (self) => void

Defined in: react/src/generated/jsx.ts:6184

The number of columns of the treeview has changed.

Parameters

ParameterType
selfTreeView

Returns

void


onCursorChanged()?

optional onCursorChanged: (self) => void

Defined in: react/src/generated/jsx.ts:6186

The position of the cursor (focused cell) has changed.

Parameters

ParameterType
selfTreeView

Returns

void


onDestroy()?

optional onDestroy: (self) => void

Defined in: react/src/generated/jsx.ts:593

Signals that all holders of a reference to the widget should release the reference that they hold.

May result in finalization of the widget if all references are released.

This signal is not suitable for saving widget state.

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onDestroy


onDirectionChanged()?

optional onDirectionChanged: (self, previousDirection) => void

Defined in: react/src/generated/jsx.ts:595

Emitted when the text direction of a widget changes.

Parameters

ParameterType
selfWidget
previousDirectionTextDirection

Returns

void

Inherited from

WidgetProps.onDirectionChanged


onExpandCollapseCursorRow()?

optional onExpandCollapseCursorRow: (self, object, p0, p1) => boolean

Defined in: react/src/generated/jsx.ts:6187

Parameters

ParameterType
selfTreeView
objectboolean
p0boolean
p1boolean

Returns

boolean


onHide()?

optional onHide: (self) => void

Defined in: react/src/generated/jsx.ts:600

Emitted when widget is hidden.

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onHide


onKeynavFailed()?

optional onKeynavFailed: (self, direction) => boolean

Defined in: react/src/generated/jsx.ts:606

Emitted if keyboard navigation fails.

See [method@Gtk.Widget.keynav_failed] for details.

Parameters

ParameterType
selfWidget
directionDirectionType

Returns

boolean

Inherited from

WidgetProps.onKeynavFailed


onMap()?

optional onMap: (self) => void

Defined in: react/src/generated/jsx.ts:618

Emitted when widget is going to be mapped.

A widget is mapped when the widget is visible (which is controlled with [property@Gtk.Widget:visible]) and all its parents up to the toplevel widget are also visible.

The ::map signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of [signal@Gtk.Widget::unmap].

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onMap


onMnemonicActivate()?

optional onMnemonicActivate: (self, groupCycling) => boolean

Defined in: react/src/generated/jsx.ts:624

Emitted when a widget is activated via a mnemonic.

The default handler for this signal activates widget if group_cycling is false, or just makes widget grab focus if group_cycling is true.

Parameters

ParameterType
selfWidget
groupCyclingboolean

Returns

boolean

Inherited from

WidgetProps.onMnemonicActivate


onMoveCursor()?

optional onMoveCursor: (self, step, direction, extend, modify) => boolean

Defined in: react/src/generated/jsx.ts:6204

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.

Parameters

ParameterType
selfTreeView
stepMovementStep
directionnumber
extendboolean
modifyboolean

Returns

boolean


onMoveFocus()?

optional onMoveFocus: (self, direction) => void

Defined in: react/src/generated/jsx.ts:633

Emitted when the focus is moved.

The ::move-focus signal is a keybinding signal.

The default bindings for this signal are Tab to move forward, and Shift+Tab to move backward.

Parameters

ParameterType
selfWidget
directionDirectionType

Returns

void

Inherited from

WidgetProps.onMoveFocus


onQueryTooltip()?

optional onQueryTooltip: (self, x, y, keyboardMode, tooltip) => boolean

Defined in: react/src/generated/jsx.ts:648

Emitted when the widget’s tooltip is about to be shown.

This happens when the [property@Gtk.Widget:has-tooltip] property is true and the hover timeout has expired with the cursor hovering above @widget; or emitted when widget got focus in keyboard mode.

Using the given coordinates, the signal handler should determine whether a tooltip should be shown for @widget. If this is the case true should be returned, false otherwise. Note that if keyboard_mode is true, the values of x and y are undefined and should not be used.

The signal handler is free to manipulate tooltip with the therefore destined function calls.

Parameters

ParameterType
selfWidget
xnumber
ynumber
keyboardModeboolean
tooltipTooltip

Returns

boolean

Inherited from

WidgetProps.onQueryTooltip


onRealize()?

optional onRealize: (self) => void

Defined in: react/src/generated/jsx.ts:661

Emitted when widget is associated with a GdkSurface.

This means that [method@Gtk.Widget.realize] has been called or the widget has been mapped (that is, it is going to be drawn).

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onRealize


onRowActivated()?

optional onRowActivated: (self, path, column) => void

Defined in: react/src/generated/jsx.ts:6227

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: Space, Shift+Space, Return or Enter is pressed.

For selection handling refer to the tree widget conceptual overview as well as GtkTreeSelection.

Parameters

ParameterType
selfTreeView
pathTreePath
columnTreeViewColumn

Returns

void


onRowCollapsed()?

optional onRowCollapsed: (self, iter, path) => void

Defined in: react/src/generated/jsx.ts:6233

The given row has been collapsed (child nodes are hidden).

Parameters

ParameterType
selfTreeView
iterTreeIter
pathTreePath

Returns

void


onRowExpanded()?

optional onRowExpanded: (self, iter, path) => void

Defined in: react/src/generated/jsx.ts:6239

The given row has been expanded (child nodes are shown).

Parameters

ParameterType
selfTreeView
iterTreeIter
pathTreePath

Returns

void


onSelectAll()?

optional onSelectAll: (self) => boolean

Defined in: react/src/generated/jsx.ts:6244

Parameters

ParameterType
selfTreeView

Returns

boolean


onSelectCursorParent()?

optional onSelectCursorParent: (self) => boolean

Defined in: react/src/generated/jsx.ts:6245

Parameters

ParameterType
selfTreeView

Returns

boolean


onSelectCursorRow()?

optional onSelectCursorRow: (self, object) => boolean

Defined in: react/src/generated/jsx.ts:6246

Parameters

ParameterType
selfTreeView
objectboolean

Returns

boolean


onShow()?

optional onShow: (self) => void

Defined in: react/src/generated/jsx.ts:663

Emitted when widget is shown.

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onShow


onStartInteractiveSearch()?

optional onStartInteractiveSearch: (self) => boolean

Defined in: react/src/generated/jsx.ts:6247

Parameters

ParameterType
selfTreeView

Returns

boolean


onStateFlagsChanged()?

optional onStateFlagsChanged: (self, flags) => void

Defined in: react/src/generated/jsx.ts:669

Emitted when the widget state changes.

See [method@Gtk.Widget.get_state_flags].

Parameters

ParameterType
selfWidget
flagsStateFlags

Returns

void

Inherited from

WidgetProps.onStateFlagsChanged


onTestCollapseRow()?

optional onTestCollapseRow: (self, iter, path) => boolean

Defined in: react/src/generated/jsx.ts:6252

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.

Parameters

ParameterType
selfTreeView
iterTreeIter
pathTreePath

Returns

boolean


onTestExpandRow()?

optional onTestExpandRow: (self, iter, path) => boolean

Defined in: react/src/generated/jsx.ts:6261

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.

Parameters

ParameterType
selfTreeView
iterTreeIter
pathTreePath

Returns

boolean


onToggleCursorRow()?

optional onToggleCursorRow: (self) => boolean

Defined in: react/src/generated/jsx.ts:6266

Parameters

ParameterType
selfTreeView

Returns

boolean


onUnmap()?

optional onUnmap: (self) => void

Defined in: react/src/generated/jsx.ts:679

Emitted when widget is going to be unmapped.

A widget is unmapped when either it or any of its parents up to the toplevel widget have been set as hidden.

As ::unmap indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onUnmap


onUnrealize()?

optional onUnrealize: (self) => void

Defined in: react/src/generated/jsx.ts:686

Emitted when the GdkSurface associated with widget is destroyed.

This means that [method@Gtk.Widget.unrealize] has been called or the widget has been unmapped (that is, it is going to be hidden).

Parameters

ParameterType
selfWidget

Returns

void

Inherited from

WidgetProps.onUnrealize


onUnselectAll()?

optional onUnselectAll: (self) => boolean

Defined in: react/src/generated/jsx.ts:6267

Parameters

ParameterType
selfTreeView

Returns

boolean


opacity?

optional opacity: number

Defined in: react/src/generated/jsx.ts:517

The requested opacity of the widget.

Inherited from

WidgetProps.opacity


overflow?

optional overflow: Overflow

Defined in: react/src/generated/jsx.ts:524

How content outside the widget's content area is treated.

This property is meant to be set by widget implementations, typically in their instance init function.

Inherited from

WidgetProps.overflow


parent?

optional parent: Widget

Defined in: react/src/generated/jsx.ts:526

The parent widget of this widget.

Inherited from

WidgetProps.parent


receivesDefault?

optional receivesDefault: boolean

Defined in: react/src/generated/jsx.ts:528

Whether the widget will receive the default action when it is focused.

Inherited from

WidgetProps.receivesDefault


ref?

optional ref: Ref<TreeView>

Defined in: react/src/generated/jsx.ts:6269


reorderable?

optional reorderable: boolean

Defined in: react/src/generated/jsx.ts:6160


root?

optional root: Root

Defined in: react/src/generated/jsx.ts:534

The GtkRoot widget of the widget tree containing this widget.

This will be NULL if the widget is not contained in a root widget.

Inherited from

WidgetProps.root


rubberBanding?

optional rubberBanding: boolean

Defined in: react/src/generated/jsx.ts:6161


scaleFactor?

optional scaleFactor: number

Defined in: react/src/generated/jsx.ts:536

The scale factor of the widget.

Inherited from

WidgetProps.scaleFactor


searchColumn?

optional searchColumn: number

Defined in: react/src/generated/jsx.ts:6162


sensitive?

optional sensitive: boolean

Defined in: react/src/generated/jsx.ts:538

Whether the widget responds to input.

Inherited from

WidgetProps.sensitive


showExpanders?

optional showExpanders: boolean

Defined in: react/src/generated/jsx.ts:6164

%TRUE if the view has expanders.


tooltipColumn?

optional tooltipColumn: number

Defined in: react/src/generated/jsx.ts:6165


tooltipMarkup?

optional tooltipMarkup: string

Defined in: react/src/generated/jsx.ts:554

Sets the text of tooltip to be the given string, which is marked up with Pango markup.

Also see [method@Gtk.Tooltip.set_markup].

This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL: [property@Gtk.Widget:has-tooltip] will automatically be set to true and there will be taken care of [signal@Gtk.Widget::query-tooltip] in the default signal handler.

Note that if both [property@Gtk.Widget:tooltip-text] and [property@Gtk.Widget:tooltip-markup] are set, the last one wins.

Inherited from

WidgetProps.tooltipMarkup


tooltipText?

optional tooltipText: string

Defined in: react/src/generated/jsx.ts:569

Sets the text of tooltip to be the given string.

Also see [method@Gtk.Tooltip.set_text].

This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL: [property@Gtk.Widget:has-tooltip] will automatically be set to true and there will be taken care of [signal@Gtk.Widget::query-tooltip] in the default signal handler.

Note that if both [property@Gtk.Widget:tooltip-text] and [property@Gtk.Widget:tooltip-markup] are set, the last one wins.

Inherited from

WidgetProps.tooltipText


vadjustment?

optional vadjustment: Adjustment

Defined in: react/src/generated/jsx.ts:6179

Vertical GtkAdjustment of the scrollable widget.

This adjustment is shared between the scrollable widget and its parent.


valign?

optional valign: Align

Defined in: react/src/generated/jsx.ts:571

How to distribute vertical space if widget gets extra space.

Inherited from

WidgetProps.valign


vexpand?

optional vexpand: boolean

Defined in: react/src/generated/jsx.ts:573

Whether to expand vertically.

Inherited from

WidgetProps.vexpand


vexpandSet?

optional vexpandSet: boolean

Defined in: react/src/generated/jsx.ts:575

Whether to use the vexpand property.

Inherited from

WidgetProps.vexpandSet


visible?

optional visible: boolean

Defined in: react/src/generated/jsx.ts:577

Whether the widget is visible.

Inherited from

WidgetProps.visible


vscrollPolicy?

optional vscrollPolicy: ScrollablePolicy

Defined in: react/src/generated/jsx.ts:6181

Determines when vertical scrolling should start.


widthRequest?

optional widthRequest: number

Defined in: react/src/generated/jsx.ts:583

Overrides for width request of the widget.

If this is -1, the natural request will be used.

Inherited from

WidgetProps.widthRequest