pub trait EntryExt: 'static {
Show 193 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 cursor_hadjustment(&self) -> Option<Adjustment>;
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_pixbuf(&self, icon_pos: EntryIconPosition) -> Option<Pixbuf>;
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 layout(&self) -> Option<Layout>;
fn layout_offsets(&self) -> (i32, i32);
fn max_length(&self) -> i32;
fn max_width_chars(&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(&self) -> GString;
fn text_area(&self) -> Rectangle;
fn text_length(&self) -> u16;
fn is_visible(&self) -> bool;
fn width_chars(&self) -> i32;
fn grab_focus_without_selecting(&self);
fn im_context_filter_keypress(&self, event: &EventKey) -> bool;
fn layout_index_to_text_index(&self, layout_index: i32) -> i32;
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<&impl IsA<EntryCompletion>>);
fn set_cursor_hadjustment(&self, adjustment: Option<&impl IsA<Adjustment>>);
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,
target_list: &TargetList,
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_pixbuf(
&self,
icon_pos: EntryIconPosition,
pixbuf: Option<&Pixbuf>
);
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_max_width_chars(&self, n_chars: 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: &TabArray);
fn set_text(&self, text: &str);
fn set_visibility(&self, visible: bool);
fn set_width_chars(&self, n_chars: i32);
fn text_index_to_layout_index(&self, text_index: i32) -> i32;
fn unset_invisible_char(&self);
fn is_caps_lock_warning(&self) -> bool;
fn set_caps_lock_warning(&self, caps_lock_warning: bool);
fn cursor_position(&self) -> i32;
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 set_invisible_char_set(&self, invisible_char_set: bool);
fn populates_all(&self) -> bool;
fn set_populate_all(&self, populate_all: 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_pixbuf(&self) -> Option<Pixbuf>;
fn set_primary_icon_pixbuf(&self, primary_icon_pixbuf: Option<&Pixbuf>);
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_pixbuf(&self) -> Option<Pixbuf>;
fn set_secondary_icon_pixbuf(&self, secondary_icon_pixbuf: Option<&Pixbuf>);
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 selection_bound(&self) -> i32;
fn shadow_type(&self) -> ShadowType;
fn set_shadow_type(&self, shadow_type: ShadowType);
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 xalign(&self) -> f32;
fn set_xalign(&self, xalign: f32);
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_activate(&self);
fn connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_backspace(&self);
fn connect_copy_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_copy_clipboard(&self);
fn connect_cut_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_cut_clipboard(&self);
fn connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_delete_from_cursor(&self, type_: DeleteType, count: i32);
fn connect_icon_press<F: Fn(&Self, EntryIconPosition, &Event) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_icon_release<F: Fn(&Self, EntryIconPosition, &Event) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_insert_at_cursor(&self, string: &str);
fn connect_insert_emoji<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_insert_emoji(&self);
fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_move_cursor(
&self,
step: MovementStep,
count: i32,
extend_selection: bool
);
fn connect_paste_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_paste_clipboard(&self);
fn connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_preedit_changed<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_preedit_changed(&self, preedit: &str);
fn connect_toggle_overwrite<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn emit_toggle_overwrite(&self);
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_caps_lock_warning_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_completion_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_cursor_position_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_editable_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_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_max_width_chars_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_populate_all_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_pixbuf_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_pixbuf_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_selection_bound_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_shadow_type_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_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;
fn connect_width_chars_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_xalign_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
fn activates_default(&self) -> bool
fn activates_default(&self) -> bool
Retrieves the value set by set_activates_default()
.
Returns
true
if the entry will activate the default widget
fn attributes(&self) -> Option<AttrList>
fn attributes(&self) -> Option<AttrList>
Gets the attribute list that was set on the entry using
set_attributes()
, if any.
Returns
the attribute list, or None
if none was set.
fn buffer(&self) -> EntryBuffer
fn buffer(&self) -> EntryBuffer
fn completion(&self) -> Option<EntryCompletion>
fn completion(&self) -> Option<EntryCompletion>
Returns the auxiliary completion object currently in use by self
.
Returns
The auxiliary completion object currently
in use by self
.
fn current_icon_drag_source(&self) -> i32
fn current_icon_drag_source(&self) -> i32
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 signal::Widget::drag-data-get
callback.
Returns
index of the icon which is the source of the current DND operation, or -1.
fn cursor_hadjustment(&self) -> Option<Adjustment>
fn cursor_hadjustment(&self) -> Option<Adjustment>
Retrieves the horizontal cursor adjustment for the entry.
See set_cursor_hadjustment()
.
Returns
the horizontal cursor adjustment, or None
if none has been set.
fn icon_is_activatable(&self, icon_pos: EntryIconPosition) -> bool
fn icon_is_activatable(&self, icon_pos: EntryIconPosition) -> bool
fn icon_area(&self, icon_pos: EntryIconPosition) -> Rectangle
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.
See also text_area()
icon_pos
Icon position
Returns
icon_area
Return location for the icon’s area
fn icon_at_pos(&self, x: i32, y: i32) -> i32
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 signal::Widget::query-tooltip
signal handler.
x
the x coordinate of the position to find
y
the y coordinate of the position to find
Returns
the index of the icon at the given position, or -1
fn icon_gicon(&self, icon_pos: EntryIconPosition) -> Option<Icon>
fn icon_gicon(&self, icon_pos: EntryIconPosition) -> Option<Icon>
fn icon_name(&self, icon_pos: EntryIconPosition) -> Option<GString>
fn icon_name(&self, icon_pos: EntryIconPosition) -> Option<GString>
fn icon_pixbuf(&self, icon_pos: EntryIconPosition) -> Option<Pixbuf>
fn icon_pixbuf(&self, icon_pos: EntryIconPosition) -> Option<Pixbuf>
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
gdk_pixbuf::Pixbuf
, a gio::Icon
, a stock item, or an icon name.
icon_pos
Icon position
Returns
A gdk_pixbuf::Pixbuf
, or None
if no icon is
set for this position.
fn icon_is_sensitive(&self, icon_pos: EntryIconPosition) -> bool
fn icon_is_sensitive(&self, icon_pos: EntryIconPosition) -> bool
fn icon_storage_type(&self, icon_pos: EntryIconPosition) -> ImageType
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
fn icon_tooltip_markup(&self, icon_pos: EntryIconPosition) -> Option<GString>
fn icon_tooltip_markup(&self, icon_pos: EntryIconPosition) -> Option<GString>
fn icon_tooltip_text(&self, icon_pos: EntryIconPosition) -> Option<GString>
fn icon_tooltip_text(&self, icon_pos: EntryIconPosition) -> Option<GString>
fn input_hints(&self) -> InputHints
fn input_hints(&self) -> InputHints
Gets the value of the property::Entry::input-hints
property.
fn input_purpose(&self) -> InputPurpose
fn input_purpose(&self) -> InputPurpose
Gets the value of the property::Entry::input-purpose
property.
Gets the pango::Layout
used to display the entry.
The layout is useful to e.g. convert text positions to
pixel positions, in combination with 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
layout_index_to_text_index()
and
text_index_to_layout_index()
are needed to convert byte
indices in the layout to byte indices in the entry contents.
Returns
the pango::Layout
for this entry
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() or PANGO_SCALE
.
Keep in mind that the layout text may contain a preedit string, so
layout_index_to_text_index()
and
text_index_to_layout_index()
are needed to convert byte
indices in the layout to byte indices in the entry contents.
Returns
x
location to store X offset of layout, or None
y
location to store Y offset of layout, or None
fn max_length(&self) -> i32
fn max_length(&self) -> i32
Retrieves the maximum allowed length of the text in
self
. See set_max_length()
.
This is equivalent to getting self
’s EntryBuffer
and
calling [EntryBufferExtManual::max_length()
][crate::prelude::EntryBufferExtManual::max_length()] on it.
Returns
the maximum allowed number of characters
in Entry
, or 0 if there is no maximum.
fn max_width_chars(&self) -> i32
fn max_width_chars(&self) -> i32
Retrieves the desired maximum width of self
, in characters.
See set_max_width_chars()
.
Returns
the maximum width of the entry, in characters
fn is_overwrite_mode(&self) -> bool
fn is_overwrite_mode(&self) -> bool
fn placeholder_text(&self) -> Option<GString>
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.
fn progress_fraction(&self) -> f64
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
fn progress_pulse_step(&self) -> f64
fn progress_pulse_step(&self) -> f64
Gets the tabstops that were set on the entry using set_tabs()
, if
any.
Returns
the tabstops, or None
if none was set.
Retrieves the contents of the entry widget.
See also EditableExt::chars()
.
This is equivalent to getting self
’s EntryBuffer
and calling
[EntryBufferExtManual::text()
][crate::prelude::EntryBufferExtManual::text()] on it.
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.
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 icon_area()
.
Returns
text_area
Return location for the text area.
fn text_length(&self) -> u16
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()
][crate::prelude::EntryBufferExtManual::length()] on it.
Returns
the current number of characters
in Entry
, or 0 if there are none.
fn is_visible(&self) -> bool
fn is_visible(&self) -> bool
Retrieves whether the text in self
is visible. See
set_visibility()
.
Returns
true
if the text is currently visible
fn width_chars(&self) -> i32
fn width_chars(&self) -> i32
Gets the value set by set_width_chars()
.
Returns
number of chars to request space for, or negative if unset
fn grab_focus_without_selecting(&self)
fn grab_focus_without_selecting(&self)
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.
fn im_context_filter_keypress(&self, event: &EventKey) -> bool
fn im_context_filter_keypress(&self, event: &EventKey) -> bool
Allow the Entry
input method to internally handle key press
and release events. If this function returns true
, then no further
processing should be done for this key event. See
IMContextExt::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 Entry
.
See TextViewExt::reset_im_context()
for an example of use.
event
the key event
Returns
true
if the input method handled the key event.
fn layout_index_to_text_index(&self, layout_index: i32) -> i32
fn layout_index_to_text_index(&self, layout_index: i32) -> i32
Converts from a position in the entry’s pango::Layout
(returned by
layout()
) to a position in the entry contents
(returned by text()
).
layout_index
byte index into the entry layout text
Returns
byte index into the entry contents
fn progress_pulse(&self)
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
progress_pulse()
causes the block to move by a little bit
(the amount of movement per pulse is determined by
set_progress_pulse_step()
).
fn reset_im_context(&self)
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.
fn set_activates_default(&self, setting: bool)
fn set_activates_default(&self, setting: bool)
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 calls
GtkWindowExt::activate_default()
on the window containing the entry, in
the default handler for the signal::Entry::activate
signal.)
setting
true
to activate window’s default widget on Enter keypress
fn set_alignment(&self, xalign: f32)
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.
xalign
The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts
fn set_attributes(&self, attrs: &AttrList)
fn set_attributes(&self, attrs: &AttrList)
Sets a pango::AttrList
; the attributes in the list are applied to the
entry text.
attrs
fn set_buffer(&self, buffer: &impl IsA<EntryBuffer>)
fn set_buffer(&self, buffer: &impl IsA<EntryBuffer>)
fn set_completion(&self, completion: Option<&impl IsA<EntryCompletion>>)
fn set_completion(&self, completion: Option<&impl IsA<EntryCompletion>>)
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
.
completion
The EntryCompletion
or None
fn set_cursor_hadjustment(&self, adjustment: Option<&impl IsA<Adjustment>>)
fn set_cursor_hadjustment(&self, adjustment: Option<&impl IsA<Adjustment>>)
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 ScrolledWindowExt::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.
adjustment
an adjustment which should be adjusted when the cursor
is moved, or None
fn set_has_frame(&self, setting: bool)
fn set_has_frame(&self, setting: bool)
fn set_icon_activatable(&self, icon_pos: EntryIconPosition, activatable: bool)
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
fn set_icon_drag_source(
&self,
icon_pos: EntryIconPosition,
target_list: &TargetList,
actions: DragAction
)
fn set_icon_drag_source(
&self,
icon_pos: EntryIconPosition,
target_list: &TargetList,
actions: DragAction
)
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
signal::Widget::drag-data-get
(or possibly signal::Widget::drag-data-delete
)
signal, and use 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
signal::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.
icon_pos
icon position
target_list
the targets (data formats) in which the data can be provided
actions
a bitmask of the allowed drag actions
fn set_icon_from_gicon(
&self,
icon_pos: EntryIconPosition,
icon: Option<&impl IsA<Icon>>
)
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, or None
fn set_icon_from_icon_name(
&self,
icon_pos: EntryIconPosition,
icon_name: Option<&str>
)
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, or None
fn set_icon_from_pixbuf(
&self,
icon_pos: EntryIconPosition,
pixbuf: Option<&Pixbuf>
)
fn set_icon_from_pixbuf(
&self,
icon_pos: EntryIconPosition,
pixbuf: Option<&Pixbuf>
)
Sets the icon shown in the specified position using a pixbuf.
If pixbuf
is None
, no icon will be shown in the specified position.
icon_pos
Icon position
pixbuf
A gdk_pixbuf::Pixbuf
, or None
fn set_icon_sensitive(&self, icon_pos: EntryIconPosition, sensitive: bool)
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_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
the [Pango text markup language][PangoMarkupFormat].
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, or None
fn set_icon_tooltip_text(
&self,
icon_pos: EntryIconPosition,
tooltip: Option<&str>
)
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 GtkWidget:has-tooltip to false
,
which suppresses icon tooltips too. You can resolve this by then calling
WidgetExt::set_has_tooltip()
to set GtkWidget: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, or None
fn set_input_hints(&self, hints: InputHints)
fn set_input_hints(&self, hints: InputHints)
Sets the property::Entry::input-hints
property, which
allows input methods to fine-tune their behaviour.
hints
the hints
fn set_input_purpose(&self, purpose: InputPurpose)
fn set_input_purpose(&self, purpose: InputPurpose)
Sets the property::Entry::input-purpose
property which
can be used by on-screen keyboards and other input
methods to adjust their behaviour.
purpose
the purpose
fn set_invisible_char(&self, ch: Option<char>)
fn set_invisible_char(&self, ch: Option<char>)
Sets the character to use in place of the actual text when
set_visibility()
has been called to set text visibility
to false
. 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 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
fn set_max_length(&self, max: i32)
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.
This is equivalent to getting self
’s EntryBuffer
and
calling [EntryBufferExtManual::set_max_length()
][crate::prelude::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.
fn set_max_width_chars(&self, n_chars: i32)
fn set_max_width_chars(&self, n_chars: i32)
Sets the desired maximum width in characters of self
.
n_chars
the new desired maximum width, in characters
fn set_overwrite_mode(&self, overwrite: bool)
fn set_overwrite_mode(&self, overwrite: bool)
fn set_placeholder_text(&self, text: Option<&str>)
fn set_placeholder_text(&self, text: Option<&str>)
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 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.
text
a string to be displayed when self
is empty and unfocused, or None
fn set_progress_fraction(&self, fraction: f64)
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
fn set_progress_pulse_step(&self, fraction: f64)
fn set_progress_pulse_step(&self, fraction: f64)
Sets the fraction of total entry width to move the progress
bouncing block for each call to progress_pulse()
.
fraction
fraction between 0.0 and 1.0
Sets a pango::TabArray
; the tabstops in the array are applied to the entry
text.
tabs
Sets the text in the widget to the given value, replacing the current contents.
See [EntryBufferExtManual::set_text()
][crate::prelude::EntryBufferExtManual::set_text()].
text
the new text
fn set_visibility(&self, visible: bool)
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 property::Entry::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
fn set_width_chars(&self, n_chars: i32)
fn set_width_chars(&self, n_chars: i32)
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.
n_chars
width in chars
fn text_index_to_layout_index(&self, text_index: i32) -> i32
fn text_index_to_layout_index(&self, text_index: i32) -> i32
Converts from a position in the entry contents (returned
by text()
) to a position in the
entry’s pango::Layout
(returned by layout()
,
with text retrieved via Layout::text()
).
text_index
byte index into the entry contents
Returns
byte index into the entry layout text
fn unset_invisible_char(&self)
fn unset_invisible_char(&self)
Unsets the invisible char previously set with
set_invisible_char()
. So that the
default invisible char is used again.
fn is_caps_lock_warning(&self) -> bool
fn is_caps_lock_warning(&self) -> bool
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.
fn set_caps_lock_warning(&self, caps_lock_warning: bool)
fn set_caps_lock_warning(&self, caps_lock_warning: bool)
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.
fn cursor_position(&self) -> i32
fn enables_emoji_completion(&self) -> bool
fn set_enable_emoji_completion(&self, enable_emoji_completion: bool)
fn set_im_module(&self, im_module: Option<&str>)
fn set_im_module(&self, im_module: Option<&str>)
fn is_invisible_char_set(&self) -> bool
fn is_invisible_char_set(&self) -> bool
Whether the invisible char has been set for the Entry
.
fn set_invisible_char_set(&self, invisible_char_set: bool)
fn set_invisible_char_set(&self, invisible_char_set: bool)
Whether the invisible char has been set for the Entry
.
fn populates_all(&self) -> bool
fn populates_all(&self) -> bool
If :populate-all is true
, the signal::Entry::populate-popup
signal is also emitted for touch popups.
fn set_populate_all(&self, populate_all: bool)
fn set_populate_all(&self, populate_all: bool)
If :populate-all is true
, the signal::Entry::populate-popup
signal is also emitted for touch popups.
fn is_primary_icon_activatable(&self) -> bool
fn is_primary_icon_activatable(&self) -> bool
Whether the primary icon is activatable.
GTK+ emits the signal::Entry::icon-press
and signal::Entry::icon-release
signals only on sensitive, activatable icons.
Sensitive, but non-activatable icons can be used for purely informational purposes.
fn set_primary_icon_activatable(&self, primary_icon_activatable: bool)
fn set_primary_icon_activatable(&self, primary_icon_activatable: bool)
Whether the primary icon is activatable.
GTK+ emits the signal::Entry::icon-press
and signal::Entry::icon-release
signals only on sensitive, activatable icons.
Sensitive, but non-activatable icons can be used for purely informational purposes.
fn primary_icon_gicon(&self) -> Option<Icon>
fn primary_icon_gicon(&self) -> Option<Icon>
The gio::Icon
to use for the primary icon for the entry.
The gio::Icon
to use for the primary icon for the entry.
fn primary_icon_name(&self) -> Option<GString>
fn primary_icon_name(&self) -> Option<GString>
The icon name to use for the primary icon for the entry.
fn set_primary_icon_name(&self, primary_icon_name: Option<&str>)
fn set_primary_icon_name(&self, primary_icon_name: Option<&str>)
The icon name to use for the primary icon for the entry.
fn primary_icon_pixbuf(&self) -> Option<Pixbuf>
fn primary_icon_pixbuf(&self) -> Option<Pixbuf>
A pixbuf to use as the primary icon for the entry.
fn set_primary_icon_pixbuf(&self, primary_icon_pixbuf: Option<&Pixbuf>)
fn set_primary_icon_pixbuf(&self, primary_icon_pixbuf: Option<&Pixbuf>)
A pixbuf to use as the primary icon for the entry.
fn is_primary_icon_sensitive(&self) -> bool
fn is_primary_icon_sensitive(&self) -> bool
Whether the primary icon is sensitive.
An insensitive icon appears grayed out. GTK+ does not emit the
signal::Entry::icon-press
and signal::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.
fn set_primary_icon_sensitive(&self, primary_icon_sensitive: bool)
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
signal::Entry::icon-press
and signal::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.
fn primary_icon_storage_type(&self) -> ImageType
fn primary_icon_storage_type(&self) -> ImageType
The representation which is used for the primary icon of the entry.
fn primary_icon_tooltip_markup(&self) -> Option<GString>
fn primary_icon_tooltip_markup(&self) -> Option<GString>
The contents of the tooltip on the primary icon, which is marked up with the [Pango text markup language][PangoMarkupFormat].
Also see set_icon_tooltip_markup()
.
fn set_primary_icon_tooltip_markup(
&self,
primary_icon_tooltip_markup: Option<&str>
)
fn set_primary_icon_tooltip_markup(
&self,
primary_icon_tooltip_markup: Option<&str>
)
The contents of the tooltip on the primary icon, which is marked up with the [Pango text markup language][PangoMarkupFormat].
Also see set_icon_tooltip_markup()
.
fn primary_icon_tooltip_text(&self) -> Option<GString>
fn primary_icon_tooltip_text(&self) -> Option<GString>
The contents of the tooltip on the primary icon.
Also see set_icon_tooltip_text()
.
fn set_primary_icon_tooltip_text(&self, primary_icon_tooltip_text: Option<&str>)
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()
.
fn scroll_offset(&self) -> i32
fn is_secondary_icon_activatable(&self) -> bool
fn is_secondary_icon_activatable(&self) -> bool
Whether the secondary icon is activatable.
GTK+ emits the signal::Entry::icon-press
and signal::Entry::icon-release
signals only on sensitive, activatable icons.
Sensitive, but non-activatable icons can be used for purely informational purposes.
fn set_secondary_icon_activatable(&self, secondary_icon_activatable: bool)
fn set_secondary_icon_activatable(&self, secondary_icon_activatable: bool)
Whether the secondary icon is activatable.
GTK+ emits the signal::Entry::icon-press
and signal::Entry::icon-release
signals only on sensitive, activatable icons.
Sensitive, but non-activatable icons can be used for purely informational purposes.
fn secondary_icon_gicon(&self) -> Option<Icon>
fn secondary_icon_gicon(&self) -> Option<Icon>
The gio::Icon
to use for the secondary icon for the entry.
The gio::Icon
to use for the secondary icon for the entry.
fn secondary_icon_name(&self) -> Option<GString>
fn secondary_icon_name(&self) -> Option<GString>
The icon name to use for the secondary icon for the entry.
fn set_secondary_icon_name(&self, secondary_icon_name: Option<&str>)
fn set_secondary_icon_name(&self, secondary_icon_name: Option<&str>)
The icon name to use for the secondary icon for the entry.
fn secondary_icon_pixbuf(&self) -> Option<Pixbuf>
fn secondary_icon_pixbuf(&self) -> Option<Pixbuf>
An pixbuf to use as the secondary icon for the entry.
fn set_secondary_icon_pixbuf(&self, secondary_icon_pixbuf: Option<&Pixbuf>)
fn set_secondary_icon_pixbuf(&self, secondary_icon_pixbuf: Option<&Pixbuf>)
An pixbuf to use as the secondary icon for the entry.
fn is_secondary_icon_sensitive(&self) -> bool
fn is_secondary_icon_sensitive(&self) -> bool
Whether the secondary icon is sensitive.
An insensitive icon appears grayed out. GTK+ does not emit the
signal::Entry::icon-press
and signal::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.
fn set_secondary_icon_sensitive(&self, secondary_icon_sensitive: bool)
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
signal::Entry::icon-press
and signal::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.
fn secondary_icon_storage_type(&self) -> ImageType
fn secondary_icon_storage_type(&self) -> ImageType
The representation which is used for the secondary icon of the entry.
fn secondary_icon_tooltip_markup(&self) -> Option<GString>
fn secondary_icon_tooltip_markup(&self) -> Option<GString>
The contents of the tooltip on the secondary icon, which is marked up with the [Pango text markup language][PangoMarkupFormat].
Also see set_icon_tooltip_markup()
.
fn set_secondary_icon_tooltip_markup(
&self,
secondary_icon_tooltip_markup: Option<&str>
)
fn set_secondary_icon_tooltip_markup(
&self,
secondary_icon_tooltip_markup: Option<&str>
)
The contents of the tooltip on the secondary icon, which is marked up with the [Pango text markup language][PangoMarkupFormat].
Also see set_icon_tooltip_markup()
.
fn secondary_icon_tooltip_text(&self) -> Option<GString>
fn secondary_icon_tooltip_text(&self) -> Option<GString>
The contents of the tooltip on the secondary icon.
Also see set_icon_tooltip_text()
.
fn set_secondary_icon_tooltip_text(
&self,
secondary_icon_tooltip_text: Option<&str>
)
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()
.
fn selection_bound(&self) -> i32
fn shadow_type(&self) -> ShadowType
fn shadow_type(&self) -> ShadowType
Which kind of shadow to draw around the entry when
property::Entry::has-frame
is set to true
.
Deprecated since 3.20
Use CSS to determine the style of the border; the value of this style property is ignored.
fn set_shadow_type(&self, shadow_type: ShadowType)
fn set_shadow_type(&self, shadow_type: ShadowType)
Which kind of shadow to draw around the entry when
property::Entry::has-frame
is set to true
.
Deprecated since 3.20
Use CSS to determine the style of the border; the value of this style property is ignored.
fn shows_emoji_icon(&self) -> bool
fn set_show_emoji_icon(&self, show_emoji_icon: bool)
fn must_truncate_multiline(&self) -> bool
fn must_truncate_multiline(&self) -> bool
When true
, pasted multi-line text is truncated to the first line.
fn set_truncate_multiline(&self, truncate_multiline: bool)
fn set_truncate_multiline(&self, truncate_multiline: bool)
When true
, pasted multi-line text is truncated to the first line.
The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.
fn set_xalign(&self, xalign: f32)
fn set_xalign(&self, xalign: f32)
The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::activate signal is emitted when the user hits the Enter key.
While this signal is used as a [keybinding signal][GtkBindingSignal], 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.
fn emit_activate(&self)
fn connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_backspace<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::backspace signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user asks for it.
The default bindings for this signal are Backspace and Shift-Backspace.
fn emit_backspace(&self)
fn connect_copy_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_copy_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
The ::copy-clipboard signal is a [keybinding signal][GtkBindingSignal] which gets emitted to copy the selection to the clipboard.
The default bindings for this signal are Ctrl-c and Ctrl-Insert.
fn emit_copy_clipboard(&self)
fn connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_cut_clipboard<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::cut-clipboard signal is a [keybinding signal][GtkBindingSignal] which gets emitted to cut the selection to the clipboard.
The default bindings for this signal are Ctrl-x and Shift-Delete.
fn emit_cut_clipboard(&self)
fn connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_delete_from_cursor<F: Fn(&Self, DeleteType, i32) + 'static>(
&self,
f: F
) -> SignalHandlerId
The ::delete-from-cursor signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user initiates a text deletion.
If the type_
is 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.
type_
the granularity of the deletion, as a DeleteType
count
the number of type_
units to delete
fn emit_delete_from_cursor(&self, type_: DeleteType, count: i32)
fn connect_icon_press<F: Fn(&Self, EntryIconPosition, &Event) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_icon_press<F: Fn(&Self, EntryIconPosition, &Event) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_icon_release<F: Fn(&Self, EntryIconPosition, &Event) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_icon_release<F: Fn(&Self, EntryIconPosition, &Event) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_insert_at_cursor<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
The ::insert-at-cursor signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user initiates the insertion of a fixed string at the cursor.
This signal has no default bindings.
string
the string to insert
fn emit_insert_at_cursor(&self, string: &str)
fn connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_insert_emoji<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
v3_22_27
only.The ::insert-emoji signal is a
[keybinding signal][GtkBindingSignal]
which gets emitted to present the Emoji chooser for the entry
.
The default bindings for this signal are Ctrl-. and Ctrl-;
fn emit_insert_emoji(&self)
fn emit_insert_emoji(&self)
v3_22_27
only.fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool) + 'static>(
&self,
f: F
) -> SignalHandlerId
The ::move-cursor signal is a
[keybinding signal][GtkBindingSignal]
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
step
the granularity of the move, as a MovementStep
count
the number of step
units to move
extend_selection
true
if the move should extend the selection
fn emit_move_cursor(
&self,
step: MovementStep,
count: i32,
extend_selection: bool
)
fn connect_paste_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_paste_clipboard<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
The ::paste-clipboard signal is a [keybinding signal][GtkBindingSignal] 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.
fn emit_paste_clipboard(&self)
fn connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_populate_popup<F: Fn(&Self, &Widget) + 'static>(
&self,
f: F
) -> SignalHandlerId
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 Menu
in this case.
If property::Entry::populate-all
is true
, this signal will
also be emitted to populate touch popups. In this case,
widget
will be a different container, e.g. a Toolbar
.
The signal handler should not make assumptions about the
type of widget
.
widget
the container that is being populated
fn connect_preedit_changed<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_preedit_changed<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
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.
preedit
the current preedit string
fn emit_preedit_changed(&self, preedit: &str)
fn connect_toggle_overwrite<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_toggle_overwrite<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
The ::toggle-overwrite signal is a [keybinding signal][GtkBindingSignal] which gets emitted to toggle the overwrite mode of the entry.
The default bindings for this signal is Insert.