Class TreeViewColumn

All Implemented Interfaces:
Buildable, CellLayout, Proxy

@Generated("org.javagi.JavaGI") @Deprecated public class TreeViewColumn extends InitiallyUnowned implements Buildable, CellLayout
Deprecated.
Use ColumnView and ColumnViewColumn instead of TreeView to show a tabular list

A visible column in a 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 TreeView documentation for specifics about the CSS node structure for treeviews and their headers.

  • Constructor Details

    • TreeViewColumn

      public TreeViewColumn(MemorySegment address)
      Deprecated.
      Create a TreeViewColumn instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TreeViewColumn

      public TreeViewColumn()
      Deprecated.
      Create a new TreeViewColumn.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Deprecated.
      Get the GType of the TreeViewColumn class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      Deprecated.
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TreeViewColumn asParent()
      Deprecated.
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class InitiallyUnowned
      Returns:
      the instance as if it were its parent type
    • withArea

      @Deprecated public static TreeViewColumn withArea(CellArea area)
      Deprecated.
      Use GtkColumnView instead
      Creates a new GtkTreeViewColumn using area to render its cells.
      Parameters:
      area - the GtkCellArea that the newly created column should use to layout cells.
      Returns:
      A newly created GtkTreeViewColumn.
    • withAttributes

      @Deprecated public static TreeViewColumn withAttributes(String title, CellRenderer cell, Object... varargs)
      Deprecated.
      Use GtkColumnView instead

      Creates a new GtkTreeViewColumn with a number of default values. This is equivalent to calling gtk_tree_view_column_set_title(), gtk_tree_view_column_pack_start(), and gtk_tree_view_column_set_attributes() on the newly created GtkTreeViewColumn.

      Here’s a simple example:

       enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
       // ...
       {
         GtkTreeViewColumn *column;
         GtkCellRenderer   *renderer = gtk_cell_renderer_text_new ();
      
         column = gtk_tree_view_column_new_with_attributes ("Title",
                                                            renderer,
                                                            "text", TEXT_COLUMN,
                                                            "foreground", COLOR_COLUMN,
                                                            NULL);
       }
      
      Parameters:
      title - The title to set the header to
      cell - The GtkCellRenderer
      varargs - A null-terminated list of attributes
      Returns:
      A newly created GtkTreeViewColumn.
    • addAttribute

      @Deprecated public void addAttribute(CellRenderer cellRenderer, String attribute, int column)
      Deprecated.
      Use GtkColumnView instead

      Adds an attribute mapping to the list in treeColumn.

      The column is the column of the model to get a value from, and the attribute is the parameter on cellRenderer 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.

      Specified by:
      addAttribute in interface CellLayout
      Parameters:
      cellRenderer - the GtkCellRenderer to set attributes on
      attribute - An attribute on the renderer
      column - The column position on the model to get the attribute from.
    • cellGetPosition

      @Deprecated public boolean cellGetPosition(CellRenderer cellRenderer, @Nullable Out<Integer> xOffset, @Nullable Out<Integer> width)
      Deprecated.
      Use GtkColumnView instead

      Obtains the horizontal position and size of a cell in a column.

      If the cell is not found in the column, startPos and width are not changed and false is returned.

      Parameters:
      cellRenderer - a GtkCellRenderer
      xOffset - return location for the horizontal position of cell within this TreeViewColumn
      width - return location for the width of cell
      Returns:
      true if cell belongs to this TreeViewColumn
    • cellGetSize

      @Deprecated public void cellGetSize(@Nullable Out<Integer> xOffset, @Nullable Out<Integer> yOffset, @Nullable Out<Integer> width, @Nullable Out<Integer> height)
      Deprecated.
      Use GtkColumnView instead
      Obtains the width and height needed to render the column. This is used primarily by the GtkTreeView.
      Parameters:
      xOffset - location to return x offset of a cell relative to cellArea
      yOffset - location to return y offset of a cell relative to cellArea
      width - location to return width needed to render a cell
      height - location to return height needed to render a cell
    • cellIsVisible

      @Deprecated public boolean cellIsVisible()
      Deprecated.
      Use GtkColumnView instead
      Returns true if any of the cells packed into the this TreeViewColumn are visible. For this to be meaningful, you must first initialize the cells with gtk_tree_view_column_cell_set_cell_data()
      Returns:
      true, if any of the cells packed into the this TreeViewColumn are currently visible
    • cellSetCellData

      @Deprecated public void cellSetCellData(TreeModel treeModel, TreeIter iter, boolean isExpander, boolean isExpanded)
      Deprecated.
      Use GtkColumnView instead
      Sets the cell renderer based on the treeModel and iter. That is, for every attribute mapping in treeColumn, 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.
      Parameters:
      treeModel - The GtkTreeModel to get the cell renderers attributes from.
      iter - The GtkTreeIter to get the cell renderer’s attributes from.
      isExpander - true, if the row has children
      isExpanded - true, if the row has visible children
    • clear

      @Deprecated public void clear()
      Deprecated.
      Use GtkColumnView instead
      Unsets all the mappings on all renderers on the treeColumn.
      Specified by:
      clear in interface CellLayout
    • clearAttributes

      @Deprecated public void clearAttributes(CellRenderer cellRenderer)
      Deprecated.
      Use GtkColumnView instead
      Clears all existing attributes previously set with gtk_tree_view_column_set_attributes().
      Specified by:
      clearAttributes in interface CellLayout
      Parameters:
      cellRenderer - a GtkCellRenderer to clear the attribute mapping on.
    • clicked

      @Deprecated public void clicked()
      Deprecated.
      Use GtkColumnView instead
      Emits the “clicked” signal on the column. This function will only work if this TreeViewColumn is clickable.
    • focusCell

      @Deprecated public void focusCell(CellRenderer cell)
      Deprecated.
      Use GtkColumnView instead
      Sets the current keyboard focus to be at cell, if the column contains 2 or more editable and activatable cells.
      Parameters:
      cell - A GtkCellRenderer
    • getAlignment

      @Deprecated public float getAlignment()
      Deprecated.
      Use GtkColumnView instead
      Returns the current x alignment of treeColumn. This value can range between 0.0 and 1.0.
      Returns:
      The current alignent of treeColumn.
    • getButton

      @Deprecated public Widget getButton()
      Deprecated.
      Use GtkColumnView instead
      Returns the button used in the treeview column header
      Returns:
      The button for the column header.
    • getClickable

      @Deprecated public boolean getClickable()
      Deprecated.
      Use GtkColumnView instead
      Returns true if the user can click on the header for the column.
      Returns:
      true if user can click the column header.
    • getExpand

      @Deprecated public boolean getExpand()
      Deprecated.
      Use GtkColumnView instead
      Returns true if the column expands to fill available space.
      Returns:
      true if the column expands to fill available space.
    • getFixedWidth

      @Deprecated public int getFixedWidth()
      Deprecated.
      Use GtkColumnView instead
      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().
      Returns:
      The fixed width of the column.
    • getMaxWidth

      @Deprecated public int getMaxWidth()
      Deprecated.
      Use GtkColumnView instead
      Returns the maximum width in pixels of the treeColumn, or -1 if no maximum width is set.
      Returns:
      The maximum width of the treeColumn.
    • getMinWidth

      @Deprecated public int getMinWidth()
      Deprecated.
      Use GtkColumnView instead
      Returns the minimum width in pixels of the treeColumn, or -1 if no minimum width is set.
      Returns:
      The minimum width of the treeColumn.
    • getReorderable

      @Deprecated public boolean getReorderable()
      Deprecated.
      Use GtkColumnView instead
      Returns true if the this TreeViewColumn can be reordered by the user.
      Returns:
      true if the this TreeViewColumn can be reordered by the user.
    • getResizable

      @Deprecated public boolean getResizable()
      Deprecated.
      Use GtkColumnView instead
      Returns true if the this TreeViewColumn can be resized by the end user.
      Returns:
      true, if the this TreeViewColumn can be resized.
    • getSizing

      @Deprecated public TreeViewColumnSizing getSizing()
      Deprecated.
      Use GtkColumnView instead
      Returns the current type of treeColumn.
      Returns:
      The type of treeColumn.
    • getSortColumnId

      @Deprecated public int getSortColumnId()
      Deprecated.
      Use GtkColumnView instead

      Gets the logical sortColumnId that the model sorts on when this column is selected for sorting.

      See setSortColumnId(int).

      Returns:
      the current sortColumnId for this column, or -1 if this column can’t be used for sorting
    • getSortIndicator

      @Deprecated public boolean getSortIndicator()
      Deprecated.
      Use GtkColumnView instead
      Gets the value set by gtk_tree_view_column_set_sort_indicator().
      Returns:
      whether the sort indicator arrow is displayed
    • getSortOrder

      @Deprecated public SortType getSortOrder()
      Deprecated.
      Use GtkColumnView instead
      Gets the value set by gtk_tree_view_column_set_sort_order().
      Returns:
      the sort order the sort indicator is indicating
    • getSpacing

      @Deprecated public int getSpacing()
      Deprecated.
      Use GtkColumnView instead
      Returns the spacing of treeColumn.
      Returns:
      the spacing of treeColumn.
    • getTitle

      @Deprecated public String getTitle()
      Deprecated.
      Use GtkColumnView instead
      Returns the title of the widget.
      Returns:
      the title of the column. This string should not be modified or freed.
    • getTreeView

      @Deprecated public @Nullable Widget getTreeView()
      Deprecated.
      Use GtkColumnView instead
      Returns the GtkTreeView wherein this TreeViewColumn has been inserted. If column is currently not inserted in any tree view, null is returned.
      Returns:
      The tree view wherein column has been inserted
    • getVisible

      @Deprecated public boolean getVisible()
      Deprecated.
      Use GtkColumnView instead
      Returns true if this TreeViewColumn is visible.
      Returns:
      whether the column is visible or not. If it is visible, then the tree will show the column.
    • getWidget

      @Deprecated public @Nullable Widget getWidget()
      Deprecated.
      Use GtkColumnView instead

      Returns the GtkWidget in the button on the column header.

      If a custom widget has not been set then null is returned.

      Returns:
      The GtkWidget in the column header
    • getWidth

      @Deprecated public int getWidth()
      Deprecated.
      Use GtkColumnView instead
      Returns the current size of this TreeViewColumn in pixels.
      Returns:
      The current width of treeColumn.
    • getXOffset

      @Deprecated public int getXOffset()
      Deprecated.
      Use GtkColumnView instead
      Returns the current X offset of this TreeViewColumn in pixels.
      Returns:
      The current X offset of treeColumn.
    • packEnd

      @Deprecated public void packEnd(CellRenderer cell, boolean expand)
      Deprecated.
      Use GtkColumnView instead
      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.
      Specified by:
      packEnd in interface CellLayout
      Parameters:
      cell - The GtkCellRenderer
      expand - true if cell is to be given extra space allocated to treeColumn.
    • packStart

      @Deprecated public void packStart(CellRenderer cell, boolean expand)
      Deprecated.
      Use GtkColumnView instead
      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.
      Specified by:
      packStart in interface CellLayout
      Parameters:
      cell - The GtkCellRenderer
      expand - true if cell is to be given extra space allocated to treeColumn.
    • queueResize

      @Deprecated public void queueResize()
      Deprecated.
      Use GtkColumnView instead
      Flags the column, and the cell renderers added to this column, to have their sizes renegotiated.
    • setAlignment

      @Deprecated public void setAlignment(float xalign)
      Deprecated.
      Use GtkColumnView instead
      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.
      Parameters:
      xalign - The alignment, which is between [0.0 and 1.0] inclusive.
    • setAttributes

      @Deprecated public void setAttributes(CellRenderer cellRenderer, Object... varargs)
      Deprecated.
      Use GtkColumnView instead

      Sets the attributes in the list as the attributes of treeColumn.

      The attributes should be in attribute/column order, as in gtk_tree_view_column_add_attribute(). All existing attributes are removed, and replaced with the new attributes.

      Specified by:
      setAttributes in interface CellLayout
      Parameters:
      cellRenderer - the GtkCellRenderer we’re setting the attributes of
      varargs - A null-terminated list of attributes
    • setCellDataFunc

      @Deprecated public void setCellDataFunc(CellRenderer cellRenderer, @Nullable TreeCellDataFunc func)
      Deprecated.
      Use GtkColumnView instead

      Sets the GtkTreeCellDataFunc to use for the column.

      This function is used instead of the standard attributes mapping for setting the column value, and should set the value of treeColumn's cell renderer as appropriate. func may be null to remove an older one.

      Parameters:
      cellRenderer - A GtkCellRenderer
      func - The GtkTreeCellDataFunc to use.
    • setClickable

      @Deprecated public void setClickable(boolean clickable)
      Deprecated.
      Use GtkColumnView instead
      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.
      Parameters:
      clickable - true if the header is active.
    • setExpand

      @Deprecated public void setExpand(boolean expand)
      Deprecated.
      Use GtkColumnView instead

      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.

      Parameters:
      expand - true if the column should expand to fill available space.
    • setFixedWidth

      @Deprecated public void setFixedWidth(int fixedWidth)
      Deprecated.
      Use GtkColumnView instead

      If fixedWidth is not -1, sets the fixed width of treeColumn; otherwise unsets it. The effective value of fixedWidth 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 TreeViewColumnSizing.GROW_ONLY or TreeViewColumnSizing.AUTOSIZE, setting a fixed width overrides the automatically calculated width. Note that fixedWidth 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.

      Parameters:
      fixedWidth - The new fixed width, in pixels, or -1.
    • setMaxWidth

      @Deprecated public void setMaxWidth(int maxWidth)
      Deprecated.
      Use GtkColumnView instead
      Sets the maximum width of the treeColumn. If maxWidth 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.
      Parameters:
      maxWidth - The maximum width of the column in pixels, or -1.
    • setMinWidth

      @Deprecated public void setMinWidth(int minWidth)
      Deprecated.
      Use GtkColumnView instead
      Sets the minimum width of the treeColumn. If minWidth is -1, then the minimum width is unset.
      Parameters:
      minWidth - The minimum width of the column in pixels, or -1.
    • setReorderable

      @Deprecated public void setReorderable(boolean reorderable)
      Deprecated.
      Use GtkColumnView instead
      If reorderable is true, then the column can be reordered by the end user dragging the header.
      Parameters:
      reorderable - true, if the column can be reordered.
    • setResizable

      @Deprecated public void setResizable(boolean resizable)
      Deprecated.
      Use GtkColumnView instead

      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 TreeViewColumnSizing.AUTOSIZE, then the sizing mode is changed to TreeViewColumnSizing.GROW_ONLY.

      Parameters:
      resizable - true, if the column can be resized
    • setSizing

      @Deprecated public void setSizing(TreeViewColumnSizing type)
      Deprecated.
      Use GtkColumnView instead
      Sets the growth behavior of this TreeViewColumn to type.
      Parameters:
      type - The GtkTreeViewColumnSizing.
    • setSortColumnId

      @Deprecated public void setSortColumnId(int sortColumnId)
      Deprecated.
      Use GtkColumnView instead
      Sets the logical sortColumnId that this column sorts on when this column is selected for sorting. Doing so makes the column header clickable.
      Parameters:
      sortColumnId - The sortColumnId of the model to sort on.
    • setSortIndicator

      @Deprecated public void setSortIndicator(boolean setting)
      Deprecated.
      Use GtkColumnView instead
      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.
      Parameters:
      setting - true to display an indicator that the column is sorted
    • setSortOrder

      @Deprecated public void setSortOrder(SortType order)
      Deprecated.
      Use GtkColumnView instead

      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().

      Parameters:
      order - sort order that the sort indicator should indicate
    • setSpacing

      @Deprecated public void setSpacing(int spacing)
      Deprecated.
      Use GtkColumnView instead
      Sets the spacing field of treeColumn, which is the number of pixels to place between cell renderers packed into it.
      Parameters:
      spacing - distance between cell renderers in pixels.
    • setTitle

      @Deprecated public void setTitle(String title)
      Deprecated.
      Use GtkColumnView instead
      Sets the title of the treeColumn. If a custom widget has been set, then this value is ignored.
      Parameters:
      title - The title of the treeColumn.
    • setVisible

      @Deprecated public void setVisible(boolean visible)
      Deprecated.
      Use GtkColumnView instead
      Sets the visibility of treeColumn.
      Parameters:
      visible - true if the this TreeViewColumn is visible.
    • setWidget

      @Deprecated public void setWidget(@Nullable Widget widget)
      Deprecated.
      Use GtkColumnView instead
      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 treeColumn.
      Parameters:
      widget - A child GtkWidget
    • onClicked

      Deprecated.
      Emitted when the column's header has been clicked.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitClicked

      public void emitClicked()
      Deprecated.
      Emits the "clicked" signal. See onClicked(TreeViewColumn.ClickedCallback).
    • builder

      public static TreeViewColumn.Builder<? extends TreeViewColumn.Builder> builder()
      Deprecated.
      A TreeViewColumn.Builder object constructs a TreeViewColumn with the specified properties. Use the various set...() methods to set properties, and finish construction with TreeViewColumn.Builder.build().
      Returns:
      the builder object