## GntEntry GntEntry — A widget for entering text |

## Functions

#define | GNT_ENTRY_FLAGS()
#define | GNT_ENTRY_SET_FLAGS()
#define | GNT_ENTRY_UNSET_FLAGS()
GType | gnt_entry_get_gtype ()
GntWidget * | gnt_entry_new ()
void | gnt_entry_set_max ()
void | gnt_entry_set_text ()
void | gnt_entry_set_flag ()
const char * | gnt_entry_get_text ()
void | gnt_entry_clear ()
void | gnt_entry_set_masked ()
void | gnt_entry_add_to_history ()
void | gnt_entry_set_history_length ()
void | gnt_entry_set_word_suggest ()
void | gnt_entry_set_always_suggest ()
void | gnt_entry_add_suggest ()
void | gnt_entry_remove_suggest ()

## Types and Values

#define | ENTRY_CHAR
enum | GntEntryFlag
#define | GNT_ENTRY_FLAG_ALL
struct | GntEntry
| GntEntryKillRing
| GntEntryPriv
| GntEntrySearch

## Description

## Functions

### GNT_ENTRY_FLAGS()

    #define GNT_ENTRY_FLAGS(obj)				(GNT_ENTRY(obj)->priv.flags)

`GNT_ENTRY_FLAGS` has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.

### GNT_ENTRY_SET_FLAGS()

    #define GNT_ENTRY_SET_FLAGS(obj, flags)		(GNT_ENTRY_FLAGS(obj) |= flags)

`GNT_ENTRY_SET_FLAGS` has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.

### GNT_ENTRY_UNSET_FLAGS()

    #define GNT_ENTRY_UNSET_FLAGS(obj, flags) (GNT_ENTRY_FLAGS(obj) &= ~(flags))

`GNT_ENTRY_UNSET_FLAGS` has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.

### gnt_entry_get_gtype ()

    GType
    gnt_entry_get_gtype (void);

#### Returns

GType for GntEntry.

### gnt_entry_new ()

    GntWidget *
    gnt_entry_new (const char *text);

Create a new GntEntry.

#### Parameters

text | The text in the new entry box. |

#### Returns

The newly created entry box.

### gnt_entry_set_max ()

    void
    gnt_entry_set_max (GntEntry *entry,
                       int max);

Set the maximum length of the text in the entry box.

#### Parameters

entry | The entry box. |
max | The maximum length for text. A value of 0 means infinite length. |

### gnt_entry_set_text ()

    void
    gnt_entry_set_text (GntEntry *entry,
                        const char *text);

Set the text in an entry box.

#### Parameters

entry | The entry box. |
text | The text to set in the box. |

### gnt_entry_set_flag ()

    void
    gnt_entry_set_flag (GntEntry *entry,
                        GntEntryFlag flag);

Set flags an entry box.

#### Parameters

entry | The entry box. |
flag | The flags to set for the entry box. |

### gnt_entry_get_text ()

    const char *
    gnt_entry_get_text (GntEntry *entry);

Get the text in an entry box.

#### Parameters

entry | The entry box. |

#### Returns

The current text in the entry box.

### gnt_entry_clear ()

    void
    gnt_entry_clear (GntEntry *entry);

Clear the text in the entry box.

#### Parameters

entry | The entry box. |

### gnt_entry_set_masked ()

    void
    gnt_entry_set_masked (GntEntry *entry,
                          gboolean set);

Set whether the text in the entry box should be masked for display.

#### Parameters

entry | The entry box. |
set | `TRUE` if the text should be masked, `FALSE` otherwise. |

### gnt_entry_add_to_history ()

    void
    gnt_entry_add_to_history (GntEntry *entry,
                              const char *text);

Add a text to the history list for the text. The history length for the entry box needs to be set first by gnt_entry_set_history_length.

#### Parameters

entry | The entry box. |
text | A new entry for the history list. |

### gnt_entry_set_history_length ()

    void
    gnt_entry_set_history_length (GntEntry *entry,
                                  int num);

Set the length of history for the entry box.

#### Parameters

entry | The entry box. |
num | The maximum length of the history, -1 for unlimited. |

### gnt_entry_set_word_suggest ()

    void
    gnt_entry_set_word_suggest (GntEntry *entry,
                                gboolean word);

Set whether the suggestions are for the entire entry box, or for each individual word in the entry box.

#### Parameters

entry | The entry box. |
word | `TRUE` if the suggestions are for individual words, `FALSE` otherwise. |

### gnt_entry_set_always_suggest ()

    void
    gnt_entry_set_always_suggest (GntEntry *entry,
                                  gboolean always);

Set whether to always display the suggestions list, or only when the tab-completion key is pressed (the TAB key, by default).

#### Parameters

entry | The entry box. |
always | `TRUE` if the suggestion list should always be displayed. |

### gnt_entry_add_suggest ()

    void
    gnt_entry_add_suggest (GntEntry *entry,
                           const char *text);

Add an item to the suggestion list.

#### Parameters

entry | The entry box. |
text | An item to add to the suggestion list. |

### gnt_entry_remove_suggest ()

    void
    gnt_entry_remove_suggest (GntEntry *entry,
                              const char *text);

Remove an entry from the suggestion list.

#### Parameters

entry | The entry box. |
text | The item to remove from the suggestion list. |

## Types and Values

### ENTRY_CHAR

    #define ENTRY_CHAR		'_'			/* The character to use to fill in the blank places */

### enum GntEntryFlag

#### Members

GNT_ENTRY_FLAG_ALPHA |  |
GNT_ENTRY_FLAG_INT |  |
GNT_ENTRY_FLAG_NO_SPACE |  |
GNT_ENTRY_FLAG_NO_PUNCT |  |
GNT_ENTRY_FLAG_MASK |  |

### GNT_ENTRY_FLAG_ALL

    #define GNT_ENTRY_FLAG_ALL    (GNT_ENTRY_FLAG_ALPHA | GNT_ENTRY_FLAG_INT)

### struct GntEntry

    struct GntEntry {
    	GntWidget parent;

    	GntEntryFlag GNTSEAL(flag);

    	char *GNTSEAL(start);
    	char *GNTSEAL(end);
    	char *GNTSEAL(scroll);   /* Current scrolling position */
    	char *GNTSEAL(cursor);   /* Cursor location */
    	                         /* 0 <= cursor - scroll < widget-width */

    	size_t GNTSEAL(buffer);  /* Size of the buffer */

    	int GNTSEAL(max);        /* 0 means infinite */
    	gboolean GNTSEAL(masked);

    	GList *GNTSEAL(history); /* History of the strings. User can use this by pressing ctrl+up/down */
    	int GNTSEAL(histlength); /* How long can the history be? */

    	GList *GNTSEAL(suggests);    /* List of suggestions */
    	gboolean GNTSEAL(word);      /* Are the suggestions for only a word, or for the whole thing? */
    	gboolean GNTSEAL(always);    /* Should the list of suggestions show at all times, or only on tab-press? */
    	GntWidget *GNTSEAL(ddown);   /* The dropdown with the suggested list */
    	struct _GntEntryKillRing *GNTSEAL(killring); /* Since: 2.3.0 */
    	struct _GntEntrySearch *GNTSEAL(search);     /* Since: 2.7.0 */
    };

Access to any fields is deprecated. See inline comments for replacements.

### GntEntryKillRing

    typedef struct _GntEntryKillRing GntEntryKillRing;

`GntEntryKillRing` has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.

### GntEntryPriv

    typedef struct _GntEntryPriv GntEntryPriv;

`GntEntryPriv` has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.

### GntEntrySearch

    typedef struct _GntEntrySearch GntEntrySearch;

`GntEntrySearch` has been deprecated since version 2.14.0 and should not be used in newly-written code.

This is an internal implementation detail.