|
|
|
|
Etk_Entry
Detailed Description
An Etk_Entry is a widget that allows the user to edit a single-line text.
You can add an empty entry with etk_entry_new().
You can change the text of the entry with etk_entry_text_set() or etk_entry_clear(), and get the text with etk_entry_text_get().
An entry can work in two modes: the normal mode (the text is visible) and the password mode (the text is replaced by '*'). To change the mode of the entry, use etk_entry_password_mode_set().
- Object Hierarchy:
-
- Signals:
- "text-changed": Emitted when the text of the entry is changed
Callback: Etk_Bool callback(Etk_Entry *entry, void *data)
entry: the entry whose text has been changeddata: the user data set when the callback has been connected to the signal
- Properties:
- "password-mode": The height of an item of the combobox (should be > 0)
Type: BooleanAccess: Read/WriteDefault Value: ETK_FALSE
|
Data Structures |
struct | Etk_Entry |
| [Widget] A widget that allows the user to edit a single-line text More...
|
Defines |
#define | ETK_ENTRY_TYPE (etk_entry_type_get()) |
#define | ETK_ENTRY(obj) (ETK_OBJECT_CAST((obj), ETK_ENTRY_TYPE, Etk_Entry)) |
#define | ETK_IS_ENTRY(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_ENTRY_TYPE)) |
Enumerations |
enum | Etk_Entry_Image_Position {
ETK_ENTRY_IMAGE_PRIMARY,
ETK_ENTRY_IMAGE_SECONDARY
} |
| The position of the image in the entry. More...
|
Functions |
Etk_Widget * | etk_entry_new (void) |
| Creates a new entry.
|
void | etk_entry_text_set (Etk_Entry *entry, const char *text) |
| Sets the text of the entry.
|
const char * | etk_entry_text_get (Etk_Entry *entry) |
| Gets the text of the entry.
|
void | etk_entry_text_limit_set (Etk_Entry *entry, size_t limit) |
| Set the text limit of the entry.
|
size_t | etk_entry_text_limit_get (Etk_Entry *entry) |
| Get the text limit of the entry.
|
void | etk_entry_clear (Etk_Entry *entry) |
| Clears the text of the entry.
|
void | etk_entry_image_set (Etk_Entry *entry, Etk_Entry_Image_Position position, Etk_Image *image) |
| Sets an image inside the entry.
|
Etk_Image * | etk_entry_image_get (Etk_Entry *entry, Etk_Entry_Image_Position position) |
| Gets the image of the entry.
|
void | etk_entry_clear_button_add (Etk_Entry *entry) |
| Adds a "Clear" button on the right of the entry.
|
void | etk_entry_image_highlight_set (Etk_Entry *entry, Etk_Entry_Image_Position position, Etk_Bool highlight) |
| Sets whether the image will be highlighted on mouse-over.
|
void | etk_entry_password_mode_set (Etk_Entry *entry, Etk_Bool password_mode) |
| Sets whether or not the entry is in password mode.
|
Etk_Bool | etk_entry_password_mode_get (Etk_Entry *entry) |
| Gets whether or not the entry is in password mode.
|
Define Documentation
#define ETK_ENTRY_TYPE (etk_entry_type_get()) |
Gets the type of an entry
#define ETK_ENTRY |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_ENTRY_TYPE, Etk_Entry)) |
#define ETK_IS_ENTRY |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_ENTRY_TYPE)) |
Enumeration Type Documentation
The position of the image in the entry.
- Enumerator:
-
ETK_ENTRY_IMAGE_PRIMARY |
The image is primary, to the left of the editable object |
ETK_ENTRY_IMAGE_SECONDARY |
The image is secondary, to the right of the editable object |
Function Documentation
Creates a new entry.
- Returns:
- Returns the new entry widget
void etk_entry_text_set |
( |
Etk_Entry * |
entry, |
|
|
const char * |
text | |
|
) |
| | |
Sets the text of the entry.
- Parameters:
-
| entry | an entry |
| text | the text to set |
const char * etk_entry_text_get |
( |
Etk_Entry * |
entry |
) |
|
Gets the text of the entry.
- Parameters:
-
- Returns:
- Returns the text of the entry
void etk_entry_text_limit_set |
( |
Etk_Entry * |
entry, |
|
|
size_t |
limit | |
|
) |
| | |
Set the text limit of the entry.
- Parameters:
-
| entry | an entry |
| limit | the limit of text length, 0 means no limit |
size_t etk_entry_text_limit_get |
( |
Etk_Entry * |
entry |
) |
|
Get the text limit of the entry.
- Parameters:
-
- Returns:
- Returns the limit of text entry, 0 means no limit.
Clears the text of the entry.
- Parameters:
-
Sets an image inside the entry.
- Parameters:
-
| entry | an entry |
| position | the position where to place the image: ETK_ENTRY_IMAGE_PRIMARY to place it on the left, and ETK_ENTRY_IMAGE_SECONDARY to place it on the right |
| image | an image |
- Note:
- If there was an existing image already there, it will be destroyed. To avoid this, or if you just want to remove the previous image, you hav to unparent it with etk_widget_parent_set(prev_image, NULL)
By default, the new image will be highlighted on mouse-over. You can change this behavior with etk_entry_image_highlight_set()
The given image will be automatically shown
Gets the image of the entry.
- Parameters:
-
| entry | an entry |
| position | the position of the image to get: ETK_ENTRY_IMAGE_PRIMARY for the left image, ETK_ENTRY_IMAGE_SECONDARY for the right image |
- Returns:
- Returns the image of the entry
void etk_entry_clear_button_add |
( |
Etk_Entry * |
entry |
) |
|
Adds a "Clear" button on the right of the entry.
- Parameters:
-
Sets whether the image will be highlighted on mouse-over.
- Parameters:
-
| entry | an entry |
| position | the position of the image to set: ETK_ENTRY_IMAGE_PRIMARY for the left image, ETK_ENTRY_IMAGE_SECONDARY for the right image |
| highlight | if highlight is ETK_TRUE, the image will be highlighted |
- Note:
- By default, the image has mouse highlight turned on
void etk_entry_password_mode_set |
( |
Etk_Entry * |
entry, |
|
|
Etk_Bool |
password_mode | |
|
) |
| | |
Sets whether or not the entry is in password mode.
- Parameters:
-
| entry | an entry |
| password_mode | ETK_TRUE to turn the entry into a password entry, ETK_FALSE to turn it into a normal entry |
Etk_Bool etk_entry_password_mode_get |
( |
Etk_Entry * |
entry |
) |
|
Gets whether or not the entry is in password mode.
- Parameters:
-
- Returns:
- Returns ETK_TRUE if the entry is in password mode, ETK_FALSE otherwise
|
|
|
|
|
|