Class: Gtk::EntryBuffer

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#bytesInteger

Retrieves the length in bytes of the buffer. See gtk_entry_buffer_get_length().

Returns:

  • (Integer)

    The byte length of the buffer.

#delete_text(position, n_chars) ⇒ Integer

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.

Parameters:

  • position (Integer)

    position at which to delete text

  • n_chars (Integer)

    number of characters to delete

Returns:

  • (Integer)

    The number of characters deleted.

#emit_deleted_text(position, n_chars) ⇒ nil

Used when subclassing Gtk::EntryBuffer

Parameters:

  • position (Integer)

    position at which text was deleted

  • n_chars (Integer)

    number of characters deleted

Returns:

  • (nil)

#emit_inserted_text(position, chars, n_chars) ⇒ nil

Used when subclassing Gtk::EntryBuffer

Parameters:

  • position (Integer)

    position at which text was inserted

  • chars (String)

    text that was inserted

  • n_chars (Integer)

    number of characters inserted

Returns:

  • (nil)

#insert_text(position, chars, n_chars) ⇒ Integer

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.

Parameters:

  • position (Integer)

    the position at which to insert text.

  • chars (String)

    the text to insert into the buffer.

  • n_chars (Integer)

    the length of the text in characters, or -1

Returns:

  • (Integer)

    The number of characters actually inserted.

#lengthInteger

The length (in characters) of the text in buffer.

Returns:

  • (Integer)

    length

#length=(length) ⇒ Integer

The length (in characters) of the text in buffer.

Parameters:

  • length (Integer)

Returns:

  • (Integer)

    length

  • (Integer)

    length

#max_lengthInteger

The maximum length (in characters) of the text in the buffer.

Returns:

  • (Integer)

    max-length

#max_length=(max_length) ⇒ Integer

The maximum length (in characters) of the text in the buffer.

Parameters:

  • max_length (Integer)

Returns:

  • (Integer)

    max-length

  • (Integer)

    max-length

#new(initial_chars, n_initial_chars) ⇒ Gtk::EntryBuffer

Create a new GtkEntryBuffer object.

Optionally, specify initial text to set in the buffer.

Parameters:

  • initial_chars (String)

    initial buffer text, or nil

  • n_initial_chars (Integer)

    number of characters in initial_chars, or -1

Returns:

#set_text(chars, n_chars) ⇒ nil

Sets the text in the buffer.

This is roughly equivalent to calling gtk_entry_buffer_delete_text() and gtk_entry_buffer_insert_text().

Note that n_chars is in characters, not in bytes.

Parameters:

  • chars (String)

    the new text

  • n_chars (Integer)

    the number of characters in text, or -1

Returns:

  • (nil)

#textString

The contents of the buffer.

Returns:

  • (String)

    text

#text=(text) ⇒ String

The contents of the buffer.

Parameters:

  • text (String)

Returns:

  • (String)

    text

  • (String)

    text