package ocgtk

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

Module Wrappers.List_box

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

Create a new ListBox

val unselect_row : t -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj -> unit

Unselects a single row of @box, if the selection mode allows it.

val unselect_all : t -> unit

Unselect all children of @box, if the selection mode allows it.

val set_show_separators : t -> bool -> unit

Sets whether the list box should show separators between rows.

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

Sets how selection works in the listbox.

val set_placeholder : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets the placeholder widget that is shown in the list when it doesn't display any visible children.

val set_adjustment : t -> [ `adjustment | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets the adjustment (if any) that the widget uses to for vertical scrolling.

For instance, this is used to get the page size for PageUp/Down key handling.

In the normal case when the @box is packed inside a `GtkScrolledWindow` the adjustment from that will be picked up automatically, so there is no need to manually do that.

val set_activate_on_single_click : t -> bool -> unit

If @single is %TRUE, rows will be activated when you click on them, otherwise you need to double-click.

val select_row : t -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Make @row the currently selected row.

val select_all : t -> unit

Select all children of @box, if the selection mode allows it.

val remove_all : t -> unit

Removes all rows from @box.

This function does nothing if @box is backed by a model.

val remove : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj -> unit

Removes a child from @box.

val prepend : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj -> unit

Prepend a widget to the list.

If a sort function is set, the widget will actually be inserted at the calculated position.

val invalidate_sort : t -> unit

Update the sorting for all rows.

Call this when result of the sort function on the @box is changed due to an external factor.

val invalidate_headers : t -> unit

Update the separators for all rows.

Call this when result of the header function on the @box is changed due to an external factor.

val invalidate_filter : t -> unit

Update the filtering for all rows.

Call this when result of the filter function on the @box is changed due to an external factor. For instance, this would be used if the filter function just looked for a specific search string and the entry with the search string has changed.

val insert : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj -> int -> unit

Insert the @child into the @box at @position.

If a sort function is set, the widget will actually be inserted at the calculated position.

If @position is -1, or larger than the total number of items in the @box, then the @child will be appended to the end.

val get_show_separators : t -> bool

Returns whether the list box should show separators between rows.

val get_selection_mode : t -> Gtk_enums.selectionmode

Gets the selection mode of the listbox.

val get_selected_rows : t -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj list

Creates a list of all selected children.

val get_selected_row : t -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the selected row, or %NULL if no rows are selected.

Note that the box may allow multiple selection, in which case you should use method@Gtk.ListBox.selected_foreach to find all selected rows.

val get_row_at_y : t -> int -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the row at the @y position.

val get_row_at_index : t -> int -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the n-th child in the list (not counting headers).

If @index_ is negative or larger than the number of items in the list, %NULL is returned.

val get_adjustment : t -> [ `adjustment | `initially_unowned | `object_ ] Gobject.obj option

Gets the adjustment (if any) that the widget uses to for vertical scrolling.

val get_activate_on_single_click : t -> bool

Returns whether rows activate on single clicks.

val drag_unhighlight_row : t -> unit

If a row has previously been highlighted via gtk_list_box_drag_highlight_row(), it will have the highlight removed.

val drag_highlight_row : t -> [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj -> unit

Add a drag highlight to a row.

This is a helper function for implementing DnD onto a `GtkListBox`. The passed in @row will be highlighted by setting the %GTK_STATE_FLAG_DROP_ACTIVE state and any previously highlighted row will be unhighlighted.

The row will also be unhighlighted when the widget gets a drag leave event.

val append : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj -> unit

Append a widget to the list.

If a sort function is set, the widget will actually be inserted at the calculated position.

val get_accept_unpaired_release : t -> bool

Get property: accept-unpaired-release

val set_accept_unpaired_release : t -> bool -> unit

Set property: accept-unpaired-release

val on_activate_cursor_row : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_move_cursor : ?after:bool -> t -> callback: (object_:Gtk_enums.movementstep -> p0:int -> p1:bool -> p2:bool -> unit) -> Gobject.Signal.handler_id
val on_row_activated : ?after:bool -> t -> callback: (row: [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj -> unit) -> Gobject.Signal.handler_id
val on_row_selected : ?after:bool -> t -> callback: (row: [ `list_box_row | `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit) -> Gobject.Signal.handler_id
val on_select_all : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_selected_rows_changed : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_toggle_cursor_row : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_unselect_all : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id