Gnome::Gtk4::PasswordEntry
Description
Gnome::Gtk4::PasswordEntry is an entry that has been tailored for entering secrets.
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, Gnome::Gtk4::PasswordEntry 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.
Gnome::Gtk4::PasswordEntry provides only minimal API and should be used with the Gnome::Gtk4::R-Editable API.
CSS Nodes
Gnome::Gtk4::PasswordEntry 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
Gnome::Gtk4::PasswordEntry uses the GTK_ACCESSIBLE_ROLE_TEXT_BOX
role.
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-passwordentry
Creates a Gnome::Gtk4::PasswordEntry.
method new-passwordentry ( --> Gnome::Gtk4::PasswordEntry \)
Methods
get-extra-menu
Gets the menu model set with .set-extra-menu()
.
method get-extra-menu (--> N-Object )
Return value; the menu model.
get-show-peek-icon
Returns whether the entry is showing an icon to reveal the contents.
method get-show-peek-icon (--> Bool )
Return value; True
if an icon is shown.
set-extra-menu
Sets a menu model to add when constructing the context menu for $entry
.
method set-extra-menu ( N-Object() $model )
$model; a Gnome::Gio::MenuModel.
set-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.
method set-show-peek-icon ( Bool() $show-peek-icon )
$show-peek-icon; whether to show the peek icon.
Signals
activate
Emitted when the entry is activated.
The keybindings for this signal are all forms of the Enter key.
method handler ( Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::PasswordEntry :$_widget, *C<user>-options )
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::PasswordEntry object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.