GtkDataTextView

GtkDataTextView — a data textview widget, based on GtkTextView

Functions

Properties

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

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkTextView
                    ╰── GtkDataTextView

Implemented Interfaces

GtkDataTextView implements AtkImplementorIface, GtkBuildable and GtkScrollable.

Description

GtkDataTextView provides additional properties:

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.

Functions

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.

Parameters

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

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

Sets the GtkDataTextView description.

Parameters

data_text_view

a GtkDataTextView

 

description

the description or NULL

 

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.

Parameters

data_text_view

a GtkDataTextView

 

Returns

maximum byte length or 0.

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.

Parameters

data_text_view

a GtkDataTextView

 

max_length

maximum character 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.

Parameters

data_text_view

a GtkDataTextView

 

Returns

maximum byte 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.

Parameters

data_text_view

a GtkDataTextView

 

max_length_bytes

maximum byte length or 0

 

Since: 3.0.6

Types and Values

struct GtkDataTextView

struct GtkDataTextView;

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

Property Details

The “description” property

  “description”              gchar *

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

Flags: Read / Write

Default value: ""

Since: 3.0.6


The “max-length” property

  “max-length”               gint

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.

Flags: Read / Write

Allowed values: [0,1073741823]

Default value: 0

Since: 3.0.6


The “max-length-bytes” property

  “max-length-bytes”         gint

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.

Flags: Read / Write

Allowed values: [0,1073741823]

Default value: 0

Since: 3.0.6