package ocgtk

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

Module Wrappers.Menu_model

type t = [ `menu_model | `object_ ] Gobject.obj

Creates a #GMenuLinkIter to iterate over the links of the item at position @item_index in @model.

You must free the iterator with g_object_unref() when you are done.

val iterate_item_attributes : t -> int -> [ `menu_attribute_iter | `object_ ] Gobject.obj

Creates a #GMenuAttributeIter to iterate over the attributes of the item at position @item_index in @model.

You must free the iterator with g_object_unref() when you are done.

val items_changed : t -> int -> int -> int -> unit

Requests emission of the #GMenuModel::items-changed signal on @model.

This function should never be called except by #GMenuModel subclasses. Any other calls to this function will very likely lead to a violation of the interface of the model.

The implementation should update its internal representation of the menu before emitting the signal. The implementation should further expect to receive queries about the new state of the menu (and particularly added menu items) while signal handlers are running.

The implementation must dispatch this call directly from a mainloop entry and not in response to calls -- particularly those from the #GMenuModel API. Said another way: the menu must not change while user code is running without returning to the mainloop.

val is_mutable : t -> bool

Queries if @model is mutable.

An immutable #GMenuModel will never emit the #GMenuModel::items-changed signal. Consumers of the model may make optimisations accordingly.

val get_n_items : t -> int

Query the number of items in @model.

Queries the item at position @item_index in @model for the link specified by @link.

If the link exists, the linked #GMenuModel is returned. If the link does not exist, %NULL is returned.

val get_item_attribute_value : t -> int -> string -> Gvariant_type.t option -> Gvariant.t option

Queries the item at position @item_index in @model for the attribute specified by @attribute.

If @expected_type is non-%NULL then it specifies the expected type of the attribute. If it is %NULL then any type will be accepted.

If the attribute exists and matches @expected_type (or if the expected type is unspecified) then the value is returned.

If the attribute does not exist, or does not match the expected type then %NULL is returned.

val on_items_changed : ?after:bool -> t -> callback:(position:int -> removed:int -> added:int -> unit) -> Gobject.Signal.handler_id