GtkPasswordEntry — An entry for secrets
GtkWidget * | gtk_password_entry_new () |
void | gtk_password_entry_set_show_peek_icon () |
gboolean | gtk_password_entry_get_show_peek_icon () |
void | gtk_password_entry_set_extra_menu () |
GMenuModel * | gtk_password_entry_get_extra_menu () |
gboolean | activates-default | Read / Write |
GMenuModel * | extra-menu | Read / Write |
char * | placeholder-text | Read / Write |
gboolean | show-peek-icon | Read / Write |
void | activate | Action |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkPasswordEntry
GtkPasswordEntry implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkEditable.
#include <gtk/gtk.h>
GtkPasswordEntry is 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, 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.
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.
GtkPasswordEntry uses the GTK_ACCESSIBLE_ROLE_TEXT_BOX role.
GtkWidget *
gtk_password_entry_new (void
);
Creates a GtkPasswordEntry.
a new GtkPasswordEntry
void gtk_password_entry_set_show_peek_icon (GtkPasswordEntry *entry
,gboolean show_peek_icon
);
Sets whether the entry should have a clickable icon to show the contents of the entry in clear text.
Setting this to FALSE
also hides the text again.
entry | ||
show_peek_icon | whether to show the peek icon |
gboolean
gtk_password_entry_get_show_peek_icon (GtkPasswordEntry *entry
);
Returns whether the entry is showing a clickable icon to reveal the contents of the entry in clear text.
entry |
TRUE
if an icon is shown
void gtk_password_entry_set_extra_menu (GtkPasswordEntry *entry
,GMenuModel *model
);
Sets a menu model to add when constructing the context menu for entry
.
entry | ||
model | a GMenuModel. | [allow-none] |
GMenuModel *
gtk_password_entry_get_extra_menu (GtkPasswordEntry *entry
);
Gets the menu model set with gtk_password_entry_set_extra_menu()
.
entry | a GtkText |
(nullable): the menu model.
[transfer none]
typedef struct _GtkPasswordEntry GtkPasswordEntry;
“activates-default”
property“activates-default” gboolean
Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed.
Owner: GtkPasswordEntry
Flags: Read / Write
Default value: FALSE
“extra-menu”
property“extra-menu” GMenuModel *
A menu model whose contents will be appended to the context menu.
Owner: GtkPasswordEntry
Flags: Read / Write
“placeholder-text”
property“placeholder-text” char *
Show text in the entry when it’s empty and unfocused.
Owner: GtkPasswordEntry
Flags: Read / Write
Default value: NULL
“show-peek-icon”
property“show-peek-icon” gboolean
Whether to show an icon for revealing the content.
Owner: GtkPasswordEntry
Flags: Read / Write
Default value: FALSE
“activate”
signalvoid user_function (GtkPasswordEntry *passwordentry, gpointer user_data)
Flags: Action
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkPasswordEntry.html