---
name: "Gtk2::Entry"
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::Entry"
---

# Gtk2::Entry(3pm)

wrapper for GtkEntry

## NAME

Gtk2::Entry - wrapper for GtkEntry

## HIERARCHY

```
  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Entry
```

## INTERFACES

```
  Glib::Object::_Unregistered::AtkImplementorIface
  Gtk2::Buildable
  Gtk2::Editable
  Gtk2::CellEditable
```

## METHODS

### widget = Gtk2::Entry-\>new

### widget = Gtk2::Entry-\>new\_with\_buffer ($buffer)

- •

  `$buffer` (Gtk2::EntryBuffer)

Since: gtk+ 2.18

### widget = Gtk2::Entry-\>new\_with\_max\_length ($max)

- •

  `$max` (integer)

### boolean = $entry-\>get\_activates\_default

### $entry-\>set\_activates\_default ($setting)

- •

  `$setting` (boolean)

### double = $entry-\>get\_alignment

Since: gtk+ 2.4

### $entry-\>set\_alignment ($xalign)

- •

  `$xalign` (double)

Since: gtk+ 2.4

### $entry-\>append\_text ($text)

- •

  `$text` (string)

### entrybuffer = $entry-\>get\_buffer

Since: gtk+ 2.18

### $entry-\>set\_buffer ($buffer)

- •

  `$buffer` (Gtk2::EntryBuffer)

Since: gtk+ 2.18

### entrycompletion or undef = $entry-\>get\_completion

Since: gtk+ 2.4

### $entry-\>set\_completion ($completion)

- •

  `$completion` (Gtk2::EntryCompletion or undef)

Since: gtk+ 2.4

### integer = $entry-\>get\_current\_icon\_drag\_source

Since: gtk+ 2.16

### adjustment or undef = $entry-\>get\_cursor\_hadjustment

Since: gtk+ 2.12

### $entry-\>set\_cursor\_hadjustment ($adjustment)

- •

  `$adjustment` (Gtk2::Adjustment or undef)

Since: gtk+ 2.12

### $entry-\>set\_editable ($editable)

- •

  `$editable` (boolean)

### boolean = $entry-\>get\_has\_frame

### $entry-\>set\_has\_frame ($setting)

- •

  `$setting` (boolean)

### boolean = $entry-\>get\_icon\_activatable ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### $entry-\>set\_icon\_activatable ($icon\_pos, $activatable)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$activatable` (boolean)

Since: gtk+ 2.16

### integer = $entry-\>get\_icon\_at\_pos ($x, $y)

- •

  `$x` (integer)

- •

  `$y` (integer)

Since: gtk+ 2.16

### $entry-\>set\_icon\_drag\_source ($icon\_pos, $target\_list, $actions)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$target_list` (Gtk2::TargetList)

- •

  `$actions` (Gtk2::Gdk::DragAction)

Since: gtk+ 2.16

### $entry-\>set\_icon\_from\_icon\_name ($icon\_pos, $icon\_name)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$icon_name` (string or undef)

Since: gtk+ 2.16

### $entry-\>set\_icon\_from\_pixbuf ($icon\_pos, $pixbuf)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$pixbuf` (Gtk2::Gdk::Pixbuf or undef)

Since: gtk+ 2.16

### $entry-\>set\_icon\_from\_stock ($icon\_pos, $stock\_id)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$stock_id` (string or undef)

Since: gtk+ 2.16

### string or undef = $entry-\>get\_icon\_name ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### pixbuf or undef = $entry-\>get\_icon\_pixbuf ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### boolean = $entry-\>get\_icon\_sensitive ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### $entry-\>set\_icon\_sensitive ($icon\_pos, $sensitive)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$sensitive` (boolean)

Since: gtk+ 2.16

### string or undef = $entry-\>get\_icon\_stock ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### imagetype = $entry-\>get\_icon\_storage\_type ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### string or undef = $entry-\>get\_icon\_tooltip\_markup ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### $entry-\>set\_icon\_tooltip\_markup ($icon\_pos, $tooltip)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$tooltip` (string or undef)

Since: gtk+ 2.16

### string or undef = $entry-\>get\_icon\_tooltip\_text ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.16

### $entry-\>set\_icon\_tooltip\_text ($icon\_pos, $tooltip)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

- •

  `$tooltip` (string or undef)

Since: gtk+ 2.16

### window = $entry-\>get\_icon\_window ($icon\_pos)

- •

  `$icon_pos` (Gtk2::EntryIconPosition)

Since: gtk+ 2.20

### boolean = $entry-\>im\_context\_filter\_keypress ($event)

- •

  `$event` (Gtk2::Gdk::Event)

Since: gtk+ 2.22

### border or undef = $entry-\>get\_inner\_border

Since: gtk+ 2.10

### $entry-\>set\_inner\_border ($border)

- •

  `$border` (Gtk2::Border or undef)

Since: gtk+ 2.10

### character = $entry-\>get\_invisible\_char

### $entry-\>set\_invisible\_char ($ch)

- •

  `$ch` (character)

### layout = $entry-\>get\_layout

### integer = $entry-\>layout\_index\_to\_text\_index ($layout\_index)

- •

  `$layout_index` (integer)

Since: gtk+ 2.6

### (x, y) = $entry-\>get\_layout\_offsets

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

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

- •

  `$max` (integer)

### boolean = $entry-\>get\_overwrite\_mode

Since: gtk+ 2.14

### $entry-\>set\_overwrite\_mode ($overwrite)

- •

  `$overwrite` (boolean)

Since: gtk+ 2.14

### $entry-\>set\_position ($position)

- •

  `$position` (integer)

### $entry-\>prepend\_text ($text)

- •

  `$text` (string)

### double = $entry-\>get\_progress\_fraction

Since: gtk+ 2.16

### $entry-\>set\_progress\_fraction ($fraction)

- •

  `$fraction` (double)

Since: gtk+ 2.16

### $entry-\>progress\_pulse

Since: gtk+ 2.16

### double = $entry-\>get\_progress\_pulse\_step

Since: gtk+ 2.16

### $entry-\>set\_progress\_pulse\_step ($fraction)

- •

  `$fraction` (double)

Since: gtk+ 2.16

### $entry-\>reset\_im\_context

Since: gtk+ 2.22

### $entry-\>select\_region ($start, $end)

- •

  `$start` (integer)

- •

  `$end` (integer)

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

### integer = $entry-\>text\_index\_to\_layout\_index ($text\_index)

- •

  `$text_index` (integer)

Since: gtk+ 2.6

### unsigned = $entry-\>get\_text\_length

Since: gtk+ 2.14

### $entry-\>set\_text ($text)

- •

  `$text` (string)

### window = $entry-\>get\_text\_window

Since: gtk+ 2.20

### $entry-\>unset\_invisible\_char

Since: gtk+ 2.16

### boolean = $entry-\>get\_visibility

### $entry-\>set\_visibility ($visible)

- •

  `$visible` (boolean)

### integer = $entry-\>get\_width\_chars

### $entry-\>set\_width\_chars ($n\_chars)

- •

  `$n_chars` (integer)

## PROPERTIES

- 'activates-default' (boolean : default false : readable / writable / private)

  Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed

- 'buffer' (Gtk2::EntryBuffer : default undef : readable / writable / construct / private)

  Text buffer object which actually stores entry text

- 'caps-lock-warning' (boolean : default true : readable / writable / private)

  Whether password entries will show a warning when Caps Lock is on

- 'cursor-position' (integer : default 0 : readable / private)

  The current position of the insertion cursor in chars

- 'editable' (boolean : default true : readable / writable / private)

  Whether the entry contents can be edited

- 'has-frame' (boolean : default true : readable / writable / private)

  FALSE removes outside bevel from entry

- 'im-module' (string : default undef : readable / writable / private)

  Which IM module should be used

- 'inner-border' (Gtk2::Border : default undef : readable / writable / private)

  Border between text and frame. Overrides the inner-border style property

- 'invisible-char' (Glib::UInt : default 42 "\*" : readable / writable / private)

  The character to use when masking entry contents (in "password mode")

- 'invisible-char-set' (boolean : default false : readable / writable / private)

  Whether the invisible char has been set

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

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

- 'overwrite-mode' (boolean : default false : readable / writable / private)

  Whether new text overwrites existing text

- 'primary-icon-activatable' (boolean : default false : readable / writable / private)

  Whether the primary icon is activatable

- 'primary-icon-gicon' (Glib::Object::\_Unregistered::GIcon : default undef : readable / writable / private)

  GIcon for primary icon

- 'primary-icon-name' (string : default undef : readable / writable / private)

  Icon name for primary icon

- 'primary-icon-pixbuf' (Gtk2::Gdk::Pixbuf : default undef : readable / writable / private)

  Primary pixbuf for the entry

- 'primary-icon-sensitive' (boolean : default true : readable / writable / private)

  Whether the primary icon is sensitive

- 'primary-icon-stock' (string : default undef : readable / writable / private)

  Stock ID for primary icon

- 'primary-icon-storage-type' (Gtk2::ImageType : default "empty" : readable / private)

  The representation being used for primary icon

- 'primary-icon-tooltip-markup' (string : default undef : readable / writable / private)

  The contents of the tooltip on the primary icon

- 'primary-icon-tooltip-text' (string : default undef : readable / writable / private)

  The contents of the tooltip on the primary icon

- 'progress-fraction' (double : default 0 : readable / writable / private)

  The current fraction of the task that's been completed

- 'progress-pulse-step' (double : default 0.1 : readable / writable / private)

  The fraction of total entry width to move the progress bouncing block for each call to *gtk\_entry\_progress\_pulse()*

- 'scroll-offset' (integer : default 0 : readable / private)

  Number of pixels of the entry scrolled off the screen to the left

- 'secondary-icon-activatable' (boolean : default false : readable / writable / private)

  Whether the secondary icon is activatable

- 'secondary-icon-gicon' (Glib::Object::\_Unregistered::GIcon : default undef : readable / writable / private)

  GIcon for secondary icon

- 'secondary-icon-name' (string : default undef : readable / writable / private)

  Icon name for secondary icon

- 'secondary-icon-pixbuf' (Gtk2::Gdk::Pixbuf : default undef : readable / writable / private)

  Secondary pixbuf for the entry

- 'secondary-icon-sensitive' (boolean : default true : readable / writable / private)

  Whether the secondary icon is sensitive

- 'secondary-icon-stock' (string : default undef : readable / writable / private)

  Stock ID for secondary icon

- 'secondary-icon-storage-type' (Gtk2::ImageType : default "empty" : readable / private)

  The representation being used for secondary icon

- 'secondary-icon-tooltip-markup' (string : default undef : readable / writable / private)

  The contents of the tooltip on the secondary icon

- 'secondary-icon-tooltip-text' (string : default undef : readable / writable / private)

  The contents of the tooltip on the secondary icon

- 'selection-bound' (integer : default 0 : readable / private)

  The position of the opposite end of the selection from the cursor in chars

- 'shadow-type' (Gtk2::ShadowType : default "in" : readable / writable / private)

  Which kind of shadow to draw around the entry when has-frame is set

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

  The contents of the entry

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

  Length of the text currently in the entry

- 'truncate-multiline' (boolean : default false : readable / writable / private)

  Whether to truncate multiline pastes to one line.

- 'visibility' (boolean : default true : readable / writable / private)

  FALSE displays the "invisible char" instead of the actual text (password mode)

- 'width-chars' (integer : default -1 : readable / writable / private)

  Number of characters to leave space for in the entry

- 'xalign' (float : default 0 : readable / writable / private)

  The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.

## STYLE PROPERTIES

- 'icon-prelight' (boolean : default true : readable / private)

  Whether activatable icons should prelight when hovered

- 'inner-border' (Gtk2::Border : default undef : readable / private)

  Border between text and frame.

- 'invisible-char' (Glib::UInt : default 0 "\\0" : readable / private)

  The character to use when masking entry contents (in "password mode")

- 'progress-border' (Gtk2::Border : default undef : readable / private)

  Border around the progress bar

- 'state-hint' (boolean : default false : readable / private)

  Whether to pass a proper state when drawing shadow or background

## SIGNALS

- **activate** (Gtk2::Entry)

  - **backspace** (Gtk2::Entry)

  - **copy-clipboard** (Gtk2::Entry)

  - **cut-clipboard** (Gtk2::Entry)

  - **delete-from-cursor** (Gtk2::Entry, Gtk2::DeleteType, integer)

  - **icon-press** (Gtk2::Entry, Gtk2::EntryIconPosition, Gtk2::Gdk::Event)

  - **icon-release** (Gtk2::Entry, Gtk2::EntryIconPosition, Gtk2::Gdk::Event)

  - **insert-at-cursor** (Gtk2::Entry, string)

  - **move-cursor** (Gtk2::Entry, Gtk2::MovementStep, integer, boolean)

  - **paste-clipboard** (Gtk2::Entry)

  - **populate-popup** (Gtk2::Entry, Gtk2::Menu)

  - **preedit-changed** (Gtk2::Entry, string)

  - **toggle-overwrite** (Gtk2::Entry)

  ## ENUMS AND FLAGS

### enum Gtk2::DeleteType

- •

  'chars' / 'GTK\_DELETE\_CHARS'

- •

  'word-ends' / 'GTK\_DELETE\_WORD\_ENDS'

- •

  'words' / 'GTK\_DELETE\_WORDS'

- •

  'display-lines' / 'GTK\_DELETE\_DISPLAY\_LINES'

- •

  'display-line-ends' / 'GTK\_DELETE\_DISPLAY\_LINE\_ENDS'

- •

  'paragraph-ends' / 'GTK\_DELETE\_PARAGRAPH\_ENDS'

- •

  'paragraphs' / 'GTK\_DELETE\_PARAGRAPHS'

- •

  'whitespace' / 'GTK\_DELETE\_WHITESPACE'

### enum Gtk2::EntryIconPosition

- •

  'primary' / 'GTK\_ENTRY\_ICON\_PRIMARY'

- •

  'secondary' / 'GTK\_ENTRY\_ICON\_SECONDARY'

### flags Gtk2::Gdk::DragAction

- •

  'default' / 'GDK\_ACTION\_DEFAULT'

- •

  'copy' / 'GDK\_ACTION\_COPY'

- •

  'move' / 'GDK\_ACTION\_MOVE'

- •

  'link' / 'GDK\_ACTION\_LINK'

- •

  'private' / 'GDK\_ACTION\_PRIVATE'

- •

  'ask' / 'GDK\_ACTION\_ASK'

### enum Gtk2::ImageType

- •

  'empty' / 'GTK\_IMAGE\_EMPTY'

- •

  'pixmap' / 'GTK\_IMAGE\_PIXMAP'

- •

  'image' / 'GTK\_IMAGE\_IMAGE'

- •

  'pixbuf' / 'GTK\_IMAGE\_PIXBUF'

- •

  'stock' / 'GTK\_IMAGE\_STOCK'

- •

  'icon-set' / 'GTK\_IMAGE\_ICON\_SET'

- •

  'animation' / 'GTK\_IMAGE\_ANIMATION'

- •

  'icon-name' / 'GTK\_IMAGE\_ICON\_NAME'

- •

  'gicon' / 'GTK\_IMAGE\_GICON'

### enum Gtk2::MovementStep

- •

  'logical-positions' / 'GTK\_MOVEMENT\_LOGICAL\_POSITIONS'

- •

  'visual-positions' / 'GTK\_MOVEMENT\_VISUAL\_POSITIONS'

- •

  'words' / 'GTK\_MOVEMENT\_WORDS'

- •

  'display-lines' / 'GTK\_MOVEMENT\_DISPLAY\_LINES'

- •

  'display-line-ends' / 'GTK\_MOVEMENT\_DISPLAY\_LINE\_ENDS'

- •

  'paragraphs' / 'GTK\_MOVEMENT\_PARAGRAPHS'

- •

  'paragraph-ends' / 'GTK\_MOVEMENT\_PARAGRAPH\_ENDS'

- •

  'pages' / 'GTK\_MOVEMENT\_PAGES'

- •

  'buffer-ends' / 'GTK\_MOVEMENT\_BUFFER\_ENDS'

- •

  'horizontal-pages' / 'GTK\_MOVEMENT\_HORIZONTAL\_PAGES'

### enum Gtk2::ShadowType

- •

  'none' / 'GTK\_SHADOW\_NONE'

- •

  'in' / 'GTK\_SHADOW\_IN'

- •

  'out' / 'GTK\_SHADOW\_OUT'

- •

  'etched-in' / 'GTK\_SHADOW\_ETCHED\_IN'

- •

  'etched-out' / 'GTK\_SHADOW\_ETCHED\_OUT'

## SEE ALSO

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget

## COPYRIGHT

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

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