gtk.Entrya single line text entry field.Synopsisgtk.Entrygtk.Widgetgtk.Editablegtk.CellEditablegtk.Entrymax0set_visibilityvisibleget_visibilityset_invisible_charchget_invisible_charunset_invisible_charset_has_framesettingget_has_frameset_max_lengthmaxget_max_lengthset_activates_defaultsettingget_activates_defaultset_width_charsn_charsget_width_charsset_texttextget_textget_text_lengthget_layoutget_layout_offsetsset_alignmentxalignget_alignmentset_completionwidth_charsget_completionset_inner_borderborderget_inner_borderset_cursor_hadjustmentadjustmentget_cursor_hadjustmentset_overwrite_modeoverwriteget_overwrite_modeset_bufferbufferget_bufferset_progress_fractionfractionget_progress_fractionset_progress_pulse_stepfractionget_progress_pulse_stepprogress_pulseset_icon_from_pixbuficon_pospixbufset_icon_from_stockicon_posstock_idset_icon_from_icon_nameicon_posicon_nameset_icon_from_giconicon_posiconget_icon_storage_typeicon_posget_icon_pixbuficon_posget_icon_stockicon_posget_icon_nameicon_posget_icon_giconicon_posset_icon_activatableicon_posactivatableget_icon_activatableicon_posset_icon_sensitiveicon_possensitiveget_icon_sensitiveicon_posget_icon_at_posxyset_icon_tooltip_texticon_postooltipget_icon_tooltip_texticon_posset_icon_tooltip_markupicon_postooltipget_icon_tooltip_markupicon_posset_icon_drag_sourceicon_postarget_listactionsget_current_icon_drag_sourceget_icon_windowicon_posget_text_windowlayout_index_to_text_indexlayout_indextext_index_to_layout_indextext_indexim_context_filter_keypresseventreset_im_contextAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Entry
Implemented Interfacesgtk.Entry
implements
gtk.Buildableatk.ImplementorIFacegtk.Editablegtk.CellEditablegtk.Entry Propertiesgtk.Object Propertiesgtk.Widget Properties
"activates-default"Read/WriteIf True activate the default widget
(such as the default button in a dialog) when Enter is
pressed. Default value: False."buffer"Read/Write/Constructgtk.EntryBuffer object which actually stores entry text."caps-lock-warning"Read/WriteWhether 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. Default value: True.
This property is available in GTK+ 2.16 and above.
"cursor-position"ReadThe current position of the insertion cursor as a
character index. Allowed values: [0,65535]. Default value:
0"editable"Read/WriteIf True the entry contents can be
edited. Default value: True."has-frame"Read/WriteIf False removes outside bevel from
entry. Default value: True."im-module"Read/WriteWhich IM (input method) module should be used for this entry. See
gtk.IMContext.
Setting this to a non-None value overrides the system-wide
IM module setting. See the gtk.Settings
"gtk-im-module" property. Default value: None.
This property is available in GTK+ 2.16 and above."inner-border"Read/WriteThe text area's border between the text and the frame
as a gtkBorder. Available in GTK+ 2.10."invisible-char"Read/WriteThe character to use when masking entry contents (when
"visibility" is False). Default value:
'*'."invisible-char-set"Read/Write
Whether the invisible char has been set for the GtkEntry.
Default value: False This property is available in GTK+ 2.16 and above.
"max-length"Read/WriteThe maximum number of characters for this entry. Zero
if no maximum. Allowed values: [0,65535] Default value:
0."overwrite-mode"Read/WriteIf text is overwritten when typing in the GtkEntry.
Default value: False.
Available in GTK+ 2.14 and above."primary-icon-activatable"Read/Write
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.
Default value: False
This property is available in GTK+ 2.16 and above.
"primary-icon-gicon"Read/Write
The gio.Icon
to use for the primary icon for the entry.
This property is available in GTK+ 2.16 and above.
"primary-icon-name"Read/Write
The icon name to use for the primary icon for the entry.
Default value: None
This property is available in GTK+ 2.16 and above.
"primary-icon-pixbuf"Read/Write
A pixbuf to use as the primary icon for the entry.
This property is available in GTK+ 2.16 and above.
"primary-icon-sensitive"Read/Write
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. Default value: True
This property is available in GTK+ 2.16 and above.
"primary-icon-stock"Read/Write
The stock id to use for the primary icon for the entry.
Default value: None
This property is available in GTK+ 2.16 and above.
"primary-icon-storage-type"Read/Write
The representation which is used for the primary icon of the entry.
Default value: gtk.IMAGE_EMPTY
This property is available in GTK+ 2.16 and above.
"primary-icon-tooltip-markup"Read/Write
The contents of the tooltip on the primary icon, which is marked
up with the Pango text markup language.
Also see gtk_entry_set_icon_tooltip_markup(). ##FIXME
Default value: None.
This property is available in GTK+ 2.16 and above.
"primary-icon-tooltip-text"Read/Write
The contents of the tooltip on the primary icon.
Also see gtk_entry_set_icon_tooltip_text(). ##FIXME
Default value: None.
This property is available in GTK+ 2.16 and above.
"progress-fraction"Read/Write
The current fraction of the task that's been completed.
Allowed values: [0,1] Default value: 0
This property is available in GTK+ 2.16 and above.
"progress-pulse-step"Read/Write
The fraction of total entry width to move the progress bouncing block
for each call to gtk_entry_progress_pulse(). ##FIXME
Allowed values: [0,1] Default value: 0.1
This property is available in GTK+ 2.16 and above.
"scroll-offset"ReadThe number of pixels of the entry scrolled off the
screen to the left. Allowed values: >= 0 Default value:
0."secondary-icon-activatable"Read/Write
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.
Default value: False
This property is available in GTK+ 2.16 and above.
"secondary-icon-gicon"Read/Write
The gio.Icon
to use for the secondary icon for the entry.
This property is available in GTK+ 2.16 and above.
"secondary-icon-name"Read/Write
The icon name to use for the secondary icon for the entry.
Default value: None.
This property is available in GTK+ 2.16 and above.
"secondary-icon-pixbuf"Read/Write
A pixbuf to use as the secondary icon for the entry.
This property is available in GTK+ 2.16 and above.
"secondary-icon-sensitive"Read/Write
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.
Default value: True.
This property is available in GTK+ 2.16 and above.
"secondary-icon-stock"Read/Write
The stock id to use for the secondary icon for the entry.
Default value: None.
This property is available in GTK+ 2.16 and above.
"secondary-icon-storage-type"Read/Write
The representation which is used for the secondary icon of the entry.
Default value: gtk.IMAGE_EMPTY
This property is available in GTK+ 2.16 and above.
"secondary-icon-tooltip-markup"Read/Write
The contents of the tooltip on the secondary icon, which is marked
up with the Pango text markup language.
Also see gtk_entry_set_icon_tooltip_markup(). ##FIXME
Default value: None.
This property is available in GTK+ 2.16 and above.
"secondary-icon-tooltip-text"Read/Write
The contents of the tooltip on the secondary icon.
Also see gtk_entry_set_icon_tooltip_text(). #àFIXME
Default value: None.
This property is available in GTK+ 2.16 and above.
"selection-bound"ReadThe position of the opposite end of the selection from
the cursor as a character index. Allowed values: [0,65535]
Default value: 0."shadow-type"Read/WriteWhich kind of shadow to draw around the entry when
GtkEntry:has-frame is set to True.
Default value: gtk.SHADOW_IN
Available in GTK+ 2.12 and above."text"Read/WriteThe contents of the entry. Default value: ""."text-length"ReadThe length of the text in the GtkEntry. Allowed values: [0,65535].
Default value: 0. Available in GTK+ 2.14 and above."truncate-multiline"Read/WriteIf True, pasted multi-line text is
truncated to the first line. Default value:
False. Available in GTK+ 2.10 and
above."visibility"Read/WriteIf False displays the "invisible
char" instead of the actual text (e.g. password mode). Default
value: True."width-chars"Read/WriteThe number of characters to leave space for in the
entry. Allowed values: >= -1. Default value: -1."xalign"Read/WriteThe horizontal alignment ranging from 0.0 to 1.0
representing the fraction of freespace to the left (right for
RTL layouts) of the text. Available in GTK+ 2.4 and
above.
"icon-prelight"ReadThe prelight style property determines whether activatable icons
prelight on mouseover. Default value: True
This property is available in GTK+ 2.16 and above."inner-border"ReadSets the text area's border between the text and the frame.
This property is available in GTK+ 2.10 and above."invisible-char"ReadThe invisible character is used when masking entry contents (in "password mode"). When
it is not explicitly set with the "invisible-char" property, GTK+ determines the character to
use from a list of possible candidates, depending on availability in the current font.
This property is available in GTK+ 2.18 and above."progress-border"ReadThe invisible character is used when masking entry contents (in "password mode"). When
it is not explicitly set with the "invisible-char" property, GTK+ determines the character to
use from a list of possible candidates, depending on availability in the current font.
This property is available in GTK+ 2.16 and above."state-hint"Read
Indicates whether to pass a proper widget state when drawing the shadow
and the widget background. Default value: False.
This property is available in GTK+ 2.16 and above.
gtk.Entry Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Editable Signal Prototypesgtk.CellEditable Signal Prototypes"activate"callbackentryuser_param1..."backspacecallbackentryuser_param1..."copy-clipboard"callbackentryuser_param1..."cut-clipboard"callbackentryuser_param1..."delete-from-cursor"callbackentrydelete_typecountuser_param1..."icon-press"callbackentryicon_poseventuser_param1..."icon-release"callbackentryicon_poseventuser_param1..."insert-at-cursor"callbackentrystringuser_param1..."move-cursor"callbackentrystep_sizecountextend_selectionuser_param1..."paste-clipboard"callbackentryuser_param1..."populate-popup"callbackentrymenuuser_param1..."preedit-changed"callbackentrypreedituser_param1..."toggle-overwrite"callbackentryuser_param1...DescriptionThe gtk.Entry widget is a single line text
entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the
allocation of the widget, the widget will scroll so that the cursor position is visible.When using an entry for passwords and other sensitive information, it can be put into "password mode" using
gtk.Entry.set_visibility(). In this mode,
entered text is displayed using a 'invisible' character. By default, GTK+ picks the best invisible character that is
available in the current font, but it can be changed with
gtk.Entry.set_invisible_char().
Since 2.16, GTK+ displays a warning when Caps Lock or input methods might interfere with entering text in a password entry.
The warning can be turned off with the "caps-lock-warning" property.Since 2.16, gtk.Entry has the ability to display
progress or activity information behind the text. To make an entry display such information, use
gtk.Entry.set_progress_fraction() or
gtk.Entry.set_progress_pulse_step().Additionally, gtk.Entry can show icons at either side of
the entry. These icons can be activatable by clicking, can be set up as drag source and can have tooltips. To add an icon, use
gtk.Entry.set_icon_from_gicon() or one of
the various other functions that set an icon from a stock id, an icon name or a pixbuf. To trigger an action when the user
clicks an icon, connect to the "icon-press" signal. To allow DND operations from an icon, use
gtk.Entry.set_icon_drag_source().
To set a tooltip on an icon, use
gtk.Entry.set_icon_tooltip_text()
or the corresponding function for markup.Note that functionality or information that is only available by clicking on an icon in an entry may not be accessible
at all to users which are not able to use a mouse or other pointing device. It is therefore recommended that any such functionality
should also be available by other means, e.g. via the context menu of the entry.Constructorgtk.Entrymax0max :the maximum length of the entry, or 0 for no
maximum. (other than the maximum length of entries.) The value passed in
will be limited to the range 0-65536.Returns :a new gtk.Entry.Creates a new gtk.Entry widget
with the maximum length specified by max.Methodsgtk.Entry.set_visibilityset_visibilityvisiblevisible :If False the contents are obscured using the
"invisible-char"The set_visibility() method sets the
"visibility" property to the value of
visible. If visible is True
the contents of the entry are displayed as plain text. If visible is
False, the contents are obscured by replacing the
characters with the invisible character (specified by the
"invisible-char" property). The characters will also be obscured when
the text in the entry widget is copied elsewhere. The default
invisible char is the asterisk '*', but it can be changed with set_invisible_char().gtk.Entry.get_visibilityget_visibilityReturns :True if the text is
currently visibleThe get_visibility() method retrieves
the value of the "visibility" property that determines whether the
text in entry is visible. See set_visibility().gtk.Entry.set_invisible_charset_invisible_charchch :a Unicode characterThe set_invisible_char() method sets
the "invisible-char" property with the value of
ch. The "invisible-char" is 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. The default invisible character is an asterisk ('*'). If you
set the invisible character to 0, then the user will get no feedback
at all; there will be no text on the screen as they type.gtk.Entry.get_invisible_charget_invisible_charReturns :the current invisible char, or 0, if the entry
does not show invisible text at all.The get_invisible_char() method retrieves the value of the
"invisible-char" property. The "invisible-char" is the character
displayed in place of the real characters for entries with visibility
set to False. See set_invisible_char().gtk.Entry.unset_invisible_charunset_invisible_charThis method is available in PyGTK 2.16 and above.The unset_invisible_char() method unsets the invisible char previously set with
set_invisible_char()
so that the default invisible char is used again.gtk.Entry.set_has_frameset_has_framesettingsetting :If True the entry is displayed with a beveled
frame around it.The set_has_frame() method sets the
"has-frame" property to the value of setting.
If setting is True the entry
is displayed with a beveled frame around it.gtk.Entry.get_has_frameget_has_frameReturns :whether the entry has a beveled
frameThe get_has_frame() method gets the
value of the "has-frame" property. If "has-frame" is
True the entry will be displayed with a beveled
frame around it.gtk.Entry.set_max_lengthset_max_lengthmaxmax :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.The set_max_length() method sets the
"max-length" property to the value of max. The
"max-length" property 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. If max is 0 then there is
no maximum length (other than 65536).gtk.Entry.get_max_lengthget_max_lengthReturns :the maximum allowed number of characters in
gtk.Entry, or 0
if there is no maximum.The get_max_length() method retrieves
the value of the "max-length" property that specifies the maximum
allowed length of the text in the entry. See set_max_length().gtk.Entry.set_activates_defaultset_activates_defaultsettingsetting :If True activate the
window's default widget on an Enter
key pressThe set_activates_default() method sets
the "activates-default" property to the value of
setting. If setting is
True, pressing the Enter key in
the entry 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 gtk.Window.activate_default()
on the window containing the entry, in the default handler for the
"activate" signal.)gtk.Entry.get_activates_defaultget_activates_defaultReturns :True if the entry will
activate the default widgetThe get_activates_default() method
retrieves the value of the "activates-default" property which is set
by set_activates_default().
If "activates-default" is True pressing the
Enter key in the entry will activate the default
widget for the window containing the entry.gtk.Entry.set_width_charsset_width_charsn_charsn_chars :width in charsThe set_width_chars() method sets the
"width-chars" property to the value of n_char.
Setting the "width-chars" property changes the size request of the
entry to be about the right size for n_chars
characters. Note that it only 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.gtk.Entry.get_width_charsget_width_charsReturns :number of chars to request space for, or
negative if unsetThe get_width_chars() method gets the
value of the "width-chars" property which is set by the set_width_chars()
method.gtk.Entry.set_textset_texttexttext :a string to use as the new contents of the
entryThe set_text() method sets the "text"
property to the value of text. The string in
text replaces the current contents of the
entry.gtk.Entry.get_textget_textReturns :the contents of the entry as a
stringThe get_text() method returns the value
of the "text" property which is a string containing the contents of
the entry.gtk.Entry.get_text_lengthget_text_lengthReturns :the current number of characters in GtkEntry, or 0 if there are none.This method is available in PyGTK 2.14 and above.
The get_text_length() method retrieves the current length of the text in entry.
gtk.Entry.get_layoutget_layoutReturns :the pango.Layout for
this entryThe get_layout() method 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 get_layout_offsets().gtk.Entry.get_layout_offsetsget_layout_offsetsReturns :a tuple containing the X and Y offsets of the
pango layoutThe get_layout_offsets() method obtains
the position of the pango.Layout
used to render text in the entry, in widget coordinates and returns it
as a tuple. This method is used 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. It is 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.gtk.Entry.set_alignmentset_alignmentxalignxalign :The horizontal alignment ranging from 0.0 to
1.0 representing the freespace to the left (right for RTL layouts)
of the text.This method is available in PyGTK 2.4 and above.The set_alignment() method sets the
"xalign" property to the value of xalign. The
alignment controls the horizontal positioning of the contents when the
displayed text is shorter than the width of the entry. The value of
xalign is the fraction of freespace to the left
(right in RTL layouts) of the text.gtk.Entry.get_alignmentget_alignmentReturns :The horizontal alignment ranging from 0.0 to
1.0 representing the freespace to the left (right for RTL layouts)
of the text.This method is available in PyGTK 2.4 and above.The get_alignment() method returns the
value of the "xalign" property which is the fraction of freespace (if
any) to the left (right in RTL layouts) of the text.gtk.Entry.set_completionset_completioncompletioncompletion :a gtk.EntryCompletionThis method is available in PyGTK 2.4 and above.The set_completion() method sets the
gtk.EntryCompletion
specified by completion to be the auxiliary
completion object to use with the entry. All further configuration of
the completion mechanism is done using
completion and the gtk.EntryCompletion
methods.gtk.Entry.get_completionget_completionReturns :the auxiliary completion objectThis method is available in PyGTK 2.4 and above.The get_completion() method returns the
gtk.EntryCompletion
object currently in use by the entry.gtk.Entry.set_inner_borderset_inner_borderborderborder :a gtk.Border,
or NoneThis method is available in PyGTK 2.10 and above.The set_inner_border() method sets the
entry's "inner-border" property to the value specified by
border, or clears it if None
is passed. The "inner-border" is the area around the entry's text, but
inside its frame.If set, this property overrides the inner-border style property.
Overriding the style-provided border is useful when you want to do
in-place editing of some text in a canvas or list widget, where
pixel-exact positioning of the entry is important.gtk.Entry.get_inner_borderget_inner_borderReturns :the entry's gtk.Border,
or None if none was set.This method is available in PyGTK 2.10 and above.The get_inner_border() method returns
the value of the entry's "inner-border" property. See set_inner_border()
for more information.gtk.Entry.set_cursor_hadjustmentset_cursor_hadjustmentadjustmentadjustment :An adjustment which should be adjusted when
the cursor is moved, or None.This method is available in PyGTK 2.12 and above.
The set_cursor_hadjustment() method hooks up an adjustment
to the cursor position in an entry, so that when the cursor is moved, the adjustment
is scrolled to show that position. See
gtk.ScrolledWindow.get_hadjustment
for a typical way of obtaining the adjustment.
The adjustment has to be in pixel units and in the same coordinate system as the entry.
gtk.Entry.get_cursor_hadjustmentget_cursor_hadjustmentReturns :The horizontal cursor adjustment, or
None if none has been set.This method is available in PyGTK 2.12 and above.
The get_cursor_hadjustment() method retrieves the horizontal
cursor adjustment for the entry. See
set_cursor_hadjustment.
gtk.Entry.set_overwrite_modeset_overwrite_modeoverwriteoverwrite :new value.This method is available in PyGTK 2.14 and above.The set_overwrite_mode() method sets whether the text
is overwritten when typing in the Entry.gtk.Entry.get_overwrite_modeget_overwrite_modeReturns :whether text is overwritten when typing in the Entry.This method is available in PyGTK 2.14 and above.The get_overwrite_mode() method gets the value set by
gtk.Entry.set_overwrite_mode().gtk.Entry.set_bufferset_bufferbufferbuffer :a gtk.EntryBuffer.This method is available in PyGTK 2.22 and above.The set_buffer() method sets the
gtk.EntryBuffer
object which holds the text for this widget.gtk.Entry.get_bufferget_bufferReturns :a gtk.EntryBuffer object.This method is available in PyGTK 2.22 and above.The get_buffer() method gets the
gtk.EntryBuffer
which holds the text for this widget.gtk.Entry.set_progress_fractionset_progress_fractionfractionfraction :fraction of the task that's been completed.This method is available in PyGTK 2.16 and above.The set_progress_fraction() method 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.gtk.Entry.get_progress_fractionget_progress_fractionReturns :a fraction from 0.0 to 1.0.This method is available in PyGTK 2.16 and above.The get_progress_fraction() method returns the current fraction of the task that's been
completed. See gtk.Entry.set_progress_fraction().gtk.Entry.set_progress_pulse_stepset_progress_pulse_stepfractionfraction :fraction between 0.0 and 1.0.This method is available in PyGTK 2.16 and above.The set_progress_pulse_step() method sets the fraction of
total entry width to move the progress bouncing block for each call to
gtk.Entry.progress_pulse().gtk.Entry.get_progress_pulse_stepget_progress_pulse_stepReturns :a fraction from 0.0 to 1.0.This method is available in PyGTK 2.16 and above.The get_progress_pulse_step() method retrieves the pulse step set with
gtk.Entry.set_progress_pulse_step().gtk.Entry.progress_pulseprogress_pulseThis method is available in PyGTK 2.16 and above.The progress_pulse() method 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
gtk.Entry.set_progress_pulse_step()).gtk.Entry.set_icon_from_pixbufset_icon_from_pixbuficon_pospixbuficon_pos :The position at which to set the icon.pixbuf :A gtk.gdk.Pixbuf, or None.This method is available in PyGTK 2.16 and above.The set_icon_from_pixbuf() method sets
the icon shown in the specified position using a pixbuf.If pixbuf is None, no
icon will be shown in the specified position.gtk.Entry.set_icon_from_stockset_icon_from_stockicon_posstock_idicon_pos :The position at which to set the icon.stock_id :The name of the stock item, or None.This method is available in PyGTK 2.16 and above.The set_icon_from_stock() method sets
the icon shown in the entry at the specified position from a stock image.If stock_id is None, no
icon will be shown in the specified position.gtk.Entry.set_icon_from_icon_nameset_icon_from_icon_nameicon_posicon_nameicon_pos :The position at which to set the icon.icon_name :An icon name, or None.This method is available in PyGTK 2.16 and above.The set_icon_from_icon_name() method sets
the icon shown in the entry at the specified position from the current icon theme.If icon_name is None, no
icon will be shown in the specified position.gtk.Entry.set_icon_from_giconset_icon_from_giconicon_posiconicon_pos :The position at which to set the icon.icon :The icon to set, or None.This method is available in PyGTK 2.16 and above.The set_icon_from_gicon() method 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.gtk.Entry.get_icon_storage_typeget_icon_storage_typeicon_posicon_pos :Icon position.Returns :the image representation being used.This method is available in PyGTK 2.16 and above.The get_icon_storage_type() method gets the type of
representation being used by the icon to store image data. If the icon has no image
data, the return value will be gtk.IMAGE_EMPTY.gtk.Entry.get_icon_pixbufget_icon_pixbuficon_posicon_pos :Icon position.Returns :A gtk.gdk.Pixbuf, or None if no icon is set for this position.This method is available in PyGTK 2.16 and above.The get_icon_pixbuf() method 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 gtk.gdk.Pixbuf,
a gio.Icon, a stock item, or an icon name.gtk.Entry.get_icon_stockget_icon_stockicon_posicon_pos :Icon position.Returns :A stock id, or None if no icon is set or if the icon wasn't set from a stock id.This method is available in PyGTK 2.16 and above.The get_icon_stock() method retrieves the stock id used for the icon,
or None if there is no icon or if the icon was set by some other method
(e.g. by pixbuf, icon name or gicon).gtk.Entry.get_icon_nameget_icon_nameicon_posicon_pos :Icon position.Returns :An icon name, or None if no icon is set or if the icon wasn't set from an icon name.This method is available in PyGTK 2.16 and above.The get_icon_name() method retrieves the icon name used for the icon,
or None if there is no icon or if the icon was set by some other method
(e.g. by pixbuf, stock or gicon). gtk.Entry.get_icon_giconget_icon_giconicon_posicon_pos :Icon position.Returns :A gio.Icon,
or None if no icon is set or if the icon is not a
gio.Icon.This method is available in PyGTK 2.16 and above.The get_icon_gicon() method retrieves the
gio.Icon used for the icon,
or None if there is no icon or if the icon was set by some other
method (e.g. by stock, pixbuf, or icon name).gtk.Entry.set_icon_activatableset_icon_activatableicon_posactivatableicon_pos :Icon position.activatable :True if the icon should be activatable.This method is available in PyGTK 2.16 and above.The set_icon_activatable() method sets whether the icon is activatable.gtk.Entry.get_icon_activatableget_icon_activatableicon_posicon_pos :Icon position.Returns :True if the icon is activatable, False otherwise.This method is available in PyGTK 2.16 and above.The get_icon_activatable() method returns whether the icon is activatable.gtk.Entry.set_icon_sensitiveset_icon_sensitiveicon_possensitiveicon_pos :Icon position.sensitive :True if the icon should appear sensitive, False if the icon should appear insensitive.This method is available in PyGTK 2.16 and above.The set_icon_sensitive() method sets the sensitivity for the specified icon.gtk.Entry.get_icon_sensitiveget_icon_sensitiveicon_posicon_pos :Icon position.Returns :True if the icon appears sensitive, False if the icon appears insensitive.This method is available in PyGTK 2.16 and above.The get_icon_sensitive() method returns whether the icon appears sensitive or insensitive. .gtk.Entry.get_icon_at_posget_icon_at_posxyx :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.This method is available in PyGTK 2.16 and above.The get_icon_at_pos() method finds the icon at the given
position and return its index. If x, y doesn't lie inside an icon, -1 is returned. This
function is intended for use in a "query-tooltip" signal handler.gtk.Entry.set_icon_tooltip_textset_icon_tooltip_texticon_postooltipicon_pos :the icon position.tooltip :the contents of the tooltip for the icon, or None.This method is available in PyGTK 2.16 and above.The set_icon_tooltip_text() method sets
tooltip as the contents of the tooltip for the
icon at the specified position.gtk.Entry.get_icon_tooltip_textget_icon_tooltip_texticon_posicon_pos :the icon position.Returns :the tooltip text, or None.This method is available in PyGTK 2.16 and above.The get_icon_tooltip_text() method gets the contents of the tooltip on the icon at the specified position in the entry.gtk.Entry.set_icon_tooltip_markupset_icon_tooltip_markupicon_postooltipicon_pos :the icon position.tooltip :the contents of the tooltip for the icon, or None.This method is available in PyGTK 2.16 and above.The set_icon_tooltip_markup() method 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.gtk.Entry.get_icon_tooltip_markupget_icon_tooltip_markupicon_posicon_pos :the icon position.Returns :the tooltip text, or None.This method is available in PyGTK 2.16 and above.The get_icon_tooltip_markup() method gets the contents of the tooltip on the icon at the specified position in the entry.gtk.Entry.set_icon_drag_sourceset_icon_drag_sourceicon_postarget_listactionsicon_pos :icon position.target_list :the targets (data formats) in which the data can be provided.actions :a bitmask of the allowed drag actions.This method is available in PyGTK 2.16 and above.The set_icon_drag_source() method 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 "drag-data-get" (or possibly "drag-data-delete") signal, and use
gtk.Entry.get_current_icon_drag_source())
in your signal handler to find out if the drag was started from an icon.By default, GTK+ uses the icon as the drag icon. You can use the "drag-begin" signal to set a different icon. Note that you have to use
gobject.connect_after()
to ensure that your signal handler gets executed after the default handler.gtk.Entry.get_current_icon_drag_sourceget_current_icon_drag_sourceReturns :the index of the icon which is the source of the current DND operation, or -1.This method is available in PyGTK 2.16 and above.The get_current_icon_drag_source() method 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 "drag-data-get" callback.gtk.Entry.get_icon_windowget_icon_windowicon_posicon_pos :Icon position.Returns :the entry's icon window at icon_pos.This method is available in PyGTK 2.22 and above.The get_icon_window() method returns the
gtk.gdk.Window
which contains the entry's icon at icon_pos. This
function is useful when drawing something to the entry in an "expose-event"
callback because it enables the callback to distinguish between the text
window and entry's icon windows.gtk.Entry.get_text_windowget_text_windowReturns :the entry's text window.This method is available in PyGTK 2.22 and above.The get_text_window() method returns the
gtk.gdk.Window
which contains the text. This function is useful when drawing something to the
entry in an "expose-event" callback because it enables the callback to distinguish
between the text window and entry's icon windows.gtk.Entry.layout_index_to_text_indexlayout_index_to_text_indexlayout_indexlayout_index :index of the entry layout text.Returns :index of the entry contents.The layout_index_to_text_index() method converts from a position in the entry contents (returned by
gtk.Entry.get_text()) to a position in the entry's
pango.Layout
(returned by gtk.Entry.get_layout(),
with text retrieved via pango.Layout.get_text()).gtk.Entry.text_index_to_layout_indextext_index_to_layout_indextext_indextext_index :index of the entry contents.Returns :index of the entry layout text.The text_index_to_layout_index() method converts from a position in the entry contents (returned by
gtk.Entry.get_text()) to a position in the entry's
pango.Layout
(returned by gtk.Entry.get_layout(),
with text retrieved via pango.Layout.get_text()).gtk.Entry.im_context_filter_keypressim_context_filter_keypresseventevent :The key event.This method is available in PyGTK 2.22 and above.
The im_context_filter_keypress() method allows the
gtk.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 gtk.IMContext.filter_keypress().
Note that you are expected to call this function from your handler when overriding key event handling. This
is needed in the case when you need to insert your own key handling between the input method and the default
key event handling of the gtk.Entry.
gtk.Entry.reset_im_contextreset_im_contextThis method is available in PyGTK 2.22 and above.
The reset_im_context() method resets 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.
SignalsThe "activate" gtk.Entry Signalcallbackentryuser_param1...entry :the entry that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "activate" signal is emitted when the entry is activated
either by user action (pressing the Enter key) or
programmatically with the gtk.Widget.activate()
methodThe "backspace" gtk.Entry Signalcallbackentryuser_param1...entry :the object which received the signal.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)The "backspace" signal is emitted when the
Backspace key is entered from the keyboard.The "copy-clipboard" gtk.Entry Signalcallbackentryuser_param1...entry :the entry that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "copy-clipboard" signal is emitted when the selection text
in the entry is copied to the clipboard.The "cut-clipboard" gtk.Entry Signalcallbackentryuser_param1...entry :the entry that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "cut-clipboard" signal is emitted when the selection in the
entry is cut (removed from the entry) and placed in the
clipboard.The "delete-from-cursor" gtk.Entry Signalcallbackentrydelete_typecountuser_param1...entry :the entry that received the
signaldelete_type :the type of deletioncount :the number of deletions of the type to
performuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "delete-from-cursor" signal is emitted when the a deletion
from the cursor i.e. removal o text at the cursor position, either
before it (negative count) or after it
(positive count). The value of
delete_type can be one of:gtk.DELETE_CHARSgtk.DELETE_WORD_ENDS gtk.DELETE_WORDS gtk.DELETE_DISPLAY_LINES gtk.DELETE_DISPLAY_LINE_ENDS gtk.DELETE_PARAGRAPH_ENDS gtk.DELETE_PARAGRAPHS gtk.DELETE_WHITESPACEThe "icon-press" gtk.Entry Signalcallbackentryicon_poseventuser_param1...entry :the entry that received the
signalicon_pos :The position of the clicked icon.event :The button press event.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)
The "icon-press" signal is emitted when an activatable icon is clicked.
The "icon-release" gtk.Entry Signalcallbackentryicon_poseventuser_param1...entry :the entry that received the
signalicon_pos :The position of the clicked icon.event :The button press event.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)
The "icon-press" signal is emitted when the button release from a mouse
click over an activatable icon.
The "insert-at-cursor" gtk.Entry Signalcallbackentrystringuser_param1...entry :the entry that received the
signalstring :the text being inserted in the
entryuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "insert-at-cursor" signal is emitted when text is being
inserted in the entry.The "move-cursor" gtk.Entry Signalcallbackentrystepcountextend_selectionuser_param1...entry :the entry that received the
signalstep :the size of the step to move the
cursorcount :the number of steps to move the
cursorextend_selection :if True extend the selection as well as moving
the cursoruser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "move-cursor" signal is emitted when the cursor is being
moved by count steps of size
step. If
extend_selection is True the
selection is extended as the cursor is being moved. The value of
step can be one of:gtk.MOVEMENT_LOGICAL_POSITIONSgtk.MOVEMENT_VISUAL_POSITIONS gtk.MOVEMENT_WORDS gtk.MOVEMENT_DISPLAY_LINES gtk.MOVEMENT_DISPLAY_LINE_ENDS gtk.MOVEMENT_PARAGRAPH_ENDS gtk.MOVEMENT_PARAGRAPHS gtk.MOVEMENT_PAGES gtk.MOVEMENT_BUFFER_ENDSThe "paste-clipboard" gtk.Entry Signalcallbackentryuser_param1...entry :the entry that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "paste-clipboard" signal is emitted when the contents of the
clipboard are pasted into the entry.The "populate-popup" gtk.Entry Signalcallbackentrymenuuser_param1...entry :the entry that received the
signalmenu :the menu that needs
populatinguser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "populate-popup" signal is emitted when the
menu needs populating.The "preedit-changed" gtk.Entry Signalcallbackentrypreedituser_param1...entry :the entry that received the
signalpreedit :the current preedit stringuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "preedit-changed" signal is emitted when 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.The "toggle-overwrite" gtk.Entry Signalcallbackentryuser_param1...entry :the entry that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "toggle-overwrite" signal is emitted when the internal entry
attribute "overwrite_mode" is toggled by pressing the
Insert key.