GtkSheetColumn

GtkSheetColumn — A spreadsheet column widget for GtkSheet

Functions

GtkSheetColumn * gtk_sheet_column_get ()
gint gtk_sheet_column_get_index ()
void gtk_sheet_set_column_width ()
const gint gtk_sheet_get_column_width ()
void gtk_sheet_column_set_justification ()
GtkJustification gtk_sheet_column_get_justification ()
void gtk_sheet_column_set_vjustification ()
GtkSheetVerticalJustification gtk_sheet_column_get_vjustification ()
gboolean gtk_sheet_column_get_iskey ()
void gtk_sheet_column_set_iskey ()
gboolean gtk_sheet_column_get_readonly ()
void gtk_sheet_column_set_readonly ()
gchar * gtk_sheet_column_get_format ()
void gtk_sheet_column_set_format ()
gchar * gtk_sheet_column_get_datatype ()
void gtk_sheet_column_set_datatype ()
gchar * gtk_sheet_column_get_description ()
void gtk_sheet_column_set_description ()
GType gtk_sheet_column_get_entry_type ()
void gtk_sheet_column_set_entry_type ()
gchar * gtk_sheet_column_get_tooltip_markup ()
void gtk_sheet_column_set_tooltip_markup ()
gchar * gtk_sheet_column_get_tooltip_text ()
void gtk_sheet_column_set_tooltip_text ()
gboolean gtk_sheet_column_sensitive ()
void gtk_sheet_column_set_sensitivity ()
void gtk_sheet_columns_set_sensitivity ()
gboolean gtk_sheet_columns_resizable ()
void gtk_sheet_columns_set_resizable ()
gboolean gtk_sheet_column_visible ()
void gtk_sheet_column_set_visibility ()
void gtk_sheet_column_button_justify ()
const gchar * gtk_sheet_column_button_get_label ()
void gtk_sheet_column_label_set_visibility ()
void gtk_sheet_columns_labels_set_visibility ()
void gtk_sheet_column_button_add_label ()
void gtk_sheet_set_column_titles_height ()
void gtk_sheet_show_column_titles ()
void gtk_sheet_hide_column_titles ()
gboolean gtk_sheet_column_titles_visible ()
const gchar * gtk_sheet_get_column_title ()
void gtk_sheet_set_column_title ()

Properties

gchar * dataformat Read / Write
gchar * datatype Read / Write
gchar * description Read / Write
GtkSheetEntryType entry-type Read / Write
gboolean iskey Read / Write
GtkJustification justification Read / Write
gchar * label Read / Write
gint max-length Read / Write
gint max-length-bytes Read / Write
gint position Read / Write
gboolean readonly Read / Write
gboolean visible Read / Write
GtkSheetVerticalJustification vjust Read / Write
gint width Read / Write
GtkWrapMode wrap-mode Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkSheetColumn

Implemented Interfaces

GtkSheetColumn implements AtkImplementorIface and GtkBuildable.

Description

The GtkSheetColumn provides properties for sheet columns.

Functions

gtk_sheet_column_get ()

GtkSheetColumn *
gtk_sheet_column_get (GtkSheet *sheet,
                      gint col);

Get a GtkSheetColumn

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the requested GtkSheetColumn or NULL.

[transfer none]


gtk_sheet_column_get_index ()

gint
gtk_sheet_column_get_index (GtkSheetColumn *colobj);

find index of colobj in GtkSheet

Parameters

colobj

GtkSheetColumn to find

 

Returns

column index or -1


gtk_sheet_set_column_width ()

void
gtk_sheet_set_column_width (GtkSheet *sheet,
                            gint column,
                            guint width);

Set column width.

Parameters

sheet

a GtkSheet.

 

column

column number.

 

width

the width of the column.

 

gtk_sheet_get_column_width ()

const gint
gtk_sheet_get_column_width (GtkSheet *sheet,
                            gint column);

Get column width.

Parameters

sheet

a GtkSheet

 

column

column number

 

Returns

column width


gtk_sheet_column_set_justification ()

void
gtk_sheet_column_set_justification (GtkSheet *sheet,
                                    gint col,
                                    GtkJustification just);

Set column justification (GTK_JUSTIFY_LEFT, RIGHT, CENTER). The default value is GTK_JUSTIFY_LEFT. If autoformat is on, the default justification for numbers is GTK_JUSTIFY_RIGHT.

Parameters

sheet

a GtkSheet.

 

col

column number

 

just

a GtkJustification : GTK_JUSTIFY_LEFT, RIGHT, CENTER

 

gtk_sheet_column_get_justification ()

GtkJustification
gtk_sheet_column_get_justification (GtkSheet *sheet,
                                    gint col);

Get the column justification.

Parameters

sheet

a GtkSheet.

 

col

column number

 

Returns

a GtkJustification


gtk_sheet_column_set_vjustification ()

void
gtk_sheet_column_set_vjustification (GtkSheet *sheet,
                                     gint col,
                                     GtkSheetVerticalJustification vjust);

Set vertical cell text jjustification

Parameters

sheet

a GtkSheet.

 

col

column number

 

vjust

a GtkSheetVerticalJustification

 

gtk_sheet_column_get_vjustification ()

GtkSheetVerticalJustification
gtk_sheet_column_get_vjustification (GtkSheet *sheet,
                                     gint col);

Get the vertical cell text justification. This overrides the default vertical cell text justification of the GtkSheet.

Parameters

sheet

a GtkSheet.

 

col

column number

 

gtk_sheet_column_get_iskey ()

gboolean
gtk_sheet_column_get_iskey (GtkSheet *sheet,
                            const gint col);

Gets the column is_key flag

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the is_key flag


gtk_sheet_column_set_iskey ()

void
gtk_sheet_column_set_iskey (GtkSheet *sheet,
                            const gint col,
                            const gboolean is_key);

Sets the column is_key flag. This flag has no effect on calculation or presentation, it is reserved for application usage.

Parameters

sheet

a GtkSheet.

 

col

column index

 

is_key

the column is_key flag

 

gtk_sheet_column_get_readonly ()

gboolean
gtk_sheet_column_get_readonly (GtkSheet *sheet,
                               const gint col);

Gets the column readonly flag

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the readonly flag


gtk_sheet_column_set_readonly ()

void
gtk_sheet_column_set_readonly (GtkSheet *sheet,
                               const gint col,
                               const gboolean is_readonly);

Sets the column readonly flag. A cell is editable if the sheet is not locked, the column is not readonly and the cell (-range) was set to editable.

Parameters

sheet

a GtkSheet.

 

col

column index

 

is_readonly

the column is_readonly flag

 

gtk_sheet_column_get_format ()

gchar *
gtk_sheet_column_get_format (GtkSheet *sheet,
                             const gint col);

Gets the column data formatting pattern

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the formatting pattern or NULL, You should free the returned string with g_free() when done.


gtk_sheet_column_set_format ()

void
gtk_sheet_column_set_format (GtkSheet *sheet,
                             const gint col,
                             const gchar *format);

Sets the column data formatting pattern.

Parameters

sheet

a GtkSheet.

 

col

column index

 

format

the data_format pattern or NULL

 

gtk_sheet_column_get_datatype ()

gchar *
gtk_sheet_column_get_datatype (GtkSheet *sheet,
                               const gint col);

Gets the column data_type for application use

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the datatype or NULL


gtk_sheet_column_set_datatype ()

void
gtk_sheet_column_set_datatype (GtkSheet *sheet,
                               const gint col,
                               const gchar *data_type);

Sets the column data data_type for application use

Parameters

sheet

a GtkSheet.

 

col

column index

 

data_type

the datatype

 

gtk_sheet_column_get_description ()

gchar *
gtk_sheet_column_get_description (GtkSheet *sheet,
                                  const gint col);

Gets the column description

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the description or NULL, You should free the returned string with g_free() when done.


gtk_sheet_column_set_description ()

void
gtk_sheet_column_set_description (GtkSheet *sheet,
                                  const gint col,
                                  const gchar *description);

Sets the column description.

Parameters

sheet

a GtkSheet.

 

col

column index

 

description

the description or NULL

 

gtk_sheet_column_get_entry_type ()

GType
gtk_sheet_column_get_entry_type (GtkSheet *sheet,
                                 const gint col);

Gets the column entry type if known

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the entry type or GTK_SHEET_ENTRY_TYPE_DEFAULT


gtk_sheet_column_set_entry_type ()

void
gtk_sheet_column_set_entry_type (GtkSheet *sheet,
                                 const gint col,
                                 const GType entry_type);

Supersedes the sheet entry type for this column. Pass G_TYPE_NONE to reset the column to the sheet entry type.

Parameters

sheet

a GtkSheet.

 

col

column index

 

entry_type

the entry type or G_TYPE_NONE

 

gtk_sheet_column_get_tooltip_markup ()

gchar *
gtk_sheet_column_get_tooltip_markup (GtkSheet *sheet,
                                     const gint col);

Gets the contents of the tooltip (markup) for the column

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the tooltip text, or NULL. You should free the returned string with g_free() when done.


gtk_sheet_column_set_tooltip_markup ()

void
gtk_sheet_column_set_tooltip_markup (GtkSheet *sheet,
                                     const gint col,
                                     const gchar *markup);

Sets markup as the contents of the tooltip, which is marked up with the Pango text markup language.

Parameters

sheet

a GtkSheet.

 

col

column index

 

markup

the contents of the tooltip for widget, or NULL.

 

gtk_sheet_column_get_tooltip_text ()

gchar *
gtk_sheet_column_get_tooltip_text (GtkSheet *sheet,
                                   const gint col);

Gets the contents of the tooltip for the column

Parameters

sheet

a GtkSheet.

 

col

column index

 

Returns

the tooltip text, or NULL. You should free the returned string with g_free() when done.


gtk_sheet_column_set_tooltip_text ()

void
gtk_sheet_column_set_tooltip_text (GtkSheet *sheet,
                                   const gint col,
                                   const gchar *text);

Sets text as the contents of the tooltip.

Parameters

sheet

a GtkSheet.

 

col

column index

 

text

the contents of the tooltip for widget

 

gtk_sheet_column_sensitive ()

gboolean
gtk_sheet_column_sensitive (GtkSheet *sheet,
                            gint column);

Get column button sensitivity.

Parameters

sheet

a GtkSheet.

 

column

column number

 

Returns

TRUE - the column is sensitive, FALSE - insensitive or not existant


gtk_sheet_column_set_sensitivity ()

void
gtk_sheet_column_set_sensitivity (GtkSheet *sheet,
                                  gint column,
                                  gboolean sensitive);

Set column button sensitivity. If sensitivity is TRUE it can be toggled, otherwise it acts as a title.

Parameters

sheet

a GtkSheet.

 

column

column number

 

sensitive

TRUE or FALSE

 

gtk_sheet_columns_set_sensitivity ()

void
gtk_sheet_columns_set_sensitivity (GtkSheet *sheet,
                                   gboolean sensitive);

Set all columns buttons sensitivity. If sensitivity is TRUE button can be toggled, otherwise act as titles. The sheet itself has no such property, it is a convenience function to set the property for all existing columns.

Parameters

sheet

a GtkSheet.

 

sensitive

TRUE or FALSE

 

gtk_sheet_columns_resizable ()

gboolean
gtk_sheet_columns_resizable (GtkSheet *sheet);

Get columns resizable status.

Parameters

sheet

a GtkSheet.

 

Returns

TRUE or FALSE


gtk_sheet_columns_set_resizable ()

void
gtk_sheet_columns_set_resizable (GtkSheet *sheet,
                                 gboolean resizable);

Set columns resizable status.

Parameters

sheet

a GtkSheet.

 

resizable

TRUE or FALSE

 

gtk_sheet_column_visible ()

gboolean
gtk_sheet_column_visible (GtkSheet *sheet,
                          gint column);

Get column visible property.

Parameters

sheet

a GtkSheet.

 

column

column number

 

Returns

TRUE - visible, FALSE - hidden or not existant


gtk_sheet_column_set_visibility ()

void
gtk_sheet_column_set_visibility (GtkSheet *sheet,
                                 gint column,
                                 gboolean visible);

Set column visible property.

Default value is TRUE. When set to FALSE, the column is hidden.

Parameters

sheet

a GtkSheet.

 

column

column number

 

visible

TRUE or FALSE

 

gtk_sheet_column_button_justify ()

void
gtk_sheet_column_button_justify (GtkSheet *sheet,
                                 gint col,
                                 GtkJustification justification);

gtk_sheet_column_button_justify has been deprecated since version 4.1.3 and should not be used in newly-written code.

Use widget properties instead

Set the justification(alignment) of the column buttons.

This function does nothing, it is kept for backward-compatibility.

Parameters

sheet

a GtkSheet.

 

col

column number

 

justification

a GtkJustification :GTK_JUSTIFY_LEFT, RIGHT, CENTER

 

gtk_sheet_column_button_get_label ()

const gchar *
gtk_sheet_column_button_get_label (GtkSheet *sheet,
                                   gint col);

Get column button label.

Parameters

sheet

a GtkSheet.

 

col

column number.

 

Returns

Column button label.

The text of the label widget. This string is owned by the widget and must not be modified or freed.


gtk_sheet_column_label_set_visibility ()

void
gtk_sheet_column_label_set_visibility (GtkSheet *sheet,
                                       gint col,
                                       gboolean visible);

Set column label visibility. The default value is TRUE. If FALSE, the column label is hidden.

Parameters

sheet

a GtkSheet.

 

col

column number.

 

visible

TRUE or FALSE

 

gtk_sheet_columns_labels_set_visibility ()

void
gtk_sheet_columns_labels_set_visibility
                               (GtkSheet *sheet,
                                gboolean visible);

Set all columns labels visibility. The default value is TRUE. If FALSE, the columns labels are hidden. The sheet itself has no such property, it is a convenience function to set the property for all existing columns.

Parameters

sheet

a GtkSheet.

 

visible

TRUE or FALSE

 

gtk_sheet_column_button_add_label ()

void
gtk_sheet_column_button_add_label (GtkSheet *sheet,
                                   gint col,
                                   const gchar *label);

Set button label.It is used to set a column title.

Parameters

sheet

a GtkSheet

 

col

column number

 

label

text label

 

gtk_sheet_set_column_titles_height ()

void
gtk_sheet_set_column_titles_height (GtkSheet *sheet,
                                    guint height);

Resize column titles area .

Parameters

sheet

a GtkSheet

 

height

column title height.

 

gtk_sheet_show_column_titles ()

void
gtk_sheet_show_column_titles (GtkSheet *sheet);

Show column title area.

Parameters

sheet

a GtkSheet

 

gtk_sheet_hide_column_titles ()

void
gtk_sheet_hide_column_titles (GtkSheet *sheet);

Hide column title area.

Parameters

sheet

a GtkSheet

 

gtk_sheet_column_titles_visible ()

gboolean
gtk_sheet_column_titles_visible (GtkSheet *sheet);

Get the visibility of sheet column titles .

Parameters

sheet

a GtkSheet

 

Returns

TRUE or FALSE


gtk_sheet_get_column_title ()

const gchar *
gtk_sheet_get_column_title (GtkSheet *sheet,
                            gint column);

Get column title.

Parameters

sheet

a GtkSheet

 

column

column number

 

Returns

column title, do not modify or free it.


gtk_sheet_set_column_title ()

void
gtk_sheet_set_column_title (GtkSheet *sheet,
                            gint column,
                            const gchar *title);

Set column title.

Parameters

sheet

a GtkSheet

 

column

column number

 

title

column title

 

Types and Values

GtkSheetColumn

typedef struct _GtkSheetColumn GtkSheetColumn;

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


GTK_SHEET_COLUMN_MIN_WIDTH

#define GTK_SHEET_COLUMN_MIN_WIDTH 10

GTK_SHEET_COLUMN_DEFAULT_WIDTH

#define GTK_SHEET_COLUMN_DEFAULT_WIDTH 80

GTK_SHEET_COLUMN_DEFAULT_JUSTIFICATION

#define GTK_SHEET_COLUMN_DEFAULT_JUSTIFICATION GTK_JUSTIFY_LEFT

Property Details

The “dataformat” property

  “dataformat”               gchar *

a formatting string that controls what you see when the widget doesn't contain input focus

Flags: Read / Write

Default value: ""


The “datatype” property

  “datatype”                 gchar *

no functionality, a datatype hint for the application because any widget content is text

Flags: Read / Write

Default value: ""


The “description” property

  “description”              gchar *

Description of column contents

Flags: Read / Write

Default value: ""


The “entry-type” property

  “entry-type”               GtkSheetEntryType

Column cell entry widget type

Flags: Read / Write

Default value: GTK_SHEET_ENTRY_TYPE_DEFAULT


The “iskey” property

  “iskey”                    gboolean

Flag for key columns

Flags: Read / Write

Default value: FALSE


The “justification” property

  “justification”            GtkJustification

Justification of the column

Flags: Read / Write

Default value: GTK_JUSTIFY_LEFT


The “label” property

  “label”                    gchar *

Label of the column button

Flags: Read / Write

Default value: ""


The “max-length” property

  “max-length”               gint

Maximum number orf characters in this column, Zero if no maximum.

This property is passed to the sheet entry editor. It is supported for the following editors: GtkItemEntry, GtkEntry, GtkDataTextView

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 GtkDataEntry. For details see gtk_data_entry_set_max_length_bytes.

This property is passed to the sheet entry editor. It is supported for the following editors: GtkItemEntry, GtkDataTextView.

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 “position” property

  “position”                 gint

The packing position of the column

Flags: Read / Write

Allowed values: [0,1024]

Default value: 0


The “readonly” property

  “readonly”                 gboolean

Lock column contents for editing.

Flags: Read / Write

Default value: FALSE


The “visible” property

  “visible”                  gboolean

Visible property for columns

Flags: Read / Write

Default value: FALSE


The “vjust” property

  “vjust”                    GtkSheetVerticalJustification

Column vertical cell text justification

Flags: Read / Write

Default value: GTK_SHEET_VERTICAL_JUSTIFICATION_DEFAULT


The “width” property

  “width”                    gint

Width of the column

Flags: Read / Write

Allowed values: [-1,8192]

Default value: -1


The “wrap-mode” property

  “wrap-mode”                GtkWrapMode

This property is passed to the sheet entry editor. It is supported for the following editors: GtkTextView, GtkDataTextView.

Flags: Read / Write

Default value: GTK_WRAP_NONE

Since: 3.0.6