GdauiEntry

GdauiEntry

Functions

Properties

char * prefix Read / Write
char * suffix Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkEntry
                ╰── GdauiEntry
                    ├── GdauiFormattedEntry
                    ╰── GdauiNumericEntry

Implemented Interfaces

GdauiEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.

Description

Functions

gdaui_entry_new ()

GtkWidget *
gdaui_entry_new (const gchar *prefix,
                 const gchar *suffix);

Creates a new GdauiEntry widget.

Parameters

prefix

a prefix (not modifiable) string, or NULL.

[nullable]

suffix

a suffix (not modifiable) string, or NULL.

[nullable]

Returns

the newly created GdauiEntry widget.

[transfer full]


gdaui_entry_set_max_length ()

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.

Parameters

entry

a GdauiEntry.

 

max

the maximum length of the entry, or 0 for no maximum.

 

gdaui_entry_set_prefix ()

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

Parameters

entry

a GdauiEntry widget

 

prefix

a prefix string

 

gdaui_entry_set_suffix ()

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

Parameters

entry

a GdauiEntry widget

 

suffix

a suffix string

 

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

Parameters

entry

a GdauiEntry widget

 

text

the text to set into entry , or NULL.

[nullable]

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

Parameters

entry

a GdauiEntry.

 

Returns

a new string, or NULL


gdaui_entry_set_width_chars ()

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

Parameters

entry

a GdauiEntry widget

 

max_width

maximum width, or -1

 

Types and Values

GDAUI_TYPE_ENTRY

#define GDAUI_TYPE_ENTRY                 (gdaui_entry_get_type ())

struct GdauiEntryClass

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);
};

GdauiEntry

typedef struct _GdauiEntry GdauiEntry;

Property Details

The “prefix” property

  “prefix”                   char *

Owner: GdauiEntry

Flags: Read / Write

Default value: NULL


The “suffix” property

  “suffix”                   char *

Owner: GdauiEntry

Flags: Read / Write

Default value: NULL