Gtk.Entry¶
Example¶
- Subclasses:
Methods¶
- Inherited:
Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.Editable (13)
- Structs:
Virtual Methods¶
- Inherited:
Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.CellEditable (3), Gtk.Editable (10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed |
||
r/w/en |
A list of style attributes to apply to the text of the label |
||
r/w/c/en |
Text buffer object which actually stores entry text |
||
r/w/en |
Whether password entries will show a warning when Caps Lock is on |
||
r/w/en |
The auxiliary completion object |
||
r |
The current position of the insertion cursor in chars |
||
r/w/en |
Whether the entry contents can be edited |
||
r/w/en |
Whether to suggest Emoji replacements |
||
r/w/en |
|
||
r/w/en |
Which IM module should be used |
||
d/r/w/en |
Border between text and frame. Overrides the inner-border style property |
||
r/w/en |
Hints for the text field behaviour |
||
r/w/en |
Purpose of the text field |
||
r/w/en |
The character to use when masking entry contents (in “password mode”) |
||
r/w |
Whether the invisible character has been set |
||
r/w/en |
Maximum number of characters for this entry. Zero if no maximum |
||
r/w/en |
The desired maximum width of the entry, in characters |
||
r/w/en |
Whether new text overwrites existing text |
||
r/w/en |
Show text in the entry when it’s empty and unfocused |
||
r/w/en |
Whether to emit |
||
r/w/en |
Whether the primary icon is activatable |
||
r/w/en |
|
||
r/w/en |
Icon name for primary icon |
||
r/w/en |
Primary pixbuf for the entry |
||
r/w/en |
Whether the primary icon is sensitive |
||
d/r/w/en |
Stock ID for primary icon |
||
r |
The representation being used for primary icon |
||
r/w/en |
The contents of the tooltip on the primary icon |
||
r/w/en |
The contents of the tooltip on the primary icon |
||
r/w/en |
The current fraction of the task that’s been completed |
||
r/w/en |
The fraction of total entry width to move the progress bouncing block for each call to |
||
r/en |
Number of pixels of the entry scrolled off the screen to the left |
||
r/w/en |
Whether the secondary icon is activatable |
||
r/w/en |
|
||
r/w/en |
Icon name for secondary icon |
||
r/w/en |
Secondary pixbuf for the entry |
||
r/w/en |
Whether the secondary icon is sensitive |
||
d/r/w/en |
Stock ID for secondary icon |
||
r |
The representation being used for secondary icon |
||
r/w/en |
The contents of the tooltip on the secondary icon |
||
r/w/en |
The contents of the tooltip on the secondary icon |
||
r |
The position of the opposite end of the selection from the cursor in chars |
||
d/r/w/en |
Which kind of shadow to draw around the entry when has-frame is set |
||
r/w/en |
Whether to show an icon for Emoji |
||
r/w/en |
A list of tabstop locations to apply to the text of the entry |
||
r/w/en |
The contents of the entry |
||
r |
Length of the text currently in the entry |
||
r/w/en |
Whether to truncate multiline pastes to one line. |
||
r/w/en |
|
||
r/w/en |
Number of characters to leave space for in the entry |
||
r/w/en |
The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts. |
Style Properties¶
- Inherited:
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
d/r |
Whether activatable icons should prelight when hovered |
||
|
d/r |
Border between text and frame. |
||
|
|
r |
The character to use when masking entry contents (in “password mode”) |
|
|
d/r |
Border around the progress bar |
Signals¶
Name |
Short Description |
---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
If an input method is used, the typed text will not immediately be committed to the buffer. |
|
The |
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.Entry(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Gtk.Entry
widget is a single line text entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.When using an entry for passwords and other sensitive information, it can be put into “password mode” using
Gtk.Entry.set_visibility
(). In this mode, entered text is displayed using a “invisible” character. By default, GTK+ picks the best invisible character that is available in the current font, but it can be changed withGtk.Entry.set_invisible_char
(). Since 2.16, GTK+ displays a warning when Caps Lock or input methods might interfere with entering text in a password entry. The warning can be turned off with theGtk.Entry
:caps-lock-warning
property.Since 2.16,
Gtk.Entry
has the ability to display progress or activity information behind the text. To make an entry display such information, useGtk.Entry.set_progress_fraction
() orGtk.Entry.set_progress_pulse_step
().Additionally,
Gtk.Entry
can show icons at either side of the entry. These icons can be activatable by clicking, can be set up as drag source and can have tooltips. To add an icon, useGtk.Entry.set_icon_from_gicon
() or one of the various other functions that set an icon from a stock id, an icon name or a pixbuf. To trigger an action when the user clicks an icon, connect to theGtk.Entry
::icon-press
signal. To allow DND operations from an icon, useGtk.Entry.set_icon_drag_source
(). To set a tooltip on an icon, useGtk.Entry.set_icon_tooltip_text
() or the corresponding function for markup.Note that functionality or information that is only available by clicking on an icon in an entry may not be accessible at all to users which are not able to use a mouse or other pointing device. It is therefore recommended that any such functionality should also be available by other means, e.g. via the context menu of the entry.
- CSS nodes
entry[.read-only][.flat][.warning][.error] ├── image.left ├── image.right ├── undershoot.left ├── undershoot.right ├── [selection] ├── [progress[.pulse]] ╰── [window.popup]
Gtk.Entry
has a main node with the name entry. Depending on the properties of the entry, the style classes .read-only and .flat may appear. The style classes .warning and .error may also be used with entries.When the entry shows icons, it adds subnodes with the name image and the style class .left or .right, depending on where the icon appears.
When the entry has a selection, it adds a subnode with the name selection.
When the entry shows progress, it adds a subnode with the name progress. The node has the style class .pulse when the shown progress is pulsing.
The CSS node for a context menu is added as a subnode below entry as well.
The undershoot nodes are used to draw the underflow indication when content is scrolled out of view. These nodes get the .left and .right style classes added depending on where the indication is drawn.
When touch is used and touch selection handles are shown, they are using CSS nodes with name cursor-handle. They get the .top or .bottom style class depending on where they are shown in relation to the selection. If there is just a single handle for the text cursor, it gets the style class .insertion-cursor.
- classmethod new_with_buffer(buffer)[source]¶
- Parameters:
buffer (
Gtk.EntryBuffer
) – The buffer to use for the newGtk.Entry
.- Returns:
a new
Gtk.Entry
- Return type:
Creates a new entry with the specified text buffer.
New in version 2.18.
- get_activates_default()[source]¶
-
Retrieves the value set by
Gtk.Entry.set_activates_default
().
- get_alignment()[source]¶
- Returns:
the alignment
- Return type:
Gets the value set by
Gtk.Entry.set_alignment
().New in version 2.4.
- get_attributes()[source]¶
- Returns:
the attribute list, or
None
if none was set.- Return type:
Gets the attribute list that was set on the entry using
Gtk.Entry.set_attributes
(), if any.New in version 3.6.
- get_buffer()[source]¶
- Returns:
A
Gtk.EntryBuffer
object.- Return type:
Get the
Gtk.EntryBuffer
object which holds the text for this widget.New in version 2.18.
- get_completion()[source]¶
- Returns:
The auxiliary completion object currently in use by self.
- Return type:
Returns the auxiliary completion object currently in use by self.
New in version 2.4.
- get_current_icon_drag_source()[source]¶
- Returns:
index of the icon which is the source of the current DND operation, or -1.
- Return type:
Returns the index of the icon which is the source of the current DND operation, or -1.
This function is meant to be used in a
Gtk.Widget
::drag-data-get
callback.New in version 2.16.
- get_cursor_hadjustment()[source]¶
- Returns:
the horizontal cursor adjustment, or
None
if none has been set.- Return type:
Retrieves the horizontal cursor adjustment for the entry. See
Gtk.Entry.set_cursor_hadjustment
().New in version 2.12.
- get_has_frame()[source]¶
- Returns:
whether the entry has a beveled frame
- Return type:
Gets the value set by
Gtk.Entry.set_has_frame
().
- get_icon_activatable(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
True
if the icon is activatable.- Return type:
Returns whether the icon is activatable.
New in version 2.16.
- get_icon_area(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
Return location for the icon’s area
- Return type:
icon_area:
Gdk.Rectangle
Gets the area where entry’s icon at icon_pos is drawn. This function is useful when drawing something to the entry in a draw callback.
If the entry is not realized or has no icon at the given position, icon_area is filled with zeros. Otherwise, icon_area will be filled with the icon’s allocation, relative to self’s allocation.
See also
Gtk.Entry.get_text_area
()New in version 3.0.
- get_icon_at_pos(x, y)[source]¶
- Parameters:
- Returns:
the index of the icon at the given position, or -1
- Return type:
Finds the icon at the given position and return its index. The position’s coordinates are relative to the self’s top left corner. If x, y doesn’t lie inside an icon, -1 is returned. This function is intended for use in a
Gtk.Widget
::query-tooltip
signal handler.New in version 2.16.
- get_icon_gicon(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
A
Gio.Icon
, orNone
if no icon is set or if the icon is not aGio.Icon
- Return type:
Retrieves the
Gio.Icon
used for the icon, orNone
if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name).New in version 2.16.
- get_icon_name(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
An icon name, or
None
if no icon is set or if the icon wasn’t set from an icon name- Return type:
Retrieves the icon name used for the icon, or
None
if there is no icon or if the icon was set by some other method (e.g., by pixbuf, stock or gicon).New in version 2.16.
- get_icon_pixbuf(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
A
GdkPixbuf.Pixbuf
, orNone
if no icon is set for this position.- Return type:
Retrieves the image used for the icon.
Unlike the other methods of setting and getting icon data, this method will work regardless of whether the icon was set using a
GdkPixbuf.Pixbuf
, aGio.Icon
, a stock item, or an icon name.New in version 2.16.
- get_icon_sensitive(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
True
if the icon is sensitive.- Return type:
Returns whether the icon appears sensitive or insensitive.
New in version 2.16.
- get_icon_stock(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
A stock id, or
None
if no icon is set or if the icon wasn’t set from a stock id- Return type:
Retrieves the stock id used for the icon, or
None
if there is no icon or if the icon was set by some other method (e.g., by pixbuf, icon name or gicon).New in version 2.16.
Deprecated since version 3.10: Use
Gtk.Entry.get_icon_name
() instead.
- get_icon_storage_type(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position- Returns:
image representation being used
- Return type:
Gets the type of representation being used by the icon to store image data. If the icon has no image data, the return value will be
Gtk.ImageType.EMPTY
.New in version 2.16.
- get_icon_tooltip_markup(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – the icon position- Returns:
the tooltip text, or
None
. Free the returned string withGLib.free
() when done.- Return type:
Gets the contents of the tooltip on the icon at the specified position in self.
New in version 2.16.
- get_icon_tooltip_text(icon_pos)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – the icon position- Returns:
the tooltip text, or
None
. Free the returned string withGLib.free
() when done.- Return type:
Gets the contents of the tooltip on the icon at the specified position in self.
New in version 2.16.
- get_inner_border()[source]¶
- Returns:
the entry’s
Gtk.Border
, orNone
if none was set.- Return type:
Gtk.Border
orNone
This function returns the entry’s
Gtk.Entry
:inner-border
property. SeeGtk.Entry.set_inner_border
() for more information.New in version 2.10.
Deprecated since version 3.4: Use the standard border and padding CSS properties (through objects like
Gtk.StyleContext
andGtk.CssProvider
); the value returned by this function is ignored byGtk.Entry
.
- get_input_hints()[source]¶
- Return type:
Gets the value of the
Gtk.Entry
:input-hints
property.New in version 3.6.
- get_input_purpose()[source]¶
- Return type:
Gets the value of the
Gtk.Entry
:input-purpose
property.New in version 3.6.
- get_invisible_char()[source]¶
- Returns:
the current invisible
str
, or 0, if the entry does not show invisible text at all.- Return type:
Retrieves the character displayed in place of the real characters for entries with visibility set to false. See
Gtk.Entry.set_invisible_char
().
- get_layout()[source]¶
- Returns:
the
Pango.Layout
for this entry- Return type:
Gets the
Pango.Layout
used to display the entry. The layout is useful to e.g. convert text positions to pixel positions, in combination withGtk.Entry.get_layout_offsets
(). The returned layout is owned by the entry and must not be modified or freed by the caller.Keep in mind that the layout text may contain a preedit string, so
Gtk.Entry.layout_index_to_text_index
() andGtk.Entry.text_index_to_layout_index
() are needed to convert byte indices in the layout to byte indices in the entry contents.
- get_layout_offsets()[source]¶
- Returns:
- Return type:
Obtains the position of the
Pango.Layout
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
Pango.Layout
, 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
Pango.Layout
functions you need to convert to and from pixels using PANGO_PIXELS() orPango.SCALE
.Keep in mind that the layout text may contain a preedit string, so
Gtk.Entry.layout_index_to_text_index
() andGtk.Entry.text_index_to_layout_index
() are needed to convert byte indices in the layout to byte indices in the entry contents.
- get_max_length()[source]¶
- Returns:
the maximum allowed number of characters in
Gtk.Entry
, or 0 if there is no maximum.- Return type:
Retrieves the maximum allowed length of the text in self. See
Gtk.Entry.set_max_length
().This is equivalent to getting self's
Gtk.EntryBuffer
and callingGtk.EntryBuffer.get_max_length
() on it.
- get_max_width_chars()[source]¶
- Returns:
the maximum width of the entry, in characters
- Return type:
Retrieves the desired maximum width of self, in characters. See
Gtk.Entry.set_max_width_chars
().New in version 3.12.
- get_overwrite_mode()[source]¶
- Returns:
whether the text is overwritten when typing.
- Return type:
Gets the value set by
Gtk.Entry.set_overwrite_mode
().New in version 2.14.
- get_placeholder_text()[source]¶
- Returns:
a pointer to the placeholder text as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored.
- Return type:
Retrieves the text that will be displayed when self is empty and unfocused
New in version 3.2.
- get_progress_fraction()[source]¶
- Returns:
a fraction from 0.0 to 1.0
- Return type:
Returns the current fraction of the task that’s been completed. See
Gtk.Entry.set_progress_fraction
().New in version 2.16.
- get_progress_pulse_step()[source]¶
- Returns:
a fraction from 0.0 to 1.0
- Return type:
Retrieves the pulse step set with
Gtk.Entry.set_progress_pulse_step
().New in version 2.16.
- get_tabs()[source]¶
- Returns:
the tabstops, or
None
if none was set.- Return type:
Gets the tabstops that were set on the entry using
Gtk.Entry.set_tabs
(), if any.New in version 3.10.
- get_text()[source]¶
- 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.
- Return type:
Retrieves the contents of the entry widget. See also
Gtk.Editable.get_chars
().This is equivalent to getting self's
Gtk.EntryBuffer
and callingGtk.EntryBuffer.get_text
() on it.
- get_text_area()[source]¶
- Returns:
Return location for the text area.
- Return type:
text_area:
Gdk.Rectangle
Gets the area where the entry’s text is drawn. This function is useful when drawing something to the entry in a draw callback.
If the entry is not realized, text_area is filled with zeros.
See also
Gtk.Entry.get_icon_area
().New in version 3.0.
- get_text_length()[source]¶
-
Retrieves the current length of the text in self.
This is equivalent to getting self's
Gtk.EntryBuffer
and callingGtk.EntryBuffer.get_length
() on it.New in version 2.14.
- get_visibility()[source]¶
-
Retrieves whether the text in self is visible. See
Gtk.Entry.set_visibility
().
- get_width_chars()[source]¶
- Returns:
number of chars to request space for, or negative if unset
- Return type:
Gets the value set by
Gtk.Entry.set_width_chars
().
- grab_focus_without_selecting()[source]¶
Causes self to have keyboard focus.
It behaves like
Gtk.Widget.grab_focus
(), except that it doesn’t select the contents of the entry. You only want to call this on some special entries which the user usually doesn’t want to replace all text in, such as search-as-you-type entries.New in version 3.16.
- im_context_filter_keypress(event)[source]¶
- Parameters:
event (
Gdk.EventKey
) – the key event- Returns:
True
if the input method handled the key event.- Return type:
Allow the
Gtk.Entry
input method to internally handle key press and release events. If this function returnsTrue
, then no further processing should be done for this key event. SeeGtk.IMContext.filter_keypress
().Note that you are expected to call this function from your handler when overriding key event handling. This is needed in the case when you need to insert your own key handling between the input method and the default key event handling of the
Gtk.Entry
. SeeGtk.TextView.reset_im_context
() for an example of use.New in version 2.22.
- layout_index_to_text_index(layout_index)[source]¶
- Parameters:
layout_index (
int
) – byte index into the entry layout text- Returns:
byte index into the entry contents
- Return type:
Converts from a position in the entry’s
Pango.Layout
(returned byGtk.Entry.get_layout
()) to a position in the entry contents (returned byGtk.Entry.get_text
()).
- progress_pulse()[source]¶
Indicates that some progress is made, but you don’t know how much. Causes the entry’s progress indicator to enter “activity mode,” where a block bounces back and forth. Each call to
Gtk.Entry.progress_pulse
() causes the block to move by a little bit (the amount of movement per pulse is determined byGtk.Entry.set_progress_pulse_step
()).New in version 2.16.
- reset_im_context()[source]¶
Reset the input method context of the entry if needed.
This can be necessary in the case where modifying the buffer would confuse on-going input method behavior.
New in version 2.22.
- set_activates_default(setting)[source]¶
-
If setting is
True
, pressing Enter in the self 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 callsGtk.Window.activate_default
() on the window containing the entry, in the default handler for theGtk.Entry
::activate
signal.)
- set_alignment(xalign)[source]¶
- Parameters:
xalign (
float
) – The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts
Sets the alignment for the contents of the entry. This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry.
New in version 2.4.
- set_attributes(attrs)[source]¶
- Parameters:
attrs (
Pango.AttrList
) – aPango.AttrList
Sets a
Pango.AttrList
; the attributes in the list are applied to the entry text.New in version 3.6.
- set_buffer(buffer)[source]¶
- Parameters:
buffer (
Gtk.EntryBuffer
) – aGtk.EntryBuffer
Set the
Gtk.EntryBuffer
object which holds the text for this widget.New in version 2.18.
- set_completion(completion)[source]¶
- Parameters:
completion (
Gtk.EntryCompletion
orNone
) – TheGtk.EntryCompletion
orNone
Sets completion to be the auxiliary completion object to use with self. All further configuration of the completion mechanism is done on completion using the
Gtk.EntryCompletion
API. Completion is disabled if completion is set toNone
.New in version 2.4.
- set_cursor_hadjustment(adjustment)[source]¶
- Parameters:
adjustment (
Gtk.Adjustment
orNone
) – an adjustment which should be adjusted when the cursor is moved, orNone
Hooks up an adjustment to the cursor position in an entry, so that when the cursor is moved, the adjustment is scrolled to show that position. See
Gtk.ScrolledWindow.get_hadjustment
() for a typical way of obtaining the adjustment.The adjustment has to be in pixel units and in the same coordinate system as the entry.
New in version 2.12.
- set_has_frame(setting)[source]¶
- Parameters:
setting (
bool
) – new value
Sets whether the entry has a beveled frame around it.
- set_icon_activatable(icon_pos, activatable)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon position
Sets whether the icon is activatable.
New in version 2.16.
- set_icon_drag_source(icon_pos, target_list, actions)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – icon positiontarget_list (
Gtk.TargetList
) – the targets (data formats) in which the data can be providedactions (
Gdk.DragAction
) – a bitmask of the allowed drag actions
Sets up the icon at the given position so that GTK+ will start a drag operation when the user clicks and drags the icon.
To handle the drag operation, you need to connect to the usual
Gtk.Widget
::drag-data-get
(or possiblyGtk.Widget
::drag-data-delete
) signal, and useGtk.Entry.get_current_icon_drag_source
() in your signal handler to find out if the drag was started from an icon.By default, GTK+ uses the icon as the drag icon. You can use the
Gtk.Widget
::drag-begin
signal to set a different icon. Note that you have to use g_signal_connect_after() to ensure that your signal handler gets executed after the default handler.New in version 2.16.
- set_icon_from_gicon(icon_pos, icon)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – The position at which to set the icon
Sets the icon shown in the entry at the specified position from the current icon theme. If the icon isn’t known, a “broken image” icon will be displayed instead.
If icon is
None
, no icon will be shown in the specified position.New in version 2.16.
- set_icon_from_icon_name(icon_pos, icon_name)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – The position at which to set the icon
Sets the icon shown in the entry at the specified position from the current icon theme.
If the icon name isn’t known, a “broken image” icon will be displayed instead.
If icon_name is
None
, no icon will be shown in the specified position.New in version 2.16.
- set_icon_from_pixbuf(icon_pos, pixbuf)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon positionpixbuf (
GdkPixbuf.Pixbuf
orNone
) – AGdkPixbuf.Pixbuf
, orNone
Sets the icon shown in the specified position using a pixbuf.
If pixbuf is
None
, no icon will be shown in the specified position.New in version 2.16.
- set_icon_from_stock(icon_pos, stock_id)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon positionstock_id (
str
orNone
) – The name of the stock item, orNone
Sets the icon shown in the entry at the specified position from a stock image.
If stock_id is
None
, no icon will be shown in the specified position.New in version 2.16.
Deprecated since version 3.10: Use
Gtk.Entry.set_icon_from_icon_name
() instead.
- set_icon_sensitive(icon_pos, sensitive)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – Icon positionsensitive (
bool
) – Specifies whether the icon should appear sensitive or insensitive
Sets the sensitivity for the specified icon.
New in version 2.16.
- set_icon_tooltip_markup(icon_pos, tooltip)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – the icon positiontooltip (
str
orNone
) – the contents of the tooltip for the icon, orNone
Sets tooltip as the contents of the tooltip for the icon at the specified position. tooltip is assumed to be marked up with the Pango text markup language.
Use
None
for tooltip to remove an existing tooltip.See also
Gtk.Widget.set_tooltip_markup
() andGtk.Entry.set_icon_tooltip_text
().New in version 2.16.
- set_icon_tooltip_text(icon_pos, tooltip)[source]¶
- Parameters:
icon_pos (
Gtk.EntryIconPosition
) – the icon positiontooltip (
str
orNone
) – the contents of the tooltip for the icon, orNone
Sets tooltip as the contents of the tooltip for the icon at the specified position.
Use
None
for tooltip to remove an existing tooltip.See also
Gtk.Widget.set_tooltip_text
() andGtk.Entry.set_icon_tooltip_markup
().If you unset the widget tooltip via
Gtk.Widget.set_tooltip_text
() orGtk.Widget.set_tooltip_markup
(), this setsGtk.Widget
:has-tooltip
toFalse
, which suppresses icon tooltips too. You can resolve this by then callingGtk.Widget.set_has_tooltip
() to setGtk.Widget
:has-tooltip
back toTrue
, or setting at least one non-empty tooltip on any icon achieves the same result.New in version 2.16.
- set_inner_border(border)[source]¶
- Parameters:
border (
Gtk.Border
orNone
) – aGtk.Border
, orNone
Sets %entry’s inner-border property to border, or clears it if
None
is passed. The inner-border is the area around the entry’s text, but inside its frame.If set, this property overrides the inner-border style property. Overriding the style-provided border is useful when you want to do in-place editing of some text in a canvas or list widget, where pixel-exact positioning of the entry is important.
New in version 2.10.
Deprecated since version 3.4: Use the standard border and padding CSS properties (through objects like
Gtk.StyleContext
andGtk.CssProvider
); the value set with this function is ignored byGtk.Entry
.
- set_input_hints(hints)[source]¶
- Parameters:
hints (
Gtk.InputHints
) – the hints
Sets the
Gtk.Entry
:input-hints
property, which allows input methods to fine-tune their behaviour.New in version 3.6.
- set_input_purpose(purpose)[source]¶
- Parameters:
purpose (
Gtk.InputPurpose
) – the purpose
Sets the
Gtk.Entry
:input-purpose
property which can be used by on-screen keyboards and other input methods to adjust their behaviour.New in version 3.6.
- set_invisible_char(ch)[source]¶
- Parameters:
ch (
str
) – a Unicode character
Sets the character to use in place of the actual text when
Gtk.Entry.set_visibility
() has been called to set text visibility toFalse
. i.e. this is the character used in “password mode” to show the user how many characters have been typed. By default, GTK+ picks the best invisiblestr
available in the current font. If you set the invisiblestr
to 0, then the user will get no feedback at all; there will be no text on the screen as they type.
- set_max_length(max)[source]¶
- Parameters:
max (
int
) – 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.
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.
This is equivalent to getting self's
Gtk.EntryBuffer
and callingGtk.EntryBuffer.set_max_length
() on it. ]|
- set_max_width_chars(n_chars)[source]¶
- Parameters:
n_chars (
int
) – the new desired maximum width, in characters
Sets the desired maximum width in characters of self.
New in version 3.12.
- set_overwrite_mode(overwrite)[source]¶
- Parameters:
overwrite (
bool
) – new value
Sets whether the text is overwritten when typing in the
Gtk.Entry
.New in version 2.14.
- set_placeholder_text(text)[source]¶
-
Sets text to be displayed in self when it is empty and unfocused. This can be used to give a visual hint of the expected contents of the
Gtk.Entry
.Note that since the placeholder text gets removed when the entry received focus, using this feature is a bit problematic if the entry is given the initial focus in a window. Sometimes this can be worked around by delaying the initial focus setting until the first key event arrives.
New in version 3.2.
- set_progress_fraction(fraction)[source]¶
- Parameters:
fraction (
float
) – fraction of the task that’s been completed
Causes the entry’s progress indicator to “fill in” the given fraction of the bar. The fraction should be between 0.0 and 1.0, inclusive.
New in version 2.16.
- set_progress_pulse_step(fraction)[source]¶
- Parameters:
fraction (
float
) – fraction between 0.0 and 1.0
Sets the fraction of total entry width to move the progress bouncing block for each call to
Gtk.Entry.progress_pulse
().New in version 2.16.
- set_tabs(tabs)[source]¶
- Parameters:
tabs (
Pango.TabArray
) – aPango.TabArray
Sets a
Pango.TabArray
; the tabstops in the array are applied to the entry text.New in version 3.10.
- set_text(text)[source]¶
- Parameters:
text (
str
) – the new text
Sets the text in the widget to the given value, replacing the current contents.
See
Gtk.EntryBuffer.set_text
().
- set_visibility(visible)[source]¶
-
Sets whether the contents of the entry are visible or not. When visibility is set to
False
, characters are displayed as the invisiblestr
, and will also appear that way when the text in the entry widget is copied elsewhere.By default, GTK+ picks the best invisible character available in the current font, but it can be changed with
Gtk.Entry.set_invisible_char
().Note that you probably want to set
Gtk.Entry
:input-purpose
toGtk.InputPurpose.PASSWORD
orGtk.InputPurpose.PIN
to inform input methods about the purpose of this entry, in addition to setting visibility toFalse
.
- set_width_chars(n_chars)[source]¶
- Parameters:
n_chars (
int
) – width in 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.
- text_index_to_layout_index(text_index)[source]¶
- Parameters:
text_index (
int
) – byte index into the entry contents- Returns:
byte index into the entry layout text
- Return type:
Converts from a position in the entry contents (returned by
Gtk.Entry.get_text
()) to a position in the entry’sPango.Layout
(returned byGtk.Entry.get_layout
(), with text retrieved viaPango.Layout.get_text
()).
- unset_invisible_char()[source]¶
Unsets the invisible
str
previously set withGtk.Entry.set_invisible_char
(). So that the default invisiblestr
is used again.New in version 2.16.
- do_activate() virtual¶
Class handler for the
Gtk.Entry
::activate
signal. The default implementation callsGtk.Window.activate_default
() on the entry’s top-level window.
- do_backspace() virtual¶
Class handler for the
Gtk.Entry
::backspace
signal. The default implementation deletes the selection or a single character or word.
- do_copy_clipboard() virtual¶
Class handler for the
Gtk.Entry
::copy-clipboard
signal. The default implementation copies the selection, if one exists.
- do_cut_clipboard() virtual¶
Class handler for the
Gtk.Entry
::cut-clipboard
signal. The default implementation cuts the selection, if one exists.
- do_delete_from_cursor(type, count) virtual¶
- Parameters:
type (
Gtk.DeleteType
) –count (
int
) –
Class handler for the
Gtk.Entry
::delete-from-cursor
signal. The default implementation deletes the selection or the specified number of characters or words.
- do_get_frame_size(x, y, width, height) virtual¶
-
Calculate the size of the text area frame, which is its allocated width and requested height, minus space for margins and borders, and taking baseline and text height into account. This virtual function must be non-
None
.
- do_get_text_area_size(x, y, width, height) virtual¶
-
Calculate the size of the text area, which is its allocated width and requested height, minus space for margins and borders. This virtual function must be non-
None
.
- do_insert_at_cursor(str) virtual¶
- Parameters:
str (
str
) –
Class handler for the
Gtk.Entry
::insert-at-cursor
signal. The default implementation inserts text at the cursor.
- do_insert_emoji() virtual¶
- do_move_cursor(step, count, extend_selection) virtual¶
- Parameters:
step (
Gtk.MovementStep
) –count (
int
) –extend_selection (
bool
) –
Class handler for the
Gtk.Entry
::move-cursor
signal. The default implementation specifies the standardGtk.Entry
cursor movement behavior.
- do_paste_clipboard() virtual¶
Class handler for the
Gtk.Entry
::paste-clipboard
signal. The default implementation pastes at the current cursor position or over the current selection if one exists.
- do_populate_popup(popup) virtual¶
- Parameters:
popup (
Gtk.Widget
) –
Class handler for the
Gtk.Entry
::populate-popup
signal. If non-None
, this will be called to add additional entries to the context menu when it is displayed.
- do_toggle_overwrite() virtual¶
Class handler for the
Gtk.Entry
::toggle-overwrite
signal. The default implementation toggles overwrite mode and blinks the cursor.
Signal Details¶
- Gtk.Entry.signals.activate(entry)¶
- Signal Name:
activate
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::activate
signal is emitted when the user hits the Enter key.While this signal is used as a
keybinding signal
, it is also commonly used by applications to intercept activation of entries.The default bindings for this signal are all forms of the Enter key.
- Gtk.Entry.signals.backspace(entry)¶
- Signal Name:
backspace
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::backspace
signal is akeybinding signal
which gets emitted when the user asks for it.The default bindings for this signal are Backspace and Shift-Backspace.
- Gtk.Entry.signals.copy_clipboard(entry)¶
- Signal Name:
copy-clipboard
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::copy-clipboard
signal is akeybinding signal
which gets emitted to copy the selection to the clipboard.The default bindings for this signal are Ctrl-c and Ctrl-Insert.
- Gtk.Entry.signals.cut_clipboard(entry)¶
- Signal Name:
cut-clipboard
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::cut-clipboard
signal is akeybinding signal
which gets emitted to cut the selection to the clipboard.The default bindings for this signal are Ctrl-x and Shift-Delete.
- Gtk.Entry.signals.delete_from_cursor(entry, type, count)¶
- Signal Name:
delete-from-cursor
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signaltype (
Gtk.DeleteType
) – the granularity of the deletion, as aGtk.DeleteType
count (
int
) – the number of type units to delete
The
::delete-from-cursor
signal is akeybinding signal
which gets emitted when the user initiates a text deletion.If the type is
Gtk.DeleteType.CHARS
, GTK+ deletes the selection if there is one, otherwise it deletes the requested number of characters.The default bindings for this signal are Delete for deleting a character and Ctrl-Delete for deleting a word.
- Gtk.Entry.signals.icon_press(entry, icon_pos, event)¶
- Signal Name:
icon-press
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signalicon_pos (
Gtk.EntryIconPosition
) – The position of the clicked iconevent (
Gdk.Event
) – the button press event
The
::icon-press
signal is emitted when an activatable icon is clicked.New in version 2.16.
- Gtk.Entry.signals.icon_release(entry, icon_pos, event)¶
- Signal Name:
icon-release
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signalicon_pos (
Gtk.EntryIconPosition
) – The position of the clicked iconevent (
Gdk.Event
) – the button release event
The
::icon-release
signal is emitted on the button release from a mouse click over an activatable icon.New in version 2.16.
- Gtk.Entry.signals.insert_at_cursor(entry, string)¶
- Signal Name:
insert-at-cursor
- Flags:
- Parameters:
The
::insert-at-cursor
signal is akeybinding signal
which gets emitted when the user initiates the insertion of a fixed string at the cursor.This signal has no default bindings.
- Gtk.Entry.signals.insert_emoji(entry)¶
- Signal Name:
insert-emoji
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::insert-emoji
signal is akeybinding signal
which gets emitted to present the Emoji chooser for the entry.The default bindings for this signal are Ctrl-. and Ctrl-;
New in version 3.22.27.
- Gtk.Entry.signals.move_cursor(entry, step, count, extend_selection)¶
- Signal Name:
move-cursor
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signalstep (
Gtk.MovementStep
) – the granularity of the move, as aGtk.MovementStep
count (
int
) – the number of step units to moveextend_selection (
bool
) –True
if the move should extend the selection
The
::move-cursor
signal is akeybinding signal
which gets emitted when the user initiates a cursor movement. If the cursor is not visible in entry, this signal causes the viewport to be moved instead.Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.
The default bindings for this signal come in two variants, the variant with the Shift modifier extends the selection, the variant without the Shift modifer does not. There are too many key combinations to list them all here.
Arrow keys move by individual characters/lines
Ctrl-arrow key combinations move by words/paragraphs
Home/End keys move to the ends of the buffer
- Gtk.Entry.signals.paste_clipboard(entry)¶
- Signal Name:
paste-clipboard
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::paste-clipboard
signal is akeybinding signal
which gets emitted to paste the contents of the clipboard into the text view.The default bindings for this signal are Ctrl-v and Shift-Insert.
- Gtk.Entry.signals.populate_popup(entry, widget)¶
- Signal Name:
populate-popup
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signalwidget (
Gtk.Widget
) – the container that is being populated
The
::populate-popup
signal gets emitted before showing the context menu of the entry.If you need to add items to the context menu, connect to this signal and append your items to the widget, which will be a
Gtk.Menu
in this case.If
Gtk.Entry
:populate-all
isTrue
, this signal will also be emitted to populate touch popups. In this case, widget will be a different container, e.g. aGtk.Toolbar
. The signal handler should not make assumptions about the type of widget.
- Gtk.Entry.signals.preedit_changed(entry, preedit)¶
- Signal Name:
preedit-changed
- Flags:
- Parameters:
If an input method is used, the typed text will not immediately be committed to the buffer. So if you are interested in the text, connect to this signal.
New in version 2.20.
- Gtk.Entry.signals.toggle_overwrite(entry)¶
- Signal Name:
toggle-overwrite
- Flags:
- Parameters:
entry (
Gtk.Entry
) – The object which received the signal
The
::toggle-overwrite
signal is akeybinding signal
which gets emitted to toggle the overwrite mode of the entry.The default bindings for this signal is Insert.
Property Details¶
- Gtk.Entry.props.activates_default¶
- Name:
activates-default
- Type:
- Default Value:
- Flags:
Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed
- Gtk.Entry.props.attributes¶
- Name:
attributes
- Type:
- Default Value:
- Flags:
A list of Pango attributes to apply to the text of the entry.
This is mainly useful to change the size or weight of the text.
The
Pango.Attribute
's start_index and end_index must refer to theGtk.EntryBuffer
text, i.e. without the preedit string.New in version 3.6.
- Gtk.Entry.props.buffer¶
- Name:
buffer
- Type:
- Default Value:
- Flags:
Text buffer object which actually stores entry text
- Gtk.Entry.props.caps_lock_warning¶
- Name:
caps-lock-warning
- Type:
- Default Value:
- Flags:
Whether password entries will show a warning when Caps Lock is on.
Note that the warning is shown using a secondary icon, and thus does not work if you are using the secondary icon position for some other purpose.
New in version 2.16.
- Gtk.Entry.props.completion¶
- Name:
completion
- Type:
- Default Value:
- Flags:
The auxiliary completion object to use with the entry.
New in version 3.2.
- Gtk.Entry.props.cursor_position¶
-
The current position of the insertion cursor in chars
- Gtk.Entry.props.editable¶
- Name:
editable
- Type:
- Default Value:
- Flags:
Whether the entry contents can be edited
- Gtk.Entry.props.enable_emoji_completion¶
- Name:
enable-emoji-completion
- Type:
- Default Value:
- Flags:
Whether to suggest Emoji replacements
- Gtk.Entry.props.has_frame¶
- Name:
has-frame
- Type:
- Default Value:
- Flags:
False
removes outside bevel from entry
- Gtk.Entry.props.im_module¶
- Name:
im-module
- Type:
- Default Value:
- Flags:
Which IM (input method) module should be used for this entry. See
Gtk.IMContext
.Setting this to a non-
None
value overrides the system-wide IM module setting. See theGtk.Settings
Gtk.Settings
:gtk-im-module
property.New in version 2.16.
- Gtk.Entry.props.inner_border¶
- Name:
inner-border
- Type:
- Default Value:
- Flags:
Sets the text area’s border between the text and the frame.
New in version 2.10.
Deprecated since version 3.4: Use the standard border and padding CSS properties (through objects like
Gtk.StyleContext
andGtk.CssProvider
); the value of this style property is ignored.
- Gtk.Entry.props.input_hints¶
- Name:
input-hints
- Type:
- Default Value:
- Flags:
Additional hints (beyond
Gtk.Entry
:input-purpose
) that allow input methods to fine-tune their behaviour.New in version 3.6.
- Gtk.Entry.props.input_purpose¶
- Name:
input-purpose
- Type:
- Default Value:
- Flags:
The purpose of this text field.
This property can be used by on-screen keyboards and other input methods to adjust their behaviour.
Note that setting the purpose to
Gtk.InputPurpose.PASSWORD
orGtk.InputPurpose.PIN
is independent from settingGtk.Entry
:visibility
.New in version 3.6.
- Gtk.Entry.props.invisible_char¶
- Name:
invisible-char
- Type:
- Default Value:
42
- Flags:
The invisible character is used when masking entry contents (in \”password mode\”)”). When it is not explicitly set with the
Gtk.Entry
:invisible-char
property, GTK+ determines the character to use from a list of possible candidates, depending on availability in the current font.This style property allows the theme to prepend a character to the list of candidates.
New in version 2.18.
- Gtk.Entry.props.invisible_char_set¶
-
Whether the invisible
str
has been set for theGtk.Entry
.New in version 2.16.
- Gtk.Entry.props.max_length¶
- Name:
max-length
- Type:
- Default Value:
0
- Flags:
Maximum number of characters for this entry. Zero if no maximum
- Gtk.Entry.props.max_width_chars¶
- Name:
max-width-chars
- Type:
- Default Value:
-1
- Flags:
The desired maximum width of the entry, in characters. If this property is set to -1, the width will be calculated automatically.
New in version 3.12.
- Gtk.Entry.props.overwrite_mode¶
- Name:
overwrite-mode
- Type:
- Default Value:
- Flags:
If text is overwritten when typing in the
Gtk.Entry
.New in version 2.14.
- Gtk.Entry.props.placeholder_text¶
- Name:
placeholder-text
- Type:
- Default Value:
- Flags:
The text that will be displayed in the
Gtk.Entry
when it is empty and unfocused.New in version 3.2.
- Gtk.Entry.props.populate_all¶
- Name:
populate-all
- Type:
- Default Value:
- Flags:
If
:populate-all
isTrue
, theGtk.Entry
::populate-popup
signal is also emitted for touch popups.New in version 3.8.
- Gtk.Entry.props.primary_icon_activatable¶
- Name:
primary-icon-activatable
- Type:
- Default Value:
- Flags:
Whether the primary icon is activatable.
GTK+ emits the
Gtk.Entry
::icon-press
andGtk.Entry
::icon-release
signals only on sensitive, activatable icons.Sensitive, but non-activatable icons can be used for purely informational purposes.
New in version 2.16.
- Gtk.Entry.props.primary_icon_gicon¶
- Name:
primary-icon-gicon
- Type:
- Default Value:
- Flags:
The
Gio.Icon
to use for the primary icon for the entry.New in version 2.16.
- Gtk.Entry.props.primary_icon_name¶
- Name:
primary-icon-name
- Type:
- Default Value:
- Flags:
The icon name to use for the primary icon for the entry.
New in version 2.16.
- Gtk.Entry.props.primary_icon_pixbuf¶
- Name:
primary-icon-pixbuf
- Type:
- Default Value:
- Flags:
A pixbuf to use as the primary icon for the entry.
New in version 2.16.
- Gtk.Entry.props.primary_icon_sensitive¶
- Name:
primary-icon-sensitive
- Type:
- Default Value:
- Flags:
Whether the primary icon is sensitive.
An insensitive icon appears grayed out. GTK+ does not emit the
Gtk.Entry
::icon-press
andGtk.Entry
::icon-release
signals and does not allow DND from insensitive icons.An icon should be set insensitive if the action that would trigger when clicked is currently not available.
New in version 2.16.
- Gtk.Entry.props.primary_icon_stock¶
- Name:
primary-icon-stock
- Type:
- Default Value:
- Flags:
The stock id to use for the primary icon for the entry.
New in version 2.16.
Deprecated since version 3.10: Use
Gtk.Entry
:primary-icon-name
instead.
- Gtk.Entry.props.primary_icon_storage_type¶
- Name:
primary-icon-storage-type
- Type:
- Default Value:
- Flags:
The representation which is used for the primary icon of the entry.
New in version 2.16.
- Gtk.Entry.props.primary_icon_tooltip_markup¶
- Name:
primary-icon-tooltip-markup
- Type:
- Default Value:
- Flags:
The contents of the tooltip on the primary icon, which is marked up with the Pango text markup language.
Also see
Gtk.Entry.set_icon_tooltip_markup
().New in version 2.16.
- Gtk.Entry.props.primary_icon_tooltip_text¶
- Name:
primary-icon-tooltip-text
- Type:
- Default Value:
- Flags:
The contents of the tooltip on the primary icon.
Also see
Gtk.Entry.set_icon_tooltip_text
().New in version 2.16.
- Gtk.Entry.props.progress_fraction¶
- Name:
progress-fraction
- Type:
- Default Value:
0.0
- Flags:
The current fraction of the task that’s been completed.
New in version 2.16.
- Gtk.Entry.props.progress_pulse_step¶
- Name:
progress-pulse-step
- Type:
- Default Value:
0.1
- Flags:
The fraction of total entry width to move the progress bouncing block for each call to
Gtk.Entry.progress_pulse
().New in version 2.16.
- Gtk.Entry.props.scroll_offset¶
- Name:
scroll-offset
- Type:
- Default Value:
0
- Flags:
Number of pixels of the entry scrolled off the screen to the left
- Gtk.Entry.props.secondary_icon_activatable¶
- Name:
secondary-icon-activatable
- Type:
- Default Value:
- Flags:
Whether the secondary icon is activatable.
GTK+ emits the
Gtk.Entry
::icon-press
andGtk.Entry
::icon-release
signals only on sensitive, activatable icons.Sensitive, but non-activatable icons can be used for purely informational purposes.
New in version 2.16.
- Gtk.Entry.props.secondary_icon_gicon¶
- Name:
secondary-icon-gicon
- Type:
- Default Value:
- Flags:
The
Gio.Icon
to use for the secondary icon for the entry.New in version 2.16.
- Gtk.Entry.props.secondary_icon_name¶
- Name:
secondary-icon-name
- Type:
- Default Value:
- Flags:
The icon name to use for the secondary icon for the entry.
New in version 2.16.
- Gtk.Entry.props.secondary_icon_pixbuf¶
- Name:
secondary-icon-pixbuf
- Type:
- Default Value:
- Flags:
An pixbuf to use as the secondary icon for the entry.
New in version 2.16.
- Gtk.Entry.props.secondary_icon_sensitive¶
- Name:
secondary-icon-sensitive
- Type:
- Default Value:
- Flags:
Whether the secondary icon is sensitive.
An insensitive icon appears grayed out. GTK+ does not emit the
Gtk.Entry
::icon-press
andGtk.Entry
::icon-release
signals and does not allow DND from insensitive icons.An icon should be set insensitive if the action that would trigger when clicked is currently not available.
New in version 2.16.
- Gtk.Entry.props.secondary_icon_stock¶
- Name:
secondary-icon-stock
- Type:
- Default Value:
- Flags:
The stock id to use for the secondary icon for the entry.
New in version 2.16.
Deprecated since version 3.10: Use
Gtk.Entry
:secondary-icon-name
instead.
- Gtk.Entry.props.secondary_icon_storage_type¶
- Name:
secondary-icon-storage-type
- Type:
- Default Value:
- Flags:
The representation which is used for the secondary icon of the entry.
New in version 2.16.
- Gtk.Entry.props.secondary_icon_tooltip_markup¶
- Name:
secondary-icon-tooltip-markup
- Type:
- Default Value:
- Flags:
The contents of the tooltip on the secondary icon, which is marked up with the Pango text markup language.
Also see
Gtk.Entry.set_icon_tooltip_markup
().New in version 2.16.
- Gtk.Entry.props.secondary_icon_tooltip_text¶
- Name:
secondary-icon-tooltip-text
- Type:
- Default Value:
- Flags:
The contents of the tooltip on the secondary icon.
Also see
Gtk.Entry.set_icon_tooltip_text
().New in version 2.16.
- Gtk.Entry.props.selection_bound¶
-
The position of the opposite end of the selection from the cursor in chars
- Gtk.Entry.props.shadow_type¶
- Name:
shadow-type
- Type:
- Default Value:
- Flags:
Which kind of shadow to draw around the entry when
Gtk.Entry
:has-frame
is set toTrue
.New in version 2.12.
Deprecated since version 3.20: Use CSS to determine the style of the border; the value of this style property is ignored.
- Gtk.Entry.props.show_emoji_icon¶
- Name:
show-emoji-icon
- Type:
- Default Value:
- Flags:
Whether to show an icon for Emoji
- Gtk.Entry.props.tabs¶
- Name:
tabs
- Type:
- Default Value:
- Flags:
A list of tabstop locations to apply to the text of the entry
- Gtk.Entry.props.text¶
- Name:
text
- Type:
- Default Value:
''
- Flags:
The contents of the entry
- Gtk.Entry.props.truncate_multiline¶
- Name:
truncate-multiline
- Type:
- Default Value:
- Flags:
When
True
, pasted multi-line text is truncated to the first line.New in version 2.10.
- Gtk.Entry.props.visibility¶
- Name:
visibility
- Type:
- Default Value:
- Flags:
False
displays the “invisiblestr
" instead of the actual text (password mode)
- Gtk.Entry.props.width_chars¶
- Name:
width-chars
- Type:
- Default Value:
-1
- Flags:
Number of characters to leave space for in the entry
- Gtk.Entry.props.xalign¶
- Name:
xalign
- Type:
- Default Value:
0.0
- Flags:
The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.
New in version 2.4.