Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TreeViewColumn

[21:7] extends: object

A visible column in a [class@Gtk.TreeView] widget The GtkTreeViewColumn object represents a visible column in a GtkTreeView widget. It allows to set properties of the column header, and functions as a holding pen for the cell renderers which determine how the data in the column is displayed. Please refer to the tree widget conceptual overview for an overview of all the objects and data types related to the tree widget and how they work together, and to the [class@Gtk.TreeView] documentation for specifics about the CSS node structure for treeviews and their headers.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • TreeViewColumn (area = null)

    Creates a new GtkTreeViewColumn.

    • @p area is the GtkCellArea that the newly created column should use to layout cells..
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asInitiallyUnowned ()

    Wraps this handle as InitiallyUnowned.

    • @r A InitiallyUnowned object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asCellLayout ()

    Wraps this handle as CellLayout.

    • @r A CellLayout object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnClicked (callback Fn, UserData = null)

    Emitted when the column's header has been clicked.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TreeViewColumn Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setAlignment (double Value)

    Writes the alignment property.

    • @p Value is the new property value.
    • @r None.
  • setClickable (bool Value)

    Writes the clickable property.

    • @p Value is the new property value.
    • @r None.
  • setExpand (bool Value)

    Writes the expand property.

    • @p Value is the new property value.
    • @r None.
  • setFixedwidth (int Value)

    Writes the fixed-width property.

    • @p Value is the new property value.
    • @r None.
  • setMaxwidth (int Value)

    Writes the max-width property.

    • @p Value is the new property value.
    • @r None.
  • setMinwidth (int Value)

    Writes the min-width property.

    • @p Value is the new property value.
    • @r None.
  • setReorderable (bool Value)

    Writes the reorderable property.

    • @p Value is the new property value.
    • @r None.
  • setResizable (bool Value)

    Writes the resizable property.

    • @p Value is the new property value.
    • @r None.
  • setSizing (string Value)

    Writes the sizing property.

    • @p Value is the new property value.
    • @r None.
  • setSortcolumnid (int Value)

    Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header clickable. Set to -1 to make the column unsortable.

    • @p Value is the new property value.
    • @r None.
  • setSortindicator (bool Value)

    Writes the sort-indicator property.

    • @p Value is the new property value.
    • @r None.
  • setSortorder (string Value)

    Writes the sort-order property.

    • @p Value is the new property value.
    • @r None.
  • setSpacing (int Value)

    Writes the spacing property.

    • @p Value is the new property value.
    • @r None.
  • setTitle (string Value)

    Writes the title property.

    • @p Value is the new property value.
    • @r None.
  • setVisible (bool Value)

    Writes the visible property.

    • @p Value is the new property value.
    • @r None.
  • setWidget (object Value)

    Writes the widget property.

    • @p Value is the new property value.
    • @r None.
  • add_attribute (object cell_renderer, string attribute, int column)

    Adds an attribute mapping to the list in @tree_column. The @column is the column of the model to get a value from, and the @attribute is the parameter on @cell_renderer to be set from the value. So for example if column 2 of the model contains strings, you could have the “text” attribute of a GtkCellRendererText get its values from column 2.

    • @p cell_renderer is the GtkCellRenderer to set attributes on.
    • @p attribute is An attribute on the renderer.
    • @p column is The column position on the model to get the attribute from..
    • @r None.
  • cell_is_visible ()

    Returns %TRUE if any of the cells packed into the @tree_column are visible. For this to be meaningful, you must first initialize the cells with gtk_tree_view_column_cell_set_cell_data()

  • cell_set_cell_data (object tree_model, iter, bool is_expander, bool is_expanded)

    Sets the cell renderer based on the @tree_model and @iter. That is, for every attribute mapping in @tree_column, it will get a value from the set column on the @iter, and use that value to set the attribute on the cell renderer. This is used primarily by the GtkTreeView.

    • @p tree_model is The GtkTreeModel to get the cell renderers attributes from..
    • @p iter is The GtkTreeIter to get the cell renderer’s attributes from..
    • @p is_expander is %TRUE, if the row has children.
    • @p is_expanded is %TRUE, if the row has visible children.
    • @r None.
  • clear ()

    Unsets all the mappings on all renderers on the @tree_column.

    • @r None.
  • clear_attributes (object cell_renderer)

    Clears all existing attributes previously set with gtk_tree_view_column_set_attributes().

    • @p cell_renderer is a GtkCellRenderer to clear the attribute mapping on..
    • @r None.
  • clicked ()

    Emits the “clicked” signal on the column. This function will only work if

    • @tree_column is clickable.
    • @r None.
  • focus_cell (object cell)

    Sets the current keyboard focus to be at @cell, if the column contains 2 or more editable and activatable cells.

    • @p cell is A GtkCellRenderer.
    • @r None.
  • get_alignment ()

    Returns the current x alignment of @tree_column. This value can range between 0.0 and 1.0.

  • get_button ()

    Returns the button used in the treeview column header

  • get_clickable ()

    Returns %TRUE if the user can click on the header for the column.

  • get_expand ()

    Returns %TRUE if the column expands to fill available space.

  • get_fixed_width ()

    Gets the fixed width of the column. This may not be the actual displayed width of the column; for that, use gtk_tree_view_column_get_width().

  • get_max_width ()

    Returns the maximum width in pixels of the @tree_column, or -1 if no maximum width is set.

  • get_min_width ()

    Returns the minimum width in pixels of the @tree_column, or -1 if no minimum width is set.

  • get_reorderable ()

    Returns %TRUE if the @tree_column can be reordered by the user.

  • get_resizable ()

    Returns %TRUE if the @tree_column can be resized by the end user.

  • get_sizing ()

    Returns the current type of @tree_column.

  • get_sort_column_id ()

    Gets the logical @sort_column_id that the model sorts on when this column is selected for sorting. See [method@Gtk.TreeViewColumn.set_sort_column_id].

  • get_sort_indicator ()

    Gets the value set by gtk_tree_view_column_set_sort_indicator().

  • get_sort_order ()

    Gets the value set by gtk_tree_view_column_set_sort_order().

  • get_spacing ()

    Returns the spacing of @tree_column.

  • get_title ()

    Returns the title of the widget.

  • get_tree_view ()

    Returns the GtkTreeView wherein @tree_column has been inserted. If

    • @column is currently not inserted in any tree view, %NULL is returned.
  • get_visible ()

    Returns %TRUE if @tree_column is visible.

  • get_widget ()

    Returns the GtkWidget in the button on the column header. If a custom widget has not been set then %NULL is returned.

  • get_width ()

    Returns the current size of @tree_column in pixels.

  • get_x_offset ()

    Returns the current X offset of @tree_column in pixels.

  • pack_end (object cell, bool expand)

    Adds the @cell to end of the column. If @expand is %FALSE, then the @cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which @expand is %TRUE.

    • @p cell is The GtkCellRenderer.
    • @p expand is %TRUE if @cell is to be given extra space allocated to
    • @tree_column.. ``
    • @r None.
  • pack_start (object cell, bool expand)

    Packs the @cell into the beginning of the column. If @expand is %FALSE, then the @cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which @expand is %TRUE.

    • @p cell is The GtkCellRenderer.
    • @p expand is %TRUE if @cell is to be given extra space allocated to
    • @tree_column.. ``
    • @r None.
  • queue_resize ()

    Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.

    • @r None.
  • set_alignment (double xalign)

    Sets the alignment of the title or custom widget inside the column header. The alignment determines its location inside the button -- 0.0 for left, 0.5 for center, 1.0 for right.

    • @p xalign is The alignment, which is between [0.0 and 1.0] inclusive..
    • @r None.
  • set_clickable (bool clickable)

    Sets the header to be active if @clickable is %TRUE. When the header is active, then it can take keyboard focus, and can be clicked.

    • @p clickable is %TRUE if the header is active..
    • @r None.
  • set_expand (bool expand)

    Sets the column to take available extra space. This space is shared equally amongst all columns that have the expand set to %TRUE. If no column has this option set, then the last column gets all extra space. By default, every column is created with this %FALSE. Along with “fixed-width”, the “expand” property changes when the column is resized by the user.

    • @p expand is %TRUE if the column should expand to fill available space..
    • @r None.
  • set_fixed_width (int fixed_width)

    If @fixed_width is not -1, sets the fixed width of @tree_column; otherwise unsets it. The effective value of @fixed_width is clamped between the minimum and maximum width of the column; however, the value stored in the “fixed-width” property is not clamped. If the column sizing is %GTK_TREE_VIEW_COLUMN_GROW_ONLY or %GTK_TREE_VIEW_COLUMN_AUTOSIZE, setting a fixed width overrides the automatically calculated width. Note that @fixed_width is only a hint to GTK; the width actually allocated to the column may be greater or less than requested. Along with “expand”, the “fixed-width” property changes when the column is resized by the user.

    • @p fixed_width is The new fixed width, in pixels, or -1..
    • @r None.
  • set_max_width (int max_width)

    Sets the maximum width of the @tree_column. If @max_width is -1, then the maximum width is unset. Note, the column can actually be wider than max width if it’s the last column in a view. In this case, the column expands to fill any extra space.

    • @p max_width is The maximum width of the column in pixels, or -1..
    • @r None.
  • set_min_width (int min_width)

    Sets the minimum width of the @tree_column. If @min_width is -1, then the minimum width is unset.

    • @p min_width is The minimum width of the column in pixels, or -1..
    • @r None.
  • set_reorderable (bool reorderable)

    If @reorderable is %TRUE, then the column can be reordered by the end user dragging the header.

    • @p reorderable is %TRUE, if the column can be reordered..
    • @r None.
  • set_resizable (bool resizable)

    If @resizable is %TRUE, then the user can explicitly resize the column by grabbing the outer edge of the column button. If resizable is %TRUE and sizing mode of the column is %GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing mode is changed to %GTK_TREE_VIEW_COLUMN_GROW_ONLY.

    • @p resizable is %TRUE, if the column can be resized.
    • @r None.
  • set_sizing (string type)

    Sets the growth behavior of @tree_column to @type.

    • @p type is The GtkTreeViewColumnSizing..
    • @r None.
  • set_sort_column_id (int sort_column_id)

    Sets the logical @sort_column_id that this column sorts on when this column is selected for sorting. Doing so makes the column header clickable.

    • @p sort_column_id is The @sort_column_id of the model to sort on..
    • @r None.
  • set_sort_indicator (bool setting)

    Call this function with a @setting of %TRUE to display an arrow in the header button indicating the column is sorted. Call gtk_tree_view_column_set_sort_order() to change the direction of the arrow.

    • @p setting is %TRUE to display an indicator that the column is sorted.
    • @r None.
  • set_sort_order (string order)

    Changes the appearance of the sort indicator. This does not actually sort the model. Use gtk_tree_view_column_set_sort_column_id() if you want automatic sorting support. This function is primarily for custom sorting behavior, and should be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do that. For custom models, the mechanism will vary. The sort indicator changes direction to indicate normal sort or reverse sort. Note that you must have the sort indicator enabled to see anything when calling this function; see gtk_tree_view_column_set_sort_indicator().

    • @p order is sort order that the sort indicator should indicate.
    • @r None.
  • set_spacing (int spacing)

    Sets the spacing field of @tree_column, which is the number of pixels to place between cell renderers packed into it.

    • @p spacing is distance between cell renderers in pixels..
    • @r None.
  • set_title (string title)

    Sets the title of the @tree_column. If a custom widget has been set, then this value is ignored.

    • @p title is The title of the @tree_column..
    • @r None.
  • set_visible (bool visible)

    Sets the visibility of @tree_column.

    • @p visible is %TRUE if the @tree_column is visible..
    • @r None.
  • set_widget (object widget)

    Sets the widget in the header to be @widget. If widget is %NULL, then the header button is set with a GtkLabel set to the title of @tree_column.

    • @p widget is A child GtkWidget.
    • @r None.

class: TreeViewColumnMeta

[1027:14] static extends: object

Generated metadata helpers for TreeViewColumn class surfaces.

Methods

  • properties ()

    Returns property metadata for TreeViewColumn.

    • @r A list.
  • signals ()

    Returns signal metadata for TreeViewColumn.

    • @r A list.

class: TreeViewColumnClickedCallback

[957:7] extends: object

Generated low-level callback wrapper for GIR callback clicked.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TreeViewColumnClickedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.