package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Entry/index.html

Module Wrappers.Entry

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

Create a new Entry

val new_with_buffer : [ `entry_buffer | `object_ ] Gobject.obj -> t

Create a new Entry

val unset_invisible_char : t -> unit

Unsets the invisible char, so that the default invisible char is used again. See method@Gtk.Entry.set_invisible_char.

val set_visibility : t -> bool -> unit

Sets whether the contents of the entry are visible or not.

When visibility is set to %FALSE, characters are displayed as the invisible char, and will also appear that way when the text in the entry widget is copied elsewhere.

By default, GTK picks the best invisible character available in the current font, but it can be changed with method@Gtk.Entry.set_invisible_char.

Note that you probably want to set property@Gtk.Entry:input-purpose to %GTK_INPUT_PURPOSE_PASSWORD or %GTK_INPUT_PURPOSE_PIN to inform input methods about the purpose of this entry, in addition to setting visibility to %FALSE.

val set_tabs : t -> Ocgtk_pango.Pango.Wrappers.Tab_array.t option -> unit

Sets a `PangoTabArray`.

The tabstops in the array are applied to the entry text.

val set_progress_pulse_step : t -> float -> unit

Sets the fraction of total entry width to move the progress bouncing block for each pulse.

Use method@Gtk.Entry.progress_pulse to pulse the progress.

val set_progress_fraction : t -> float -> unit

Causes the entry’s progress indicator to “fill in” the given fraction of the bar.

The fraction should be between 0.0 and 1.0, inclusive.

val set_placeholder_text : t -> string option -> unit

Sets text to be displayed in @entry when it is empty.

This can be used to give a visual hint of the expected contents of the `GtkEntry`.

val set_overwrite_mode : t -> bool -> unit

Sets whether the text is overwritten when typing in the `GtkEntry`.

val set_max_length : t -> int -> unit

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

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

This is equivalent to getting @entry's `GtkEntryBuffer` and calling method@Gtk.EntryBuffer.set_max_length on it.

val set_invisible_char : t -> int -> unit

Sets the character to use in place of the actual text in “password mode”.

See method@Gtk.Entry.set_visibility for how to enable “password mode”.

By default, GTK picks the best invisible char available in the current font. If you set the invisible char to 0, then the user will get no feedback at all; there will be no text on the screen as they type.

val set_input_purpose : t -> Gtk_enums.inputpurpose -> unit

Sets the input purpose which can be used by input methods to adjust their behavior.

val set_input_hints : t -> Gtk_enums.inputhints -> unit

Set additional hints which allow input methods to fine-tune their behavior.

val set_icon_tooltip_text : t -> Gtk_enums.entryiconposition -> string option -> unit

Sets @tooltip as the contents of the tooltip for the icon at the specified position.

Use %NULL for @tooltip to remove an existing tooltip.

See also method@Gtk.Widget.set_tooltip_text and method@Gtk.Entry.set_icon_tooltip_markup.

If you unset the widget tooltip via method@Gtk.Widget.set_tooltip_text or method@Gtk.Widget.set_tooltip_markup, this sets property@Gtk.Widget:has-tooltip to %FALSE, which suppresses icon tooltips too. You can resolve this by then calling method@Gtk.Widget.set_has_tooltip to set property@Gtk.Widget:has-tooltip back to %TRUE, or setting at least one non-empty tooltip on any icon achieves the same result.

val set_icon_tooltip_markup : t -> Gtk_enums.entryiconposition -> string option -> unit

Sets @tooltip as the contents of the tooltip for the icon at the specified position.

@tooltip is assumed to be marked up with Pango Markup.

Use %NULL for @tooltip to remove an existing tooltip.

See also method@Gtk.Widget.set_tooltip_markup and method@Gtk.Entry.set_icon_tooltip_text.

val set_icon_sensitive : t -> Gtk_enums.entryiconposition -> bool -> unit

Sets the sensitivity for the specified icon.

val set_icon_from_paintable : t -> Gtk_enums.entryiconposition -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t option -> unit

Sets the icon shown in the specified position using a `GdkPaintable`.

If @paintable is %NULL, no icon will be shown in the specified position.

val set_icon_from_icon_name : t -> Gtk_enums.entryiconposition -> string option -> unit

Sets the icon shown in the entry at the specified position from the current icon theme.

If the icon name isn’t known, a “broken image” icon will be displayed instead.

If @icon_name is %NULL, no icon will be shown in the specified position.

val set_icon_from_gicon : t -> Gtk_enums.entryiconposition -> Ocgtk_gio.Gio.Wrappers.Icon.t option -> unit

Sets the icon shown in the entry at the specified position from the current icon theme.

If the icon isn’t known, a “broken image” icon will be displayed instead.

If @icon is %NULL, no icon will be shown in the specified position.

Sets up the icon at the given position as drag source.

This makes it so that GTK will start a drag operation when the user clicks and drags the icon.

val set_icon_activatable : t -> Gtk_enums.entryiconposition -> bool -> unit

Sets whether the icon is activatable.

val set_has_frame : t -> bool -> unit

Sets whether the entry has a beveled frame around it.

val set_extra_menu : t -> Ocgtk_gio.Gio.Wrappers.Menu_model.t option -> unit

Sets a menu model to add when constructing the context menu for @entry.

val set_completion : t -> [ `entry_completion | `object_ ] Gobject.obj option -> unit

Sets @completion to be the auxiliary completion object to use with @entry.

All further configuration of the completion mechanism is done on @completion using the `GtkEntryCompletion` API. Completion is disabled if @completion is set to %NULL.

val set_buffer : t -> [ `entry_buffer | `object_ ] Gobject.obj -> unit

Set the `GtkEntryBuffer` object which holds the text for this widget.

val set_attributes : t -> Ocgtk_pango.Pango.Wrappers.Attr_list.t -> unit

Sets a `PangoAttrList`.

The attributes in the list are applied to the entry text.

Since the attributes will be applied to text that changes as the user types, it makes most sense to use attributes with unlimited extent.

val set_alignment : t -> float -> unit

Sets the alignment for the contents of the entry.

This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry.

See also: property@Gtk.Editable:xalign

val set_activates_default : t -> bool -> unit

Sets whether pressing Enter in the @entry will activate the default widget for the window containing the entry.

This usually means that the dialog containing the entry will be closed, since the default widget is usually one of the dialog buttons.

val reset_im_context : t -> unit

Reset the input method context of the entry if needed.

This can be necessary in the case where modifying the buffer would confuse on-going input method behavior.

val progress_pulse : t -> unit

Indicates that some progress is made, but you don’t know how much.

Causes the entry’s progress indicator to enter “activity mode”, where a block bounces back and forth. Each call to gtk_entry_progress_pulse() causes the block to move by a little bit (the amount of movement per pulse is determined by method@Gtk.Entry.set_progress_pulse_step).

val grab_focus_without_selecting : t -> bool

Causes @entry to have keyboard focus.

It behaves like method@Gtk.Widget.grab_focus, except that it doesn't select the contents of the entry. You only want to call this on some special entries which the user usually doesn't want to replace all text in, such as search-as-you-type entries.

val get_visibility : t -> bool

Retrieves whether the text in @entry is visible.

See method@Gtk.Entry.set_visibility.

val get_text_length : t -> UInt16.t

Retrieves the current length of the text in @entry.

This is equivalent to getting @entry's `GtkEntryBuffer` and calling method@Gtk.EntryBuffer.get_length on it.

val get_tabs : t -> Ocgtk_pango.Pango.Wrappers.Tab_array.t option

Gets the tabstops of the `GtkEntry`.

See method@Gtk.Entry.set_tabs.

val get_progress_pulse_step : t -> float

Retrieves the pulse step set with gtk_entry_set_progress_pulse_step().

val get_progress_fraction : t -> float

Returns the current fraction of the task that’s been completed.

See method@Gtk.Entry.set_progress_fraction.

val get_placeholder_text : t -> string option

Retrieves the text that will be displayed when @entry is empty and unfocused

val get_overwrite_mode : t -> bool

Gets whether the `GtkEntry` is in overwrite mode.

val get_max_length : t -> int

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

See method@Gtk.Entry.set_max_length.

val get_invisible_char : t -> int

Retrieves the character displayed in place of the actual text in “password mode”.

val get_input_purpose : t -> Gtk_enums.inputpurpose

Gets the input purpose of the `GtkEntry`.

val get_input_hints : t -> Gtk_enums.inputhints

Gets the input hints of this `GtkEntry`.

val get_icon_tooltip_text : t -> Gtk_enums.entryiconposition -> string option

Gets the contents of the tooltip on the icon at the specified position in @entry.

val get_icon_tooltip_markup : t -> Gtk_enums.entryiconposition -> string option

Gets the contents of the tooltip on the icon at the specified position in @entry.

val get_icon_storage_type : t -> Gtk_enums.entryiconposition -> Gtk_enums.imagetype

Gets the type of representation being used by the icon to store image data.

If the icon has no image data, the return value will be %GTK_IMAGE_EMPTY.

val get_icon_sensitive : t -> Gtk_enums.entryiconposition -> bool

Returns whether the icon appears sensitive or insensitive.

Retrieves the `GdkPaintable` used for the icon.

If no `GdkPaintable` was used for the icon, %NULL is returned.

val get_icon_name : t -> Gtk_enums.entryiconposition -> string option

Retrieves the icon name used for the icon.

%NULL is returned if there is no icon or if the icon was set by some other method (e.g., by `GdkPaintable` or gicon).

Retrieves the `GIcon` used for the icon.

%NULL will be returned if there is no icon or if the icon was set by some other method (e.g., by `GdkPaintable` or icon name).

val get_icon_at_pos : t -> int -> int -> int

Finds the icon at the given position and return its index.

The position’s coordinates are relative to the @entry’s top left corner. If @x, @y doesn’t lie inside an icon, -1 is returned. This function is intended for use in a signal@Gtk.Widget::query-tooltip signal handler.

Gets the area where entry’s icon at @icon_pos is drawn.

This function is useful when drawing something to the entry in a draw callback.

If the entry is not realized or has no icon at the given position, @icon_area is filled with zeros. Otherwise, @icon_area will be filled with the icon's allocation, relative to @entry's allocation.

val get_icon_activatable : t -> Gtk_enums.entryiconposition -> bool

Returns whether the icon is activatable.

val get_has_frame : t -> bool

Gets the value set by gtk_entry_set_has_frame().

val get_extra_menu : t -> Ocgtk_gio.Gio.Wrappers.Menu_model.t option

Gets the menu model set with gtk_entry_set_extra_menu().

val get_current_icon_drag_source : t -> int

Returns the index of the icon which is the source of the current DND operation, or -1.

val get_completion : t -> [ `entry_completion | `object_ ] Gobject.obj option

Returns the auxiliary completion object currently in use by @entry.

val get_buffer : t -> [ `entry_buffer | `object_ ] Gobject.obj

Get the `GtkEntryBuffer` object which holds the text for this widget.

val get_attributes : t -> Ocgtk_pango.Pango.Wrappers.Attr_list.t option

Gets the attribute list of the `GtkEntry`.

See method@Gtk.Entry.set_attributes.

val get_alignment : t -> float

Gets the value set by gtk_entry_set_alignment().

See also: property@Gtk.Editable:xalign

val get_activates_default : t -> bool

Retrieves the value set by gtk_entry_set_activates_default().

val get_enable_emoji_completion : t -> bool

Get property: enable-emoji-completion

val set_enable_emoji_completion : t -> bool -> unit

Set property: enable-emoji-completion

val get_im_module : t -> string

Get property: im-module

val set_im_module : t -> string -> unit

Set property: im-module

val get_invisible_char_set : t -> bool

Get property: invisible-char-set

val set_invisible_char_set : t -> bool -> unit

Set property: invisible-char-set

val get_primary_icon_activatable : t -> bool

Get property: primary-icon-activatable

val set_primary_icon_activatable : t -> bool -> unit

Set property: primary-icon-activatable

val get_primary_icon_gicon : t -> Ocgtk_gio.Gio.Wrappers.Icon.t

Get property: primary-icon-gicon

val set_primary_icon_gicon : t -> Ocgtk_gio.Gio.Wrappers.Icon.t -> unit

Set property: primary-icon-gicon

val get_primary_icon_name : t -> string

Get property: primary-icon-name

val set_primary_icon_name : t -> string -> unit

Set property: primary-icon-name

val get_primary_icon_paintable : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t

Get property: primary-icon-paintable

val set_primary_icon_paintable : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t -> unit

Set property: primary-icon-paintable

val get_primary_icon_sensitive : t -> bool

Get property: primary-icon-sensitive

val set_primary_icon_sensitive : t -> bool -> unit

Set property: primary-icon-sensitive

val get_primary_icon_storage_type : t -> Gtk_enums.imagetype

Get property: primary-icon-storage-type

val get_primary_icon_tooltip_markup : t -> string

Get property: primary-icon-tooltip-markup

val set_primary_icon_tooltip_markup : t -> string -> unit

Set property: primary-icon-tooltip-markup

val get_primary_icon_tooltip_text : t -> string

Get property: primary-icon-tooltip-text

val set_primary_icon_tooltip_text : t -> string -> unit

Set property: primary-icon-tooltip-text

val get_scroll_offset : t -> int

Get property: scroll-offset

val get_secondary_icon_activatable : t -> bool

Get property: secondary-icon-activatable

val set_secondary_icon_activatable : t -> bool -> unit

Set property: secondary-icon-activatable

val get_secondary_icon_gicon : t -> Ocgtk_gio.Gio.Wrappers.Icon.t

Get property: secondary-icon-gicon

val set_secondary_icon_gicon : t -> Ocgtk_gio.Gio.Wrappers.Icon.t -> unit

Set property: secondary-icon-gicon

val get_secondary_icon_name : t -> string

Get property: secondary-icon-name

val set_secondary_icon_name : t -> string -> unit

Set property: secondary-icon-name

val get_secondary_icon_paintable : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t

Get property: secondary-icon-paintable

val set_secondary_icon_paintable : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t -> unit

Set property: secondary-icon-paintable

val get_secondary_icon_sensitive : t -> bool

Get property: secondary-icon-sensitive

val set_secondary_icon_sensitive : t -> bool -> unit

Set property: secondary-icon-sensitive

val get_secondary_icon_storage_type : t -> Gtk_enums.imagetype

Get property: secondary-icon-storage-type

val get_secondary_icon_tooltip_markup : t -> string

Get property: secondary-icon-tooltip-markup

val set_secondary_icon_tooltip_markup : t -> string -> unit

Set property: secondary-icon-tooltip-markup

val get_secondary_icon_tooltip_text : t -> string

Get property: secondary-icon-tooltip-text

val set_secondary_icon_tooltip_text : t -> string -> unit

Set property: secondary-icon-tooltip-text

val get_show_emoji_icon : t -> bool

Get property: show-emoji-icon

val set_show_emoji_icon : t -> bool -> unit

Set property: show-emoji-icon

val get_truncate_multiline : t -> bool

Get property: truncate-multiline

val set_truncate_multiline : t -> bool -> unit

Set property: truncate-multiline

val on_activate : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_icon_press : ?after:bool -> t -> callback:(icon_pos:Gtk_enums.entryiconposition -> unit) -> Gobject.Signal.handler_id
val on_icon_release : ?after:bool -> t -> callback:(icon_pos:Gtk_enums.entryiconposition -> unit) -> Gobject.Signal.handler_id