class Gtk::IconView

Overview

Gtk::IconView is a widget which displays data in a grid of icons.

Gtk::IconView provides an alternative view on a Gtk::TreeModel. It displays the model as a grid of icons with labels. Like Gtk::TreeView, it allows to select one or multiple items (depending on the selection mode, see Gtk::IconView#selection_mode=). In addition to selection with the arrow keys, Gtk::IconView supports rubberband selection, which is controlled by dragging the pointer.

Note that if the tree model is backed by an actual tree store (as opposed to a flat list where the mapping to icons is obvious), Gtk::IconView will only display the first level of the tree and ignore the tree’s branches.

CSS nodes

iconview.view
╰── [rubberband]

Gtk::IconView has a single CSS node with name iconview and style class .view. For rubberband selection, a subnode with name rubberband is used.

Included Modules

Defined in:

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

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Gtk::Scrollable

border : Gtk::Border border, hadjustment : Gtk::Adjustment | Nil hadjustment, hadjustment=(hadjustment : Gtk::Adjustment | Nil) : Nil hadjustment=, hscroll_policy : Gtk::ScrollablePolicy hscroll_policy, hscroll_policy=(policy : Gtk::ScrollablePolicy) : Nil hscroll_policy=, to_unsafe to_unsafe, vadjustment : Gtk::Adjustment | Nil vadjustment, vadjustment=(vadjustment : Gtk::Adjustment | Nil) : Nil vadjustment=, vscroll_policy : Gtk::ScrollablePolicy vscroll_policy, vscroll_policy=(policy : Gtk::ScrollablePolicy) : Nil vscroll_policy=

Constructor methods inherited from module Gtk::Scrollable

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::Scrollable

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from module Gtk::CellLayout

add_attribute(cell : Gtk::CellRenderer, attribute : String, column : Int32) : Nil add_attribute, area : Gtk::CellArea | Nil area, cells : GLib::List cells, clear : Nil clear, clear_attributes(cell : Gtk::CellRenderer) : Nil clear_attributes, pack_end(cell : Gtk::CellRenderer, expand : Bool) : Nil pack_end, pack_start(cell : Gtk::CellRenderer, expand : Bool) : Nil pack_start, reorder(cell : Gtk::CellRenderer, position : Int32) : Nil reorder, set_cell_data_func(cell : Gtk::CellRenderer, func : Gtk::CellLayoutDataFunc | Nil) : Nil set_cell_data_func, to_unsafe to_unsafe

Constructor methods inherited from module Gtk::CellLayout

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::CellLayout

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from module Gtk::ConstraintTarget

to_unsafe to_unsafe

Constructor methods inherited from module Gtk::ConstraintTarget

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::ConstraintTarget

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from module Gtk::Buildable

buildable_id : String | Nil buildable_id, to_unsafe to_unsafe

Constructor methods inherited from module Gtk::Buildable

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::Buildable

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from module Gtk::Accessible

accessible_role : Gtk::AccessibleRole accessible_role, accessible_role=(value : Gtk::AccessibleRole) : Gtk::AccessibleRole accessible_role=, reset_property(property : Gtk::AccessibleProperty) : Nil reset_property, reset_relation(relation : Gtk::AccessibleRelation) : Nil reset_relation, reset_state(state : Gtk::AccessibleState) : Nil reset_state, to_unsafe to_unsafe, update_property(properties : Enumerable(Gtk::AccessibleProperty), values : Enumerable(_)) : Nil update_property, update_relation(relations : Enumerable(Gtk::AccessibleRelation), values : Enumerable(_)) : Nil update_relation, update_state(states : Enumerable(Gtk::AccessibleState), values : Enumerable(_)) : Nil update_state

Constructor methods inherited from module Gtk::Accessible

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::Accessible

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from class Gtk::Widget

==(other : self) ==, action_set_enabled(action_name : String, enabled : Bool) : Nil action_set_enabled, activate : Bool activate, activate_action(name : String, args : _ | Nil) : Bool activate_action, activate_default : Nil activate_default, add_controller(controller : Gtk::EventController) : Nil add_controller, add_css_class(css_class : String) : Nil add_css_class, add_mnemonic_label(label : Gtk::Widget) : Nil add_mnemonic_label, add_tick_callback(callback : Gtk::TickCallback) : UInt32 add_tick_callback, allocate(width : Int32, height : Int32, baseline : Int32, transform : Gsk::Transform | Nil) : Nil allocate, allocated_baseline : Int32 allocated_baseline, allocated_height : Int32 allocated_height, allocated_width : Int32 allocated_width, allocation : Gdk::Rectangle allocation, ancestor(widget_type : UInt64) : Gtk::Widget | Nil ancestor, can_focus : Bool can_focus, can_focus=(can_focus : Bool) : Nil can_focus=, can_focus? : Bool can_focus?, can_target : Bool can_target, can_target=(can_target : Bool) : Nil can_target=, can_target? : Bool can_target?, child_focus(direction : Gtk::DirectionType) : Bool child_focus, child_visible : Bool child_visible, child_visible=(child_visible : Bool) : Nil child_visible=, children : Iterator(Widget) children, clipboard : Gdk::Clipboard clipboard, compute_bounds(target : Gtk::Widget) : Graphene::Rect compute_bounds, compute_expand(orientation : Gtk::Orientation) : Bool compute_expand, compute_point(target : Gtk::Widget, point : Graphene::Point) : Graphene::Point compute_point, compute_transform(target : Gtk::Widget) : Graphene::Matrix compute_transform, contains(x : Float64, y : Float64) : Bool contains, create_pango_context : Pango::Context create_pango_context, create_pango_layout(text : String | Nil) : Pango::Layout create_pango_layout, css_classes : Enumerable(String) css_classes, css_classes=(classes : Enumerable(String)) : Nil css_classes=, css_name : String css_name, css_name=(value : String) : String css_name=, cursor : Gdk::Cursor | Nil cursor, cursor=(cursor : Gdk::Cursor | Nil) : Nil cursor=, cursor_from_name=(name : String | Nil) : Nil cursor_from_name=, destroy_signal destroy_signal, direction : Gtk::TextDirection direction, direction=(dir : Gtk::TextDirection) : Nil direction=, direction_changed_signal direction_changed_signal, display : Gdk::Display display, drag_check_threshold(start_x : Int32, start_y : Int32, current_x : Int32, current_y : Int32) : Bool drag_check_threshold, error_bell : Nil error_bell, first_child : Gtk::Widget | Nil first_child, focus_child : Gtk::Widget | Nil focus_child, focus_child=(child : Gtk::Widget | Nil) : Nil focus_child=, focus_on_click : Bool focus_on_click, focus_on_click=(focus_on_click : Bool) : Nil focus_on_click=, focus_on_click? : Bool focus_on_click?, focusable : Bool focusable, focusable=(focusable : Bool) : Nil focusable=, focusable? : Bool focusable?, font_map : Pango::FontMap | Nil font_map, font_map=(font_map : Pango::FontMap | Nil) : Nil font_map=, font_options : Cairo::FontOptions | Nil font_options, font_options=(options : Cairo::FontOptions | Nil) : Nil font_options=, frame_clock : Gdk::FrameClock | Nil frame_clock, grab_focus : Bool grab_focus, halign : Gtk::Align halign, halign=(align : Gtk::Align) : Nil halign=, has_css_class(css_class : String) : Bool has_css_class, has_default : Bool has_default, has_default? : Bool has_default?, has_focus : Bool has_focus, has_focus? : Bool has_focus?, has_tooltip : Bool has_tooltip, has_tooltip=(has_tooltip : Bool) : Nil has_tooltip=, has_tooltip? : Bool has_tooltip?, has_visible_focus : Bool has_visible_focus, hash(hasher) hash, height : Int32 height, height_request : Int32 height_request, height_request=(value : Int32) : Int32 height_request=, hexpand : Bool hexpand, hexpand=(expand : Bool) : Nil hexpand=, hexpand? : Bool hexpand?, hexpand_set : Bool hexpand_set, hexpand_set=(set : Bool) : Nil hexpand_set=, hexpand_set? : Bool hexpand_set?, hide : Nil hide, hide_signal hide_signal, in_destruction : Bool in_destruction, init_template : Nil init_template, insert_action_group(name : String, group : Gio::ActionGroup | Nil) : Nil insert_action_group, insert_after(parent : Gtk::Widget, previous_sibling : Gtk::Widget | Nil) : Nil insert_after, insert_before(parent : Gtk::Widget, next_sibling : Gtk::Widget | Nil) : Nil insert_before, is_ancestor(ancestor : Gtk::Widget) : Bool is_ancestor, is_drawable : Bool is_drawable, is_focus : Bool is_focus, is_sensitive : Bool is_sensitive, is_visible : Bool is_visible, keynav_failed(direction : Gtk::DirectionType) : Bool keynav_failed, keynav_failed_signal keynav_failed_signal, last_child : Gtk::Widget | Nil last_child, layout_manager : Gtk::LayoutManager | Nil layout_manager, layout_manager=(layout_manager : Gtk::LayoutManager | Nil) : Nil layout_manager=, list_mnemonic_labels : GLib::List list_mnemonic_labels, map : Nil map, map_signal map_signal, mapped : Bool mapped, margin_bottom : Int32 margin_bottom, margin_bottom=(margin : Int32) : Nil margin_bottom=, margin_end : Int32 margin_end, margin_end=(margin : Int32) : Nil margin_end=, margin_start : Int32 margin_start, margin_start=(margin : Int32) : Nil margin_start=, margin_top : Int32 margin_top, margin_top=(margin : Int32) : Nil margin_top=, measure(orientation : Gtk::Orientation, for_size : Int32) : Nil measure, mnemonic_activate(group_cycling : Bool) : Bool mnemonic_activate, mnemonic_activate_signal mnemonic_activate_signal, move_focus_signal move_focus_signal, name : String name, name=(name : String) : Nil name=, native : Gtk::Native | Nil native, next_sibling : Gtk::Widget | Nil next_sibling, observe_children : Gio::ListModel observe_children, observe_controllers : Gio::ListModel observe_controllers, opacity : Float64 opacity, opacity=(opacity : Float64) : Nil opacity=, overflow : Gtk::Overflow overflow, overflow=(overflow : Gtk::Overflow) : Nil overflow=, pango_context : Pango::Context pango_context, parent : Gtk::Widget | Nil parent, parent=(parent : Gtk::Widget) : Nil parent=, pick(x : Float64, y : Float64, flags : Gtk::PickFlags) : Gtk::Widget | Nil pick, preferred_size : Gtk::Requisition preferred_size, prev_sibling : Gtk::Widget | Nil prev_sibling, primary_clipboard : Gdk::Clipboard primary_clipboard, query_tooltip_signal query_tooltip_signal, queue_allocate : Nil queue_allocate, queue_draw : Nil queue_draw, queue_resize : Nil queue_resize, realize : Nil realize, realize_signal realize_signal, realized : Bool realized, receives_default : Bool receives_default, receives_default=(receives_default : Bool) : Nil receives_default=, receives_default? : Bool receives_default?, remove_controller(controller : Gtk::EventController) : Nil remove_controller, remove_css_class(css_class : String) : Nil remove_css_class, remove_mnemonic_label(label : Gtk::Widget) : Nil remove_mnemonic_label, remove_tick_callback(id : UInt32) : Nil remove_tick_callback, request_mode : Gtk::SizeRequestMode request_mode, root : Gtk::Root | Nil root, scale_factor : Int32 scale_factor, sensitive : Bool sensitive, sensitive=(sensitive : Bool) : Nil sensitive=, sensitive? : Bool sensitive?, set_size_request(width : Int32, height : Int32) : Nil set_size_request, set_state_flags(flags : Gtk::StateFlags, clear : Bool) : Nil set_state_flags, settings : Gtk::Settings settings, should_layout : Bool should_layout, show : Nil show, show_signal show_signal, size(orientation : Gtk::Orientation) : Int32 size, size_allocate(allocation : Gdk::Rectangle, baseline : Int32) : Nil size_allocate, size_request : Nil size_request, snapshot_child(child : Gtk::Widget, snapshot : Gtk::Snapshot) : Nil snapshot_child, state_flags : Gtk::StateFlags state_flags, state_flags_changed_signal state_flags_changed_signal, style_context : Gtk::StyleContext style_context, template_child(widget_type : UInt64, name : String) : GObject::Object
template_child(name : String) : GObject::Object
template_child
, tooltip_markup : String | Nil tooltip_markup, tooltip_markup=(value : String) : String
tooltip_markup=(markup : String | Nil) : Nil
tooltip_markup=
, tooltip_text : String | Nil tooltip_text, tooltip_text=(value : String) : String
tooltip_text=(text : String | Nil) : Nil
tooltip_text=
, translate_coordinates(dest_widget : Gtk::Widget, src_x : Float64, src_y : Float64) : Bool translate_coordinates, trigger_tooltip_query : Nil trigger_tooltip_query, unmap : Nil unmap, unmap_signal unmap_signal, unparent : Nil unparent, unrealize : Nil unrealize, unrealize_signal unrealize_signal, unset_state_flags(flags : Gtk::StateFlags) : Nil unset_state_flags, valign : Gtk::Align valign, valign=(align : Gtk::Align) : Nil valign=, vexpand : Bool vexpand, vexpand=(expand : Bool) : Nil vexpand=, vexpand? : Bool vexpand?, vexpand_set : Bool vexpand_set, vexpand_set=(set : Bool) : Nil vexpand_set=, vexpand_set? : Bool vexpand_set?, visible : Bool visible, visible=(visible : Bool) : Nil visible=, visible? : Bool visible?, width : Int32 width, width_request : Int32 width_request, width_request=(value : Int32) : Int32 width_request=

Constructor methods inherited from class Gtk::Widget

new
new(*, accessible_role : Gtk::AccessibleRole | Nil = nil, can_focus : Bool | Nil = nil, can_target : Bool | Nil = nil, css_classes : Enumerable(String) | Nil = nil, css_name : String | Nil = nil, cursor : Gdk::Cursor | Nil = nil, focus_on_click : Bool | Nil = nil, focusable : Bool | Nil = nil, halign : Gtk::Align | Nil = nil, has_default : Bool | Nil = nil, has_focus : Bool | Nil = nil, has_tooltip : Bool | Nil = nil, height_request : Int32 | Nil = nil, hexpand : Bool | Nil = nil, hexpand_set : Bool | Nil = nil, layout_manager : Gtk::LayoutManager | Nil = nil, margin_bottom : Int32 | Nil = nil, margin_end : Int32 | Nil = nil, margin_start : Int32 | Nil = nil, margin_top : Int32 | Nil = nil, name : String | Nil = nil, opacity : Float64 | Nil = nil, overflow : Gtk::Overflow | Nil = nil, parent : Gtk::Widget | Nil = nil, receives_default : Bool | Nil = nil, root : Gtk::Root | Nil = nil, scale_factor : Int32 | Nil = nil, sensitive : Bool | Nil = nil, tooltip_markup : String | Nil = nil, tooltip_text : String | Nil = nil, valign : Gtk::Align | Nil = nil, vexpand : Bool | Nil = nil, vexpand_set : Bool | Nil = nil, visible : Bool | Nil = nil, width_request : Int32 | Nil = nil)
new

Class methods inherited from class Gtk::Widget

default_direction : Gtk::TextDirection default_direction, default_direction=(dir : Gtk::TextDirection) : Nil default_direction=, g_type : UInt64 g_type

Instance methods inherited from module Gtk::ConstraintTarget

to_unsafe to_unsafe

Constructor methods inherited from module Gtk::ConstraintTarget

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::ConstraintTarget

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from module Gtk::Buildable

buildable_id : String | Nil buildable_id, to_unsafe to_unsafe

Constructor methods inherited from module Gtk::Buildable

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::Buildable

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from module Gtk::Accessible

accessible_role : Gtk::AccessibleRole accessible_role, accessible_role=(value : Gtk::AccessibleRole) : Gtk::AccessibleRole accessible_role=, reset_property(property : Gtk::AccessibleProperty) : Nil reset_property, reset_relation(relation : Gtk::AccessibleRelation) : Nil reset_relation, reset_state(state : Gtk::AccessibleState) : Nil reset_state, to_unsafe to_unsafe, update_property(properties : Enumerable(Gtk::AccessibleProperty), values : Enumerable(_)) : Nil update_property, update_relation(relations : Enumerable(Gtk::AccessibleRelation), values : Enumerable(_)) : Nil update_relation, update_state(states : Enumerable(Gtk::AccessibleState), values : Enumerable(_)) : Nil update_state

Constructor methods inherited from module Gtk::Accessible

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::Accessible

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from class GObject::InitiallyUnowned

==(other : self) ==, hash(hasher) hash

Constructor methods inherited from class GObject::InitiallyUnowned

new new

Class methods inherited from class GObject::InitiallyUnowned

g_type : UInt64 g_type

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

Constructor Detail

def self.new : self #

Creates a new Gtk::IconView widget


[View source]
def self.new(*, accessible_role : Gtk::AccessibleRole | Nil = nil, activate_on_single_click : Bool | Nil = nil, can_focus : Bool | Nil = nil, can_target : Bool | Nil = nil, cell_area : Gtk::CellArea | Nil = nil, column_spacing : Int32 | Nil = nil, columns : Int32 | Nil = nil, css_classes : Enumerable(String) | Nil = nil, css_name : String | Nil = nil, cursor : Gdk::Cursor | Nil = nil, focus_on_click : Bool | Nil = nil, focusable : Bool | Nil = nil, hadjustment : Gtk::Adjustment | Nil = nil, halign : Gtk::Align | Nil = nil, has_default : Bool | Nil = nil, has_focus : Bool | Nil = nil, has_tooltip : Bool | Nil = nil, height_request : Int32 | Nil = nil, hexpand : Bool | Nil = nil, hexpand_set : Bool | Nil = nil, hscroll_policy : Gtk::ScrollablePolicy | Nil = nil, item_orientation : Gtk::Orientation | Nil = nil, item_padding : Int32 | Nil = nil, item_width : Int32 | Nil = nil, layout_manager : Gtk::LayoutManager | Nil = nil, margin : Int32 | Nil = nil, margin_bottom : Int32 | Nil = nil, margin_end : Int32 | Nil = nil, margin_start : Int32 | Nil = nil, margin_top : Int32 | Nil = nil, markup_column : Int32 | Nil = nil, model : Gtk::TreeModel | Nil = nil, name : String | Nil = nil, opacity : Float64 | Nil = nil, overflow : Gtk::Overflow | Nil = nil, parent : Gtk::Widget | Nil = nil, pixbuf_column : Int32 | Nil = nil, receives_default : Bool | Nil = nil, reorderable : Bool | Nil = nil, root : Gtk::Root | Nil = nil, row_spacing : Int32 | Nil = nil, scale_factor : Int32 | Nil = nil, selection_mode : Gtk::SelectionMode | Nil = nil, sensitive : Bool | Nil = nil, spacing : Int32 | Nil = nil, text_column : Int32 | Nil = nil, tooltip_column : Int32 | Nil = nil, tooltip_markup : String | Nil = nil, tooltip_text : String | Nil = nil, vadjustment : Gtk::Adjustment | Nil = nil, valign : Gtk::Align | Nil = nil, vexpand : Bool | Nil = nil, vexpand_set : Bool | Nil = nil, visible : Bool | Nil = nil, vscroll_policy : Gtk::ScrollablePolicy | Nil = nil, width_request : Int32 | Nil = nil) #

[View source]
def self.new_with_area(area : Gtk::CellArea) : self #

Creates a new Gtk::IconView widget using the specified area to layout cells inside the icons.


[View source]
def self.new_with_model(model : Gtk::TreeModel) : self #

Creates a new Gtk::IconView widget with the model model.


[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 activate_cursor_item_signal #

[View source]
def activate_on_single_click : Bool #

Gets the setting set by gtk_icon_view_set_activate_on_single_click().


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

Causes the Gtk::IconView::item-activated signal to be emitted on a single click instead of a double click.


[View source]
def activate_on_single_click? : Bool #

[View source]
def cell_area : Gtk::CellArea | Nil #

[View source]
def cell_area=(value : Gtk::CellArea | Nil) : Gtk::CellArea | Nil #

[View source]
def cell_rect(path : Gtk::TreePath, cell : Gtk::CellRenderer | Nil) : Gdk::Rectangle #

Fills the bounding rectangle in widget coordinates for the cell specified by path and cell. If cell is nil the main cell area is used.

This function is only valid if icon_view is realized.


[View source]
def column_spacing : Int32 #

Returns the value of the ::column-spacing property.


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

Sets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.


[View source]
def columns : Int32 #

Returns the value of the ::columns property.


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

Sets the ::columns property which determines in how many columns the icons are arranged. If columns is -1, the number of columns will be chosen automatically to fill the available area.


[View source]
def create_drag_icon(path : Gtk::TreePath) : Gdk::Paintable | Nil #

Creates a Gdk::Paintable representation of the item at path. This image is used for a drag icon.


[View source]
def cursor : Bool #

Fills in path and cell with the current cursor path and cell. If the cursor isn’t currently set, then *@path will be nil. If no cell currently has focus, then *@cell will be nil.

The returned Gtk::TreePath must be freed with gtk_tree_path_free().


[View source]
def dest_item_at_pos(drag_x : Int32, drag_y : Int32) : Bool #

Determines the destination item for a given position.


[View source]
def drag_dest_item : Nil #

Gets information about the item that is highlighted for feedback.


[View source]
def enable_model_drag_dest(formats : Gdk::ContentFormats, actions : Gdk::DragAction) : Nil #

Turns icon_view into a drop destination for automatic DND. Calling this method sets Gtk::IconView:reorderable to false.


[View source]
def enable_model_drag_source(start_button_mask : Gdk::ModifierType, formats : Gdk::ContentFormats, actions : Gdk::DragAction) : Nil #

Turns icon_view into a drag source for automatic DND. Calling this method sets Gtk::IconView:reorderable to false.


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

See Object#hash(hasher)


def item_activated(path : Gtk::TreePath) : Nil #

Activates the item determined by path.


[View source]
def item_activated_signal #

[View source]
def item_at_pos(x : Int32, y : Int32) : Bool #

Gets the path and cell for the icon at the given position.


[View source]
def item_column(path : Gtk::TreePath) : Int32 #

Gets the column in which the item path is currently displayed. Column numbers start at 0.


[View source]
def item_orientation : Gtk::Orientation #

Returns the value of the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.


[View source]
def item_orientation=(orientation : Gtk::Orientation) : Nil #

Sets the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.


[View source]
def item_padding : Int32 #

Returns the value of the ::item-padding property.


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

Sets the Gtk::IconView:item-padding property which specifies the padding around each of the icon view’s items.


[View source]
def item_row(path : Gtk::TreePath) : Int32 #

Gets the row in which the item path is currently displayed. Row numbers start at 0.


[View source]
def item_width : Int32 #

Returns the value of the ::item-width property.


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

Sets the ::item-width property which specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.


[View source]
def margin : Int32 #

Returns the value of the ::margin property.


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

Sets the ::margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.


[View source]
def markup_column : Int32 #

Returns the column with markup text for icon_view.


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

Sets the column with markup information for icon_view to be column. The markup column must be of type G_TYPE_STRING. If the markup column is set to something, it overrides the text column set by gtk_icon_view_set_text_column().


[View source]
def model : Gtk::TreeModel | Nil #

Returns the model the Gtk::IconView is based on. Returns nil if the model is unset.


[View source]
def model=(model : Gtk::TreeModel | Nil) : Nil #

Sets the model for a Gtk::IconView. If the icon_view already has a model set, it will remove it before setting the new model. If model is nil, then it will unset the old model.


[View source]
def move_cursor_signal #

[View source]
def path_at_pos(x : Int32, y : Int32) : Gtk::TreePath | Nil #

Gets the path for the icon at the given position.


[View source]
def path_is_selected(path : Gtk::TreePath) : Bool #

Returns true if the icon pointed to by path is currently selected. If path does not point to a valid location, false is returned.


[View source]
def pixbuf_column : Int32 #

Returns the column with pixbufs for icon_view.


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

Sets the column with pixbufs for icon_view to be column. The pixbuf column must be of type GDK_TYPE_PIXBUF


[View source]
def reorderable : Bool #

Retrieves whether the user can reorder the list via drag-and-drop. See gtk_icon_view_set_reorderable().


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

This function is a convenience function to allow you to reorder models that support the Gtk::TreeDragSourceIface and the Gtk::TreeDragDestIface. Both Gtk::TreeStore and Gtk::ListStore support these. If reorderable is true, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model's row_inserted and row_deleted signals. The reordering is implemented by setting up the icon view as a drag source and destination. Therefore, drag and drop can not be used in a reorderable view for any other purpose.

This function does not give you any degree of control over the order -- any reordering is allowed. If more control is needed, you should probably handle drag and drop manually.


[View source]
def reorderable? : Bool #

[View source]
def row_spacing : Int32 #

Returns the value of the ::row-spacing property.


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

Sets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.


[View source]
def scroll_to_path(path : Gtk::TreePath, use_align : Bool, row_align : Float32, col_align : Float32) : Nil #

Moves the alignments of icon_view to the position specified by path. row_align determines where the row is placed, and col_align determines where column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.

If use_align is false, then the alignment arguments are ignored, and the tree does the minimum amount of work to scroll the item onto the screen. This means that the item will be scrolled to the edge closest to its current position. If the item is currently visible on the screen, nothing is done.

This function only works if the model is set, and path is a valid row on the model. If the model changes before the icon_view is realized, the centered path will be modified to reflect this change.


[View source]
def select_all : Nil #

Selects all the icons. icon_view must has its selection mode set to %GTK_SELECTION_MULTIPLE.


[View source]
def select_all_signal #

[View source]
def select_cursor_item_signal #

[View source]
def select_path(path : Gtk::TreePath) : Nil #

Selects the row at path.


[View source]
def selected_foreach(func : Gtk::IconViewForeachFunc, data : Pointer(Void) | Nil) : Nil #

Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.


[View source]
def selected_items : GLib::List #

Creates a list of paths of all selected items. Additionally, if you are planning on modifying the model after calling this function, you may want to convert the returned list into a list of Gtk::TreeRowReferences. To do this, you can use gtk_tree_row_reference_new().

To free the return value, use g_list_free_full: |[ Gtk::Widget *icon_view = gtk_icon_view_new (); // Use icon_view

GList *list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (icon_view));

// use list

g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); ]|


[View source]
def selection_changed_signal #

[View source]
def selection_mode : Gtk::SelectionMode #

Gets the selection mode of the icon_view.


[View source]
def selection_mode=(mode : Gtk::SelectionMode) : Nil #

Sets the selection mode of the icon_view.


[View source]
def set_cursor(path : Gtk::TreePath, cell : Gtk::CellRenderer | Nil, start_editing : Bool) : Nil #

Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user’s attention on a particular item. If cell is not nil, then focus is given to the cell specified by it. Additionally, if start_editing is true, then editing should be started in the specified cell.

This function is often followed by gtk_widget_grab_focus (icon_view) in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.


[View source]
def set_drag_dest_item(path : Gtk::TreePath | Nil, pos : Gtk::IconViewDropPosition) : Nil #

Sets the item that is highlighted for feedback.


[View source]
def set_tooltip_cell(tooltip : Gtk::Tooltip, path : Gtk::TreePath, cell : Gtk::CellRenderer | Nil) : Nil #

Sets the tip area of tooltip to the area which cell occupies in the item pointed to by path. See also gtk_tooltip_set_tip_area().

See also gtk_icon_view_set_tooltip_column() for a simpler alternative.


[View source]
def set_tooltip_item(tooltip : Gtk::Tooltip, path : Gtk::TreePath) : Nil #

Sets the tip area of tooltip to be the area covered by the item at path. See also gtk_icon_view_set_tooltip_column() for a simpler alternative. See also gtk_tooltip_set_tip_area().


[View source]
def spacing : Int32 #

Returns the value of the ::spacing property.


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

Sets the ::spacing property which specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.


[View source]
def text_column : Int32 #

Returns the column with text for icon_view.


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

Sets the column with text for icon_view to be column. The text column must be of type G_TYPE_STRING.


[View source]
def toggle_cursor_item_signal #

[View source]
def tooltip_column : Int32 #

Returns the column of icon_view’s model which is being used for displaying tooltips on icon_view’s rows.


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

If you only plan to have simple (text-only) tooltips on full items, you can use this function to have Gtk::IconView handle these automatically for you. column should be set to the column in icon_view’s model containing the tooltip texts, or -1 to disable this feature.

When enabled, Gtk::Widget:has-tooltip will be set to true and icon_view will connect a Gtk::Widget::query-tooltip signal handler.

Note that the signal handler sets the text with gtk_tooltip_set_markup(), so &, <, etc have to be escaped in the text.


[View source]
def tooltip_context(x : Int32, y : Int32, keyboard_tip : Bool) : Gtk::TreeIter #

This function is supposed to be used in a Gtk::Widget::query-tooltip signal handler for Gtk::IconView. The x, y and keyboard_tip values which are received in the signal handler, should be passed to this function without modification.

The return value indicates whether there is an icon view item at the given coordinates (true) or not (false) for mouse tooltips. For keyboard tooltips the item returned will be the cursor item. When true, then any of model, path and iter which have been provided will be set to point to that row and the corresponding model.


[View source]
def unselect_all : Nil #

Unselects all the icons.


[View source]
def unselect_all_signal #

[View source]
def unselect_path(path : Gtk::TreePath) : Nil #

Unselects the row at path.


[View source]
def unset_model_drag_dest : Nil #

Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this method sets Gtk::IconView:reorderable to false.


[View source]
def unset_model_drag_source : Nil #

Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this method sets Gtk::IconView:reorderable to false.


[View source]
def visible_range : Bool #

Sets start_path and end_path to be the first and last visible path. Note that there may be invisible paths in between.

Both paths should be freed with gtk_tree_path_free() after use.


[View source]