Interface

Gtk-3.0GtkEditableInterface

Interface for implementing Editable. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_changed(): void;
    vfunc_delete_text(start_pos: number, end_pos: number): void;
    vfunc_do_delete_text(start_pos: number, end_pos: number): void;
    vfunc_do_insert_text(
        new_text: string,
        new_text_length: number,
        position: number,
    ): number;
    vfunc_get_chars(start_pos: number, end_pos: number): string;
    vfunc_get_position(): number;
    vfunc_get_selection_bounds(): [boolean, number, number];
    vfunc_insert_text(
        new_text: string,
        new_text_length: number,
        position: number,
    ): number;
    vfunc_set_position(position: number): void;
    vfunc_set_selection_bounds(start_pos: number, end_pos: number): void;
}

Hierarchy (View Summary)

Index

Methods

  • Deletes a sequence of characters. The characters that are deleted are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the characters deleted are those from start_pos to the end of the text.

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

    Parameters

    • start_pos: number

      start position

    • end_pos: number

      end position

    Returns void

  • Deletes a sequence of characters. The characters that are deleted are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the characters deleted are those from start_pos to the end of the text.

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

    Parameters

    • start_pos: number

      start position

    • end_pos: number

      end position

    Returns void

  • Inserts new_text_length bytes of new_text into the contents of the widget, at position position.

    Note that the position is in characters, not in bytes. The function updates position to point after the newly inserted text.

    Parameters

    • new_text: string

      the text to append

    • new_text_length: number

      the length of the text in bytes, or -1

    • position: number

      location of the position text will be inserted at

    Returns number

  • Retrieves a sequence of characters. The characters that are retrieved are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the characters retrieved are those characters from start_pos to the end of the text.

    Note that positions are specified in characters, not bytes.

    Parameters

    • start_pos: number

      start of text

    • end_pos: number

      end of text

    Returns string

  • Retrieves the current position of the cursor relative to the start of the content of the editable.

    Note that this position is in characters, not in bytes.

    Returns number

  • Retrieves the selection bound of the editable. start_pos will be filled with the start of the selection and end_pos with end. If no text was selected both will be identical and false will be returned.

    Note that positions are specified in characters, not bytes.

    Returns [boolean, number, number]

  • Inserts new_text_length bytes of new_text into the contents of the widget, at position position.

    Note that the position is in characters, not in bytes. The function updates position to point after the newly inserted text.

    Parameters

    • new_text: string

      the text to append

    • new_text_length: number

      the length of the text in bytes, or -1

    • position: number

      location of the position text will be inserted at

    Returns number

  • Sets the cursor position in the editable to the given value.

    The cursor is displayed before the character with the given (base 0) index in the contents of the editable. The value must be less than or equal to the number of characters in the editable. A value of -1 indicates that the position should be set after the last character of the editable. Note that position is in characters, not in bytes.

    Parameters

    • position: number

      the position of the cursor

    Returns void

  • Selects a region of text. The characters that are selected are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the characters selected are those characters from start_pos to the end of the text.

    Note that positions are specified in characters, not bytes.

    Parameters

    • start_pos: number

      start of region

    • end_pos: number

      end of region

    Returns void