package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Icon_view

type t = [ `icon_view | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new IconView

val new_with_area : [ `cell_area | `initially_unowned | `object_ ] Gobject.obj -> t

Create a new IconView

val new_with_model : [ `tree_model ] Gobject.obj -> t

Create a new IconView

val unset_model_drag_source : t -> unit

Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this method sets `GtkIconView`:reorderable to %FALSE.

val unset_model_drag_dest : t -> unit

Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this method sets `GtkIconView`:reorderable to %FALSE.

val unselect_path : t -> [ `tree_path ] Gobject.obj -> unit

Unselects the row at @path.

val unselect_all : t -> unit

Unselects all the icons.

val set_tooltip_item : t -> [ `tooltip | `object_ ] Gobject.obj -> [ `tree_path ] Gobject.obj -> unit

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

val set_tooltip_column : t -> int -> unit

If you only plan to have simple (text-only) tooltips on full items, you can use this function to have `GtkIconView` 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, `GtkWidget:has-tooltip` will be set to %TRUE and @icon_view will connect a `GtkWidget::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.

val set_tooltip_cell : t -> [ `tooltip | `object_ ] Gobject.obj -> [ `tree_path ] Gobject.obj -> [ `cell_renderer | `initially_unowned | `object_ ] Gobject.obj option -> unit

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.

val set_text_column : t -> int -> unit

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

val set_spacing : t -> int -> unit

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

val set_selection_mode : t -> Gtk_enums.selectionmode -> unit

Sets the selection mode of the @icon_view.

val set_row_spacing : t -> int -> unit

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

val set_reorderable : t -> bool -> unit

This function is a convenience function to allow you to reorder models that support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both `GtkTreeStore` and `GtkListStore` 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.

val set_pixbuf_column : t -> int -> unit

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

val set_model : t -> [ `tree_model ] Gobject.obj option -> unit

Sets the model for a `GtkIconView`. If the @icon_view already has a model set, it will remove it before setting the new model. If @model is %NULL, then it will unset the old model.

val set_markup_column : t -> int -> unit

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

val set_margin : t -> int -> unit

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

val set_item_width : t -> int -> unit

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.

val set_item_padding : t -> int -> unit

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

val set_item_orientation : t -> Gtk_enums.orientation -> unit

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

val set_drag_dest_item : t -> [ `tree_path ] Gobject.obj option -> Gtk_enums.iconviewdropposition -> unit

Sets the item that is highlighted for feedback.

val set_cursor : t -> [ `tree_path ] Gobject.obj -> [ `cell_renderer | `initially_unowned | `object_ ] Gobject.obj option -> bool -> unit

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 %NULL, 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.

val set_columns : t -> int -> unit

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.

val set_column_spacing : t -> int -> unit

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

val set_activate_on_single_click : t -> bool -> unit

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

val select_path : t -> [ `tree_path ] Gobject.obj -> unit

Selects the row at @path.

val select_all : t -> unit

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

val scroll_to_path : t -> [ `tree_path ] Gobject.obj -> bool -> float -> float -> unit

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.

val path_is_selected : t -> [ `tree_path ] Gobject.obj -> 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.

val item_activated : t -> [ `tree_path ] Gobject.obj -> unit

Activates the item determined by @path.

val get_tooltip_column : t -> int

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

val get_text_column : t -> int

Returns the column with text for @icon_view.

val get_spacing : t -> int

Returns the value of the ::spacing property.

val get_selection_mode : t -> Gtk_enums.selectionmode

Gets the selection mode of the @icon_view.

val get_selected_items : t -> [ `tree_path ] Gobject.obj 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 `GtkTreeRowReferences`. To do this, you can use gtk_tree_row_reference_new().

To free the return value, use `g_list_free_full`: |<!-- language="C" --> GtkWidget *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); |

val get_row_spacing : t -> int

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

val get_reorderable : t -> bool

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

val get_pixbuf_column : t -> int

Returns the column with pixbufs for @icon_view.

val get_path_at_pos : t -> int -> int -> [ `tree_path ] Gobject.obj option

Gets the path for the icon at the given position.

val get_model : t -> [ `tree_model ] Gobject.obj option

Returns the model the `GtkIconView` is based on. Returns %NULL if the model is unset.

val get_markup_column : t -> int

Returns the column with markup text for @icon_view.

val get_margin : t -> int

Returns the value of the ::margin property.

val get_item_width : t -> int

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

val get_item_row : t -> [ `tree_path ] Gobject.obj -> int

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

val get_item_padding : t -> int

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

val get_item_orientation : t -> Gtk_enums.orientation

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

val get_item_column : t -> [ `tree_path ] Gobject.obj -> int

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

val get_columns : t -> int

Returns the value of the ::columns property.

val get_column_spacing : t -> int

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

val get_cell_rect : t -> [ `tree_path ] Gobject.obj -> [ `cell_renderer | `initially_unowned | `object_ ] Gobject.obj option -> bool * Ocgtk_gdk.Gdk.Wrappers.Rectangle.t

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

This function is only valid if @icon_view is realized.

val get_activate_on_single_click : t -> bool

Gets the setting set by gtk_icon_view_set_activate_on_single_click().

Turns @icon_view into a drag source for automatic DND. Calling this method sets `GtkIconView`:reorderable to %FALSE.

val enable_model_drag_dest : t -> Ocgtk_gdk.Gdk.Wrappers.Content_formats.t -> Ocgtk_gdk.Gdk.dragaction -> unit

Turns @icon_view into a drop destination for automatic DND. Calling this method sets `GtkIconView`:reorderable to %FALSE.

val create_drag_icon : t -> [ `tree_path ] Gobject.obj -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t option

Creates a `GdkPaintable` representation of the item at @path. This image is used for a drag icon.

val get_cell_area : t -> [ `cell_area | `initially_unowned | `object_ ] Gobject.obj

Get property: cell-area

val on_activate_cursor_item : ?after:bool -> t -> callback:(unit -> bool) -> Gobject.Signal.handler_id
val on_move_cursor : ?after:bool -> t -> callback: (step:Gtk_enums.movementstep -> count:int -> extend:bool -> modify:bool -> bool) -> Gobject.Signal.handler_id
val on_select_all : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_select_cursor_item : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_selection_changed : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_toggle_cursor_item : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_unselect_all : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id