class Gtk::ColumnViewColumn

Overview

Gtk::ColumnViewColumn represents the columns being added to Gtk::ColumnView.

The main ingredient for a Gtk::ColumnViewColumn is the Gtk::ListItemFactory 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 Gtk::ColumnViewColumn#header_menu=.

A sorter can be associated with a column using Gtk::ColumnViewColumn#sorter=, to let users influence sorting by clicking on the column header.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/column_view_column.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class GObject::Object

==(other : self) ==, bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void) | Nil data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, hash(hasher) hash, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void) | Nil qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void) | Nil) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void) | Nil steal_data, steal_qdata(quark : UInt32) : Pointer(Void) | Nil steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

cast?(obj : GObject::Object) : self | Nil cast?, compat_control(what : UInt64, data : Pointer(Void) | Nil) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Macros inherited from class GObject::Object

previous_vfunc(*args) previous_vfunc, previous_vfunc!(*args) previous_vfunc!, signal(signature) signal

Constructor Detail

def self.new(title : String | Nil, factory : Gtk::ListItemFactory | Nil) : self #

Creates a new Gtk::ColumnViewColumn that uses the given factory for mapping items to widgets.

You most likely want to call Gtk::ColumnView#append_column next.

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

WARNING ⚠️ The following code is in c ⚠️

column = gtk_column_view_column_new (_("Name"),
  gtk_builder_list_item_factory_new_from_resource ("/name.ui"));

[View source]
def self.new #

Initialize a new ColumnViewColumn.


[View source]
def self.new(*, column_view : Gtk::ColumnView | Nil = nil, expand : Bool | Nil = nil, factory : Gtk::ListItemFactory | Nil = nil, fixed_width : Int32 | Nil = nil, header_menu : Gio::MenuModel | Nil = nil, resizable : Bool | Nil = nil, sorter : Gtk::Sorter | Nil = nil, title : String | Nil = nil, visible : Bool | Nil = nil) #

[View source]

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def column_view : Gtk::ColumnView | Nil #

Gets the column view that's currently displaying this column.

If self has not been added to a column view yet, nil is returned.


[View source]
def expand : Bool #

Returns whether this column should expand.


[View source]
def expand=(expand : Bool) : Nil #

Sets the column to take available extra space.

The extra space is shared equally amongst all columns that have the expand set to true.


[View source]
def expand? : Bool #

[View source]
def factory : Gtk::ListItemFactory | Nil #

Gets the factory that's currently used to populate list items for this column.


[View source]
def factory=(factory : Gtk::ListItemFactory | Nil) : Nil #

Sets the Gtk::ListItemFactory to use for populating list items for this column.


[View source]
def fixed_width : Int32 #

Gets the fixed width of the column.


[View source]
def fixed_width=(fixed_width : Int32) : Nil #

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.


[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def header_menu : Gio::MenuModel | Nil #

Gets the menu model that is used to create the context menu for the column header.


[View source]
def header_menu=(menu : Gio::MenuModel | Nil) : Nil #

Sets the menu model that is used to create the context menu for the column header.


[View source]
def resizable : Bool #

Returns whether this column is resizable.


[View source]
def resizable=(resizable : Bool) : Nil #

Sets whether this column should be resizable by dragging.


[View source]
def resizable? : Bool #

[View source]
def sorter : Gtk::Sorter | Nil #

Returns the sorter that is associated with the column.


[View source]
def sorter=(sorter : Gtk::Sorter | Nil) : Nil #

Associates a sorter with the column.

If sorter is nil, 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 Gtk::ColumnView#sort_by_column.

See Gtk::ColumnView#sorter for the necessary steps for setting up customizable sorting for Gtk::ColumnView.


[View source]
def title : String | Nil #

Returns the title set with gtk_column_view_column_set_title().


[View source]
def title=(value : String) : String #

[View source]
def title=(value : Nil) : Nil #

Set #title property to nil.


[View source]
def title=(title : String | Nil) : Nil #

Sets the title of this column.

The title is displayed in the header of a Gtk::ColumnView for this column and is therefore user-facing text that should be translated.


[View source]
def title? : String | Nil #

Same as #title, but can return nil.


[View source]
def visible : Bool #

Returns whether this column is visible.


[View source]
def visible=(visible : Bool) : Nil #

Sets whether this column should be visible in views.


[View source]
def visible? : Bool #

[View source]