![]() |
![]() |
![]() |
Hildon Reference Manual | ![]() |
---|---|---|---|---|
HildonEntry; GtkWidget* hildon_entry_new (HildonSizeType size); void hildon_entry_set_text (HildonEntry *entry, const gchar *text); const gchar* hildon_entry_get_text (HildonEntry *entry); void hildon_entry_set_placeholder (HildonEntry *entry, const gchar *text);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkEntry +----HildonEntry
HildonEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.
HildonEntry is text entry derived from the GtkEntry widget but with a slightly different appearance designed for the Hildon 2.2 framework.
Text entries in Hildon 2.2 can have a placeholder text, set with
hildon_gtk_entry_set_placeholder_text()
. This text will be shown if
the entry is empty and doesn't have the input focus, but it's
otherwise ignored. Thus, calls to gtk_entry_get_text()
will never
return the placeholder text, not even when it's being displayed.
Example 12. Creating a HildonEntry with a placeholder
GtkWidget * create_entry (void) { GtkWidget *entry; entry = hildon_entry_new (HILDON_SIZE_AUTO); hildon_gtk_entry_set_placeholder_text (GTK_ENTRY (entry), "First name"); return entry; }
GtkWidget* hildon_entry_new (HildonSizeType size);
Creates a new entry.
size : |
The size of the entry |
Returns : | a new HildonEntry |
Since 2.2
void hildon_entry_set_text (HildonEntry *entry, const gchar *text);
hildon_entry_set_text
is deprecated and should not be used in newly-written code. Use gtk_entry_set_text()
instead
Sets the text in entry
to text
, replacing its current contents.
entry : |
a HildonEntry |
text : |
the new text |
Since 2.2
const gchar* hildon_entry_get_text (HildonEntry *entry);
hildon_entry_get_text
is deprecated and should not be used in newly-written code. Use gtk_entry_get_text()
instead
Gets the current text in entry
.
Note that the placeholder text (set using
hildon_gtk_entry_set_placeholder_text()
) is never returned. Only
text set by gtk_entry_set_text()
or typed by the user is
considered.
entry : |
a HildonEntry |
Returns : | the text in entry . This text must not be modified or
freed.
|
Since 2.2
void hildon_entry_set_placeholder (HildonEntry *entry, const gchar *text);
hildon_entry_set_placeholder
is deprecated and should not be used in newly-written code. Use hildon_gtk_entry_set_placeholder_text()
instead
Sets the placeholder text in entry
to text
.
entry : |
a HildonEntry |
text : |
the new text |
Since 2.2
"size"
property"size" HildonSizeType : Write / Construct
Size request for the entry.
Default value: HILDON_SIZE_FINGER_HEIGHT