Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gdaui_entry_new () |
void | gdaui_entry_set_max_length () |
void | gdaui_entry_set_prefix () |
void | gdaui_entry_set_suffix () |
void | gdaui_entry_set_text () |
gchar * | gdaui_entry_get_text () |
void | gdaui_entry_set_width_chars () |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkEntry ╰── GdauiEntry ├── GdauiFormattedEntry ╰── GdauiNumericEntry
GdauiEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.
GtkWidget * gdaui_entry_new (const gchar *prefix
,const gchar *suffix
);
Creates a new GdauiEntry widget.
void gdaui_entry_set_max_length (GdauiEntry *entry
,gint 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.
The difference with gtk_entry_set_max_length()
is that the max length does not take into account
the prefix and/or suffix parts which may have been set.
void gdaui_entry_set_prefix (GdauiEntry *entry
,const gchar *prefix
);
Sets prefix
as a prefix string of entry
: that string will always be displayed in the
text entry, will not be modifiable, and won't be part of the returned text
void gdaui_entry_set_suffix (GdauiEntry *entry
,const gchar *suffix
);
Sets suffix
as a suffix string of entry
: that string will always be displayed in the
text entry, will not be modifiable, and won't be part of the returned text
void gdaui_entry_set_text (GdauiEntry *entry
,const gchar *text
);
Sets text
into entry
.
As a side effect, if text
is NULL
, then the entry will
be completely empty, whereas if text
is the empty string (""), then
entry
will display the prefix and/or suffix and/or format string if they have
been set. Except this case, calling this method is similar to calling
gtk_entry_set_text()
gchar *
gdaui_entry_get_text (GdauiEntry *entry
);
Get a new string containing the contents of the widget as a string without the
prefix and/or suffix and/or format if they have been specified. This method differs
from calling gtk_entry_get_text()
since the latest will return the complete text
in entry
including prefix and/or suffix and/or format.
Note: NULL
may be returned if this method is called while the widget is working on some
internal modifications, or if gdaui_entry_set_text()
was called with a NULL
as its text
argument.
void gdaui_entry_set_width_chars (GdauiEntry *entry
,gint max_width
);
Sets entry
's width in characters, without taking into account
any prefix or suffix (which will automatically be handled). If you want to take
a prefix or suffix into account direclty, then use gtk_entry_set_width_chars()
struct GdauiEntryClass { GtkEntryClass parent_class; /* virtual methods */ /** * GdauiEntryClass::get_empty_text: * * If defined, sould return a text suitable to display EMPTY value, it will be called when * entry was set to NULL and is becomming not NULL * * Returns: a new string, or %NULL */ gchar *(*get_empty_text) (GdauiEntry *entry); /** * GdauiEntryClass::assume_insert: * @entry: a #GdauiEntry * @text: the text to be inserted * @text_length: @text's length in bytes (not characters) * @virt_pos: the position where @text is to be inserted * @offset: an offset to add to positions using @virt_pos as reference to call gtk_editable_*() * * To be defined by children classes to handle insert themselves */ void (*assume_insert) (GdauiEntry *entry, const gchar *text, gint text_length, gint *virt_pos, gint offset); /** * GdauiEntryClass::assume_delete: * @entry: a #GdauiEntry * @virt_start_pos: the starting position. * @virt_end_pos: the end position (not included in deletion), always > @start_pos * @offset: an offset to add to positions using @virt_start_pos or @virt_end_pos as reference * to call gtk_editable_*() * * To be defined by children classes to handle delete themselves */ void (*assume_delete) (GdauiEntry *entry, gint virt_start_pos, gint virt_end_pos, gint offset); };