![]() |
![]() |
![]() |
GtkExtra Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <gtkextra.h> GtkDataEntry; GtkDataEntry * gtk_data_entry_new (void); const gchar * gtk_data_entry_get_description (GtkDataEntry *data_entry); void gtk_data_entry_set_description (GtkDataEntry *data_entry, const gchar *description); const gchar * gtk_data_entry_get_data_type (GtkDataEntry *data_entry); void gtk_data_entry_set_data_type (GtkDataEntry *data_entry, const gchar *data_type); void gtk_data_entry_set_data_format (GtkDataEntry *data_entry, const gchar *data_format); const gchar * gtk_data_entry_get_text (GtkDataEntry *data_entry); void gtk_data_entry_set_text (GtkDataEntry *data_entry, const gchar *text);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkEntry +----GtkDataEntry
GtkDataEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.
"dataformat" gchar* : Read / Write "datatype" gchar* : Read / Write "description" gchar* : Read / Write "text" gchar* : Read / Write
GtkDataEntry provides additional features:
- description (property): no functionality, a place for private information that cannot be put anywhere else - data_type (property): no functionality, a datatype hint for the application because any widget content is text - data_format (property): a formatting instruction that controls what you see when the widget doesn't have input focus - text (property): set the contents of the widget. if the widget doesn't have input focus text will be formatted according to the data_format The main reason for this widget is to provide a formatting entry widget for numeric data like integer, float, money which also supports NULL values (GtkSpinButton is nice but doesn't support empty field values). Handling of Null values is supported by all SQL database systems. The Null values are represented by empty field contents. When editing field contents, all data formatting is removed before the focus enters the widget. As soon as the focus leaves the widget, data will be nicely formatted again. As an additional feature, the minus sign (negative numbers) can be entered at the end of the data. As soon as you leave the field it will be placed properly in front of the number.
typedef struct _GtkDataEntry GtkDataEntry;
The GtkDataEntry struct contains only private data. It should only be accessed through the functions described below.
GtkDataEntry * gtk_data_entry_new (void);
Creates a new GtkDataEntry Widget.
Returns : |
the new GtkDataEntry Widget |
const gchar * gtk_data_entry_get_description (GtkDataEntry *data_entry);
Retrieves the GtkDataEntry description.
|
a GtkDataEntry |
Returns : |
a pointer to the contents of the widget as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored. |
void gtk_data_entry_set_description (GtkDataEntry *data_entry, const gchar *description);
Sets the GtkDataEntry description.
|
a GtkDataEntry |
|
the description or NULL |
const gchar * gtk_data_entry_get_data_type (GtkDataEntry *data_entry);
Retrieves the GtkDataEntry data_type.
|
a GtkDataEntry |
Returns : |
a pointer to the contents of the widget as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored. |
void gtk_data_entry_set_data_type (GtkDataEntry *data_entry, const gchar *data_type);
Sets the GtkDataEntry data type for application use.
|
a GtkDataEntry |
|
the data type or NULL |
void gtk_data_entry_set_data_format (GtkDataEntry *data_entry, const gchar *data_format);
Sets the GtkDataEntry data type for application use. The display will not be refreshed upon change.
|
a GtkDataEntry |
|
the data type or NULL |
const gchar * gtk_data_entry_get_text (GtkDataEntry *data_entry);
Retrieves the GtkDataEntry contents. All formatting will be removed.
|
a GtkDataEntry |
Returns : |
a pointer to the contents of the widget as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored. |
void gtk_data_entry_set_text (GtkDataEntry *data_entry, const gchar *text);
Sets the GtkDataEntry contents. The contents will be formatted due to the current data_format.
|
a GtkDataEntry |
|
the contents to be set |
"dataformat"
property"dataformat" gchar* : Read / Write
a formatting string that controls what you see when the widget doesn't contain input focus.
Default value: ""
"datatype"
property"datatype" gchar* : Read / Write
no functionality, a datatype hint for the application because any widget content is text.
Default value: ""
"description"
property"description" gchar* : Read / Write
Description of the GtkDataEntry, no functionality, a place for private information that cannot be put anywhere else.
Default value: ""
"text"
property"text" gchar* : Read / Write
Set the contents of the GtkDataEntry. For details see gtk_data_entry_set_text.
Default value: ""