Class ColumnViewColumn

All Implemented Interfaces:
PointerInterface

public class ColumnViewColumn extends Object
`GtkColumnViewColumn` represents the columns being added to `GtkColumnView`.

The main ingredient for a `GtkColumnViewColumn` is the `GtkListItemFactory`
that tells the columnview how to create cells for this column from items in
the model.

Columns have a title, and can optionally have a header menu set
with [method@Gtk.ColumnViewColumn.set_header_menu].

A sorter can be associated with a column using
[method@Gtk.ColumnViewColumn.set_sorter], to let users influence sorting
by clicking on the column header.

https://docs.gtk.org/gtk4/class.ColumnViewColumn.html

  • Constructor Details

    • ColumnViewColumn

      public ColumnViewColumn(PointerContainer pointer)
    • ColumnViewColumn

      public ColumnViewColumn(@Nullable Str title, @Nullable ListItemFactory factory)
      Creates a new `GtkColumnViewColumn` that uses the given @factory for
      mapping items to widgets.

      You most likely want to call [method@Gtk.ColumnView.append_column] next.

      The function takes ownership of the argument, so you can write code like:

      ```c
      column = gtk_column_view_column_new (_("Name"),
      gtk_builder_list_item_factory_new_from_resource ("/name.ui"));
      ```
      Parameters:
      title - Title to use for this column
      factory - The factory to populate items with
    • ColumnViewColumn

      public ColumnViewColumn(String title, @Nullable ListItemFactory factory)
      Creates a new `GtkColumnViewColumn` that uses the given @factory for
      mapping items to widgets.

      You most likely want to call [method@Gtk.ColumnView.append_column] next.

      The function takes ownership of the argument, so you can write code like:

      ```c
      column = gtk_column_view_column_new (_("Name"),
      gtk_builder_list_item_factory_new_from_resource ("/name.ui"));
      ```
      Parameters:
      title - Title to use for this column
      factory - The factory to populate items with
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getColumnView

      public ColumnView getColumnView()
      Gets the column view that's currently displaying this column.

      If @self has not been added to a column view yet, %NULL is returned.
      Returns:
      The column view displaying @self.
    • getExpand

      public boolean getExpand()
      Returns whether this column should expand.
      Returns:
      %TRUE if this column expands
    • getFactory

      public ListItemFactory getFactory()
      Gets the factory that's currently used to populate list items for
      this column.
      Returns:
      The factory in use
    • getFixedWidth

      public int getFixedWidth()
      Gets the fixed width of the column.
      Returns:
      the fixed with of the column
    • getHeaderMenu

      public MenuModel getHeaderMenu()
      Gets the menu model that is used to create the context menu
      for the column header.
      Returns:
      the `GMenuModel`
    • getResizable

      public boolean getResizable()
      Returns whether this column is resizable.
      Returns:
      %TRUE if this column is resizable
    • getSorter

      public Sorter getSorter()
      Returns the sorter that is associated with the column.
      Returns:
      the `GtkSorter` of @self
    • getTitle

      public Str getTitle()
      Returns the title set with gtk_column_view_column_set_title().
      Returns:
      The column's title
    • getVisible

      public boolean getVisible()
      Returns whether this column is visible.
      Returns:
      %TRUE if this column is visible
    • setExpand

      public void setExpand(boolean expand)
      Sets the column to take available extra space.

      The extra space is shared equally amongst all columns that
      have the expand set to %TRUE.
      Parameters:
      expand - %TRUE if this column should expand to fill available sace
    • setFactory

      public void setFactory(@Nullable ListItemFactory factory)
      Sets the `GtkListItemFactory` to use for populating list items for this
      column.
      Parameters:
      factory - the factory to use
    • setFixedWidth

      public void setFixedWidth(int fixed_width)
      If @fixed_width is not -1, sets the fixed width of @column;
      otherwise unsets it.

      Setting a fixed width overrides the automatically calculated
      width. Interactive resizing also sets the “fixed-width” property.
      Parameters:
      fixed_width - the new fixed width, or -1
    • setHeaderMenu

      public void setHeaderMenu(@Nullable MenuModel menu)
      Sets the menu model that is used to create the context menu
      for the column header.
      Parameters:
      menu - a `GMenuModel`
    • setResizable

      public void setResizable(boolean resizable)
      Sets whether this column should be resizable by dragging.
      Parameters:
      resizable - whether this column should be resizable
    • setSorter

      public void setSorter(@Nullable Sorter sorter)
      Associates a sorter with the column.

      If @sorter is %NULL, the column will not let users change
      the sorting by clicking on its header.

      This sorter can be made active by clicking on the column
      header, or by calling [method@Gtk.ColumnView.sort_by_column].

      See [method@Gtk.ColumnView.get_sorter] for the necessary steps
      for setting up customizable sorting for [class@Gtk.ColumnView].
      Parameters:
      sorter - the `GtkSorter` to associate with @column
    • setTitle

      public void setTitle(@Nullable Str title)
      Sets the title of this column.

      The title is displayed in the header of a `GtkColumnView`
      for this column and is therefore user-facing text that should
      be translated.
      Parameters:
      title - Title to use for this column
    • setTitle

      public void setTitle(String title)
      Sets the title of this column.

      The title is displayed in the header of a `GtkColumnView`
      for this column and is therefore user-facing text that should
      be translated.
      Parameters:
      title - Title to use for this column
    • setVisible

      public void setVisible(boolean visible)
      Sets whether this column should be visible in views.
      Parameters:
      visible - whether this column should be visible
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()