Class TreeViewColumn
- All Implemented Interfaces:
Proxy
,Buildable
,CellLayout
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TreeViewColumn.Builder<B extends TreeViewColumn.Builder<B>>
Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static interface
Deprecated.Functional interface declaration of theClickedCallback
callback.Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.CellLayout
CellLayout.CellLayoutIface, CellLayout.CellLayoutImpl
-
Constructor Summary
ConstructorDescriptionDeprecated.Use GtkColumnView insteadTreeViewColumn
(MemorySegment address) Deprecated.Create a TreeViewColumn proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(CellRenderer cellRenderer, String attribute, int column) Deprecated.Use GtkColumnView insteadprotected TreeViewColumn
asParent()
Deprecated.Returns this instance as if it were its parent type.static TreeViewColumn.Builder
<? extends TreeViewColumn.Builder> builder()
Deprecated.ATreeViewColumn.Builder
object constructs aTreeViewColumn
with the specified properties.boolean
cellGetPosition
(CellRenderer cellRenderer, @Nullable Out<Integer> xOffset, @Nullable Out<Integer> width) Deprecated.Use GtkColumnView insteadvoid
cellGetSize
(@Nullable Out<Integer> xOffset, @Nullable Out<Integer> yOffset, @Nullable Out<Integer> width, @Nullable Out<Integer> height) Deprecated.Use GtkColumnView insteadboolean
Deprecated.Use GtkColumnView insteadvoid
cellSetCellData
(TreeModel treeModel, TreeIter iter, boolean isExpander, boolean isExpanded) Deprecated.Use GtkColumnView insteadvoid
clear()
Deprecated.Use GtkColumnView insteadvoid
clearAttributes
(CellRenderer cellRenderer) Deprecated.Use GtkColumnView insteadvoid
clicked()
Deprecated.Use GtkColumnView insteadvoid
Deprecated.Emits the "clicked" signal.void
focusCell
(CellRenderer cell) Deprecated.Use GtkColumnView insteadfloat
Deprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadboolean
Deprecated.Use GtkColumnView insteadboolean
Deprecated.Use GtkColumnView insteadint
Deprecated.Use GtkColumnView insteadint
Deprecated.Use GtkColumnView insteadint
Deprecated.Use GtkColumnView insteadboolean
Deprecated.Use GtkColumnView insteadboolean
Deprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadint
Deprecated.Use GtkColumnView insteadboolean
Deprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadint
Deprecated.Use GtkColumnView insteadgetTitle()
Deprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadstatic Type
getType()
Deprecated.Get the GType of the TreeViewColumn classboolean
Deprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadint
getWidth()
Deprecated.Use GtkColumnView insteadint
Deprecated.Use GtkColumnView insteadonClicked
(TreeViewColumn.ClickedCallback handler) Deprecated.Emitted when the column's header has been clicked.void
packEnd
(CellRenderer cell, boolean expand) Deprecated.Use GtkColumnView insteadvoid
packStart
(CellRenderer cell, boolean expand) Deprecated.Use GtkColumnView insteadvoid
Deprecated.Use GtkColumnView insteadvoid
setAlignment
(float xalign) Deprecated.Use GtkColumnView insteadvoid
setAttributes
(CellRenderer cellRenderer, Object... varargs) Deprecated.Use GtkColumnView insteadvoid
setCellDataFunc
(CellRenderer cellRenderer, @Nullable TreeCellDataFunc func) Deprecated.Use GtkColumnView insteadvoid
setClickable
(boolean clickable) Deprecated.Use GtkColumnView insteadvoid
setExpand
(boolean expand) Deprecated.Use GtkColumnView insteadvoid
setFixedWidth
(int fixedWidth) Deprecated.Use GtkColumnView insteadvoid
setMaxWidth
(int maxWidth) Deprecated.Use GtkColumnView insteadvoid
setMinWidth
(int minWidth) Deprecated.Use GtkColumnView insteadvoid
setReorderable
(boolean reorderable) Deprecated.Use GtkColumnView insteadvoid
setResizable
(boolean resizable) Deprecated.Use GtkColumnView insteadvoid
Deprecated.Use GtkColumnView insteadvoid
setSortColumnId
(int sortColumnId) Deprecated.Use GtkColumnView insteadvoid
setSortIndicator
(boolean setting) Deprecated.Use GtkColumnView insteadvoid
setSortOrder
(SortType order) Deprecated.Use GtkColumnView insteadvoid
setSpacing
(int spacing) Deprecated.Use GtkColumnView insteadvoid
Deprecated.Use GtkColumnView insteadvoid
setVisible
(boolean visible) Deprecated.Use GtkColumnView insteadvoid
Deprecated.Use GtkColumnView insteadstatic TreeViewColumn
Deprecated.Use GtkColumnView insteadstatic TreeViewColumn
withAttributes
(String title, CellRenderer cell, Object... varargs) Deprecated.Use GtkColumnView insteadMethods inherited from class org.gnome.gobject.InitiallyUnowned
getMemoryLayout
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.CellLayout
getArea, getCells, reorder, setCellDataFunc
-
Constructor Details
-
TreeViewColumn
Deprecated.Create a TreeViewColumn proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
TreeViewColumn
Deprecated.Use GtkColumnView insteadCreates a newGtkTreeViewColumn
.
-
-
Method Details
-
getType
Deprecated.Get the GType of the TreeViewColumn class- Returns:
- the GType
-
asParent
Deprecated.Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParent
in classInitiallyUnowned
-
withArea
Deprecated.Use GtkColumnView insteadCreates a newGtkTreeViewColumn
usingarea
to render its cells.- Parameters:
area
- theGtkCellArea
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 insteadCreates a newGtkTreeViewColumn
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 createdGtkTreeViewColumn
.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 tocell
- TheGtkCellRenderer
varargs
- Anull
-terminated list of attributes- Returns:
- A newly created
GtkTreeViewColumn
.
-
addAttribute
Deprecated.Use GtkColumnView insteadAdds an attribute mapping to the list in this TreeViewColumn.The
column
is the column of the model to get a value from, and theattribute
is the parameter oncellRenderer
to be set from the value. So for example if column 2 of the model contains strings, you could have the “text” attribute of aGtkCellRendererText
get its values from column 2.- Specified by:
addAttribute
in interfaceCellLayout
- Parameters:
cellRenderer
- theGtkCellRenderer
to set attributes onattribute
- An attribute on the renderercolumn
- The column position on the model to get the attribute from.
-
cellGetPosition
@Deprecated public boolean cellGetPosition(CellRenderer cellRenderer, @Nullable @Nullable Out<Integer> xOffset, @Nullable @Nullable Out<Integer> width) Deprecated.Use GtkColumnView insteadObtains the horizontal position and size of a cell in a column.If the cell is not found in the column,
startPos
andwidth
are not changed andfalse
is returned.- Parameters:
cellRenderer
- aGtkCellRenderer
xOffset
- return location for the horizontal position ofcell
within this TreeViewColumnwidth
- return location for the width ofcell
- Returns:
true
ifcell
belongs to this TreeViewColumn
-
cellGetSize
@Deprecated public void cellGetSize(@Nullable @Nullable Out<Integer> xOffset, @Nullable @Nullable Out<Integer> yOffset, @Nullable @Nullable Out<Integer> width, @Nullable @Nullable Out<Integer> height) Deprecated.Use GtkColumnView insteadObtains the width and height needed to render the column. This is used primarily by theGtkTreeView
.- Parameters:
xOffset
- location to return x offset of a cell relative tocellArea
yOffset
- location to return y offset of a cell relative tocellArea
width
- location to return width needed to render a cellheight
- location to return height needed to render a cell
-
cellIsVisible
Deprecated.Use GtkColumnView insteadReturnstrue
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 insteadSets the cell renderer based on thetreeModel
anditer
. That is, for every attribute mapping in this TreeViewColumn, it will get a value from the set column on theiter
, and use that value to set the attribute on the cell renderer. This is used primarily by theGtkTreeView
.- Parameters:
treeModel
- TheGtkTreeModel
to get the cell renderers attributes from.iter
- TheGtkTreeIter
to get the cell renderer’s attributes from.isExpander
-true
, if the row has childrenisExpanded
-true
, if the row has visible children
-
clear
Deprecated.Use GtkColumnView insteadUnsets all the mappings on all renderers on the this TreeViewColumn.- Specified by:
clear
in interfaceCellLayout
-
clearAttributes
Deprecated.Use GtkColumnView insteadClears all existing attributes previously set with gtk_tree_view_column_set_attributes().- Specified by:
clearAttributes
in interfaceCellLayout
- Parameters:
cellRenderer
- aGtkCellRenderer
to clear the attribute mapping on.
-
clicked
Deprecated.Use GtkColumnView insteadEmits the “clicked” signal on the column. This function will only work if this TreeViewColumn is clickable. -
focusCell
Deprecated.Use GtkColumnView insteadSets the current keyboard focus to be atcell
, if the column contains 2 or more editable and activatable cells.- Parameters:
cell
- AGtkCellRenderer
-
getAlignment
Deprecated.Use GtkColumnView insteadReturns the current x alignment of this TreeViewColumn. This value can range between 0.0 and 1.0.- Returns:
- The current alignent of this TreeViewColumn.
-
getButton
Deprecated.Use GtkColumnView insteadReturns the button used in the treeview column header- Returns:
- The button for the column header.
-
getClickable
Deprecated.Use GtkColumnView insteadReturnstrue
if the user can click on the header for the column.- Returns:
true
if user can click the column header.
-
getExpand
Deprecated.Use GtkColumnView insteadReturnstrue
if the column expands to fill available space.- Returns:
true
if the column expands to fill available space.
-
getFixedWidth
Deprecated.Use GtkColumnView insteadGets 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.Use GtkColumnView insteadReturns the maximum width in pixels of the this TreeViewColumn, or -1 if no maximum width is set.- Returns:
- The maximum width of the this TreeViewColumn.
-
getMinWidth
Deprecated.Use GtkColumnView insteadReturns the minimum width in pixels of the this TreeViewColumn, or -1 if no minimum width is set.- Returns:
- The minimum width of the this TreeViewColumn.
-
getReorderable
Deprecated.Use GtkColumnView insteadReturnstrue
if the this TreeViewColumn can be reordered by the user.- Returns:
true
if the this TreeViewColumn can be reordered by the user.
-
getResizable
Deprecated.Use GtkColumnView insteadReturnstrue
if the this TreeViewColumn can be resized by the end user.- Returns:
true
, if the this TreeViewColumn can be resized.
-
getSizing
Deprecated.Use GtkColumnView insteadReturns the current type of this TreeViewColumn.- Returns:
- The type of this TreeViewColumn.
-
getSortColumnId
Deprecated.Use GtkColumnView insteadGets the logicalsortColumnId
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.Use GtkColumnView insteadGets the value set by gtk_tree_view_column_set_sort_indicator().- Returns:
- whether the sort indicator arrow is displayed
-
getSortOrder
Deprecated.Use GtkColumnView insteadGets the value set by gtk_tree_view_column_set_sort_order().- Returns:
- the sort order the sort indicator is indicating
-
getSpacing
Deprecated.Use GtkColumnView insteadReturns the spacing of this TreeViewColumn.- Returns:
- the spacing of this TreeViewColumn.
-
getTitle
Deprecated.Use GtkColumnView insteadReturns the title of the widget.- Returns:
- the title of the column. This string should not be modified or freed.
-
getTreeView
Deprecated.Use GtkColumnView insteadReturns theGtkTreeView
wherein this TreeViewColumn has been inserted. Ifcolumn
is currently not inserted in any tree view,null
is returned.- Returns:
- The tree view wherein
column
has been inserted
-
getVisible
Deprecated.Use GtkColumnView insteadReturnstrue
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.Use GtkColumnView insteadReturns theGtkWidget
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.Use GtkColumnView insteadReturns the current size of this TreeViewColumn in pixels.- Returns:
- The current width of this TreeViewColumn.
-
getXOffset
Deprecated.Use GtkColumnView insteadReturns the current X offset of this TreeViewColumn in pixels.- Returns:
- The current X offset of this TreeViewColumn.
-
packEnd
Deprecated.Use GtkColumnView insteadAdds thecell
to end of the column. Ifexpand
isfalse
, then thecell
is allocated no more space than it needs. Any unused space is divided evenly between cells for whichexpand
istrue
.- Specified by:
packEnd
in interfaceCellLayout
- Parameters:
cell
- TheGtkCellRenderer
expand
-true
ifcell
is to be given extra space allocated to this TreeViewColumn.
-
packStart
Deprecated.Use GtkColumnView insteadPacks thecell
into the beginning of the column. Ifexpand
isfalse
, then thecell
is allocated no more space than it needs. Any unused space is divided evenly between cells for whichexpand
istrue
.- Specified by:
packStart
in interfaceCellLayout
- Parameters:
cell
- TheGtkCellRenderer
expand
-true
ifcell
is to be given extra space allocated to this TreeViewColumn.
-
queueResize
Deprecated.Use GtkColumnView insteadFlags the column, and the cell renderers added to this column, to have their sizes renegotiated. -
setAlignment
Deprecated.Use GtkColumnView insteadSets 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.Use GtkColumnView insteadSets the attributes in the list as the attributes of this TreeViewColumn.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 interfaceCellLayout
- Parameters:
cellRenderer
- theGtkCellRenderer
we’re setting the attributes ofvarargs
- Anull
-terminated list of attributes
-
setCellDataFunc
@Deprecated public void setCellDataFunc(CellRenderer cellRenderer, @Nullable @Nullable TreeCellDataFunc func) Deprecated.Use GtkColumnView insteadSets theGtkTreeCellDataFunc
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 this TreeViewColumn's cell renderer as appropriate.
func
may benull
to remove an older one.- Parameters:
cellRenderer
- AGtkCellRenderer
func
- TheGtkTreeCellDataFunc
to use.
-
setClickable
Deprecated.Use GtkColumnView insteadSets the header to be active ifclickable
istrue
. 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.Use GtkColumnView insteadSets the column to take available extra space. This space is shared equally amongst all columns that have the expand set totrue
. If no column has this option set, then the last column gets all extra space. By default, every column is created with thisfalse
.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.Use GtkColumnView insteadIffixedWidth
is not -1, sets the fixed width of this TreeViewColumn; otherwise unsets it. The effective value offixedWidth
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 isTreeViewColumnSizing.GROW_ONLY
orTreeViewColumnSizing.AUTOSIZE
, setting a fixed width overrides the automatically calculated width. Note thatfixedWidth
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.Use GtkColumnView insteadSets the maximum width of the this TreeViewColumn. IfmaxWidth
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.Use GtkColumnView insteadSets the minimum width of the this TreeViewColumn. IfminWidth
is -1, then the minimum width is unset.- Parameters:
minWidth
- The minimum width of the column in pixels, or -1.
-
setReorderable
Deprecated.Use GtkColumnView insteadIfreorderable
istrue
, then the column can be reordered by the end user dragging the header.- Parameters:
reorderable
-true
, if the column can be reordered.
-
setResizable
Deprecated.Use GtkColumnView insteadIfresizable
istrue
, 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 isTreeViewColumnSizing.AUTOSIZE
, then the sizing mode is changed toTreeViewColumnSizing.GROW_ONLY
.- Parameters:
resizable
-true
, if the column can be resized
-
setSizing
Deprecated.Use GtkColumnView insteadSets the growth behavior of this TreeViewColumn totype
.- Parameters:
type
- TheGtkTreeViewColumn
Sizing.
-
setSortColumnId
Deprecated.Use GtkColumnView insteadSets the logicalsortColumnId
that this column sorts on when this column is selected for sorting. Doing so makes the column header clickable.- Parameters:
sortColumnId
- ThesortColumnId
of the model to sort on.
-
setSortIndicator
Deprecated.Use GtkColumnView insteadCall this function with asetting
oftrue
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.Use GtkColumnView insteadChanges 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.Use GtkColumnView insteadSets the spacing field of this TreeViewColumn, which is the number of pixels to place between cell renderers packed into it.- Parameters:
spacing
- distance between cell renderers in pixels.
-
setTitle
Deprecated.Use GtkColumnView insteadSets the title of the this TreeViewColumn. If a custom widget has been set, then this value is ignored.- Parameters:
title
- The title of the this TreeViewColumn.
-
setVisible
Deprecated.Use GtkColumnView insteadSets the visibility of this TreeViewColumn.- Parameters:
visible
-true
if the this TreeViewColumn is visible.
-
setWidget
Deprecated.Use GtkColumnView insteadSets the widget in the header to bewidget
. If widget isnull
, then the header button is set with aGtkLabel
set to the title of this TreeViewColumn.- Parameters:
widget
- A childGtkWidget
-
onClicked
public SignalConnection<TreeViewColumn.ClickedCallback> onClicked(TreeViewColumn.ClickedCallback handler) 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. SeeonClicked(org.gnome.gtk.TreeViewColumn.ClickedCallback)
. -
builder
Deprecated.ATreeViewColumn.Builder
object constructs aTreeViewColumn
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withTreeViewColumn.Builder.build()
.
-