gtk4::prelude

Trait EntryExt

source
pub trait EntryExt:
    IsA<Entry>
    + Sealed
    + 'static {
Show 140 methods // Provided methods fn activates_default(&self) -> bool { ... } fn alignment(&self) -> f32 { ... } fn attributes(&self) -> Option<AttrList> { ... } fn buffer(&self) -> EntryBuffer { ... } fn completion(&self) -> Option<EntryCompletion> { ... } fn current_icon_drag_source(&self) -> i32 { ... } fn extra_menu(&self) -> Option<MenuModel> { ... } fn has_frame(&self) -> bool { ... } fn icon_is_activatable(&self, icon_pos: EntryIconPosition) -> bool { ... } fn icon_area(&self, icon_pos: EntryIconPosition) -> Rectangle { ... } fn icon_at_pos(&self, x: i32, y: i32) -> i32 { ... } fn icon_gicon(&self, icon_pos: EntryIconPosition) -> Option<Icon> { ... } fn icon_name(&self, icon_pos: EntryIconPosition) -> Option<GString> { ... } fn icon_paintable(&self, icon_pos: EntryIconPosition) -> Option<Paintable> { ... } fn icon_is_sensitive(&self, icon_pos: EntryIconPosition) -> bool { ... } fn icon_storage_type(&self, icon_pos: EntryIconPosition) -> ImageType { ... } fn icon_tooltip_markup( &self, icon_pos: EntryIconPosition, ) -> Option<GString> { ... } fn icon_tooltip_text(&self, icon_pos: EntryIconPosition) -> Option<GString> { ... } fn input_hints(&self) -> InputHints { ... } fn input_purpose(&self) -> InputPurpose { ... } fn max_length(&self) -> i32 { ... } fn is_overwrite_mode(&self) -> bool { ... } fn placeholder_text(&self) -> Option<GString> { ... } fn progress_fraction(&self) -> f64 { ... } fn progress_pulse_step(&self) -> f64 { ... } fn tabs(&self) -> Option<TabArray> { ... } fn text_length(&self) -> u16 { ... } fn is_visible(&self) -> bool { ... } fn grab_focus_without_selecting(&self) -> bool { ... } fn progress_pulse(&self) { ... } fn reset_im_context(&self) { ... } fn set_activates_default(&self, setting: bool) { ... } fn set_alignment(&self, xalign: f32) { ... } fn set_attributes(&self, attrs: &AttrList) { ... } fn set_buffer(&self, buffer: &impl IsA<EntryBuffer>) { ... } fn set_completion(&self, completion: Option<&EntryCompletion>) { ... } fn set_extra_menu(&self, model: Option<&impl IsA<MenuModel>>) { ... } fn set_has_frame(&self, setting: bool) { ... } fn set_icon_activatable( &self, icon_pos: EntryIconPosition, activatable: bool, ) { ... } fn set_icon_drag_source( &self, icon_pos: EntryIconPosition, provider: &impl IsA<ContentProvider>, actions: DragAction, ) { ... } fn set_icon_from_gicon( &self, icon_pos: EntryIconPosition, icon: Option<&impl IsA<Icon>>, ) { ... } fn set_icon_from_icon_name( &self, icon_pos: EntryIconPosition, icon_name: Option<&str>, ) { ... } fn set_icon_from_paintable( &self, icon_pos: EntryIconPosition, paintable: Option<&impl IsA<Paintable>>, ) { ... } fn set_icon_sensitive(&self, icon_pos: EntryIconPosition, sensitive: bool) { ... } fn set_icon_tooltip_markup( &self, icon_pos: EntryIconPosition, tooltip: Option<&str>, ) { ... } fn set_icon_tooltip_text( &self, icon_pos: EntryIconPosition, tooltip: Option<&str>, ) { ... } fn set_input_hints(&self, hints: InputHints) { ... } fn set_input_purpose(&self, purpose: InputPurpose) { ... } fn set_invisible_char(&self, ch: Option<char>) { ... } fn set_max_length(&self, max: i32) { ... } fn set_overwrite_mode(&self, overwrite: bool) { ... } fn set_placeholder_text(&self, text: Option<&str>) { ... } fn set_progress_fraction(&self, fraction: f64) { ... } fn set_progress_pulse_step(&self, fraction: f64) { ... } fn set_tabs(&self, tabs: Option<&TabArray>) { ... } fn set_visibility(&self, visible: bool) { ... } fn unset_invisible_char(&self) { ... } fn enables_emoji_completion(&self) -> bool { ... } fn set_enable_emoji_completion(&self, enable_emoji_completion: bool) { ... } fn im_module(&self) -> Option<GString> { ... } fn set_im_module(&self, im_module: Option<&str>) { ... } fn is_invisible_char_set(&self) -> bool { ... } fn is_primary_icon_activatable(&self) -> bool { ... } fn set_primary_icon_activatable(&self, primary_icon_activatable: bool) { ... } fn primary_icon_gicon(&self) -> Option<Icon> { ... } fn set_primary_icon_gicon<P: IsA<Icon>>( &self, primary_icon_gicon: Option<&P>, ) { ... } fn primary_icon_name(&self) -> Option<GString> { ... } fn set_primary_icon_name(&self, primary_icon_name: Option<&str>) { ... } fn primary_icon_paintable(&self) -> Option<Paintable> { ... } fn set_primary_icon_paintable<P: IsA<Paintable>>( &self, primary_icon_paintable: Option<&P>, ) { ... } fn is_primary_icon_sensitive(&self) -> bool { ... } fn set_primary_icon_sensitive(&self, primary_icon_sensitive: bool) { ... } fn primary_icon_storage_type(&self) -> ImageType { ... } fn primary_icon_tooltip_markup(&self) -> Option<GString> { ... } fn set_primary_icon_tooltip_markup( &self, primary_icon_tooltip_markup: Option<&str>, ) { ... } fn primary_icon_tooltip_text(&self) -> Option<GString> { ... } fn set_primary_icon_tooltip_text( &self, primary_icon_tooltip_text: Option<&str>, ) { ... } fn scroll_offset(&self) -> i32 { ... } fn is_secondary_icon_activatable(&self) -> bool { ... } fn set_secondary_icon_activatable(&self, secondary_icon_activatable: bool) { ... } fn secondary_icon_gicon(&self) -> Option<Icon> { ... } fn set_secondary_icon_gicon<P: IsA<Icon>>( &self, secondary_icon_gicon: Option<&P>, ) { ... } fn secondary_icon_name(&self) -> Option<GString> { ... } fn set_secondary_icon_name(&self, secondary_icon_name: Option<&str>) { ... } fn secondary_icon_paintable(&self) -> Option<Paintable> { ... } fn set_secondary_icon_paintable<P: IsA<Paintable>>( &self, secondary_icon_paintable: Option<&P>, ) { ... } fn is_secondary_icon_sensitive(&self) -> bool { ... } fn set_secondary_icon_sensitive(&self, secondary_icon_sensitive: bool) { ... } fn secondary_icon_storage_type(&self) -> ImageType { ... } fn secondary_icon_tooltip_markup(&self) -> Option<GString> { ... } fn set_secondary_icon_tooltip_markup( &self, secondary_icon_tooltip_markup: Option<&str>, ) { ... } fn secondary_icon_tooltip_text(&self) -> Option<GString> { ... } fn set_secondary_icon_tooltip_text( &self, secondary_icon_tooltip_text: Option<&str>, ) { ... } fn shows_emoji_icon(&self) -> bool { ... } fn set_show_emoji_icon(&self, show_emoji_icon: bool) { ... } fn must_truncate_multiline(&self) -> bool { ... } fn set_truncate_multiline(&self, truncate_multiline: bool) { ... } fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_activate(&self) { ... } fn connect_icon_press<F: Fn(&Self, EntryIconPosition) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_icon_release<F: Fn(&Self, EntryIconPosition) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_activates_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_attributes_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_buffer_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_completion_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_enable_emoji_completion_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_extra_menu_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_has_frame_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_im_module_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_input_hints_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_input_purpose_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_invisible_char_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_invisible_char_set_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_max_length_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_overwrite_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_placeholder_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_activatable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_gicon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_paintable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_sensitive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_storage_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_primary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_progress_fraction_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_progress_pulse_step_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_scroll_offset_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_activatable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_gicon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_paintable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_sensitive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_storage_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_secondary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_emoji_icon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_tabs_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_text_length_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_truncate_multiline_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_visibility_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Entry methods.

§Implementors

Entry

Provided Methods§

source

fn activates_default(&self) -> bool

Retrieves the value set by gtk_entry_set_activates_default().

§Returns

true if the entry will activate the default widget

source

fn alignment(&self) -> f32

Gets the value set by gtk_entry_set_alignment().

See also: xalign

§Returns

the alignment

source

fn attributes(&self) -> Option<AttrList>

Gets the attribute list of the Entry.

See set_attributes().

§Returns

the attribute list

source

fn buffer(&self) -> EntryBuffer

Get the EntryBuffer object which holds the text for this widget.

§Returns

A EntryBuffer object.

source

fn completion(&self) -> Option<EntryCompletion>

👎Deprecated: Since 4.10

Returns the auxiliary completion object currently in use by @self.

§Deprecated since 4.10

GtkEntryCompletion will be removed in GTK 5.

§Returns

The auxiliary completion object currently in use by @self

source

fn current_icon_drag_source(&self) -> i32

Returns the index of the icon which is the source of the current DND operation, or -1.

§Returns

index of the icon which is the source of the current DND operation, or -1.

source

fn extra_menu(&self) -> Option<MenuModel>

Gets the menu model set with gtk_entry_set_extra_menu().

§Returns

the menu model

source

fn has_frame(&self) -> bool

Gets the value set by gtk_entry_set_has_frame().

§Returns

whether the entry has a beveled frame

source

fn icon_is_activatable(&self, icon_pos: EntryIconPosition) -> bool

Returns whether the icon is activatable.

§icon_pos

Icon position

§Returns

true if the icon is activatable.

source

fn icon_area(&self, icon_pos: EntryIconPosition) -> 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.

§icon_pos

Icon position

§Returns
§icon_area

Return location for the icon’s area

source

fn icon_at_pos(&self, x: i32, y: i32) -> i32

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 query-tooltip signal handler.

§x

the x coordinate of the position to find, relative to @self

§y

the y coordinate of the position to find, relative to @self

§Returns

the index of the icon at the given position, or -1

source

fn icon_gicon(&self, icon_pos: EntryIconPosition) -> Option<Icon>

Retrieves the GIcon used for the icon.

None will be returned if there is no icon or if the icon was set by some other method (e.g., by gdk::Paintable or icon name).

§icon_pos

Icon position

§Returns

A GIcon

source

fn icon_name(&self, icon_pos: EntryIconPosition) -> Option<GString>

Retrieves the icon name used for the icon.

None is returned if there is no icon or if the icon was set by some other method (e.g., by gdk::Paintable or gicon).

§icon_pos

Icon position

§Returns

An icon name

source

fn icon_paintable(&self, icon_pos: EntryIconPosition) -> Option<Paintable>

Retrieves the gdk::Paintable used for the icon.

If no gdk::Paintable was used for the icon, None is returned.

§icon_pos

Icon position

§Returns

A gdk::Paintable if no icon is set for this position or the icon set is not a gdk::Paintable.

source

fn icon_is_sensitive(&self, icon_pos: EntryIconPosition) -> bool

Returns whether the icon appears sensitive or insensitive.

§icon_pos

Icon position

§Returns

true if the icon is sensitive.

source

fn icon_storage_type(&self, icon_pos: EntryIconPosition) -> 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 ImageType::Empty.

§icon_pos

Icon position

§Returns

image representation being used

source

fn icon_tooltip_markup(&self, icon_pos: EntryIconPosition) -> Option<GString>

Gets the contents of the tooltip on the icon at the specified position in @self.

§icon_pos

the icon position

§Returns

the tooltip text

source

fn icon_tooltip_text(&self, icon_pos: EntryIconPosition) -> Option<GString>

Gets the contents of the tooltip on the icon at the specified position in @self.

§icon_pos

the icon position

§Returns

the tooltip text

source

fn input_hints(&self) -> InputHints

Gets the input hints of this Entry.

§Returns

the input hints

source

fn input_purpose(&self) -> InputPurpose

Gets the input purpose of the Entry.

§Returns

the input purpose

source

fn max_length(&self) -> i32

Retrieves the maximum allowed length of the text in @self.

See set_max_length().

§Returns

the maximum allowed number of characters in Entry, or 0 if there is no maximum.

source

fn is_overwrite_mode(&self) -> bool

Gets whether the Entry is in overwrite mode.

§Returns

whether the text is overwritten when typing.

source

fn placeholder_text(&self) -> Option<GString>

Retrieves the text that will be displayed when @self is empty and unfocused

§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. If no placeholder text has been set, None will be returned.

source

fn progress_fraction(&self) -> f64

Returns the current fraction of the task that’s been completed.

See set_progress_fraction().

§Returns

a fraction from 0.0 to 1.0

source

fn progress_pulse_step(&self) -> f64

Retrieves the pulse step set with gtk_entry_set_progress_pulse_step().

§Returns

a fraction from 0.0 to 1.0

source

fn tabs(&self) -> Option<TabArray>

Gets the tabstops of the Entry.

See set_tabs().

§Returns

the tabstops

source

fn text_length(&self) -> u16

Retrieves the current length of the text in @self.

This is equivalent to getting @self’s EntryBuffer and calling EntryBufferExtManual::length() on it.

§Returns

the current number of characters in Entry, or 0 if there are none.

source

fn is_visible(&self) -> bool

Retrieves whether the text in @self is visible.

See set_visibility().

§Returns

true if the text is currently visible

source

fn grab_focus_without_selecting(&self) -> bool

Causes @self to have keyboard focus.

It behaves like WidgetExt::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.

§Returns

true if focus is now inside @self_

source

fn progress_pulse(&self)

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 by set_progress_pulse_step()).

source

fn reset_im_context(&self)

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.

source

fn set_activates_default(&self, setting: bool)

Sets whether pressing Enter in the @self 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.

§setting

true to activate window’s default widget on Enter keypress

source

fn set_alignment(&self, xalign: f32)

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: xalign

§xalign

The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts

source

fn set_attributes(&self, attrs: &AttrList)

Sets a pango::AttrList.

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.

§attrs

a pango::AttrList

source

fn set_buffer(&self, buffer: &impl IsA<EntryBuffer>)

Set the EntryBuffer object which holds the text for this widget.

§buffer

a EntryBuffer

source

fn set_completion(&self, completion: Option<&EntryCompletion>)

👎Deprecated: Since 4.10

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 EntryCompletion API. Completion is disabled if @completion is set to None.

§Deprecated since 4.10

GtkEntryCompletion will be removed in GTK 5.

§completion

The EntryCompletion

source

fn set_extra_menu(&self, model: Option<&impl IsA<MenuModel>>)

Sets a menu model to add when constructing the context menu for @self.

§model

a GMenuModel

source

fn set_has_frame(&self, setting: bool)

Sets whether the entry has a beveled frame around it.

§setting

new value

source

fn set_icon_activatable(&self, icon_pos: EntryIconPosition, activatable: bool)

Sets whether the icon is activatable.

§icon_pos

Icon position

§activatable

true if the icon should be activatable

source

fn set_icon_drag_source( &self, icon_pos: EntryIconPosition, provider: &impl IsA<ContentProvider>, actions: DragAction, )

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.

§icon_pos

icon position

§provider

a gdk::ContentProvider

§actions

a bitmask of the allowed drag actions

source

fn set_icon_from_gicon( &self, icon_pos: EntryIconPosition, icon: Option<&impl IsA<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.

§icon_pos

The position at which to set the icon

§icon

The icon to set

source

fn set_icon_from_icon_name( &self, icon_pos: EntryIconPosition, icon_name: Option<&str>, )

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.

§icon_pos

The position at which to set the icon

§icon_name

An icon name

source

fn set_icon_from_paintable( &self, icon_pos: EntryIconPosition, paintable: Option<&impl IsA<Paintable>>, )

Sets the icon shown in the specified position using a gdk::Paintable.

If @paintable is None, no icon will be shown in the specified position.

§icon_pos

Icon position

§paintable

A gdk::Paintable

source

fn set_icon_sensitive(&self, icon_pos: EntryIconPosition, sensitive: bool)

Sets the sensitivity for the specified icon.

§icon_pos

Icon position

§sensitive

Specifies whether the icon should appear sensitive or insensitive

source

fn set_icon_tooltip_markup( &self, icon_pos: EntryIconPosition, tooltip: Option<&str>, )

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 None for @tooltip to remove an existing tooltip.

See also WidgetExt::set_tooltip_markup() and set_icon_tooltip_text().

§icon_pos

the icon position

§tooltip

the contents of the tooltip for the icon

source

fn set_icon_tooltip_text( &self, icon_pos: EntryIconPosition, tooltip: Option<&str>, )

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 WidgetExt::set_tooltip_text() and set_icon_tooltip_markup().

If you unset the widget tooltip via WidgetExt::set_tooltip_text() or WidgetExt::set_tooltip_markup(), this sets has-tooltip to false, which suppresses icon tooltips too. You can resolve this by then calling WidgetExt::set_has_tooltip() to set has-tooltip back to true, or setting at least one non-empty tooltip on any icon achieves the same result.

§icon_pos

the icon position

§tooltip

the contents of the tooltip for the icon

source

fn set_input_hints(&self, hints: InputHints)

Set additional hints which allow input methods to fine-tune their behavior.

§hints

the hints

source

fn set_input_purpose(&self, purpose: InputPurpose)

Sets the input purpose which can be used by input methods to adjust their behavior.

§purpose

the purpose

source

fn set_invisible_char(&self, ch: Option<char>)

Sets the character to use in place of the actual text in “password mode”.

See 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.

§ch

a Unicode character

source

fn set_max_length(&self, max: i32)

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 @self’s EntryBuffer and calling EntryBufferExtManual::set_max_length() on it.

§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.

source

fn set_overwrite_mode(&self, overwrite: bool)

Sets whether the text is overwritten when typing in the Entry.

§overwrite

new value

source

fn set_placeholder_text(&self, text: Option<&str>)

Sets text to be displayed in @self when it is empty.

This can be used to give a visual hint of the expected contents of the Entry.

§text

a string to be displayed when @self is empty and unfocused

source

fn set_progress_fraction(&self, fraction: f64)

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.

§fraction

fraction of the task that’s been completed

source

fn set_progress_pulse_step(&self, fraction: f64)

Sets the fraction of total entry width to move the progress bouncing block for each pulse.

Use progress_pulse() to pulse the progress.

§fraction

fraction between 0.0 and 1.0

source

fn set_tabs(&self, tabs: Option<&TabArray>)

Sets a pango::TabArray.

The tabstops in the array are applied to the entry text.

§tabs

a pango::TabArray

source

fn set_visibility(&self, visible: bool)

Sets whether the contents of the entry are visible or not.

When visibility is set to 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 set_invisible_char().

Note that you probably want to set input-purpose to InputPurpose::Password or InputPurpose::Pin to inform input methods about the purpose of this entry, in addition to setting visibility to false.

§visible

true if the contents of the entry are displayed as plaintext

source

fn unset_invisible_char(&self)

Unsets the invisible char, so that the default invisible char is used again. See set_invisible_char().

source

fn enables_emoji_completion(&self) -> bool

Whether to suggest Emoji replacements for :-delimited names like :heart:.

source

fn set_enable_emoji_completion(&self, enable_emoji_completion: bool)

Whether to suggest Emoji replacements for :-delimited names like :heart:.

source

fn im_module(&self) -> Option<GString>

Which IM (input method) module should be used for this entry.

See IMContext.

Setting this to a non-None value overrides the system-wide IM module setting. See the GtkSettings gtk-im-module property.

source

fn set_im_module(&self, im_module: Option<&str>)

Which IM (input method) module should be used for this entry.

See IMContext.

Setting this to a non-None value overrides the system-wide IM module setting. See the GtkSettings gtk-im-module property.

source

fn is_invisible_char_set(&self) -> bool

Whether the invisible char has been set for the Entry.

source

fn is_primary_icon_activatable(&self) -> bool

Whether the primary icon is activatable.

GTK emits the icon-press and icon-release signals only on sensitive, activatable icons.

Sensitive, but non-activatable icons can be used for purely informational purposes.

source

fn set_primary_icon_activatable(&self, primary_icon_activatable: bool)

Whether the primary icon is activatable.

GTK emits the icon-press and icon-release signals only on sensitive, activatable icons.

Sensitive, but non-activatable icons can be used for purely informational purposes.

source

fn primary_icon_gicon(&self) -> Option<Icon>

The GIcon to use for the primary icon for the entry.

source

fn set_primary_icon_gicon<P: IsA<Icon>>(&self, primary_icon_gicon: Option<&P>)

The GIcon to use for the primary icon for the entry.

source

fn primary_icon_name(&self) -> Option<GString>

The icon name to use for the primary icon for the entry.

source

fn set_primary_icon_name(&self, primary_icon_name: Option<&str>)

The icon name to use for the primary icon for the entry.

source

fn primary_icon_paintable(&self) -> Option<Paintable>

A gdk::Paintable to use as the primary icon for the entry.

source

fn set_primary_icon_paintable<P: IsA<Paintable>>( &self, primary_icon_paintable: Option<&P>, )

A gdk::Paintable to use as the primary icon for the entry.

source

fn is_primary_icon_sensitive(&self) -> bool

Whether the primary icon is sensitive.

An insensitive icon appears grayed out. GTK does not emit the icon-press and 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.

source

fn set_primary_icon_sensitive(&self, primary_icon_sensitive: bool)

Whether the primary icon is sensitive.

An insensitive icon appears grayed out. GTK does not emit the icon-press and 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.

source

fn primary_icon_storage_type(&self) -> ImageType

The representation which is used for the primary icon of the entry.

source

fn primary_icon_tooltip_markup(&self) -> Option<GString>

The contents of the tooltip on the primary icon, with markup.

Also see set_icon_tooltip_markup().

source

fn set_primary_icon_tooltip_markup( &self, primary_icon_tooltip_markup: Option<&str>, )

The contents of the tooltip on the primary icon, with markup.

Also see set_icon_tooltip_markup().

source

fn primary_icon_tooltip_text(&self) -> Option<GString>

The contents of the tooltip on the primary icon.

Also see set_icon_tooltip_text().

source

fn set_primary_icon_tooltip_text(&self, primary_icon_tooltip_text: Option<&str>)

The contents of the tooltip on the primary icon.

Also see set_icon_tooltip_text().

source

fn scroll_offset(&self) -> i32

Number of pixels of the entry scrolled off the screen to the left.

source

fn is_secondary_icon_activatable(&self) -> bool

Whether the secondary icon is activatable.

GTK emits the icon-press and icon-release signals only on sensitive, activatable icons.

Sensitive, but non-activatable icons can be used for purely informational purposes.

source

fn set_secondary_icon_activatable(&self, secondary_icon_activatable: bool)

Whether the secondary icon is activatable.

GTK emits the icon-press and icon-release signals only on sensitive, activatable icons.

Sensitive, but non-activatable icons can be used for purely informational purposes.

source

fn secondary_icon_gicon(&self) -> Option<Icon>

The GIcon to use for the secondary icon for the entry.

source

fn set_secondary_icon_gicon<P: IsA<Icon>>( &self, secondary_icon_gicon: Option<&P>, )

The GIcon to use for the secondary icon for the entry.

source

fn secondary_icon_name(&self) -> Option<GString>

The icon name to use for the secondary icon for the entry.

source

fn set_secondary_icon_name(&self, secondary_icon_name: Option<&str>)

The icon name to use for the secondary icon for the entry.

source

fn secondary_icon_paintable(&self) -> Option<Paintable>

A gdk::Paintable to use as the secondary icon for the entry.

source

fn set_secondary_icon_paintable<P: IsA<Paintable>>( &self, secondary_icon_paintable: Option<&P>, )

A gdk::Paintable to use as the secondary icon for the entry.

source

fn is_secondary_icon_sensitive(&self) -> bool

Whether the secondary icon is sensitive.

An insensitive icon appears grayed out. GTK does not emit the icon-press[ and 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.

source

fn set_secondary_icon_sensitive(&self, secondary_icon_sensitive: bool)

Whether the secondary icon is sensitive.

An insensitive icon appears grayed out. GTK does not emit the icon-press[ and 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.

source

fn secondary_icon_storage_type(&self) -> ImageType

The representation which is used for the secondary icon of the entry.

source

fn secondary_icon_tooltip_markup(&self) -> Option<GString>

The contents of the tooltip on the secondary icon, with markup.

Also see set_icon_tooltip_markup().

source

fn set_secondary_icon_tooltip_markup( &self, secondary_icon_tooltip_markup: Option<&str>, )

The contents of the tooltip on the secondary icon, with markup.

Also see set_icon_tooltip_markup().

source

fn secondary_icon_tooltip_text(&self) -> Option<GString>

The contents of the tooltip on the secondary icon.

Also see set_icon_tooltip_text().

source

fn set_secondary_icon_tooltip_text( &self, secondary_icon_tooltip_text: Option<&str>, )

The contents of the tooltip on the secondary icon.

Also see set_icon_tooltip_text().

source

fn shows_emoji_icon(&self) -> bool

Whether the entry will show an Emoji icon in the secondary icon position to open the Emoji chooser.

source

fn set_show_emoji_icon(&self, show_emoji_icon: bool)

Whether the entry will show an Emoji icon in the secondary icon position to open the Emoji chooser.

source

fn must_truncate_multiline(&self) -> bool

When true, pasted multi-line text is truncated to the first line.

source

fn set_truncate_multiline(&self, truncate_multiline: bool)

When true, pasted multi-line text is truncated to the first line.

source

fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the entry is activated.

The keybindings for this signal are all forms of the Enter key.

source

fn emit_activate(&self)

source

fn connect_icon_press<F: Fn(&Self, EntryIconPosition) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when an activatable icon is clicked.

§icon_pos

The position of the clicked icon

source

fn connect_icon_release<F: Fn(&Self, EntryIconPosition) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted on the button release from a mouse click over an activatable icon.

§icon_pos

The position of the clicked icon

source

fn connect_activates_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_attributes_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_buffer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_completion_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 4.10
source

fn connect_enable_emoji_completion_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_extra_menu_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_has_frame_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_im_module_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_input_hints_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_input_purpose_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_invisible_char_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_invisible_char_set_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_max_length_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_overwrite_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_placeholder_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_activatable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_gicon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_paintable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_sensitive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_storage_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_primary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_progress_fraction_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_progress_pulse_step_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_scroll_offset_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_activatable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_gicon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_paintable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_sensitive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_storage_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_tooltip_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_secondary_icon_tooltip_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_show_emoji_icon_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_text_length_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_truncate_multiline_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_visibility_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Entry>> EntryExt for O