## GtkDataTextView GtkDataTextView — a data textview widget, based on GtkTextView |

## Synopsis

    #include <gtkextra.h>

                        GtkDataTextView;
    GtkDataTextView *   gtk_data_text_view_new              (void);
    const gchar *       gtk_data_text_view_get_description  (GtkDataTextView *data_text_view);
    gint                gtk_data_text_view_get_max_length   (GtkDataTextView *data_text_view);
    gint                gtk_data_text_view_get_max_length_bytes
                                                            (GtkDataTextView *data_text_view);
    void                gtk_data_text_view_set_description  (GtkDataTextView *data_text_view,
                                                             const gchar *description);
    void                gtk_data_text_view_set_max_length   (GtkDataTextView *data_text_view,
                                                             gint max_length);
    void                gtk_data_text_view_set_max_length_bytes
                                                            (GtkDataTextView *data_text_view,
                                                             gint max_length_bytes);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkTextView
                                     +----GtkDataTextView

## Implemented Interfaces

GtkDataTextView implements AtkImplementorIface and GtkBuildable.

## Properties

      "description"              gchar*                : Read / Write
      "max-length"               gint                  : Read / Write
      "max-length-bytes"         gint                  : Read / Write

## Description

GtkDataTextView provides additional properties:

- "description" - no functionality, a place for private information that cannot be put anywhere else

- "max-length" - set the maximum character length for the contents of the widget.

- "max-length-bytes" - set the maximum byte length for the contents of the widget.

The main reason for this widget is to provide a length limit for text contents, required by SQL database systems. There is always a limit, no matter what you do. Some database systems may handle character length of UTF-8 strings correctly, others may not. Choose the appropriate limit for your system, characters or bytes. Note that setting a byte length limit > 0 on a datatextview may slow down text insertions. The byte length limit is imposed upon `gtk_text_buffer_get_text()` including invisible content. See `gtk_text_buffer_get_text()` for details.

## Details

### GtkDataTextView

    typedef struct _GtkDataTextView GtkDataTextView;

The GtkDataTextView struct contains only private data. It should only be accessed through the functions described below.

### gtk_data_text_view_new ()

    GtkDataTextView *   gtk_data_text_view_new              (void);

Creates a new GtkDataTextView Widget.

Returns : | the new GtkDataTextView Widget

Since 3.0.6

### gtk_data_text_view_get_description ()

    const gchar *       gtk_data_text_view_get_description  (GtkDataTextView *data_text_view);

Retrieves the GtkDataTextView description.

`data_text_view` : | a GtkDataTextView
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.

Since 3.0.6

### gtk_data_text_view_get_max_length ()

    gint                gtk_data_text_view_get_max_length   (GtkDataTextView *data_text_view);

Retrieves the maximum character length for the contents of GtkDataTextView.

`data_text_view` : | a GtkDataTextView
Returns : | maximum byte length or 0.

Since 3.0.6

### gtk_data_text_view_get_max_length_bytes ()

    gint                gtk_data_text_view_get_max_length_bytes
                                                            (GtkDataTextView *data_text_view);

Retrieves the maximum byte length for the contents of GtkDataTextView data_format.

`data_text_view` : | a GtkDataTextView
Returns : | maximum byte length or 0.

Since 3.0.6

### gtk_data_text_view_set_description ()

    void                gtk_data_text_view_set_description  (GtkDataTextView *data_text_view,
                                                             const gchar *description);

Sets the GtkDataTextView description.

`data_text_view` : | a GtkDataTextView
`description` : | the description or NULL

Since 3.0.6

### gtk_data_text_view_set_max_length ()

    void                gtk_data_text_view_set_max_length   (GtkDataTextView *data_text_view,
                                                             gint max_length);

Sets the maximum character length for the contents of the GtkDataTextView. Existing content will not be truncted.

`data_text_view` : | a GtkDataTextView
`max_length` : | maximum character length or 0

Since 3.0.6

### gtk_data_text_view_set_max_length_bytes ()

    void                gtk_data_text_view_set_max_length_bytes
                                                            (GtkDataTextView *data_text_view,
                                                             gint max_length_bytes);

Sets the maximum byte length for the contents of the GtkDataTextView. Existing content will not be truncted.

`data_text_view` : | a GtkDataTextView
`max_length_bytes` : | maximum byte length or 0

Since 3.0.6

## Property Details

### The `"description"` property

      "description"              gchar*                : Read / Write

Description of the GtkDataTextView, no functionality, a place for private information that cannot be put anywhere else.

Default value: ""

Since 3.0.6

### The `"max-length"` property

      "max-length"               gint                  : Read / Write

Set the maximum length in characters for the GtkDataTextView. For details see gtk_data_text_view_set_max_length.

Sometimes, systems cannot handle UTF-8 string length correctly, to overcome this problem, you can use the maximum string length in bytes. When setting both limits, max-length and max-length-bytes, both must be fulfilled.

Allowed values: [0,1073741823]

Default value: 0

Since 3.0.6

### The `"max-length-bytes"` property

      "max-length-bytes"         gint                  : Read / Write

Set the maximum length in bytes for the GtkDataTextView. For details see gtk_data_text_view_set_max_length_bytes.

Sometimes, systems cannot handle UTF-8 string length correctly, to overcome this problem, you can use the maximum string length in bytes. When setting both limits, max-length and max-length-bytes, both must be fulfilled.

Allowed values: [0,1073741823]

Default value: 0

Since 3.0.6