gtkmm  3.4.0
Public Member Functions | Protected Member Functions | Related Functions
Gtk::Entry Class Reference

A single line text entry field. More...

Inheritance diagram for Gtk::Entry:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~Entry ()
GtkEntry* gobj ()
 Provides access to the underlying C GtkObject.
const GtkEntry* gobj () const
 Provides access to the underlying C GtkObject.
 Entry ()
 Entry (const Glib::RefPtr< EntryBuffer >& buffer)
Glib::RefPtr< EntryBufferget_buffer ()
 Get the Gtk::EntryBuffer object which holds the text for this widget.
Glib::RefPtr< const EntryBufferget_buffer () const
 Get the Gtk::EntryBuffer object which holds the text for this widget.
Gdk::Rectangle get_text_area () const
 Returns the area where the entry's text is drawn.
void set_buffer (const Glib::RefPtr< EntryBuffer >& buffer)
 Set the Gtk::EntryBuffer object which holds the text for this widget.
void set_visibility (bool visible=true)
 Sets whether the contents of the entry are visible or not.
bool get_visibility () const
 Retrieves whether the text in entry is visible.
void set_invisible_char (gunichar ch)
 Sets the character to use in place of the actual text when set_visibility() has been called to set text visibility to false.
void unset_invisible_char ()
 Unsets the invisible char previously set with set_invisible_char().
gunichar get_invisible_char () const
 Retrieves the character displayed in place of the real characters for entries with visibility set to false.
void set_has_frame (bool setting=true)
 Sets whether the entry has a beveled frame around it.
bool get_has_frame () const
 Gets the value set by set_has_frame().
void set_inner_border (const Border& border)
 Sets entry's inner-border property to border, or clears it if 0 is passed.
Border get_inner_border () const
 This function returns the entry's Gtk::Entry::property_inner_border() property.
void set_overwrite_mode (bool overwrite=true)
 Sets whether the text is overwritten when typing in the Gtk::Entry.
bool get_overwrite_mode () const
 Gets the value set by set_overwrite_mode().
void set_max_length (int max)
 Sets the maximum allowed length of the contents of the widget.
int get_max_length () const
 Retrieves the maximum allowed length of the text in entry.
guint16 get_text_length () const
 Retrieves the current length of the text in entry.
void set_activates_default (bool setting=true)
 If setting is true, pressing Enter in the entry will activate the default widget for the window containing the entry.
gboolean get_activates_default () const
 Retrieves the value set by set_activates_default().
void set_width_chars (int n_chars)
 Changes the size request of the entry to be about the right size for n_chars characters.
int get_width_chars () const
 Gets the value set by set_width_chars().
void set_text (const Glib::ustring& text)
 Sets the text in the widget to the given value, replacing the current contents.
Glib::ustring get_text () const
 Retrieves the contents of the entry widget.
Glib::RefPtr< Pango::Layoutget_layout ()
 Gets the Pango::Layout used to display the entry.
Glib::RefPtr< const Pango::Layoutget_layout () const
 Gets the Pango::Layout used to display the entry.
void get_layout_offsets (int& x, int& y)
 Obtains the position of the Pango::Layout used to render text in the entry, in widget coordinates.
int layout_index_to_text_index (int layout_index) const
 Converts from a position in the entry contents (returned by get_text()) to a position in the entry's Pango::Layout (returned by get_layout(), with text retrieved via pango_layout_get_text()).
int text_index_to_layout_index (int text_index) const
 Converts from a position in the entry's Pango::Layout (returned by get_layout()) to a position in the entry contents (returned by get_text()).
void set_cursor_hadjustment (const Glib::RefPtr< Adjustment >& 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.
Glib::RefPtr< Adjustmentget_cursor_hadjustment ()
 Retrieves the horizontal cursor adjustment for the entry.
Glib::RefPtr< const Adjustmentget_cursor_hadjustment () const
 Retrieves the horizontal cursor adjustment for the entry.
void set_alignment (float xalign)
 Sets the alignment for the contents of the entry.
void set_alignment (Align xalign)
 Sets the alignment for the contents of the entry.
float get_alignment () const
 Gets the value set by set_alignment().
void set_completion (const Glib::RefPtr< EntryCompletion >& completion)
 Sets completion to be the auxiliary completion object to use with entry.
Glib::RefPtr< EntryCompletionget_completion ()
 Returns the auxiliary completion object currently in use by entry.
Glib::RefPtr< const
EntryCompletion
get_completion () const
 Returns the auxiliary completion object currently in use by entry.
void set_progress_fraction (double fraction)
 Causes the entry's progress indicator to "fill in" the given fraction of the bar.
double get_progress_fraction () const
 Returns the current fraction of the task that's been completed.
void set_progress_pulse_step (double fraction)
 Sets the fraction of total entry width to move the progress bouncing block for each call to progress_pulse().
double get_progress_pulse_step ()
 Retrieves the pulse step set with set_progress_pulse_step().
void progress_pulse ()
 Indicates that some progress is made, but you don't know how much.
Glib::ustring get_placeholder_text () const
 Retrieves the text that will be displayed when entry is empty and unfocused.
void set_placeholder_text (const Glib::ustring& text)
 Sets text to be displayed in entry when it is empty and unfocused.
void set_icon_from_pixbuf (const Glib::RefPtr< Gdk::Pixbuf >& pixbuf, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets the icon shown in the specified position using a pixbuf.
void set_icon_from_stock (const StockID& stock_id, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets the icon shown in the entry at the specified position from a stock image.
void set_icon_from_icon_name (const Glib::ustring& icon_name, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets the icon shown in the entry at the specified position from the current icon theme.
void set_icon_from_gicon (const Glib::RefPtr< Gio::Icon >& icon, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets the icon shown in the entry at the specified position from the current icon theme.
void unset_icon (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Do not show any icon in the specified position.
ImageType get_icon_storage_type (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Gets the type of representation being used by the icon to store image data.
Glib::RefPtr< Gdk::Pixbufget_icon_pixbuf (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Retrieves the image used for the icon.
Glib::RefPtr< const Gdk::Pixbufget_icon_pixbuf (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Retrieves the image used for the icon.
StockID get_icon_stock (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Retrieves the stock id used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by pixbuf, icon name or gicon).
Glib::ustring get_icon_name (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Retrieves the icon name used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by pixbuf, stock or gicon).
Glib::RefPtr< Gio::Iconget_icon_gicon (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Retrieves the Icon used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name).
Glib::RefPtr< const Gio::Iconget_icon_gicon (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Retrieves the Icon used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name).
void set_icon_activatable (bool activatable=true, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets whether the icon is activatable.
bool get_icon_activatable (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Returns whether the icon is activatable.
void set_icon_sensitive (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY, bool sensitive=true)
 Sets the sensitivity for the specified icon.
bool get_icon_sensitive (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Returns whether the icon appears sensitive or insensitive.
int get_icon_at_pos (int x, int y) const
 Finds the icon at the given position and return its index.
void set_icon_tooltip_text (const Glib::ustring& tooltip, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets tooltip as the contents of the tooltip for the icon at the specified position.
Glib::ustring get_icon_tooltip_text (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Gets the contents of the tooltip on the icon at the specified position in entry.
void set_icon_tooltip_markup (const Glib::ustring& tooltip, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets tooltip as the contents of the tooltip for the icon at the specified position.
Glib::ustring get_icon_tooltip_markup (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Gets the contents of the tooltip on the icon at the specified position in entry.
void set_icon_drag_source (const Glib::RefPtr< TargetList >& target_list, Gdk::DragAction actions=Gdk::ACTION_COPY, EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY)
 Sets up the icon at the given position so that GTK+ will start a drag operation when the user clicks and drags the icon.
Gdk::Rectangle get_icon_area (EntryIconPosition icon_pos=ENTRY_ICON_PRIMARY) const
 Returns the area where entry's icon at icon_pos is drawn.
int get_current_icon_drag_source ()
 Returns the index of the icon which is the source of the current DND operation, or -1.
bool im_context_filter_keypress (GdkEventKey*event)
 Allow the Gtk::Entry input method to internally handle key press and release events.
void reset_im_context ()
 Reset the input method context of the entry if needed.
Glib::SignalProxy1< void, Menu* > signal_populate_popup ()
Glib::SignalProxy1< void,
const Glib::ustring& > 
signal_insert_at_cursor ()
Glib::SignalProxy0< void > signal_activate ()
Glib::SignalProxy2< void,
EntryIconPosition, const
GdkEventButton* > 
signal_icon_release ()
Glib::SignalProxy2< void,
EntryIconPosition, const
GdkEventButton* > 
signal_icon_press ()
Glib::PropertyProxy
< Glib::RefPtr< EntryBuffer > > 
property_buffer ()
 Text buffer object which actually stores entry text.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr< EntryBuffer > > 
property_buffer () const
 Text buffer object which actually stores entry text.
Glib::PropertyProxy_ReadOnly< int > property_cursor_position () const
 The current position of the insertion cursor in chars.
Glib::PropertyProxy_ReadOnly< int > property_selection_bound () const
 The position of the opposite end of the selection from the cursor in chars.
Glib::PropertyProxy< bool > property_editable ()
 Whether the entry contents can be edited.
Glib::PropertyProxy_ReadOnly
< bool > 
property_editable () const
 Whether the entry contents can be edited.
Glib::PropertyProxy< int > property_max_length ()
 Maximum number of characters for this entry.
Glib::PropertyProxy_ReadOnly< int > property_max_length () const
 Maximum number of characters for this entry.
Glib::PropertyProxy< bool > property_visibility ()
 FALSE displays the 'invisible char' instead of the actual text (password mode).
Glib::PropertyProxy_ReadOnly
< bool > 
property_visibility () const
 FALSE displays the 'invisible char' instead of the actual text (password mode).
Glib::PropertyProxy< bool > property_has_frame ()
 FALSE removes outside bevel from entry.
Glib::PropertyProxy_ReadOnly
< bool > 
property_has_frame () const
 FALSE removes outside bevel from entry.
Glib::PropertyProxy< Borderproperty_inner_border ()
 Border between text and frame.
Glib::PropertyProxy_ReadOnly
< Border
property_inner_border () const
 Border between text and frame.
Glib::PropertyProxy< gunichar > property_invisible_char ()
 The character to use when masking entry contents (in 'password mode').
Glib::PropertyProxy_ReadOnly
< gunichar > 
property_invisible_char () const
 The character to use when masking entry contents (in 'password mode').
Glib::PropertyProxy< bool > property_invisible_char_set ()
 Whether the invisible character has been set.
Glib::PropertyProxy_ReadOnly
< bool > 
property_invisible_char_set () const
 Whether the invisible character has been set.
Glib::PropertyProxy< bool > property_activates_default ()
 Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed.
Glib::PropertyProxy_ReadOnly
< bool > 
property_activates_default () const
 Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed.
Glib::PropertyProxy< int > property_width_chars ()
 Number of characters to leave space for in the entry.
Glib::PropertyProxy_ReadOnly< int > property_width_chars () const
 Number of characters to leave space for in the entry.
Glib::PropertyProxy_ReadOnly< int > property_scroll_offset () const
 Number of pixels of the entry scrolled off the screen to the left.
Glib::PropertyProxy< ShadowTypeproperty_shadow_type ()
 Which kind of shadow to draw around the entry when has-frame is set.
Glib::PropertyProxy_ReadOnly
< ShadowType
property_shadow_type () const
 Which kind of shadow to draw around the entry when has-frame is set.
Glib::PropertyProxy
< Glib::ustring
property_text ()
 The contents of the entry.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_text () const
 The contents of the entry.
Glib::PropertyProxy< float > property_xalign ()
 The horizontal alignment, from 0 (left) to 1 (right).
Glib::PropertyProxy_ReadOnly
< float > 
property_xalign () const
 The horizontal alignment, from 0 (left) to 1 (right).
Glib::PropertyProxy< bool > property_truncate_multiline ()
 Whether to truncate multiline pastes to one line.
Glib::PropertyProxy_ReadOnly
< bool > 
property_truncate_multiline () const
 Whether to truncate multiline pastes to one line.
Glib::PropertyProxy< bool > property_overwrite_mode ()
 Whether new text overwrites existing text.
Glib::PropertyProxy_ReadOnly
< bool > 
property_overwrite_mode () const
 Whether new text overwrites existing text.
Glib::PropertyProxy_ReadOnly
< guint > 
property_text_length () const
 Length of the text currently in the entry.
Glib::PropertyProxy< bool > property_caps_lock_warning ()
 Whether password entries will show a warning when Caps Lock is on.
Glib::PropertyProxy_ReadOnly
< bool > 
property_caps_lock_warning () const
 Whether password entries will show a warning when Caps Lock is on.
Glib::PropertyProxy< double > property_progress_fraction ()
 The current fraction of the task that's been completed.
Glib::PropertyProxy_ReadOnly
< double > 
property_progress_fraction () const
 The current fraction of the task that's been completed.
Glib::PropertyProxy< double > property_progress_pulse_step ()
 The fraction of total entry width to move the progress bouncing block for each call to gtk_entry_progress_pulse().
Glib::PropertyProxy_ReadOnly
< double > 
property_progress_pulse_step () const
 The fraction of total entry width to move the progress bouncing block for each call to gtk_entry_progress_pulse().
Glib::PropertyProxy
< Glib::RefPtr< Gdk::Pixbuf > > 
property_primary_icon_pixbuf ()
 Primary pixbuf for the entry.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr< Gdk::Pixbuf > > 
property_primary_icon_pixbuf () const
 Primary pixbuf for the entry.
Glib::PropertyProxy
< Glib::RefPtr< Gdk::Pixbuf > > 
property_secondary_icon_pixbuf ()
 Secondary pixbuf for the entry.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr< Gdk::Pixbuf > > 
property_secondary_icon_pixbuf () const
 Secondary pixbuf for the entry.
Glib::PropertyProxy< StockIDproperty_primary_icon_stock ()
 Stock ID for primary icon.
Glib::PropertyProxy_ReadOnly
< StockID
property_primary_icon_stock () const
 Stock ID for primary icon.
Glib::PropertyProxy< StockIDproperty_secondary_icon_stock ()
 Stock ID for secondary icon.
Glib::PropertyProxy_ReadOnly
< StockID
property_secondary_icon_stock () const
 Stock ID for secondary icon.
Glib::PropertyProxy
< Glib::ustring
property_primary_icon_name ()
 Icon name for primary icon.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_primary_icon_name () const
 Icon name for primary icon.
Glib::PropertyProxy
< Glib::ustring
property_secondary_icon_name ()
 Icon name for secondary icon.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_secondary_icon_name () const
 Icon name for secondary icon.
Glib::PropertyProxy
< Glib::RefPtr< Gio::Icon > > 
property_primary_icon_gicon ()
 GIcon for primary icon.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr< Gio::Icon > > 
property_primary_icon_gicon () const
 GIcon for primary icon.
Glib::PropertyProxy
< Glib::RefPtr< Gio::Icon > > 
property_secondary_icon_gicon ()
 GIcon for secondary icon.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr< Gio::Icon > > 
property_secondary_icon_gicon () const
 GIcon for secondary icon.
Glib::PropertyProxy_ReadOnly
< ImageType
property_primary_icon_storage_type () const
 The representation being used for primary icon.
Glib::PropertyProxy_ReadOnly
< ImageType
property_secondary_icon_storage_type () const
 The representation being used for secondary icon.
Glib::PropertyProxy< bool > property_primary_icon_activatable ()
 Whether the primary icon is activatable.
Glib::PropertyProxy_ReadOnly
< bool > 
property_primary_icon_activatable () const
 Whether the primary icon is activatable.
Glib::PropertyProxy< bool > property_secondary_icon_activatable ()
 Whether the secondary icon is activatable.
Glib::PropertyProxy_ReadOnly
< bool > 
property_secondary_icon_activatable () const
 Whether the secondary icon is activatable.
Glib::PropertyProxy< bool > property_primary_icon_sensitive ()
 Whether the primary icon is sensitive.
Glib::PropertyProxy_ReadOnly
< bool > 
property_primary_icon_sensitive () const
 Whether the primary icon is sensitive.
Glib::PropertyProxy< bool > property_secondary_icon_sensitive ()
 Whether the secondary icon is sensitive.
Glib::PropertyProxy_ReadOnly
< bool > 
property_secondary_icon_sensitive () const
 Whether the secondary icon is sensitive.
Glib::PropertyProxy< bool > property_primary_icon_tooltip_text ()
 The contents of the tooltip on the primary icon.
Glib::PropertyProxy_ReadOnly
< bool > 
property_primary_icon_tooltip_text () const
 The contents of the tooltip on the primary icon.
Glib::PropertyProxy< bool > property_secondary_icon_tooltip_text ()
 The contents of the tooltip on the secondary icon.
Glib::PropertyProxy_ReadOnly
< bool > 
property_secondary_icon_tooltip_text () const
 The contents of the tooltip on the secondary icon.
Glib::PropertyProxy< bool > property_primary_icon_tooltip_markup ()
 The contents of the tooltip on the primary icon.
Glib::PropertyProxy_ReadOnly
< bool > 
property_primary_icon_tooltip_markup () const
 The contents of the tooltip on the primary icon.
Glib::PropertyProxy< bool > property_secondary_icon_tooltip_markup ()
 The contents of the tooltip on the secondary icon.
Glib::PropertyProxy_ReadOnly
< bool > 
property_secondary_icon_tooltip_markup () const
 The contents of the tooltip on the secondary icon.
Glib::PropertyProxy
< Glib::ustring
property_im_module ()
 Which IM module should be used.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_im_module () const
 Which IM module should be used.
Glib::PropertyProxy
< Glib::ustring
property_placeholder_text ()
 Show text in the entry when it's empty and unfocused.
Glib::PropertyProxy_ReadOnly
< Glib::ustring
property_placeholder_text () const
 Show text in the entry when it's empty and unfocused.
Glib::PropertyProxy
< Glib::RefPtr
< EntryCompletion > > 
property_completion ()
 The auxiliary completion object.
Glib::PropertyProxy_ReadOnly
< Glib::RefPtr
< EntryCompletion > > 
property_completion () const
 The auxiliary completion object.

Protected Member Functions

virtual void on_populate_popup (Menu* menu)
 This is a default handler for the signal signal_populate_popup().
virtual void on_insert_at_cursor (const Glib::ustring& str)
 This is a default handler for the signal signal_insert_at_cursor().
virtual void on_activate ()
 This is a default handler for the signal signal_activate().

Related Functions

(Note that these are not member functions.)

Gtk::Entrywrap (GtkEntry* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

A single line text entry field.

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

The Entry widget looks like this:

entry1.png

Constructor & Destructor Documentation

virtual Gtk::Entry::~Entry ( ) [virtual]
Gtk::Entry::Entry ( const Glib::RefPtr< EntryBuffer >&  buffer) [explicit]

Member Function Documentation

Retrieves the value set by set_activates_default().

Returns:
true if the entry will activate the default widget.
float Gtk::Entry::get_alignment ( ) const

Gets the value set by set_alignment().

Since gtkmm 2.4:
Returns:
The alignment.

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

Since gtkmm 2.18:
Returns:
A Gtk::EntryBuffer object.

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

Since gtkmm 2.18:
Returns:
A Gtk::EntryBuffer object.

Returns the auxiliary completion object currently in use by entry.

Since gtkmm 2.4:
Returns:
The auxiliary completion object currently in use by entry.

Returns the auxiliary completion object currently in use by entry.

Since gtkmm 2.4:
Returns:
The auxiliary completion object currently in use by entry.

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 Gtk::Widget::signal_drag_data_get() callback.

Since gtkmm 2.16:
Returns:
Index of the icon which is the source of the current DND operation, or -1.

Retrieves the horizontal cursor adjustment for the entry.

See set_cursor_hadjustment().

Since gtkmm 2.12:
Returns:
The horizontal cursor adjustment, or 0 if none has been set.

Retrieves the horizontal cursor adjustment for the entry.

See set_cursor_hadjustment().

Since gtkmm 2.12:
Returns:
The horizontal cursor adjustment, or 0 if none has been set.
bool Gtk::Entry::get_has_frame ( ) const

Gets the value set by set_has_frame().

Returns:
Whether the entry has a beveled frame.

Returns whether the icon is activatable.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
true if the icon is activatable.

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

See also get_text_area().

Parameters:
icon_posIcon position.
Returns:
The location for the icon area.
Since gtkmm 3.0:
int Gtk::Entry::get_icon_at_pos ( int  x,
int  y 
) const

Finds the icon at the given position and return its index.

The position's coordinates are relative to the entry's top left corner. If x, y doesn't lie inside an icon, -1 is returned. This function is intended for use in a Gtk::Widget::signal_query_tooltip() signal handler.

Since gtkmm 2.16:
Parameters:
xThe x coordinate of the position to find.
yThe y coordinate of the position to find.
Returns:
The index of the icon at the given position, or -1.

Retrieves the Icon used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name).

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
A Icon, or 0 if no icon is set or if the icon is not a Icon.

Retrieves the Icon used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by stock, pixbuf, or icon name).

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
A Icon, or 0 if no icon is set or if the icon is not a Icon.

Retrieves the icon name used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by pixbuf, stock or gicon).

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
An icon name, or 0 if no icon is set or if the icon wasn't set from an icon name.

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, a Icon, a stock item, or an icon name.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
A Gdk::Pixbuf, or 0 if no icon is set for this position.

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, a Icon, a stock item, or an icon name.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
A Gdk::Pixbuf, or 0 if no icon is set for this position.

Returns whether the icon appears sensitive or insensitive.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
true if the icon is sensitive.

Retrieves the stock id used for the icon, or 0 if there is no icon or if the icon was set by some other method (e.g., by pixbuf, icon name or gicon).

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
A stock id, or 0 if no icon is set or if the icon wasn't set from a stock id.

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.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
Returns:
Image representation being used.

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

Since gtkmm 2.16:
Parameters:
icon_posThe icon position.
Returns:
The tooltip text, or 0. Free the returned string with Glib::free() when done.

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

Since gtkmm 2.16:
Parameters:
icon_posThe icon position.
Returns:
The tooltip text, or 0. Free the returned string with Glib::free() when done.

This function returns the entry's Gtk::Entry::property_inner_border() property.

See set_inner_border() for more information.

Since gtkmm 2.10:

Deprecated: 3.4: Use the standard border and padding CSS properties; the value returned by this function is ignored by Gtk::Entry.

Deprecated:
Use the standard border and padding CSS properties instead (through classes like StyleContext and CssProvider).
Returns:
The entry's Gtk::Border, or 0 if none was set.
gunichar Gtk::Entry::get_invisible_char ( ) const

Retrieves the character displayed in place of the real characters for entries with visibility set to false.

See set_invisible_char().

Returns:
The current invisible char, or 0, if the entry does not show invisible text at all.

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

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(). 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.
void Gtk::Entry::get_layout_offsets ( int &  x,
int &  y 
)

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.

Parameters:
xLocation to store X offset of layout, or 0.
yLocation to store Y offset of layout, or 0.

Retrieves the maximum allowed length of the text in entry.

See set_max_length().

This is equivalent to:

[C example ellipted]

Returns:
The maximum allowed number of characters in Gtk::Entry, or 0 if there is no maximum.

Gets the value set by set_overwrite_mode().

Since gtkmm 2.14:
Returns:
Whether the text is overwritten when typing.

Retrieves the text that will be displayed when entry is empty and unfocused.

Since gtkmm 3.2:
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.

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

See set_progress_fraction().

Since gtkmm 2.16:
Returns:
A fraction from 0.0 to 1.0.

Retrieves the pulse step set with set_progress_pulse_step().

Since gtkmm 2.16:
Returns:
A fraction from 0.0 to 1.0.

Retrieves the contents of the entry widget.

See also Gtk::Editable::get_chars().

Returns:
The contents of the entry widget.

Returns the area where the entry's text is drawn.

This function is useful when drawing something to the entry in a draw callback.

See also get_icon_area().

Returns:
The location for the text area.
Since gtkmm 3.0:
guint16 Gtk::Entry::get_text_length ( ) const

Retrieves the current length of the text in entry.

This is equivalent to:

[C example ellipted]

Since gtkmm 2.14:
Returns:
The current number of characters in Gtk::Entry, or 0 if there are none.

Retrieves whether the text in entry is visible.

See set_visibility().

Returns:
true if the text is currently visible.

Gets the value set by set_width_chars().

Returns:
Number of chars to request space for, or negative if unset.
GtkEntry* Gtk::Entry::gobj ( ) [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::CellEditable.

Reimplemented in Gtk::SpinButton.

const GtkEntry* Gtk::Entry::gobj ( ) const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::CellEditable.

Reimplemented in Gtk::SpinButton.

bool Gtk::Entry::im_context_filter_keypress ( GdkEventKey *  event)

Allow 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_im_context_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. See Gtk::TextView::reset_im_context() for an example of use.

Since gtkmm 2.22:
Parameters:
eventThe key event.
Returns:
true if the input method handled the key event.
int Gtk::Entry::layout_index_to_text_index ( int  layout_index) const

Converts from a position in the entry contents (returned by get_text()) to a position in the entry's Pango::Layout (returned by get_layout(), with text retrieved via pango_layout_get_text()).

Parameters:
layout_indexByte index into the entry layout text.
Returns:
Byte index into the entry contents.
virtual void Gtk::Entry::on_activate ( ) [protected, virtual]

This is a default handler for the signal signal_activate().

virtual void Gtk::Entry::on_insert_at_cursor ( const Glib::ustring str) [protected, virtual]

This is a default handler for the signal signal_insert_at_cursor().

virtual void Gtk::Entry::on_populate_popup ( Menu menu) [protected, virtual]

This is a default handler for the signal signal_populate_popup().

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

Since gtkmm 2.16:

Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Text buffer object which actually stores entry text.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Text buffer object which actually stores entry text.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether password entries will show a warning when Caps Lock is on.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether password entries will show a warning when Caps Lock is on.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The auxiliary completion object.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The auxiliary completion object.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The current position of the insertion cursor in chars.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the entry contents can be edited.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the entry contents can be edited.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

FALSE removes outside bevel from entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

FALSE removes outside bevel from entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Which IM module should be used.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Which IM module should be used.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Border between text and frame.

Overrides the inner-border style property.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Border between text and frame.

Overrides the inner-border style property.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The character to use when masking entry contents (in 'password mode').

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The character to use when masking entry contents (in 'password mode').

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the invisible character has been set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the invisible character has been set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Maximum number of characters for this entry.

Zero if no maximum.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Maximum number of characters for this entry.

Zero if no maximum.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether new text overwrites existing text.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether new text overwrites existing text.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Show text in the entry when it's empty and unfocused.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Show text in the entry when it's empty and unfocused.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the primary icon is activatable.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the primary icon is activatable.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

GIcon for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

GIcon for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Icon name for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Icon name for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Primary pixbuf for the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Primary pixbuf for the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the primary icon is sensitive.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the primary icon is sensitive.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Stock ID for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Stock ID for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The representation being used for primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the primary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The current fraction of the task that's been completed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The current fraction of the task that's been completed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The fraction of total entry width to move the progress bouncing block for each call to gtk_entry_progress_pulse().

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The fraction of total entry width to move the progress bouncing block for each call to gtk_entry_progress_pulse().

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

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

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the secondary icon is activatable.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the secondary icon is activatable.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

GIcon for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

GIcon for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Icon name for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Icon name for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Secondary pixbuf for the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Secondary pixbuf for the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the secondary icon is sensitive.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether the secondary icon is sensitive.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Stock ID for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Stock ID for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The representation being used for secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the tooltip on the secondary icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The position of the opposite end of the selection from the cursor in chars.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Which kind of shadow to draw around the entry when has-frame is set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Which kind of shadow to draw around the entry when has-frame is set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The contents of the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Length of the text currently in the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether to truncate multiline pastes to one line.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Whether to truncate multiline pastes to one line.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

FALSE displays the 'invisible char' instead of the actual text (password mode).

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

FALSE displays the 'invisible char' instead of the actual text (password mode).

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Number of characters to leave space for in the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Number of characters to leave space for in the entry.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The horizontal alignment, from 0 (left) to 1 (right).

Reversed for RTL layouts.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

The horizontal alignment, from 0 (left) to 1 (right).

Reversed for RTL layouts.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

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.

Since gtkmm 2.22:
void Gtk::Entry::set_activates_default ( bool  setting = true)

If setting is true, pressing Enter 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 Gtk::Widget::signal_activate() signal.)

Parameters:
settingtrue to activate window's default widget on Enter keypress.
void Gtk::Entry::set_alignment ( float  xalign)

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.

Since gtkmm 2.4:
Parameters:
xalignThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.
void Gtk::Entry::set_alignment ( Align  xalign)

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.

Since gtkmm 2.4:
Parameters:
xalignThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.
void Gtk::Entry::set_buffer ( const Glib::RefPtr< EntryBuffer >&  buffer)

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

Since gtkmm 2.18:
Parameters:
bufferA Gtk::EntryBuffer.

Sets completion to be the auxiliary completion object to use with entry.

All further configuration of the completion mechanism is done on completion using the Gtk::EntryCompletion API. Completion is disabled if completion is set to 0.

Since gtkmm 2.4:
Parameters:
completionThe Gtk::EntryCompletion or 0.

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.

Since gtkmm 2.12:
Parameters:
adjustmentAn adjustment which should be adjusted when the cursor is moved, or 0.
void Gtk::Entry::set_has_frame ( bool  setting = true)

Sets whether the entry has a beveled frame around it.

Parameters:
settingNew value.
void Gtk::Entry::set_icon_activatable ( bool  activatable = true,
EntryIconPosition  icon_pos = ENTRY_ICON_PRIMARY 
)

Sets whether the icon is activatable.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
activatabletrue if the icon should be activatable.

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 Gtk::Widget::signal_drag_data_get() (or possibly Gtk::Widget::signal_drag_data_delete()) signal, and use 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 Gtk::Widget::signal_drag_begin() signal to set a different icon. Note that you have to use Glib::signal_connect_after() to ensure that your signal handler gets executed after the default handler.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
target_listThe targets (data formats) in which the data can be provided.
actionsA bitmask of the allowed drag actions.

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 0, no icon will be shown in the specified position.

Since gtkmm 2.16:
Parameters:
icon_posThe position at which to set the icon.
iconThe icon to set, or 0.

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 0, no icon will be shown in the specified position.

Since gtkmm 2.16:
Parameters:
icon_posThe position at which to set the icon.
icon_nameAn icon name, or 0.

Sets the icon shown in the specified position using a pixbuf.

If pixbuf is 0, no icon will be shown in the specified position.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
pixbufA Gdk::Pixbuf, or 0.

Sets the icon shown in the entry at the specified position from a stock image.

If stock_id is 0, no icon will be shown in the specified position.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
stock_idThe name of the stock item, or 0.
void Gtk::Entry::set_icon_sensitive ( EntryIconPosition  icon_pos = ENTRY_ICON_PRIMARY,
bool  sensitive = true 
)

Sets the sensitivity for the specified icon.

Since gtkmm 2.16:
Parameters:
icon_posIcon position.
sensitiveSpecifies whether the icon should appear sensitive or insensitive.

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.

Use 0 for tooltip to remove an existing tooltip.

See also Gtk::Widget::set_tooltip_markup() and gtk_enty_set_icon_tooltip_text().

Since gtkmm 2.16:
Parameters:
icon_posThe icon position.
tooltipThe contents of the tooltip for the icon, or 0.

Sets tooltip as the contents of the tooltip for the icon at the specified position.

Use 0 for tooltip to remove an existing tooltip.

See also Gtk::Widget::set_tooltip_text() and set_icon_tooltip_markup().

Since gtkmm 2.16:
Parameters:
icon_posThe icon position.
tooltipThe contents of the tooltip for the icon, or 0.
void Gtk::Entry::set_inner_border ( const Border border)

Sets entry's inner-border property to border, or clears it if 0 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.

Since gtkmm 2.10:

Deprecated: 3.4: Use the standard border and padding CSS properties; the value set with this function is ignored by Gtk::Entry.

Deprecated:
Use the standard border and padding CSS properties instead (through classes like StyleContext and CssProvider).
Parameters:
borderA Gtk::Border, or 0.
void Gtk::Entry::set_invisible_char ( gunichar  ch)

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.

Parameters:
chA Unicode character.
void Gtk::Entry::set_max_length ( int  max)

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:

[C example ellipted]

Parameters:
maxThe 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.
void Gtk::Entry::set_overwrite_mode ( bool  overwrite = true)

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

Since gtkmm 2.14:
Parameters:
overwriteNew value.

Sets text to be displayed in entry when it is empty and unfocused.

This can be used to give a visual hint of the expected contents of the Gtk::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.

Since gtkmm 3.2:
Parameters:
textA string to be displayed when entry is empty an unfocused, or 0.
void Gtk::Entry::set_progress_fraction ( double  fraction)

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.

Since gtkmm 2.16:
Parameters:
fractionFraction of the task that's been completed.
void Gtk::Entry::set_progress_pulse_step ( double  fraction)

Sets the fraction of total entry width to move the progress bouncing block for each call to progress_pulse().

Since gtkmm 2.16:
Parameters:
fractionFraction between 0.0 and 1.0.
void Gtk::Entry::set_text ( const Glib::ustring text)

Sets the text in the widget to the given value, replacing the current contents.

See Gtk::EntryBuffer::set_text().

Parameters:
textThe new text.
void Gtk::Entry::set_visibility ( bool  visible = true)

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

Parameters:
visibletrue if the contents of the entry are displayed as plaintext.
void Gtk::Entry::set_width_chars ( int  n_chars)

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.

Parameters:
n_charsWidth in chars.
Slot Prototype:
void on_my_activate()

A keybinding signal which gets emitted when the user activates the entry.

Applications should not connect to it, but may emit it with Glib::signal_emit_by_name() if they need to control activation programmatically.

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

Deprecated:
Use signal_key_press_event() or signal_focus_out_event() instead.
Slot Prototype:
void on_my_icon_press(EntryIconPosition icon_position, const GdkEventButton* event)

The signal_icon_press() signal is emitted when an activatable icon is clicked.

Since gtkmm 2.16:
Parameters:
icon_posThe position of the clicked icon.
eventThe button press event.
Slot Prototype:
void on_my_icon_release(EntryIconPosition icon_position, const GdkEventButton* event)

The signal_icon_release() signal is emitted on the button release from a mouse click over an activatable icon.

Since gtkmm 2.16:
Parameters:
icon_posThe position of the clicked icon.
eventThe button release event.
Slot Prototype:
void on_my_insert_at_cursor(const Glib::ustring& str)

The signal_insert_at_cursor() signal is a keybinding signal which gets emitted when the user initiates the insertion of a fixed string at the cursor.

This signal has no default bindings.

Parameters:
stringThe string to insert.
Slot Prototype:
void on_my_populate_popup(Menu* menu)

The signal_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 menuitems to the menu.

Parameters:
menuThe menu that is being populated.
int Gtk::Entry::text_index_to_layout_index ( int  text_index) const

Converts from a position in the entry's Pango::Layout (returned by get_layout()) to a position in the entry contents (returned by get_text()).

Parameters:
text_indexByte index into the entry contents.
Returns:
Byte index into the entry layout text.

Do not show any icon in the specified position.

See set_icon_from_pixbuf(), set_icon_from_stock(), set_icon_from_icon_name(), and set_icon_from_gicon().

Parameters:
icon_posThe icon position.
Since gtkmm 3.0:

Unsets the invisible char previously set with set_invisible_char().

So that the default invisible char is used again.

Since gtkmm 2.16:

Friends And Related Function Documentation

Gtk::Entry* wrap ( GtkEntry *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: