Class: Gtk::EntryBuffer
- Inherits:
-
Object
- Object
- Gtk::EntryBuffer
- Defined in:
- lib/gtk3/entry-buffer.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#bytes ⇒ Integer
Retrieves the length in bytes of the buffer.
-
#delete_text(position, n_chars) ⇒ Integer
Deletes a sequence of characters from the buffer.
-
#emit_deleted_text(position, n_chars) ⇒ nil
Used when subclassing
GtkEntryBuffer. -
#emit_inserted_text(position, chars, n_chars) ⇒ nil
Used when subclassing
GtkEntryBuffer. -
#initialize(text = nil) ⇒ Gtk::EntryBuffer
constructor
Create a new
GtkEntryBufferobject. -
#initialize_raw ⇒ Gtk::EntryBuffer
Create a new
GtkEntryBufferobject. -
#insert_text(position, chars, n_chars) ⇒ Integer
Inserts n_chars characters of chars into the contents of the buffer, at position position.
-
#length ⇒ Integer
The length (in characters) of the text in buffer.
-
#length=(length) ⇒ Integer
The length (in characters) of the text in buffer.
-
#max_length ⇒ Integer
The maximum length (in characters) of the text in the buffer.
-
#max_length=(max_length) ⇒ Integer
The maximum length (in characters) of the text in the buffer.
-
#set_text(chars, n_chars) ⇒ nil
Sets the text in the buffer.
-
#text ⇒ String
The contents of the buffer.
-
#text=(text) ⇒ String
The contents of the buffer.
Constructor Details
#initialize(text = nil) ⇒ Gtk::EntryBuffer
Create a new GtkEntryBuffer object.
Optionally, specify initial text to set in the buffer.
20 21 22 23 24 25 26 |
# File 'lib/gtk3/entry-buffer.rb', line 20 def initialize(text=nil) if text.nil? initialize_raw(nil, -1) else initialize_raw(text, text.size) end end |
Instance Method Details
#bytes ⇒ Integer
Retrieves the length in bytes of the buffer.
See [methodGtk.EntryBuffer.get_length].
#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.
#emit_deleted_text(position, n_chars) ⇒ nil
Used when subclassing GtkEntryBuffer.
#emit_inserted_text(position, chars, n_chars) ⇒ nil
Used when subclassing GtkEntryBuffer.
#initialize_raw ⇒ Gtk::EntryBuffer
Create a new GtkEntryBuffer object.
Optionally, specify initial text to set in the buffer.
|
|
# File 'lib/gtk3/entry-buffer.rb', line 19
|
#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.
#length ⇒ Integer
The length (in characters) of the text in buffer.
#length=(length) ⇒ Integer
The length (in characters) of the text in buffer.
#max_length ⇒ Integer
The maximum length (in characters) of the text in the buffer.
#max_length=(max_length) ⇒ Integer
The maximum length (in characters) of the text in the buffer.
#set_text(chars, n_chars) ⇒ nil
Sets the text in the buffer.
This is roughly equivalent to calling [methodGtk.EntryBuffer.delete_text] and [methodGtk.EntryBuffer.insert_text].
Note that n_chars is in characters, not in bytes.
#text ⇒ String
The contents of the buffer.
#text=(text) ⇒ String
The contents of the buffer.