Class

GtkPasswordEntry

[]

Description [src]

final class Gtk.PasswordEntry : Gtk.Widget
  implements Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget, Gtk.Editable {
  /* No available fields */
}

A single-line text entry widget for entering passwords and other secrets.

An example GtkPasswordEntry

It does not show its contents in clear text, does not allow to copy it to the clipboard, and it shows a warning when Caps Lock is engaged. If the underlying platform allows it, GtkPasswordEntry will also place the text in a non-pageable memory area, to avoid it being written out to disk by the operating system.

Optionally, it can offer a way to reveal the contents in clear text.

GtkPasswordEntry provides only minimal API and should be used with the GtkEditable API.

CSS Nodes

entry.password
╰── text
    ├── image.caps-lock-indicator
    ┊

GtkPasswordEntry has a single CSS node with name entry that carries a .passwordstyle class. The text Css node below it has a child with name image and style class .caps-lock-indicator for the Caps Lock icon, and possibly other children.

Accessibility

GtkPasswordEntry uses the GTK_ACCESSIBLE_ROLE_TEXT_BOX role.

[]

Hierarchy

hierarchy this GtkPasswordEntry implements_0 GtkAccessible this--implements_0 implements_1 GtkBuildable this--implements_1 implements_2 GtkConstraintTarget this--implements_2 implements_3 GtkEditable this--implements_3 ancestor_0 GtkWidget ancestor_0--this ancestor_1 GInitiallyUnowned ancestor_1--ancestor_0 ancestor_2 GObject ancestor_2--ancestor_1
[]

Constructors

gtk_password_entry_new

Creates a GtkPasswordEntry.

[]

Instance methods

gtk_password_entry_get_extra_menu

Gets the menu model set with gtk_password_entry_set_extra_menu().

gtk_password_entry_get_show_peek_icon

Returns whether the entry is showing an icon to reveal the contents.

gtk_password_entry_set_extra_menu

Sets a menu model to add when constructing the context menu for entry.

gtk_password_entry_set_show_peek_icon

Sets whether the entry should have a clickable icon to reveal the contents.

Methods inherited from GtkWidget (164)
Methods inherited from GObject (43)
Methods inherited from GtkAccessible (20)
Methods inherited from GtkBuildable (1)
Methods inherited from GtkEditable (24)
[]

Properties

Gtk.PasswordEntry:activates-default

Whether to activate the default widget when Enter is pressed.

Gtk.PasswordEntry:extra-menu

A menu model whose contents will be appended to the context menu.

Gtk.PasswordEntry:placeholder-text

The text that will be displayed in the GtkPasswordEntry when it is empty and unfocused.

Gtk.PasswordEntry:show-peek-icon

Whether to show an icon for revealing the content.

Properties inherited from GtkWidget (35)
Properties inherited from GtkAccessible (1)
Properties inherited from GtkEditable (8)
[]

Signals

Gtk.PasswordEntry::activate

Emitted when the entry is activated.

Signals inherited from GtkWidget (13)
Signals inherited from GObject (1)
Signals inherited from GtkEditable (3)

Class structure