gtk.EntryBuffer stores text for display in a gtk.Entry (new in PyGTK 2.22) Synopsis gtk.EntryBuffer gtk.EntryBuffer initial_chars n_initial_chars get_bytes get_length set_text chars n_chars get_text set_max_length max_length get_max_length insert_text position chars n_chars delete_text position n_chars emit_inserted_text position chars n_chars emit_deleted_text position n_chars Ancestry +-- gobject.GObject +-- gtk.EntryBuffer gtk.EntryBuffer Properties
"length" Read The length (in characters) of the text in buffer. Allowed values: <=65535. Default value: 0. "max-length" Read/Write The maximum length (in characters) of the text in the buffer. Allowed values: <=65535. Default value: 0. "text" Read/Write The contents of the buffer. Default value: "".
gtk.EntryBuffer Signal Prototypes gobject.GObject Signal Prototypes "deleted-text" callback buffer position n_chars user_param1 ... "inserted-text" callback buffer position chars n_chars user_param1 ... Description The gtk.EntryBuffer class contains the actual text displayed in a gtk.Entry widget. A single gtk.EntryBuffer object can be shared by multiple gtk.Entry widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc. gtk.EntryBuffer may be derived from. Such a derived class might allow text to be stored in an alternate location, such as non-pageable memory, useful in the case of important passwords. Or a derived class could integrate with an application's concept of undo/redo. Constructor gtk.EntryBuffer initial_chars n_initial_chars initial_chars : initial buffer text, or None. n_initial_chars : number of characters in initial_chars, or -1. Returns : a new gtk.EntryBuffer. This constructor is available in PyGTK 2.22 and above. Creates a new gtk.EntryBuffer object. Methods gtk.EntryBuffer.get_bytes get_bytes Returns : the byte length of the buffer. This method is available in PyGTK 2.22 and above. The get_bytes() method retrieves the length in bytes of the buffer. See gtk.EntryBuffer.get_length(). gtk.EntryBuffer.get_length get_length Returns : the number of characters in the buffer. This method is available in PyGTK 2.22 and above. The get_length() method retrieves the length in characters of the buffer. gtk.EntryBuffer.set_text set_text chars n_chars chars : the new text n_chars : the number of characters, or -1 This method is available in PyGTK 2.22 and above. The set_text() method sets the text in the buffer. gtk.EntryBuffer.get_text get_text Returns : the contents of the buffer. This method is available in PyGTK 2.22 and above. The get_text() method retrieves the contents of the buffer. gtk.EntryBuffer.set_max_length set_max_length max_length max_length : the maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536. This method is available in PyGTK 2.22 and above. The set_max_length() sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit. gtk.EntryBuffer.get_max_length get_max_length Returns : the maximum allowed number of characters in the entry buffer, or 0 if there is no maximum. This method is available in PyGTK 2.22 and above. The get_max_length() method retrieves the maximum allowed length of the text in buffer. See gtk.EntryBuffer.set_max_length(). gtk.EntryBuffer.insert_text insert_text position chars n_chars position : the position at which to insert text. chars : the text to insert into the buffer. n_chars : the length of the text in characters, or -1. This method is available in PyGTK 2.22 and above. The insert_text() method inserts n_chars characters of chars into the contents of the buffer, at position position. gtk.EntryBuffer.delete_text delete_text position n_chars position : the position at which to delete text. n_chars : the number of characters to delete. This method is available in PyGTK 2.22 and above. The delete_text() method 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. . gtk.EntryBuffer.emit_inserted_text emit_inserted_text position chars n_chars position : the position at which text was inserted. chars : the text that was inserted. n_chars : the number of characters inserted. This method is available in PyGTK 2.22 and above. The emit_inserted_text() method can be used when subclassing gtk.EntryBuffer. gtk.EntryBuffer.emit_deleted_text emit_deleted_text position n_chars position : the position at which text was deleted. n_chars : the number of characters deleted. This method is available in PyGTK 2.22 and above. The emit_deleted_text() method can be used when subclassing gtk.EntryBuffer. Signals The "deleted-text" gtk.EntryBuffer Signal callback buffer position n_chars user_param1 ... buffer : the buffer that received the signal position : the the position the text was deleted at n_chars : the number of characters that were deleted user_param1 : the first user parameter (if any) specified with the connect() method ... : additional user parameters (if any) The "activate" signal is emitted after text is deleted from the buffer. The "inserted-text" gtk.EntryBuffer Signal callback buffer position chars n_chars user_param1 ... buffer : the buffer that received the signal position : the position the text was inserted at chars : the text that was inserted n_chars : the number of characters that were inserted user_param1 : the first user parameter (if any) specified with the connect() method ... : additional user parameters (if any) The "activate" signal is emitted after text is inserted into the buffer.