GtkSheetColumn

## GtkSheetColumn GtkSheetColumn — A spreadsheet column widget for GtkSheet |

## Synopsis

    #include <gtkextra.h>

                        GtkSheetColumn;
    void                gtk_sheet_add_column                (GtkSheet *sheet,
                                                             guint ncols);
    void                gtk_sheet_insert_columns            (GtkSheet *sheet,
                                                             guint col,
                                                             guint ncols);
    void                gtk_sheet_delete_columns            (GtkSheet *sheet,
                                                             guint col,
                                                             guint ncols);
    guint               gtk_sheet_get_columns_count         (GtkSheet *sheet);
    GtkSheetColumn *    gtk_sheet_column_get                (GtkSheet *sheet,
                                                             gint col);
    gint                gtk_sheet_column_get_index          (GtkSheetColumn *colobj);
    void                gtk_sheet_select_column             (GtkSheet *sheet,
                                                             gint column);
    gboolean            gtk_sheet_column_titles_visible     (GtkSheet *sheet);
    void                gtk_sheet_show_column_titles        (GtkSheet *sheet);
    void                gtk_sheet_hide_column_titles        (GtkSheet *sheet);
    const gchar *       gtk_sheet_get_column_title          (GtkSheet *sheet,
                                                             gint column);
    void                gtk_sheet_set_column_title          (GtkSheet *sheet,
                                                             gint column,
                                                             const gchar *title);
    void                gtk_sheet_set_column_titles_height  (GtkSheet *sheet,
                                                             guint height);
    gboolean            gtk_sheet_column_sensitive          (GtkSheet *sheet,
                                                             gint column);
    void                gtk_sheet_column_set_sensitivity    (GtkSheet *sheet,
                                                             gint column,
                                                             gboolean sensitive);
    void                gtk_sheet_columns_set_sensitivity   (GtkSheet *sheet,
                                                             gboolean sensitive);
    gboolean            gtk_sheet_columns_resizable         (GtkSheet *sheet);
    void                gtk_sheet_columns_set_resizable     (GtkSheet *sheet,
                                                             gboolean resizable);
    gboolean            gtk_sheet_column_visible            (GtkSheet *sheet,
                                                             gint column);
    void                gtk_sheet_column_set_visibility     (GtkSheet *sheet,
                                                             gint column,
                                                             gboolean visible);
    void                gtk_sheet_column_label_set_visibility
                                                            (GtkSheet *sheet,
                                                             gint col,
                                                             gboolean visible);
    void                gtk_sheet_columns_labels_set_visibility
                                                            (GtkSheet *sheet,
                                                             gboolean visible);
    const gint          gtk_sheet_get_column_width          (GtkSheet *sheet,
                                                             gint column);
    void                gtk_sheet_set_column_width          (GtkSheet *sheet,
                                                             gint column,
                                                             guint width);
    GtkJustification    gtk_sheet_column_get_justification  (GtkSheet *sheet,
                                                             gint col);
    void                gtk_sheet_column_set_justification  (GtkSheet *sheet,
                                                             gint col,
                                                             GtkJustification just);
    GtkSheetVerticalJustification  gtk_sheet_column_get_vjustification
                                                            (GtkSheet *sheet,
                                                             gint col);
    void                gtk_sheet_column_set_vjustification (GtkSheet *sheet,
                                                             gint col,
                                                             GtkSheetVerticalJustification vjust);
    const gchar *       gtk_sheet_column_button_get_label   (GtkSheet *sheet,
                                                             gint col);
    void                gtk_sheet_column_button_add_label   (GtkSheet *sheet,
                                                             gint col,
                                                             const gchar *label);
    void                gtk_sheet_column_button_justify     (GtkSheet *sheet,
                                                             gint col,
                                                             GtkJustification justification);
    gchar *             gtk_sheet_column_get_tooltip_markup (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_tooltip_markup (GtkSheet *sheet,
                                                             const gint col,
                                                             const gchar *markup);
    gchar *             gtk_sheet_column_get_tooltip_text   (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_tooltip_text   (GtkSheet *sheet,
                                                             const gint col,
                                                             const gchar *text);
    gchar *             gtk_sheet_column_get_datatype       (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_datatype       (GtkSheet *sheet,
                                                             const gint col,
                                                             const gchar *data_type);
    gchar *             gtk_sheet_column_get_description    (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_description    (GtkSheet *sheet,
                                                             const gint col,
                                                             const gchar *description);
    gchar *             gtk_sheet_column_get_format         (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_format         (GtkSheet *sheet,
                                                             const gint col,
                                                             const gchar *format);
    gboolean            gtk_sheet_column_get_iskey          (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_iskey          (GtkSheet *sheet,
                                                             const gint col,
                                                             const gboolean is_key);
    GType               gtk_sheet_column_get_entry_type     (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_entry_type     (GtkSheet *sheet,
                                                             const gint col,
                                                             const GType entry_type);
    gboolean            gtk_sheet_column_get_readonly       (GtkSheet *sheet,
                                                             const gint col);
    void                gtk_sheet_column_set_readonly       (GtkSheet *sheet,
                                                             const gint col,
                                                             const gboolean is_readonly);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkSheetColumn

## Implemented Interfaces

GtkSheetColumn implements AtkImplementorIface and GtkBuildable.

## Properties

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

## Description

The GtkSheetColumn provides properties for sheet columns.

## Details

### GtkSheetColumn

    typedef struct _GtkSheetColumn GtkSheetColumn;

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

### gtk_sheet_add_column ()

    void                gtk_sheet_add_column                (GtkSheet *sheet,
                                                             guint ncols);

Append `ncols` columns to the right of the sheet.

`sheet` : | a GtkSheet.
`ncols` : | number of columns to be appended.

### gtk_sheet_insert_columns ()

    void                gtk_sheet_insert_columns            (GtkSheet *sheet,
                                                             guint col,
                                                             guint ncols);

Insert `ncols` columns before the given row and pull right.

`sheet` : | a GtkSheet.
`col` : | column number.
`ncols` : | number of columns to be inserted.

### gtk_sheet_delete_columns ()

    void                gtk_sheet_delete_columns            (GtkSheet *sheet,
                                                             guint col,
                                                             guint ncols);

Delete `ncols` columns starting from `col`.

`sheet` : | a GtkSheet.
`col` : | column number.
`ncols` : | number of columns to be deleted.

### gtk_sheet_get_columns_count ()

    guint               gtk_sheet_get_columns_count         (GtkSheet *sheet);

Get the number of the columns of the GtkSheet.

`sheet` : | a GtkSheet
Returns : | number of columns.

### gtk_sheet_column_get ()

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

Get a GtkSheetColumn

`sheet` : | a GtkSheet.
`col` : | column index
Returns : | (transfer none) the requested GtkSheetColumn or NULL

### gtk_sheet_column_get_index ()

    gint                gtk_sheet_column_get_index          (GtkSheetColumn *colobj);

find index of `colobj` in GtkSheet

`colobj` : | GtkSheetColumn to find
Returns : | column index or -1

### gtk_sheet_select_column ()

    void                gtk_sheet_select_column             (GtkSheet *sheet,
                                                             gint column);

Select the column. The range is then highlighted, and the bounds are stored in sheet->range.

`sheet` : | a GtkSheet.
`column` : | column number

### gtk_sheet_column_titles_visible ()

    gboolean            gtk_sheet_column_titles_visible     (GtkSheet *sheet);

Get the visibility of sheet column titles .

`sheet` : | a GtkSheet
Returns : | TRUE or FALSE

### gtk_sheet_show_column_titles ()

    void                gtk_sheet_show_column_titles        (GtkSheet *sheet);

Show column titles .

`sheet` : | a GtkSheet

### gtk_sheet_hide_column_titles ()

    void                gtk_sheet_hide_column_titles        (GtkSheet *sheet);

Hide column titles .

`sheet` : | a GtkSheet

### gtk_sheet_get_column_title ()

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

Get column title.

`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.

`sheet` : | a GtkSheet
`column` : | column number
`title` : | column title

### gtk_sheet_set_column_titles_height ()

    void                gtk_sheet_set_column_titles_height  (GtkSheet *sheet,
                                                             guint height);

Resize column titles area .

`sheet` : | a GtkSheet
`height` : | column title height.

### gtk_sheet_column_sensitive ()

    gboolean            gtk_sheet_column_sensitive          (GtkSheet *sheet,
                                                             gint column);

Get column button sensitivity.

`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.

`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.

`sheet` : | a GtkSheet.
`sensitive` : | TRUE or FALSE

### gtk_sheet_columns_resizable ()

    gboolean            gtk_sheet_columns_resizable         (GtkSheet *sheet);

Get columns resizable status.

`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.

`sheet` : | a GtkSheet.
`resizable` : | TRUE or FALSE

### gtk_sheet_column_visible ()

    gboolean            gtk_sheet_column_visible            (GtkSheet *sheet,
                                                             gint column);

Get column visible property.

`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.

`sheet` : | a GtkSheet.
`column` : | column number
`visible` : | TRUE or FALSE

### 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.

`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.

`sheet` : | a GtkSheet.
`visible` : | TRUE or FALSE

### gtk_sheet_get_column_width ()

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

Get column width.

`sheet` : | a GtkSheet
`column` : | column number
Returns : | column width

### gtk_sheet_set_column_width ()

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

Set column width.

`sheet` : | a GtkSheet.
`column` : | column number.
`width` : | the width of the column.

### gtk_sheet_column_get_justification ()

    GtkJustification    gtk_sheet_column_get_justification  (GtkSheet *sheet,
                                                             gint col);

Get the column justification.

`sheet` : | a GtkSheet.
`col` : | column number
Returns : | a GtkJustification

### 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.

`sheet` : | a GtkSheet.
`col` : | column number
`just` : | a GtkJustification : GTK_JUSTIFY_LEFT, RIGHT, CENTER

### 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.

`sheet` : | a GtkSheet.
`col` : | column number
Returns : | a GtkSheetVerticalJustification

### gtk_sheet_column_set_vjustification ()

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

Set vertical cell text jjustification

`sheet` : | a GtkSheet.
`col` : | column number
`vjust` : | a GtkSheetVerticalJustification

### gtk_sheet_column_button_get_label ()

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

Get column button label.

`sheet` : | a GtkSheet.
`col` : | column number.
Returns : | Column button label.

### 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.

`sheet` : | a GtkSheet
`col` : | column number
`label` : | text label

### gtk_sheet_column_button_justify ()

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

Set the justification(alignment) of the column buttons.

`sheet` : | a GtkSheet.
`col` : | column number
`justification` : | a GtkJustification :GTK_JUSTIFY_LEFT, RIGHT, CENTER

### 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

`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.

`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

`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.

`sheet` : | a GtkSheet.
`col` : | column index
`text` : | the contents of the tooltip for widget

### gtk_sheet_column_get_datatype ()

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

Gets the column data_type for application use

`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

`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

`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.

`sheet` : | a GtkSheet.
`col` : | column index
`description` : | the description or NULL

### gtk_sheet_column_get_format ()

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

Gets the column data formatting pattern

`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.

`sheet` : | a GtkSheet.
`col` : | column index
`format` : | the data_format pattern or NULL

### gtk_sheet_column_get_iskey ()

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

Gets the column is_key flag

`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.

`sheet` : | a GtkSheet.
`col` : | column index
`is_key` : | the column is_key flag

### 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

`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.

`sheet` : | a GtkSheet.
`col` : | column index
`entry_type` : | the entry type or G_TYPE_NONE

### gtk_sheet_column_get_readonly ()

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

Gets the column readonly flag

`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.

`sheet` : | a GtkSheet.
`col` : | column index
`is_readonly` : | the column is_readonly flag

## Property Details

### The `"dataformat"` property

      "dataformat"               gchar*                : Read / Write

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

Default value: ""

### The `"datatype"` property

      "datatype"                 gchar*                : Read / Write

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

Default value: ""

### The `"description"` property

      "description"              gchar*                : Read / Write

Description of column contents

Default value: ""

### The `"entry-type"` property

      "entry-type"               GtkSheetEntryType     : Read / Write

Column cell entry widget type

Default value: GTK_SHEET_ENTRY_TYPE_DEFAULT

### The `"iskey"` property

      "iskey"                    gboolean              : Read / Write

Flag for key columns

Default value: FALSE

### The `"justification"` property

      "justification"            GtkJustification      : Read / Write

Justification of the column

Default value: GTK_JUSTIFY_LEFT

### The `"label"` property

      "label"                    gchar*                : Read / Write

Label of the column button

Default value: ""

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

      "max-length"               gint                  : Read / Write

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

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

Allowed values: [0,1073741823]

Default value: 0

Since 3.0.6

### The `"position"` property

      "position"                 gint                  : Read / Write

The packing position of the column

Allowed values: [0,1024]

Default value: 0

### The `"readonly"` property

      "readonly"                 gboolean              : Read / Write

Lock column contents for editing.

Default value: FALSE

### The `"visible"` property

      "visible"                  gboolean              : Read / Write

Visible property for columns

Default value: TRUE

### The `"vjust"` property

      "vjust"                    GtkSheetVerticalJustification  : Read / Write

Column vertical cell text justification

Default value: GTK_SHEET_VERTICAL_JUSTIFICATION_DEFAULT

### The `"width"` property

      "width"                    gint                  : Read / Write

Width of the column

Allowed values: [G_MAXULONG,8192]

Default value: -1

### The `"wrap-mode"` property

      "wrap-mode"                GtkWrapMode           : Read / Write

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

Default value: GTK_WRAP_NONE

Since 3.0.6