![]() |
![]() |
![]() |
libseahorse Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
SeahorseSecureEntry; GtkWidget* seahorse_secure_entry_new (void); void seahorse_secure_entry_reset_changed (SeahorseSecureEntry *entry); gboolean seahorse_secure_entry_get_changed (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_visibility (SeahorseSecureEntry *entry, gboolean setting); gboolean seahorse_secure_entry_get_visibility (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_invisible_char (SeahorseSecureEntry *entry, gunichar ch); gunichar seahorse_secure_entry_get_invisible_char (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_has_frame (SeahorseSecureEntry *entry, gboolean setting); gboolean seahorse_secure_entry_get_has_frame (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_max_length (SeahorseSecureEntry *entry, gint max); gint seahorse_secure_entry_get_max_length (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_activates_default (SeahorseSecureEntry *entry, gboolean setting); gboolean seahorse_secure_entry_get_activates_default (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_width_chars (SeahorseSecureEntry *entry, gint n_chars); gint seahorse_secure_entry_get_width_chars (SeahorseSecureEntry *entry); void seahorse_secure_entry_set_text (SeahorseSecureEntry *entry, const gchar *text); const gchar* seahorse_secure_entry_get_text (SeahorseSecureEntry *entry); PangoLayout* seahorse_secure_entry_get_layout (SeahorseSecureEntry *entry); void seahorse_secure_entry_get_layout_offsets (SeahorseSecureEntry *entry, gint *x, gint *y);
typedef struct { GtkWidget widget; gchar *text; guint overwrite_mode : 1; /* length in use, in chars */ guint16 text_length; guint16 text_max_length; } SeahorseSecureEntry;
void seahorse_secure_entry_reset_changed (SeahorseSecureEntry *entry);
|
gboolean seahorse_secure_entry_get_changed (SeahorseSecureEntry *entry);
|
|
Returns : |
void seahorse_secure_entry_set_visibility (SeahorseSecureEntry *entry, gboolean setting);
|
|
|
gboolean seahorse_secure_entry_get_visibility (SeahorseSecureEntry *entry);
|
|
Returns : |
void seahorse_secure_entry_set_invisible_char (SeahorseSecureEntry *entry, gunichar ch);
Sets the character to use in place of the actual text when
seahorse_secure_entry_set_visibility()
has been called to set text
to FALSE
. i.e. this is the character used in "password mode" to
show the user how many characters have been typed. The default
invisible char is an asterisk ('*'). If you set the invisible char
to 0, then the user will get no feedback at all; there will be
no text on the screen as they type.
|
a SeahorseSecureEntry |
|
a Unicode character |
gunichar seahorse_secure_entry_get_invisible_char (SeahorseSecureEntry *entry);
Retrieves the character displayed in place of the real characters
for entries with visisbility set to false. See seahorse_secure_entry_set_invisible_char()
.
|
a SeahorseSecureEntry |
Returns : |
the current invisible char, or 0, if the entry does not show invisible text at all. |
void seahorse_secure_entry_set_has_frame (SeahorseSecureEntry *entry, gboolean setting);
Sets whether the entry has a beveled frame around it.
|
a SeahorseSecureEntry |
|
new value |
gboolean seahorse_secure_entry_get_has_frame (SeahorseSecureEntry *entry);
Gets the value set by seahorse_secure_entry_set_has_frame()
.
|
a SeahorseSecureEntry |
Returns : |
whether the entry has a beveled frame |
void seahorse_secure_entry_set_max_length (SeahorseSecureEntry *entry, gint max);
Sets the maximum allowed length of the contents of the widget. If the current contents are longer than the given length, then they will be truncated to fit.
|
a SeahorseSecureEntry. |
|
the maximum length of the entry, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536. |
gint seahorse_secure_entry_get_max_length (SeahorseSecureEntry *entry);
Retrieves the maximum allowed length of the text in
entry
. See seahorse_secure_entry_set_max_length()
.
|
a SeahorseSecureEntry |
Returns : |
the maximum allowed number of characters in SeahorseSecureEntry, or 0 if there is no maximum. |
void seahorse_secure_entry_set_activates_default (SeahorseSecureEntry *entry, gboolean setting);
If setting
is TRUE
, pressing Enter in the entry
will activate the default
widget for the window containing the entry. This usually means that
the dialog box containing the entry will be closed, since the default
widget is usually one of the dialog buttons.
(For experts: if setting
is TRUE
, the entry calls
gtk_window_activate_default()
on the window containing the entry, in
the default handler for the "activate" signal.)
|
a SeahorseSecureEntry |
|
TRUE to activate window's default widget on Enter keypress
|
gboolean seahorse_secure_entry_get_activates_default (SeahorseSecureEntry *entry);
Retrieves the value set by seahorse_secure_entry_set_activates_default()
.
|
a SeahorseSecureEntry |
Returns : |
TRUE if the entry will activate the default widget
|
void seahorse_secure_entry_set_width_chars (SeahorseSecureEntry *entry, gint n_chars);
Changes the size request of the entry to be about the right size
for n_chars
characters. Note that it changes the size
request, the size can still be affected by
how you pack the widget into containers. If n_chars
is -1, the
size reverts to the default entry size.
|
a SeahorseSecureEntry |
|
width in chars |
gint seahorse_secure_entry_get_width_chars (SeahorseSecureEntry *entry);
Gets the value set by seahorse_secure_entry_set_width_chars()
.
|
a SeahorseSecureEntry |
Returns : |
number of chars to request space for, or negative if unset |
void seahorse_secure_entry_set_text (SeahorseSecureEntry *entry, const gchar *text);
|
|
|
const gchar* seahorse_secure_entry_get_text (SeahorseSecureEntry *entry);
Retrieves the contents of the entry widget.
See also gtk_editable_get_chars()
.
|
a SeahorseSecureEntry |
Returns : |
a pointer to the contents of the widget as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored. |
PangoLayout* seahorse_secure_entry_get_layout (SeahorseSecureEntry *entry);
Gets the PangoLayout used to display the entry.
The layout is useful to e.g. convert text positions to
pixel positions, in combination with seahorse_secure_entry_get_layout_offsets()
.
The returned layout is owned by the entry so need not be
freed by the caller.
Keep in mind that the layout text may contain a preedit string, so
seahorse_secure_entry_layout_index_to_text_index()
and
seahorse_secure_entry_text_index_to_layout_index()
are needed to convert byte
indices in the layout to byte indices in the entry contents.
|
a SeahorseSecureEntry |
Returns : |
the PangoLayout for this entry |
void seahorse_secure_entry_get_layout_offsets (SeahorseSecureEntry *entry, gint *x, gint *y);
Obtains the position of the PangoLayout used to render text in the entry, in widget coordinates. Useful if you want to line up the text in an entry with some other text, e.g. when using the entry to implement editable cells in a sheet widget.
Also useful to convert mouse events into coordinates inside the PangoLayout, e.g. to take some action if some part of the entry text is clicked.
Note that as the user scrolls around in the entry the offsets will
change; you'll need to connect to the "notify::scroll_offset"
signal to track this. Remember when using the PangoLayout
functions you need to convert to and from pixels using
PANGO_PIXELS()
or PANGO_SCALE.
Keep in mind that the layout text may contain a preedit string, so
seahorse_secure_entry_layout_index_to_text_index()
and
seahorse_secure_entry_text_index_to_layout_index()
are needed to convert byte
indices in the layout to byte indices in the entry contents.
|
a SeahorseSecureEntry |
|
location to store X offset of layout, or NULL
|
|
location to store Y offset of layout, or NULL
|