package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Text/index.html
Module Wrappers.Text
type t = [ `text | `widget | `initially_unowned | `object_ ] Gobject.objval new_ : unit -> tCreate a new Text
val new_with_buffer : [ `entry_buffer | `object_ ] Gobject.obj -> tCreate a new Text
val unset_invisible_char : t -> unitUnsets the invisible char.
After calling this, the default invisible char is used again.
val set_visibility : t -> bool -> unitSets whether the contents of the `GtkText` 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 widget is copied to the clipboard.
By default, GTK picks the best invisible character available in the current font, but it can be changed with method@Gtk.Text.set_invisible_char.
Note that you probably want to set property@Gtk.Text:input-purpose to %GTK_INPUT_PURPOSE_PASSWORD or %GTK_INPUT_PURPOSE_PIN to inform input methods about the purpose of this self, in addition to setting visibility to %FALSE.
val set_truncate_multiline : t -> bool -> unitSets whether the `GtkText` should truncate multi-line text that is pasted into the widget.
val set_tabs : t -> Ocgtk_pango.Pango.Wrappers.Tab_array.t option -> unitSets tabstops that are applied to the text.
val set_propagate_text_width : t -> bool -> unitSets whether the `GtkText` should grow and shrink with the content.
val set_placeholder_text : t -> string option -> unitSets text to be displayed in @self when it is empty.
This can be used to give a visual hint of the expected contents of the `GtkText`.
val set_overwrite_mode : t -> bool -> unitSets whether the text is overwritten when typing in the `GtkText`.
val set_max_length : t -> int -> unitSets 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.
This is equivalent to getting @self's `GtkEntryBuffer` and calling method@Gtk.EntryBuffer.set_max_length on it.
val set_invisible_char : t -> int -> unitSets the character to use when in “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 -> unitSets the input purpose of the `GtkText`.
This can be used by on-screen keyboards and other input methods to adjust their behaviour.
val set_input_hints : t -> Gtk_enums.inputhints -> unitSets input hints that allow input methods to fine-tune their behaviour.
Sets a menu model to add when constructing the context menu for @self.
val set_enable_emoji_completion : t -> bool -> unitSets whether Emoji completion is enabled.
If it is, typing ':', followed by a recognized keyword, will pop up a window with suggested Emojis matching the keyword.
val set_buffer : t -> [ `entry_buffer | `object_ ] Gobject.obj -> unitSet the `GtkEntryBuffer` object which holds the text for this widget.
val set_attributes : t -> Ocgtk_pango.Pango.Wrappers.Attr_list.t option -> unitSets attributes that are applied to the text.
val set_activates_default : t -> bool -> unitIf @activates is %TRUE, pressing Enter will activate the default widget for the window containing @self.
This usually means that the dialog containing the `GtkText` will be closed, since the default widget is usually one of the dialog buttons.
val grab_focus_without_selecting : t -> boolCauses @self to have keyboard focus.
It behaves like method@Gtk.Widget.grab_focus, except that it doesn't select the contents of @self. 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 -> boolRetrieves whether the text in @self is visible.
val get_truncate_multiline : t -> boolReturns whether the `GtkText` will truncate multi-line text that is pasted into the widget
Retrieves the current length of the text in @self.
This is equivalent to getting @self's `GtkEntryBuffer` and calling method@Gtk.EntryBuffer.get_length on it.
val get_tabs : t -> Ocgtk_pango.Pango.Wrappers.Tab_array.t optionGets the tabstops that were set on the `GtkText`.
See method@Gtk.Text.set_tabs.
val get_propagate_text_width : t -> boolReturns whether the `GtkText` will grow and shrink with the content.
val get_placeholder_text : t -> string optionRetrieves the text that will be displayed when @self is empty and unfocused
If no placeholder text has been set, %NULL will be returned.
val get_overwrite_mode : t -> boolGets whether text is overwritten when typing in the `GtkText`.
See method@Gtk.Text.set_overwrite_mode.
val get_max_length : t -> intRetrieves the maximum allowed length of the text in @self.
See method@Gtk.Text.set_max_length.
This is equivalent to getting @self's `GtkEntryBuffer` and calling method@Gtk.EntryBuffer.get_max_length on it.
val get_invisible_char : t -> intRetrieves the character displayed when visibility is set to false.
Note that GTK does not compute this value unless it needs it, so the value returned by this function is not very useful unless it has been explicitly set with method@Gtk.Text.set_invisible_char.
val get_input_purpose : t -> Gtk_enums.inputpurposeGets the input purpose of the `GtkText`.
val get_input_hints : t -> Gtk_enums.inputhintsGets the input hints of the `GtkText`.
Gets the menu model for extra items in the context menu.
See method@Gtk.Text.set_extra_menu.
val get_enable_emoji_completion : t -> boolReturns whether Emoji completion is enabled for this `GtkText` widget.
val get_buffer : t -> [ `entry_buffer | `object_ ] Gobject.objGet the `GtkEntryBuffer` object which holds the text for this widget.
val get_attributes : t -> Ocgtk_pango.Pango.Wrappers.Attr_list.t optionGets the attribute list that was set on the `GtkText`.
See method@Gtk.Text.set_attributes.
val get_activates_default : t -> boolReturns whether pressing Enter will activate the default widget for the window containing @self.
See method@Gtk.Text.set_activates_default.
val compute_cursor_extents :
t ->
Gsize.t ->
Ocgtk_graphene.Graphene.Wrappers.Rect.t
* Ocgtk_graphene.Graphene.Wrappers.Rect.tDetermine the positions of the strong and weak cursors if the insertion point in the layout is at @position.
The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction are inserted.
The rectangle positions are in widget coordinates.
val get_im_module : t -> stringGet property: im-module
val set_im_module : t -> string -> unitSet property: im-module
val get_invisible_char_set : t -> boolGet property: invisible-char-set
val set_invisible_char_set : t -> bool -> unitSet property: invisible-char-set
val get_scroll_offset : t -> intGet property: scroll-offset
val on_activate :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_backspace :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_copy_clipboard :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_cut_clipboard :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_delete_from_cursor :
?after:bool ->
t ->
callback:(type_:Gtk_enums.deletetype -> count:int -> unit) ->
Gobject.Signal.handler_idval on_insert_at_cursor :
?after:bool ->
t ->
callback:(string:string -> unit) ->
Gobject.Signal.handler_idval on_insert_emoji :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_move_cursor :
?after:bool ->
t ->
callback:(step:Gtk_enums.movementstep -> count:int -> extend:bool -> unit) ->
Gobject.Signal.handler_idval on_paste_clipboard :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_preedit_changed :
?after:bool ->
t ->
callback:(preedit:string -> unit) ->
Gobject.Signal.handler_idval on_toggle_overwrite :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_id