package ocgtk

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

Module Wrappers.Entry_buffer

type t = [ `entry_buffer | `object_ ] Gobject.obj
val new_ : string option -> int -> t

Create a new EntryBuffer

val set_text : t -> string -> int -> unit

Sets the text in the buffer.

This is roughly equivalent to calling method@Gtk.EntryBuffer.delete_text and method@Gtk.EntryBuffer.insert_text.

Note that @n_chars is in characters, not in bytes.

val set_max_length : t -> int -> unit

Sets the maximum allowed length of the contents of the buffer.

If the current contents are longer than the given length, then they will be truncated to fit.

val insert_text : t -> int -> string -> int -> int

Inserts @n_chars characters of @chars into the contents of the buffer, at position @position.

If @n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If @position or @n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.

Note that the position and length are in characters, not in bytes.

val get_text : t -> string

Retrieves the contents of the buffer.

The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.

val get_max_length : t -> int

Retrieves the maximum allowed length of the text in @buffer.

val get_length : t -> int

Retrieves the length in characters of the buffer.

val get_bytes : t -> Gsize.t

Retrieves the length in bytes of the buffer.

See method@Gtk.EntryBuffer.get_length.

val emit_inserted_text : t -> int -> string -> int -> unit

Used when subclassing `GtkEntryBuffer`.

val emit_deleted_text : t -> int -> int -> unit

Used when subclassing `GtkEntryBuffer`.

val delete_text : t -> int -> int -> int

Deletes a sequence of characters from the buffer.

@n_chars characters are deleted starting at @position. If @n_chars is negative, then all characters until the end of the text are deleted.

If @position or @n_chars are out of bounds, then they are coerced to sane values.

Note that the positions are specified in characters, not bytes.

val on_deleted_text : ?after:bool -> t -> callback:(position:int -> n_chars:int -> unit) -> Gobject.Signal.handler_id
val on_inserted_text : ?after:bool -> t -> callback:(position:int -> chars:string -> n_chars:int -> unit) -> Gobject.Signal.handler_id