package ocgtk

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

Module Wrappers.Drop_down

type t = [ `drop_down | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : Ocgtk_gio.Gio.Wrappers.List_model.t option -> [ `expression ] Gobject.obj option -> t

Create a new DropDown

val new_from_strings : string array -> t

Create a new DropDown

val set_show_arrow : t -> bool -> unit

Sets whether an arrow will be displayed within the widget.

val set_selected : t -> int -> unit

Selects the item at the given position.

val set_search_match_mode : t -> Gtk_enums.stringfiltermatchmode -> unit

Sets the match mode for the search filter.

val set_model : t -> Ocgtk_gio.Gio.Wrappers.List_model.t option -> unit

Sets the `GListModel` to use.

val set_list_factory : t -> [ `list_item_factory | `object_ ] Gobject.obj option -> unit

Sets the `GtkListItemFactory` to use for populating list items in the popup.

val set_header_factory : t -> [ `list_item_factory | `object_ ] Gobject.obj option -> unit

Sets the `GtkListItemFactory` to use for creating header widgets for the popup.

val set_factory : t -> [ `list_item_factory | `object_ ] Gobject.obj option -> unit

Sets the `GtkListItemFactory` to use for populating list items.

val set_expression : t -> [ `expression ] Gobject.obj option -> unit

Sets the expression that gets evaluated to obtain strings from items.

This is used for search in the popup. The expression must have a value type of %G_TYPE_STRING.

Sets whether a search entry will be shown in the popup that allows to search for items in the list.

Note that property@Gtk.DropDown:expression must be set for search to work.

val get_show_arrow : t -> bool

Returns whether to show an arrow within the widget.

val get_selected_item : t -> [ `object_ ] Gobject.obj option

Gets the selected item. If no item is selected, %NULL is returned.

val get_selected : t -> int

Gets the position of the selected item.

val get_search_match_mode : t -> Gtk_enums.stringfiltermatchmode

Returns the match mode that the search filter is using.

val get_model : t -> Ocgtk_gio.Gio.Wrappers.List_model.t option

Gets the model that provides the displayed items.

val get_list_factory : t -> [ `list_item_factory | `object_ ] Gobject.obj option

Gets the factory that's currently used to populate list items in the popup.

val get_header_factory : t -> [ `list_item_factory | `object_ ] Gobject.obj option

Gets the factory that's currently used to create header widgets for the popup.

val get_factory : t -> [ `list_item_factory | `object_ ] Gobject.obj option

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

The factory returned by this function is always used for the item in the button. It is also used for items in the popup if property@Gtk.DropDown:list-factory is not set.

val get_expression : t -> [ `expression ] Gobject.obj option

Gets the expression set that is used to obtain strings from items.

See method@Gtk.DropDown.set_expression.

Returns whether search is enabled.

val on_activate : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id