---
name: "Gtk2::EntryBuffer"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::EntryBuffer"
---

# Gtk2::EntryBuffer(3pm)

wrapper for GtkEntryBuffer

## NAME

Gtk2::EntryBuffer - wrapper for GtkEntryBuffer

## HIERARCHY

```
  Glib::Object
  +----Gtk2::EntryBuffer
```

The **Gtk2::EntryBuffer** class contains the actual text displayed in a Gtk2::Entry widget.

A single Gtk2::EntryBuffer object can be shared by multiple Gtk2::Entry widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc.

Gtk2::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.

## METHODS

### entrybuffer = Gtk2::EntryBuffer-\>new ($initial\_chars=undef)

- •

  `$initial_chars` (string)

### unsigned = $buffer-\>get\_bytes

### integer = $buffer-\>delete\_text ($position=0, $n\_chars=-1)

- •

  `$position` (integer)

- •

  `$n_chars` (integer)

### $buffer-\>emit\_deleted\_text ($position, $n\_chars)

- •

  `$position` (integer)

- •

  `$n_chars` (integer)

### $buffer-\>emit\_inserted\_text ($position, $chars, $n\_chars)

- •

  `$position` (integer)

- •

  `$chars` (string)

- •

  `$n_chars` (integer)

### $buffer-\>insert\_text ($position, $chars)

- •

  `$position` (integer)

- •

  `$chars` (string)

### integer = $buffer-\>get\_length

### integer = $buffer-\>get\_max\_length

### $buffer-\>set\_max\_length ($max\_length)

- •

  `$max_length` (integer)

### string = $buffer-\>get\_text

### $buffer-\>set\_text ($chars)

- •

  `$chars` (string)

## PROPERTIES

- 'length' (Glib::UInt : default 0 : readable / private)

  Length of the text currently in the buffer

- 'max-length' (integer : default 0 : readable / writable / private)

  Maximum number of characters for this entry. Zero if no maximum

- 'text' (string : default "" : readable / writable / private)

  The contents of the buffer

## SIGNALS

- **deleted-text** (Gtk2::EntryBuffer, Glib::UInt, Glib::UInt)

  - **inserted-text** (Gtk2::EntryBuffer, Glib::UInt, string, Glib::UInt)

  ## SEE ALSO

Gtk2, Glib::Object

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2 for a full notice.
