:right-sidebar: True Entry =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: Entry(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.CellEditable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Editable` ``GtkEntry`` is a single line text entry widget. .. image:: https://docs.gtk.org/gtk4/entry.png 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 :obj:`~gi.repository.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 with :obj:`~gi.repository.Gtk.Entry.set_invisible_char`. ``GtkEntry`` has the ability to display progress or activity information behind the text. To make an entry display such information, use :obj:`~gi.repository.Gtk.Entry.set_progress_fraction` or :obj:`~gi.repository.Gtk.Entry.set_progress_pulse_step`. Additionally, ``GtkEntry`` 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, use :obj:`~gi.repository.Gtk.Entry.set_icon_from_gicon` or one of the various other functions that set an icon from an icon name or a paintable. To trigger an action when the user clicks an icon, connect to the :obj:`~gi.repository.Gtk.Entry.signals.icon_press` signal. To allow DND operations from an icon, use :obj:`~gi.repository.Gtk.Entry.set_icon_drag_source`. To set a tooltip on an icon, use :obj:`~gi.repository.Gtk.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 --------- .. code-block:: :dedent: entry[.flat][.warning][.error] ├── text[.readonly] ├── image.left ├── image.right ╰── [progress[.pulse]] ``GtkEntry`` 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 shows progress, it adds a subnode with the name progress. The node has the style class .pulse when the shown progress is pulsing. For all the subnodes added to the text node in various situations, see :obj:`~gi.repository.Gtk.Text`. GtkEntry as GtkBuildable ------------------------ The ``GtkEntry`` implementation of the ``GtkBuildable`` interface supports a custom ```` element, which supports any number of ```` elements. The ```` element has attributes named “name“, “value“, “start“ and “end“ and allows you to specify ``PangoAttribute`` values for this label. An example of a UI definition fragment specifying Pango attributes: .. code-block:: :dedent: The start and end attributes specify the range of characters to which the Pango attribute applies. If start and end are not specified, the attribute is applied to the whole text. Note that specifying ranges does not make much sense with translatable attributes. Use markup embedded in the translatable content instead. Accessibility ------------- ``GtkEntry`` uses the :const:`~gi.repository.Gtk.AccessibleRole.TEXT_BOX` role. Constructors ------------ .. rst-class:: interim-class .. class:: Entry :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new entry. .. classmethod:: new_with_buffer(buffer: ~gi.repository.Gtk.EntryBuffer) -> ~gi.repository.Gtk.Widget Creates a new entry with the specified text buffer. :param buffer: The buffer to use for the new ``GtkEntry``. Methods ------- .. rst-class:: interim-class .. class:: Entry :no-index: .. method:: get_activates_default() -> bool Retrieves the value set by :func:`~gi.repository.Gtk.Entry.set_activates_default`. .. method:: get_alignment() -> float Gets the value set by :func:`~gi.repository.Gtk.Entry.set_alignment`. See also: :obj:`~gi.repository.Gtk.Editable.props.xalign` .. method:: get_attributes() -> ~gi.repository.Pango.AttrList | None Gets the attribute list of the ``GtkEntry``. See :obj:`~gi.repository.Gtk.Entry.set_attributes`. .. method:: get_buffer() -> ~gi.repository.Gtk.EntryBuffer Get the ``GtkEntryBuffer`` object which holds the text for this widget. .. method:: get_completion() -> ~gi.repository.Gtk.EntryCompletion | None Returns the auxiliary completion object currently in use by ``entry``. .. deprecated:: 4.10 GtkEntryCompletion will be removed in GTK 5. .. method:: get_current_icon_drag_source() -> int Returns the index of the icon which is the source of the current DND operation, or -1. .. method:: get_extra_menu() -> ~gi.repository.Gio.MenuModel | None Gets the menu model set with :func:`~gi.repository.Gtk.Entry.set_extra_menu`. .. method:: get_has_frame() -> bool Gets the value set by :func:`~gi.repository.Gtk.Entry.set_has_frame`. .. method:: get_icon_activatable(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> bool Returns whether the icon is activatable. :param icon_pos: Icon position .. method:: get_icon_area(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> ~gi.repository.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 ``entry``'s allocation. :param icon_pos: Icon position .. method:: get_icon_at_pos(x: int, y: int) -> int Finds the icon at the given position and return its index. The position’s coordinates are relative to the ``entry``’s top left corner. If ``x``, ``y`` doesn’t lie inside an icon, -1 is returned. This function is intended for use in a :obj:`~gi.repository.Gtk.Widget.signals.query_tooltip` signal handler. :param x: the x coordinate of the position to find, relative to ``entry`` :param y: the y coordinate of the position to find, relative to ``entry`` .. method:: get_icon_gicon(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> ~gi.repository.Gio.Icon | None Retrieves the ``GIcon`` used for the icon. :const:`None` will be returned if there is no icon or if the icon was set by some other method (e.g., by ``GdkPaintable`` or icon name). :param icon_pos: Icon position .. method:: get_icon_name(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> str | None Retrieves the icon name used for the icon. :const:`None` is returned if there is no icon or if the icon was set by some other method (e.g., by ``GdkPaintable`` or gicon). :param icon_pos: Icon position .. method:: get_icon_paintable(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> ~gi.repository.Gdk.Paintable | None Retrieves the ``GdkPaintable`` used for the icon. If no ``GdkPaintable`` was used for the icon, :const:`None` is returned. :param icon_pos: Icon position .. method:: get_icon_sensitive(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> bool Returns whether the icon appears sensitive or insensitive. :param icon_pos: Icon position .. method:: get_icon_storage_type(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> ~gi.repository.Gtk.ImageType 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 :const:`~gi.repository.Gtk.ImageType.EMPTY`. :param icon_pos: Icon position .. method:: get_icon_tooltip_markup(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> str | None Gets the contents of the tooltip on the icon at the specified position in ``entry``. :param icon_pos: the icon position .. method:: get_icon_tooltip_text(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> str | None Gets the contents of the tooltip on the icon at the specified position in ``entry``. :param icon_pos: the icon position .. method:: get_input_hints() -> ~gi.repository.Gtk.InputHints Gets the input hints of this ``GtkEntry``. .. method:: get_input_purpose() -> ~gi.repository.Gtk.InputPurpose Gets the input purpose of the ``GtkEntry``. .. method:: get_invisible_char() -> str Retrieves the character displayed in place of the actual text in “password mode”. .. method:: get_max_length() -> int Retrieves the maximum allowed length of the text in ``entry``. See :obj:`~gi.repository.Gtk.Entry.set_max_length`. .. method:: get_overwrite_mode() -> bool Gets whether the ``GtkEntry`` is in overwrite mode. .. method:: get_placeholder_text() -> str | None Retrieves the text that will be displayed when ``entry`` is empty and unfocused .. method:: get_progress_fraction() -> float Returns the current fraction of the task that’s been completed. See :obj:`~gi.repository.Gtk.Entry.set_progress_fraction`. .. method:: get_progress_pulse_step() -> float Retrieves the pulse step set with :func:`~gi.repository.Gtk.Entry.set_progress_pulse_step`. .. method:: get_tabs() -> ~gi.repository.Pango.TabArray | None Gets the tabstops of the ``GtkEntry``. See :obj:`~gi.repository.Gtk.Entry.set_tabs`. .. method:: get_text_length() -> int Retrieves the current length of the text in ``entry``. This is equivalent to getting ``entry``'s ``GtkEntryBuffer`` and calling :obj:`~gi.repository.Gtk.EntryBuffer.get_length` on it. .. method:: get_visibility() -> bool Retrieves whether the text in ``entry`` is visible. See :obj:`~gi.repository.Gtk.Entry.set_visibility`. .. method:: grab_focus_without_selecting() -> bool Causes ``entry`` to have keyboard focus. It behaves like :obj:`~gi.repository.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. .. method:: progress_pulse() -> None 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 :func:`~gi.repository.Gtk.Entry.progress_pulse` causes the block to move by a little bit (the amount of movement per pulse is determined by :obj:`~gi.repository.Gtk.Entry.set_progress_pulse_step`). .. method:: reset_im_context() -> None 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. .. method:: set_activates_default(setting: bool) -> None Sets whether pressing Enter in the ``entry`` will activate the default widget for the window containing the entry. This usually means that the dialog containing the entry will be closed, since the default widget is usually one of the dialog buttons. :param setting: :const:`True` to activate window’s default widget on Enter keypress .. method:: set_alignment(xalign: float) -> None 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. See also: :obj:`~gi.repository.Gtk.Editable.props.xalign` :param xalign: The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts .. method:: set_attributes(attrs: ~gi.repository.Pango.AttrList) -> None Sets a ``PangoAttrList``. The attributes in the list are applied to the entry text. Since the attributes will be applied to text that changes as the user types, it makes most sense to use attributes with unlimited extent. :param attrs: a ``PangoAttrList`` .. method:: set_buffer(buffer: ~gi.repository.Gtk.EntryBuffer) -> None Set the ``GtkEntryBuffer`` object which holds the text for this widget. :param buffer: a ``GtkEntryBuffer`` .. method:: set_completion(completion: ~gi.repository.Gtk.EntryCompletion | None = None) -> None Sets ``completion`` to be the auxiliary completion object to use with ``entry``. All further configuration of the completion mechanism is done on ``completion`` using the ``GtkEntryCompletion`` API. Completion is disabled if ``completion`` is set to :const:`None`. .. deprecated:: 4.10 GtkEntryCompletion will be removed in GTK 5. :param completion: The ``GtkEntryCompletion`` .. method:: set_extra_menu(model: ~gi.repository.Gio.MenuModel | None = None) -> None Sets a menu model to add when constructing the context menu for ``entry``. :param model: a ``GMenuModel`` .. method:: set_has_frame(setting: bool) -> None Sets whether the entry has a beveled frame around it. :param setting: new value .. method:: set_icon_activatable(icon_pos: ~gi.repository.Gtk.EntryIconPosition, activatable: bool) -> None Sets whether the icon is activatable. :param icon_pos: Icon position :param activatable: :const:`True` if the icon should be activatable .. method:: set_icon_drag_source(icon_pos: ~gi.repository.Gtk.EntryIconPosition, provider: ~gi.repository.Gdk.ContentProvider, actions: ~gi.repository.Gdk.DragAction) -> None Sets up the icon at the given position as drag source. This makes it so that GTK will start a drag operation when the user clicks and drags the icon. :param icon_pos: icon position :param provider: a ``GdkContentProvider`` :param actions: a bitmask of the allowed drag actions .. method:: set_icon_from_gicon(icon_pos: ~gi.repository.Gtk.EntryIconPosition, icon: ~gi.repository.Gio.Icon | None = None) -> None 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 :const:`None`, no icon will be shown in the specified position. :param icon_pos: The position at which to set the icon :param icon: The icon to set .. method:: set_icon_from_icon_name(icon_pos: ~gi.repository.Gtk.EntryIconPosition, icon_name: str | None = None) -> None 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 :const:`None`, no icon will be shown in the specified position. :param icon_pos: The position at which to set the icon :param icon_name: An icon name .. method:: set_icon_from_paintable(icon_pos: ~gi.repository.Gtk.EntryIconPosition, paintable: ~gi.repository.Gdk.Paintable | None = None) -> None Sets the icon shown in the specified position using a ``GdkPaintable``. If ``paintable`` is :const:`None`, no icon will be shown in the specified position. :param icon_pos: Icon position :param paintable: A ``GdkPaintable`` .. method:: set_icon_sensitive(icon_pos: ~gi.repository.Gtk.EntryIconPosition, sensitive: bool) -> None Sets the sensitivity for the specified icon. :param icon_pos: Icon position :param sensitive: Specifies whether the icon should appear sensitive or insensitive .. method:: set_icon_tooltip_markup(icon_pos: ~gi.repository.Gtk.EntryIconPosition, tooltip: str | None = None) -> None Sets ``tooltip`` as the contents of the tooltip for the icon at the specified position. ``tooltip`` is assumed to be marked up with Pango Markup. Use :const:`None` for ``tooltip`` to remove an existing tooltip. See also :obj:`~gi.repository.Gtk.Widget.set_tooltip_markup` and :obj:`~gi.repository.Gtk.Entry.set_icon_tooltip_text`. :param icon_pos: the icon position :param tooltip: the contents of the tooltip for the icon .. method:: set_icon_tooltip_text(icon_pos: ~gi.repository.Gtk.EntryIconPosition, tooltip: str | None = None) -> None Sets ``tooltip`` as the contents of the tooltip for the icon at the specified position. Use :const:`None` for ``tooltip`` to remove an existing tooltip. See also :obj:`~gi.repository.Gtk.Widget.set_tooltip_text` and :obj:`~gi.repository.Gtk.Entry.set_icon_tooltip_markup`. If you unset the widget tooltip via :obj:`~gi.repository.Gtk.Widget.set_tooltip_text` or :obj:`~gi.repository.Gtk.Widget.set_tooltip_markup`, this sets :obj:`~gi.repository.Gtk.Widget.props.has_tooltip` to :const:`False`, which suppresses icon tooltips too. You can resolve this by then calling :obj:`~gi.repository.Gtk.Widget.set_has_tooltip` to set :obj:`~gi.repository.Gtk.Widget.props.has_tooltip` back to :const:`True`, or setting at least one non-empty tooltip on any icon achieves the same result. :param icon_pos: the icon position :param tooltip: the contents of the tooltip for the icon .. method:: set_input_hints(hints: ~gi.repository.Gtk.InputHints) -> None Set additional hints which allow input methods to fine-tune their behavior. :param hints: the hints .. method:: set_input_purpose(purpose: ~gi.repository.Gtk.InputPurpose) -> None Sets the input purpose which can be used by input methods to adjust their behavior. :param purpose: the purpose .. method:: set_invisible_char(ch: str) -> None Sets the character to use in place of the actual text in “password mode”. See :obj:`~gi.repository.Gtk.Entry.set_visibility` for how to enable “password mode”. By default, GTK picks the best invisible char available in the current font. 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. :param ch: a Unicode character .. method:: set_max_length(max: int) -> None 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. The length is in characters. This is equivalent to getting ``entry``'s ``GtkEntryBuffer`` and calling :obj:`~gi.repository.Gtk.EntryBuffer.set_max_length` on it. :param max: 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. .. method:: set_overwrite_mode(overwrite: bool) -> None Sets whether the text is overwritten when typing in the ``GtkEntry``. :param overwrite: new value .. method:: set_placeholder_text(text: str | None = None) -> None Sets text to be displayed in ``entry`` when it is empty. This can be used to give a visual hint of the expected contents of the ``GtkEntry``. :param text: a string to be displayed when ``entry`` is empty and unfocused .. method:: set_progress_fraction(fraction: float) -> None 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. :param fraction: fraction of the task that’s been completed .. method:: set_progress_pulse_step(fraction: float) -> None Sets the fraction of total entry width to move the progress bouncing block for each pulse. Use :obj:`~gi.repository.Gtk.Entry.progress_pulse` to pulse the progress. :param fraction: fraction between 0.0 and 1.0 .. method:: set_tabs(tabs: ~gi.repository.Pango.TabArray | None = None) -> None Sets a ``PangoTabArray``. The tabstops in the array are applied to the entry text. :param tabs: a ``PangoTabArray`` .. method:: set_visibility(visible: bool) -> None Sets whether the contents of the entry are visible or not. When visibility is set to :const:`False`, characters are displayed as the invisible char, 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 :obj:`~gi.repository.Gtk.Entry.set_invisible_char`. Note that you probably want to set :obj:`~gi.repository.Gtk.Entry.props.input_purpose` to :const:`~gi.repository.Gtk.InputPurpose.PASSWORD` or :const:`~gi.repository.Gtk.InputPurpose.PIN` to inform input methods about the purpose of this entry, in addition to setting visibility to :const:`False`. :param visible: :const:`True` if the contents of the entry are displayed as plaintext .. method:: unset_invisible_char() -> None Unsets the invisible char, so that the default invisible char is used again. See :obj:`~gi.repository.Gtk.Entry.set_invisible_char`. Properties ---------- .. rst-class:: interim-class .. class:: Entry :no-index: .. attribute:: props.activates_default :type: bool Whether to activate the default widget when Enter is pressed. .. attribute:: props.attributes :type: ~gi.repository.Pango.AttrList 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 ``PangoAttribute``'s ``start_index`` and ``end_index`` must refer to the :obj:`~gi.repository.Gtk.EntryBuffer` text, i.e. without the preedit string. .. attribute:: props.buffer :type: ~gi.repository.Gtk.EntryBuffer The buffer object which actually stores the text. .. attribute:: props.completion :type: ~gi.repository.Gtk.EntryCompletion The auxiliary completion object to use with the entry. .. deprecated:: 4.10 GtkEntryCompletion will be removed in GTK 5. .. attribute:: props.enable_emoji_completion :type: bool Whether to suggest Emoji replacements for :-delimited names like ``:heart:``. .. attribute:: props.extra_menu :type: ~gi.repository.Gio.MenuModel A menu model whose contents will be appended to the context menu. .. attribute:: props.has_frame :type: bool Whether the entry should draw a frame. .. attribute:: props.im_module :type: str Which IM (input method) module should be used for this entry. See :obj:`~gi.repository.Gtk.IMContext`. Setting this to a non-:const:`None` value overrides the system-wide IM module setting. See the GtkSettings :obj:`~gi.repository.Gtk.Settings.props.gtk_im_module` property. .. attribute:: props.input_hints :type: ~gi.repository.Gtk.InputHints Additional hints that allow input methods to fine-tune their behavior. Also see :obj:`~gi.repository.Gtk.Entry.props.input_purpose` .. attribute:: props.input_purpose :type: ~gi.repository.Gtk.InputPurpose 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 :const:`~gi.repository.Gtk.InputPurpose.PASSWORD` or :const:`~gi.repository.Gtk.InputPurpose.PIN` is independent from setting :obj:`~gi.repository.Gtk.Entry.props.visibility`. .. attribute:: props.invisible_char :type: int The character to use when masking entry contents (“password mode”). .. attribute:: props.invisible_char_set :type: bool Whether the invisible char has been set for the ``GtkEntry``. .. attribute:: props.max_length :type: int Maximum number of characters for this entry. .. attribute:: props.overwrite_mode :type: bool If text is overwritten when typing in the ``GtkEntry``. .. attribute:: props.placeholder_text :type: str The text that will be displayed in the ``GtkEntry`` when it is empty and unfocused. .. attribute:: props.primary_icon_activatable :type: bool Whether the primary icon is activatable. GTK emits the :obj:`~gi.repository.Gtk.Entry.signals.icon_press` and :obj:`~gi.repository.Gtk.Entry.signals.icon_release` signals only on sensitive, activatable icons. Sensitive, but non-activatable icons can be used for purely informational purposes. .. attribute:: props.primary_icon_gicon :type: ~gi.repository.Gio.Icon The ``GIcon`` to use for the primary icon for the entry. .. attribute:: props.primary_icon_name :type: str The icon name to use for the primary icon for the entry. .. attribute:: props.primary_icon_paintable :type: ~gi.repository.Gdk.Paintable A ``GdkPaintable`` to use as the primary icon for the entry. .. attribute:: props.primary_icon_sensitive :type: bool Whether the primary icon is sensitive. An insensitive icon appears grayed out. GTK does not emit the :obj:`~gi.repository.Gtk.Entry.signals.icon_press` and :obj:`~gi.repository.Gtk.Entry.signals.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. .. attribute:: props.primary_icon_storage_type :type: ~gi.repository.Gtk.ImageType The representation which is used for the primary icon of the entry. .. attribute:: props.primary_icon_tooltip_markup :type: str The contents of the tooltip on the primary icon, with markup. Also see :obj:`~gi.repository.Gtk.Entry.set_icon_tooltip_markup`. .. attribute:: props.primary_icon_tooltip_text :type: str The contents of the tooltip on the primary icon. Also see :obj:`~gi.repository.Gtk.Entry.set_icon_tooltip_text`. .. attribute:: props.progress_fraction :type: float The current fraction of the task that's been completed. .. attribute:: props.progress_pulse_step :type: float The fraction of total entry width to move the progress bouncing block for each pulse. See :obj:`~gi.repository.Gtk.Entry.progress_pulse`. .. attribute:: props.scroll_offset :type: int Number of pixels of the entry scrolled off the screen to the left. .. attribute:: props.secondary_icon_activatable :type: bool Whether the secondary icon is activatable. GTK emits the :obj:`~gi.repository.Gtk.Entry.signals.icon_press` and :obj:`~gi.repository.Gtk.Entry.signals.icon_release` signals only on sensitive, activatable icons. Sensitive, but non-activatable icons can be used for purely informational purposes. .. attribute:: props.secondary_icon_gicon :type: ~gi.repository.Gio.Icon The ``GIcon`` to use for the secondary icon for the entry. .. attribute:: props.secondary_icon_name :type: str The icon name to use for the secondary icon for the entry. .. attribute:: props.secondary_icon_paintable :type: ~gi.repository.Gdk.Paintable A ``GdkPaintable`` to use as the secondary icon for the entry. .. attribute:: props.secondary_icon_sensitive :type: bool Whether the secondary icon is sensitive. An insensitive icon appears grayed out. GTK does not emit the :obj:`~gi.repository.Gtk.Entry.signals.icon_press[ and [signal``Gtk``.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. .. attribute:: props.secondary_icon_storage_type :type: ~gi.repository.Gtk.ImageType The representation which is used for the secondary icon of the entry. .. attribute:: props.secondary_icon_tooltip_markup :type: str The contents of the tooltip on the secondary icon, with markup. Also see :obj:`~gi.repository.Gtk.Entry.set_icon_tooltip_markup`. .. attribute:: props.secondary_icon_tooltip_text :type: str The contents of the tooltip on the secondary icon. Also see :obj:`~gi.repository.Gtk.Entry.set_icon_tooltip_text`. .. attribute:: props.show_emoji_icon :type: bool .. attribute:: props.tabs :type: ~gi.repository.Pango.TabArray .. attribute:: props.text_length :type: int The length of the text in the ``GtkEntry``. .. attribute:: props.truncate_multiline :type: bool When :const:`True`, pasted multi-line text is truncated to the first line. .. attribute:: props.visibility :type: bool Whether the entry should show the “invisible char” instead of the actual text (“password mode”). Signals ------- .. rst-class:: interim-class .. class:: Entry.signals :no-index: .. method:: activate() -> None Emitted when the entry is activated. The keybindings for this signal are all forms of the Enter key. .. method:: icon_press(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> None Emitted when an activatable icon is clicked. :param icon_pos: The position of the clicked icon .. method:: icon_release(icon_pos: ~gi.repository.Gtk.EntryIconPosition) -> None Emitted on the button release from a mouse click over an activatable icon. :param icon_pos: The position of the clicked icon Virtual Methods --------------- .. rst-class:: interim-class .. class:: Entry :no-index: .. method:: do_activate() -> None Class handler for the ``GtkEntry::activate`` signal. The default implementation activates the gtk.activate-default action. Fields ------ .. rst-class:: interim-class .. class:: Entry :no-index: .. attribute:: parent_instance