Class PasswordEntry

All Implemented Interfaces:
PointerInterface

public class PasswordEntry extends Widget
`GtkPasswordEntry` is an entry that has been tailored for entering secrets.

![An example GtkPasswordEntry](password-entry.png)

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 [iface@Gtk.Editable] 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.

https://docs.gtk.org/gtk4/class.PasswordEntry.html

  • Field Details

  • Constructor Details

    • PasswordEntry

      public PasswordEntry(PointerContainer pointer)
    • PasswordEntry

      public PasswordEntry()
      Creates a `GtkPasswordEntry`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getExtraMenu

      public MenuModel getExtraMenu()
      Gets the menu model set with gtk_password_entry_set_extra_menu().
      Returns:
      the menu model
    • getShowPeekIcon

      public boolean getShowPeekIcon()
      Returns whether the entry is showing an icon to
      reveal the contents.
      Returns:
      %TRUE if an icon is shown
    • setExtraMenu

      public void setExtraMenu(@Nullable MenuModel model)
      Sets a menu model to add when constructing
      the context menu for @entry.
      Parameters:
      model - a `GMenuModel`
    • setShowPeekIcon

      public void setShowPeekIcon(boolean show_peek_icon)
      Sets whether the entry should have a clickable icon
      to reveal the contents.

      Setting this to %FALSE also hides the text again.
      Parameters:
      show_peek_icon - whether to show the peek icon
    • onActivate

      public SignalHandler onActivate(PasswordEntry.OnActivate signal)
      Connect to signal "activate".
      See PasswordEntry.OnActivate.onActivate() for signal description.
      Field SIGNAL_ON_ACTIVATE contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asEditable

      public Editable asEditable()
      Implements interface Editable. Call this to get access to interface functions.
      Returns:
      Editable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()