Adw.EntryRow

g Adw.EntryRow Adw.EntryRow Adw.PreferencesRow Adw.PreferencesRow Adw.PreferencesRow->Adw.EntryRow GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Editable Gtk.Editable GObject.GInterface->Gtk.Editable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.ListBoxRow Gtk.ListBoxRow Gtk.Actionable->Gtk.ListBoxRow Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Editable->Adw.EntryRow Gtk.ListBoxRow->Adw.PreferencesRow Gtk.Widget->Gtk.ListBoxRow

Subclasses:

Adw.PasswordEntryRow

Methods

Inherited:

Adw.PreferencesRow (9), Gtk.ListBoxRow (12), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Actionable (5), Gtk.Editable (27)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

add_prefix (widget)

add_suffix (widget)

get_activates_default ()

get_attributes ()

get_enable_emoji_completion ()

get_input_hints ()

get_input_purpose ()

get_show_apply_button ()

get_text_length ()

grab_focus_without_selecting ()

remove (widget)

set_activates_default (activates)

set_attributes (attributes)

set_enable_emoji_completion (enable_emoji_completion)

set_input_hints (hints)

set_input_purpose (purpose)

set_show_apply_button (show_apply_button)

Virtual Methods

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.Actionable (4), Gtk.Editable (9)

Properties

Inherited:

Adw.PreferencesRow (4), Gtk.ListBoxRow (3), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Actionable (2), Gtk.Editable (8)

Name

Type

Flags

Short Description

activates-default

bool

r/w/en

attributes

Pango.AttrList

r/w/en

enable-emoji-completion

bool

r/w/en

input-hints

Gtk.InputHints

r/w/en

input-purpose

Gtk.InputPurpose

r/w/en

show-apply-button

bool

r/w/en

text-length

int

r

Signals

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1), Gtk.Editable (3)

Name

Short Description

apply

Emitted when the apply button is pressed.

entry-activated

Emitted when the embedded entry is activated.

Fields

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (13), GObject.Object (1), Gtk.Editable (3)

Name

Type

Access

Description

parent_instance

Adw.PreferencesRow

r

Class Details

class Adw.EntryRow(**kwargs)
Bases:

Adw.PreferencesRow, Gtk.Editable

Abstract:

No

Structure:

Adw.EntryRowClass

A [class`Gtk`.ListBoxRow] with an embedded text entry.

<picture> <source srcset=”entry-row-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”entry-row.png” alt=”entry-row”> </picture>

AdwEntryRow has a title that doubles as placeholder text. It shows an icon indicating that it’s editable and can receive additional widgets before or after the editable part.

If [property`EntryRow`:py:data::show-apply-button<Adw.EntryRow.props.show_apply_button>] is set to TRUE, AdwEntryRow can show an apply button when editing its contents. This can be useful if changing its contents can result in an expensive operation, such as network activity.

AdwEntryRow provides only minimal API and should be used with the [iface`Gtk`.Editable] API.

See also [class`PasswordEntryRow`].

Adw.EntryRow as Gtk.Buildable

The AdwEntryRow implementation of the [iface`Gtk`.Buildable] interface supports adding a child at its end by specifying “suffix” or omitting the “type” attribute of a <child> element.

It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.

CSS nodes

AdwEntryRow has a single CSS node with name row and the .entry style class.

New in version 1.2.

classmethod new()
Returns:

the newly created AdwEntryRow

Return type:

Gtk.Widget

Creates a new AdwEntryRow.

New in version 1.2.

add_prefix(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds a prefix widget to self.

New in version 1.2.

add_suffix(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds a suffix widget to self.

New in version 1.2.

get_activates_default()
Returns:

whether to activate the default widget

Return type:

bool

Gets whether activating the embedded entry can activate the default widget.

New in version 1.2.

get_attributes()
Returns:

the list of attributes

Return type:

Pango.AttrList or None

Gets Pango attributes applied to the text of the embedded entry.

New in version 1.2.

get_enable_emoji_completion()
Returns:

whether or not emoji completion is enabled

Return type:

bool

Gets whether to suggest emoji replacements on self.

New in version 1.2.

get_input_hints()
Returns:

The input hints

Return type:

Gtk.InputHints

Gets the additional input hints of self.

New in version 1.2.

get_input_purpose()
Returns:

the input purpose

Return type:

Gtk.InputPurpose

Gets the input purpose of self.

New in version 1.2.

get_show_apply_button()
Returns:

whether to show the apply button

Return type:

bool

Gets whether self can show the apply button.

New in version 1.2.

get_text_length()
Returns:

The current number of characters in self, or 0 if there are none.

Return type:

int

Retrieves the current length of the text in self.

New in version 1.5.

grab_focus_without_selecting()
Returns:

whether the focus is now inside self

Return type:

bool

Causes self to have keyboard focus without selecting the text.

See [method`Gtk`.Text.grab_focus_without_selecting] for more information.

New in version 1.3.

remove(widget)
Parameters:

widget (Gtk.Widget) – the child to be removed

Removes a child from self.

New in version 1.2.

set_activates_default(activates)
Parameters:

activates (bool) – whether to activate the default widget

Sets whether activating the embedded entry can activate the default widget.

New in version 1.2.

set_attributes(attributes)
Parameters:

attributes (Pango.AttrList or None) – a list of attributes

Sets Pango attributes to apply to the text of the embedded entry.

The [struct`Pango`.Attribute]’s start_index and end_index must refer to the [class`Gtk`.EntryBuffer] text, i.e. without the preedit string.

New in version 1.2.

set_enable_emoji_completion(enable_emoji_completion)
Parameters:

enable_emoji_completion (bool) – Whether emoji completion should be enabled or not

Sets whether to suggest emoji replacements on self.

Emoji replacement is done with :-delimited names, like :heart:.

New in version 1.2.

set_input_hints(hints)
Parameters:

hints (Gtk.InputHints) – the hints

Set additional input hints for self.

Input hints allow input methods to fine-tune their behavior.

See also: [property`AdwEntryRow`:py:data::input-purpose<Adw.EntryRow.props.input_purpose>]

New in version 1.2.

set_input_purpose(purpose)
Parameters:

purpose (Gtk.InputPurpose) – the purpose

Sets the input purpose of self.

The input purpose can be used by input methods to adjust their behavior.

New in version 1.2.

set_show_apply_button(show_apply_button)
Parameters:

show_apply_button (bool) – whether to show the apply button

Sets whether self can show the apply button.

When set to TRUE, typing text in the entry will reveal an apply button. Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and emit the [signal`EntryRow`:py:func:::apply<Adw.EntryRow.signals.apply>] signal.

This is useful if changing the entry contents can trigger an expensive operation, e.g. network activity, to avoid triggering it after typing every character.

New in version 1.2.

Signal Details

Adw.EntryRow.signals.apply(entry_row)
Signal Name:

apply

Flags:

RUN_LAST

Parameters:

entry_row (Adw.EntryRow) – The object which received the signal

Emitted when the apply button is pressed.

See [property`EntryRow`:py:data::show-apply-button<Adw.EntryRow.props.show_apply_button>].

New in version 1.2.

Adw.EntryRow.signals.entry_activated(entry_row)
Signal Name:

entry-activated

Flags:

RUN_LAST

Parameters:

entry_row (Adw.EntryRow) – The object which received the signal

Emitted when the embedded entry is activated.

New in version 1.2.

Property Details

Adw.EntryRow.props.activates_default
Name:

activates-default

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether activating the embedded entry can activate the default widget.

New in version 1.2.

Adw.EntryRow.props.attributes
Name:

attributes

Type:

Pango.AttrList

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A list of Pango attributes to apply to the text of the embedded entry.

The [struct`Pango`.Attribute]’s start_index and end_index must refer to the [class`Gtk`.EntryBuffer] text, i.e. without the preedit string.

New in version 1.2.

Adw.EntryRow.props.enable_emoji_completion
Name:

enable-emoji-completion

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to suggest emoji replacements on the entry row.

Emoji replacement is done with :-delimited names, like :heart:.

New in version 1.2.

Adw.EntryRow.props.input_hints
Name:

input-hints

Type:

Gtk.InputHints

Default Value:

Gtk.InputHints.NONE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Additional input hints for the entry row.

Input hints allow input methods to fine-tune their behavior.

See also: [property`Adw`.EntryRow:input-purpose]

New in version 1.2.

Adw.EntryRow.props.input_purpose
Name:

input-purpose

Type:

Gtk.InputPurpose

Default Value:

Gtk.InputPurpose.FREE_FORM

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The input purpose of the entry row.

The input purpose can be used by input methods to adjust their behavior.

New in version 1.2.

Adw.EntryRow.props.show_apply_button
Name:

show-apply-button

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to show the apply button.

When set to TRUE, typing text in the entry will reveal an apply button. Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and emit the [signal`EntryRow`:py:func:::apply<Adw.EntryRow.signals.apply>] signal.

This is useful if changing the entry contents can trigger an expensive operation, e.g. network activity, to avoid triggering it after typing every character.

New in version 1.2.

Adw.EntryRow.props.text_length
Name:

text-length

Type:

int

Default Value:

0

Flags:

READABLE

The length of the text in the entry row.

New in version 1.5.